Commit 706c8c93 authored by Segher Boessenkool's avatar Segher Boessenkool Committed by Paul Mackerras

[PATCH] powerpc/pseries: Change H_StudlyCaps to H_SHOUTING_CAPS

Also cleans up some nearby whitespace problems.
Signed-off-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 8df83028
...@@ -149,17 +149,17 @@ static void log_plpar_hcall_return(unsigned long rc, char *tag) ...@@ -149,17 +149,17 @@ static void log_plpar_hcall_return(unsigned long rc, char *tag)
if (rc == 0) /* success, return */ if (rc == 0) /* success, return */
return; return;
/* check for null tag ? */ /* check for null tag ? */
if (rc == H_Hardware) if (rc == H_HARDWARE)
printk(KERN_INFO printk(KERN_INFO
"plpar-hcall (%s) failed with hardware fault\n", tag); "plpar-hcall (%s) failed with hardware fault\n", tag);
else if (rc == H_Function) else if (rc == H_FUNCTION)
printk(KERN_INFO printk(KERN_INFO
"plpar-hcall (%s) failed; function not allowed\n", tag); "plpar-hcall (%s) failed; function not allowed\n", tag);
else if (rc == H_Authority) else if (rc == H_AUTHORITY)
printk(KERN_INFO printk(KERN_INFO
"plpar-hcall (%s) failed; not authorized to this function\n", "plpar-hcall (%s) failed; not authorized to this"
tag); " function\n", tag);
else if (rc == H_Parameter) else if (rc == H_PARAMETER)
printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
tag); tag);
else else
...@@ -209,7 +209,7 @@ static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs) ...@@ -209,7 +209,7 @@ static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs)
unsigned long dummy; unsigned long dummy;
rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy); rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
if (rc != H_Authority) if (rc != H_AUTHORITY)
log_plpar_hcall_return(rc, "H_PIC"); log_plpar_hcall_return(rc, "H_PIC");
} }
...@@ -529,13 +529,13 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf, ...@@ -529,13 +529,13 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr, retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
*new_weight_ptr); *new_weight_ptr);
if (retval == H_Success || retval == H_Constrained) { if (retval == H_SUCCESS || retval == H_CONSTRAINED) {
retval = count; retval = count;
} else if (retval == H_Busy) { } else if (retval == H_BUSY) {
retval = -EBUSY; retval = -EBUSY;
} else if (retval == H_Hardware) { } else if (retval == H_HARDWARE) {
retval = -EIO; retval = -EIO;
} else if (retval == H_Parameter) { } else if (retval == H_PARAMETER) {
retval = -EINVAL; retval = -EINVAL;
} else { } else {
printk(KERN_WARNING "%s: received unknown hv return code %ld", printk(KERN_WARNING "%s: received unknown hv return code %ld",
......
...@@ -578,18 +578,18 @@ static void rtas_percpu_suspend_me(void *info) ...@@ -578,18 +578,18 @@ static void rtas_percpu_suspend_me(void *info)
* We use "waiting" to indicate our state. As long * We use "waiting" to indicate our state. As long
* as it is >0, we are still trying to all join up. * as it is >0, we are still trying to all join up.
* If it goes to 0, we have successfully joined up and * If it goes to 0, we have successfully joined up and
* one thread got H_Continue. If any error happens, * one thread got H_CONTINUE. If any error happens,
* we set it to <0. * we set it to <0.
*/ */
local_irq_save(flags); local_irq_save(flags);
do { do {
rc = plpar_hcall_norets(H_JOIN); rc = plpar_hcall_norets(H_JOIN);
smp_rmb(); smp_rmb();
} while (rc == H_Success && data->waiting > 0); } while (rc == H_SUCCESS && data->waiting > 0);
if (rc == H_Success) if (rc == H_SUCCESS)
goto out; goto out;
if (rc == H_Continue) { if (rc == H_CONTINUE) {
data->waiting = 0; data->waiting = 0;
data->args->args[data->args->nargs] = data->args->args[data->args->nargs] =
rtas_call(ibm_suspend_me_token, 0, 1, NULL); rtas_call(ibm_suspend_me_token, 0, 1, NULL);
...@@ -597,7 +597,7 @@ static void rtas_percpu_suspend_me(void *info) ...@@ -597,7 +597,7 @@ static void rtas_percpu_suspend_me(void *info)
plpar_hcall_norets(H_PROD,i); plpar_hcall_norets(H_PROD,i);
} else { } else {
data->waiting = -EBUSY; data->waiting = -EBUSY;
printk(KERN_ERR "Error on H_Join hypervisor call\n"); printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
} }
out: out:
...@@ -624,7 +624,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args) ...@@ -624,7 +624,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
printk(KERN_ERR "Error doing global join\n"); printk(KERN_ERR "Error doing global join\n");
/* Prod each CPU. This won't hurt, and will wake /* Prod each CPU. This won't hurt, and will wake
* anyone we successfully put to sleep with H_Join * anyone we successfully put to sleep with H_JOIN.
*/ */
for_each_possible_cpu(i) for_each_possible_cpu(i)
plpar_hcall_norets(H_PROD, i); plpar_hcall_norets(H_PROD, i);
......
...@@ -41,7 +41,7 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count) ...@@ -41,7 +41,7 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
unsigned long got; unsigned long got;
if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got, if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
(unsigned long *)buf, (unsigned long *)buf+1) == H_Success) (unsigned long *)buf, (unsigned long *)buf+1) == H_SUCCESS)
return got; return got;
return 0; return 0;
} }
...@@ -69,9 +69,9 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count) ...@@ -69,9 +69,9 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0], ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
lbuf[1]); lbuf[1]);
if (ret == H_Success) if (ret == H_SUCCESS)
return count; return count;
if (ret == H_Busy) if (ret == H_BUSY)
return 0; return 0;
return -EIO; return -EIO;
} }
......
...@@ -43,21 +43,21 @@ MODULE_VERSION(HVCS_ARCH_VERSION); ...@@ -43,21 +43,21 @@ MODULE_VERSION(HVCS_ARCH_VERSION);
static int hvcs_convert(long to_convert) static int hvcs_convert(long to_convert)
{ {
switch (to_convert) { switch (to_convert) {
case H_Success: case H_SUCCESS:
return 0; return 0;
case H_Parameter: case H_PARAMETER:
return -EINVAL; return -EINVAL;
case H_Hardware: case H_HARDWARE:
return -EIO; return -EIO;
case H_Busy: case H_BUSY:
case H_LongBusyOrder1msec: case H_LONG_BUSY_ORDER_1_MSEC:
case H_LongBusyOrder10msec: case H_LONG_BUSY_ORDER_10_MSEC:
case H_LongBusyOrder100msec: case H_LONG_BUSY_ORDER_100_MSEC:
case H_LongBusyOrder1sec: case H_LONG_BUSY_ORDER_1_SEC:
case H_LongBusyOrder10sec: case H_LONG_BUSY_ORDER_10_SEC:
case H_LongBusyOrder100sec: case H_LONG_BUSY_ORDER_100_SEC:
return -EBUSY; return -EBUSY;
case H_Function: /* fall through */ case H_FUNCTION: /* fall through */
default: default:
return -EPERM; return -EPERM;
} }
......
...@@ -72,7 +72,7 @@ static void udbg_hvsi_putc(char c) ...@@ -72,7 +72,7 @@ static void udbg_hvsi_putc(char c)
do { do {
rc = plpar_put_term_char(vtermno, sizeof(packet), packet); rc = plpar_put_term_char(vtermno, sizeof(packet), packet);
} while (rc == H_Busy); } while (rc == H_BUSY);
} }
static long hvsi_udbg_buf_len; static long hvsi_udbg_buf_len;
...@@ -85,7 +85,7 @@ static int udbg_hvsi_getc_poll(void) ...@@ -85,7 +85,7 @@ static int udbg_hvsi_getc_poll(void)
if (hvsi_udbg_buf_len == 0) { if (hvsi_udbg_buf_len == 0) {
rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf); rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf);
if (rc != H_Success || hvsi_udbg_buf[0] != 0xff) { if (rc != H_SUCCESS || hvsi_udbg_buf[0] != 0xff) {
/* bad read or non-data packet */ /* bad read or non-data packet */
hvsi_udbg_buf_len = 0; hvsi_udbg_buf_len = 0;
} else { } else {
...@@ -139,7 +139,7 @@ static void udbg_putcLP(char c) ...@@ -139,7 +139,7 @@ static void udbg_putcLP(char c)
buf[0] = c; buf[0] = c;
do { do {
rc = plpar_put_term_char(vtermno, 1, buf); rc = plpar_put_term_char(vtermno, 1, buf);
} while(rc == H_Busy); } while(rc == H_BUSY);
} }
/* Buffered chars getc */ /* Buffered chars getc */
...@@ -158,7 +158,7 @@ static int udbg_getc_pollLP(void) ...@@ -158,7 +158,7 @@ static int udbg_getc_pollLP(void)
/* get some more chars. */ /* get some more chars. */
inbuflen = 0; inbuflen = 0;
rc = plpar_get_term_char(vtermno, &inbuflen, buf); rc = plpar_get_term_char(vtermno, &inbuflen, buf);
if (rc != H_Success) if (rc != H_SUCCESS)
inbuflen = 0; /* otherwise inbuflen is garbage */ inbuflen = 0; /* otherwise inbuflen is garbage */
} }
if (inbuflen <= 0 || inbuflen > 16) { if (inbuflen <= 0 || inbuflen > 16) {
...@@ -304,7 +304,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, ...@@ -304,7 +304,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v, lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
hpte_r, &slot, &dummy0, &dummy1); hpte_r, &slot, &dummy0, &dummy1);
if (unlikely(lpar_rc == H_PTEG_Full)) { if (unlikely(lpar_rc == H_PTEG_FULL)) {
if (!(vflags & HPTE_V_BOLTED)) if (!(vflags & HPTE_V_BOLTED))
DBG_LOW(" full\n"); DBG_LOW(" full\n");
return -1; return -1;
...@@ -315,7 +315,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group, ...@@ -315,7 +315,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
* will fail. However we must catch the failure in hash_page * will fail. However we must catch the failure in hash_page
* or we will loop forever, so return -2 in this case. * or we will loop forever, so return -2 in this case.
*/ */
if (unlikely(lpar_rc != H_Success)) { if (unlikely(lpar_rc != H_SUCCESS)) {
if (!(vflags & HPTE_V_BOLTED)) if (!(vflags & HPTE_V_BOLTED))
DBG_LOW(" lpar err %d\n", lpar_rc); DBG_LOW(" lpar err %d\n", lpar_rc);
return -2; return -2;
...@@ -346,9 +346,9 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) ...@@ -346,9 +346,9 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
/* don't remove a bolted entry */ /* don't remove a bolted entry */
lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset, lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
(0x1UL << 4), &dummy1, &dummy2); (0x1UL << 4), &dummy1, &dummy2);
if (lpar_rc == H_Success) if (lpar_rc == H_SUCCESS)
return i; return i;
BUG_ON(lpar_rc != H_Not_Found); BUG_ON(lpar_rc != H_NOT_FOUND);
slot_offset++; slot_offset++;
slot_offset &= 0x7; slot_offset &= 0x7;
...@@ -391,14 +391,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot, ...@@ -391,14 +391,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN); lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
if (lpar_rc == H_Not_Found) { if (lpar_rc == H_NOT_FOUND) {
DBG_LOW("not found !\n"); DBG_LOW("not found !\n");
return -1; return -1;
} }
DBG_LOW("ok\n"); DBG_LOW("ok\n");
BUG_ON(lpar_rc != H_Success); BUG_ON(lpar_rc != H_SUCCESS);
return 0; return 0;
} }
...@@ -417,7 +417,7 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot) ...@@ -417,7 +417,7 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1); lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1);
BUG_ON(lpar_rc != H_Success); BUG_ON(lpar_rc != H_SUCCESS);
return dword0; return dword0;
} }
...@@ -468,7 +468,7 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp, ...@@ -468,7 +468,7 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
flags = newpp & 7; flags = newpp & 7;
lpar_rc = plpar_pte_protect(flags, slot, 0); lpar_rc = plpar_pte_protect(flags, slot, 0);
BUG_ON(lpar_rc != H_Success); BUG_ON(lpar_rc != H_SUCCESS);
} }
static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
...@@ -484,10 +484,10 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, ...@@ -484,10 +484,10 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
want_v = hpte_encode_v(va, psize); want_v = hpte_encode_v(va, psize);
lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN, lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
&dummy1, &dummy2); &dummy1, &dummy2);
if (lpar_rc == H_Not_Found) if (lpar_rc == H_NOT_FOUND)
return; return;
BUG_ON(lpar_rc != H_Success); BUG_ON(lpar_rc != H_SUCCESS);
} }
/* /*
......
...@@ -463,7 +463,7 @@ static void pseries_dedicated_idle_sleep(void) ...@@ -463,7 +463,7 @@ static void pseries_dedicated_idle_sleep(void)
* very low priority. The cede enables interrupts, which * very low priority. The cede enables interrupts, which
* doesn't matter here. * doesn't matter here.
*/ */
if (!lppaca[cpu ^ 1].idle || poll_pending() == H_Pending) if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
cede_processor(); cede_processor();
out: out:
......
...@@ -258,7 +258,7 @@ EXPORT_SYMBOL(vio_find_node); ...@@ -258,7 +258,7 @@ EXPORT_SYMBOL(vio_find_node);
int vio_enable_interrupts(struct vio_dev *dev) int vio_enable_interrupts(struct vio_dev *dev)
{ {
int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE); int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
if (rc != H_Success) if (rc != H_SUCCESS)
printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc); printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
return rc; return rc;
} }
...@@ -267,7 +267,7 @@ EXPORT_SYMBOL(vio_enable_interrupts); ...@@ -267,7 +267,7 @@ EXPORT_SYMBOL(vio_enable_interrupts);
int vio_disable_interrupts(struct vio_dev *dev) int vio_disable_interrupts(struct vio_dev *dev)
{ {
int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE); int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
if (rc != H_Success) if (rc != H_SUCCESS)
printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc); printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
return rc; return rc;
} }
......
...@@ -168,7 +168,7 @@ static int pSeriesLP_xirr_info_get(int n_cpu) ...@@ -168,7 +168,7 @@ static int pSeriesLP_xirr_info_get(int n_cpu)
unsigned long return_value; unsigned long return_value;
lpar_rc = plpar_xirr(&return_value); lpar_rc = plpar_xirr(&return_value);
if (lpar_rc != H_Success) if (lpar_rc != H_SUCCESS)
panic(" bad return code xirr - rc = %lx \n", lpar_rc); panic(" bad return code xirr - rc = %lx \n", lpar_rc);
return (int)return_value; return (int)return_value;
} }
...@@ -179,7 +179,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value) ...@@ -179,7 +179,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
unsigned long val64 = value & 0xffffffff; unsigned long val64 = value & 0xffffffff;
lpar_rc = plpar_eoi(val64); lpar_rc = plpar_eoi(val64);
if (lpar_rc != H_Success) if (lpar_rc != H_SUCCESS)
panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc, panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
val64); val64);
} }
...@@ -189,7 +189,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value) ...@@ -189,7 +189,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)
unsigned long lpar_rc; unsigned long lpar_rc;
lpar_rc = plpar_cppr(value); lpar_rc = plpar_cppr(value);
if (lpar_rc != H_Success) if (lpar_rc != H_SUCCESS)
panic("bad return code cppr - rc = %lx\n", lpar_rc); panic("bad return code cppr - rc = %lx\n", lpar_rc);
} }
...@@ -198,7 +198,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value) ...@@ -198,7 +198,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)
unsigned long lpar_rc; unsigned long lpar_rc;
lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value); lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
if (lpar_rc != H_Success) if (lpar_rc != H_SUCCESS)
panic("bad return code qirr - rc = %lx\n", lpar_rc); panic("bad return code qirr - rc = %lx\n", lpar_rc);
} }
......
...@@ -904,7 +904,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address, ...@@ -904,7 +904,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address,
* It is possible the vty-server was removed after the irq was * It is possible the vty-server was removed after the irq was
* requested but before we have time to enable interrupts. * requested but before we have time to enable interrupts.
*/ */
if (vio_enable_interrupts(vdev) == H_Success) if (vio_enable_interrupts(vdev) == H_SUCCESS)
return 0; return 0;
else { else {
printk(KERN_ERR "HVCS: int enable failed for" printk(KERN_ERR "HVCS: int enable failed for"
......
...@@ -235,7 +235,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc ...@@ -235,7 +235,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
pool->free_map[free_index] = index; pool->free_map[free_index] = index;
pool->skbuff[index] = NULL; pool->skbuff[index] = NULL;
pool->consumer_index--; pool->consumer_index--;
...@@ -373,7 +373,7 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter) ...@@ -373,7 +373,7 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter)
lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc); ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc);
ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator); ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator);
} }
...@@ -511,7 +511,7 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -511,7 +511,7 @@ static int ibmveth_open(struct net_device *netdev)
adapter->filter_list_dma, adapter->filter_list_dma,
mac_address); mac_address);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc);
ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n", ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n",
adapter->buffer_list_dma, adapter->buffer_list_dma,
...@@ -527,7 +527,7 @@ static int ibmveth_open(struct net_device *netdev) ...@@ -527,7 +527,7 @@ static int ibmveth_open(struct net_device *netdev)
ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc); ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc);
do { do {
rc = h_free_logical_lan(adapter->vdev->unit_address); rc = h_free_logical_lan(adapter->vdev->unit_address);
} while (H_isLongBusy(rc) || (rc == H_Busy)); } while (H_IS_LONG_BUSY(rc) || (rc == H_BUSY));
ibmveth_cleanup(adapter); ibmveth_cleanup(adapter);
return rc; return rc;
...@@ -556,9 +556,9 @@ static int ibmveth_close(struct net_device *netdev) ...@@ -556,9 +556,9 @@ static int ibmveth_close(struct net_device *netdev)
do { do {
lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
} while (H_isLongBusy(lpar_rc) || (lpar_rc == H_Busy)); } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
if(lpar_rc != H_Success) if(lpar_rc != H_SUCCESS)
{ {
ibmveth_error_printk("h_free_logical_lan failed with %lx, continuing with close\n", ibmveth_error_printk("h_free_logical_lan failed with %lx, continuing with close\n",
lpar_rc); lpar_rc);
...@@ -693,9 +693,9 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -693,9 +693,9 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
desc[4].desc, desc[4].desc,
desc[5].desc, desc[5].desc,
correlator); correlator);
} while ((lpar_rc == H_Busy) && (retry_count--)); } while ((lpar_rc == H_BUSY) && (retry_count--));
if(lpar_rc != H_Success && lpar_rc != H_Dropped) { if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) {
int i; int i;
ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc); ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc);
for(i = 0; i < 6; i++) { for(i = 0; i < 6; i++) {
...@@ -786,14 +786,14 @@ static int ibmveth_poll(struct net_device *netdev, int *budget) ...@@ -786,14 +786,14 @@ static int ibmveth_poll(struct net_device *netdev, int *budget)
/* we think we are done - reenable interrupts, then check once more to make sure we are done */ /* we think we are done - reenable interrupts, then check once more to make sure we are done */
lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE); lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE);
ibmveth_assert(lpar_rc == H_Success); ibmveth_assert(lpar_rc == H_SUCCESS);
netif_rx_complete(netdev); netif_rx_complete(netdev);
if(ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, frames_processed)) if(ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, frames_processed))
{ {
lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
ibmveth_assert(lpar_rc == H_Success); ibmveth_assert(lpar_rc == H_SUCCESS);
more_work = 1; more_work = 1;
goto restart_poll; goto restart_poll;
} }
...@@ -813,7 +813,7 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance, struct pt_regs ...@@ -813,7 +813,7 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance, struct pt_regs
if(netif_rx_schedule_prep(netdev)) { if(netif_rx_schedule_prep(netdev)) {
lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
ibmveth_assert(lpar_rc == H_Success); ibmveth_assert(lpar_rc == H_SUCCESS);
__netif_rx_schedule(netdev); __netif_rx_schedule(netdev);
} }
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -835,7 +835,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) ...@@ -835,7 +835,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
IbmVethMcastEnableRecv | IbmVethMcastEnableRecv |
IbmVethMcastDisableFiltering, IbmVethMcastDisableFiltering,
0); 0);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc); ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc);
} }
} else { } else {
...@@ -847,7 +847,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) ...@@ -847,7 +847,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
IbmVethMcastDisableFiltering | IbmVethMcastDisableFiltering |
IbmVethMcastClearFilterTable, IbmVethMcastClearFilterTable,
0); 0);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc); ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc);
} }
/* add the addresses to the filter table */ /* add the addresses to the filter table */
...@@ -858,7 +858,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) ...@@ -858,7 +858,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
IbmVethMcastAddFilter, IbmVethMcastAddFilter,
mcast_addr); mcast_addr);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc); ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc);
} }
} }
...@@ -867,7 +867,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev) ...@@ -867,7 +867,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
IbmVethMcastEnableFiltering, IbmVethMcastEnableFiltering,
0); 0);
if(lpar_rc != H_Success) { if(lpar_rc != H_SUCCESS) {
ibmveth_error_printk("h_multicast_ctrl rc=%ld when enabling filtering\n", lpar_rc); ibmveth_error_printk("h_multicast_ctrl rc=%ld when enabling filtering\n", lpar_rc);
} }
} }
......
...@@ -80,7 +80,7 @@ void ibmvscsi_release_crq_queue(struct crq_queue *queue, ...@@ -80,7 +80,7 @@ void ibmvscsi_release_crq_queue(struct crq_queue *queue,
tasklet_kill(&hostdata->srp_task); tasklet_kill(&hostdata->srp_task);
do { do {
rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
} while ((rc == H_Busy) || (H_isLongBusy(rc))); } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
dma_unmap_single(hostdata->dev, dma_unmap_single(hostdata->dev,
queue->msg_token, queue->msg_token,
queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL); queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
...@@ -230,7 +230,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, ...@@ -230,7 +230,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
rc = plpar_hcall_norets(H_REG_CRQ, rc = plpar_hcall_norets(H_REG_CRQ,
vdev->unit_address, vdev->unit_address,
queue->msg_token, PAGE_SIZE); queue->msg_token, PAGE_SIZE);
if (rc == H_Resource) if (rc == H_RESOURCE)
/* maybe kexecing and resource is busy. try a reset */ /* maybe kexecing and resource is busy. try a reset */
rc = ibmvscsi_reset_crq_queue(queue, rc = ibmvscsi_reset_crq_queue(queue,
hostdata); hostdata);
...@@ -269,7 +269,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, ...@@ -269,7 +269,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
req_irq_failed: req_irq_failed:
do { do {
rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
} while ((rc == H_Busy) || (H_isLongBusy(rc))); } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
reg_crq_failed: reg_crq_failed:
dma_unmap_single(hostdata->dev, dma_unmap_single(hostdata->dev,
queue->msg_token, queue->msg_token,
...@@ -295,7 +295,7 @@ int ibmvscsi_reenable_crq_queue(struct crq_queue *queue, ...@@ -295,7 +295,7 @@ int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
/* Re-enable the CRQ */ /* Re-enable the CRQ */
do { do {
rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address); rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address);
} while ((rc == H_InProgress) || (rc == H_Busy) || (H_isLongBusy(rc))); } while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
if (rc) if (rc)
printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc); printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc);
...@@ -317,7 +317,7 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue, ...@@ -317,7 +317,7 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
/* Close the CRQ */ /* Close the CRQ */
do { do {
rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
} while ((rc == H_Busy) || (H_isLongBusy(rc))); } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
/* Clean out the queue */ /* Clean out the queue */
memset(queue->msgs, 0x00, PAGE_SIZE); memset(queue->msgs, 0x00, PAGE_SIZE);
......
...@@ -4,47 +4,54 @@ ...@@ -4,47 +4,54 @@
#define HVSC .long 0x44000022 #define HVSC .long 0x44000022
#define H_Success 0 #define H_SUCCESS 0
#define H_Busy 1 /* Hardware busy -- retry later */ #define H_BUSY 1 /* Hardware busy -- retry later */
#define H_Closed 2 /* Resource closed */ #define H_CLOSED 2 /* Resource closed */
#define H_Constrained 4 /* Resource request constrained to max allowed */ #define H_CONSTRAINED 4 /* Resource request constrained to max allowed */
#define H_InProgress 14 /* Kind of like busy */ #define H_IN_PROGRESS 14 /* Kind of like busy */
#define H_Pending 17 /* returned from H_POLL_PENDING */ #define H_PENDING 17 /* returned from H_POLL_PENDING */
#define H_Continue 18 /* Returned from H_Join on success */ #define H_CONTINUE 18 /* Returned from H_Join on success */
#define H_LongBusyStartRange 9900 /* Start of long busy range */ #define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */
#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ #define H_LONG_BUSY_ORDER_1_MSEC 9900 /* Long busy, hint that 1msec \
#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ is a good time to retry */
#define H_LongBusyOrder100msec 9902 /* Long busy, hint that 100msec is a good time to retry */ #define H_LONG_BUSY_ORDER_10_MSEC 9901 /* Long busy, hint that 10msec \
#define H_LongBusyOrder1sec 9903 /* Long busy, hint that 1sec is a good time to retry */ is a good time to retry */
#define H_LongBusyOrder10sec 9904 /* Long busy, hint that 10sec is a good time to retry */ #define H_LONG_BUSY_ORDER_100_MSEC 9902 /* Long busy, hint that 100msec \
#define H_LongBusyOrder100sec 9905 /* Long busy, hint that 100sec is a good time to retry */ is a good time to retry */
#define H_LongBusyEndRange 9905 /* End of long busy range */ #define H_LONG_BUSY_ORDER_1_SEC 9903 /* Long busy, hint that 1sec \
#define H_Hardware -1 /* Hardware error */ is a good time to retry */
#define H_Function -2 /* Function not supported */ #define H_LONG_BUSY_ORDER_10_SEC 9904 /* Long busy, hint that 10sec \
#define H_Privilege -3 /* Caller not privileged */ is a good time to retry */
#define H_Parameter -4 /* Parameter invalid, out-of-range or conflicting */ #define H_LONG_BUSY_ORDER_100_SEC 9905 /* Long busy, hint that 100sec \
#define H_Bad_Mode -5 /* Illegal msr value */ is a good time to retry */
#define H_PTEG_Full -6 /* PTEG is full */ #define H_LONG_BUSY_END_RANGE 9905 /* End of long busy range */
#define H_Not_Found -7 /* PTE was not found" */ #define H_HARDWARE -1 /* Hardware error */
#define H_Reserved_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ #define H_FUNCTION -2 /* Function not supported */
#define H_NoMem -9 #define H_PRIVILEGE -3 /* Caller not privileged */
#define H_Authority -10 #define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */
#define H_Permission -11 #define H_BAD_MODE -5 /* Illegal msr value */
#define H_Dropped -12 #define H_PTEG_FULL -6 /* PTEG is full */
#define H_SourceParm -13 #define H_NOT_FOUND -7 /* PTE was not found" */
#define H_DestParm -14 #define H_RESERVED_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */
#define H_RemoteParm -15 #define H_NO_MEM -9
#define H_Resource -16 #define H_AUTHORITY -10
#define H_PERMISSION -11
#define H_DROPPED -12
#define H_SOURCE_PARM -13
#define H_DEST_PARM -14
#define H_REMOTE_PARM -15
#define H_RESOURCE -16
/* Long Busy is a condition that can be returned by the firmware /* Long Busy is a condition that can be returned by the firmware
* when a call cannot be completed now, but the identical call * when a call cannot be completed now, but the identical call
* should be retried later. This prevents calls blocking in the * should be retried later. This prevents calls blocking in the
* firmware for long periods of time. Annoyingly the firmware can return * firmware for long periods of time. Annoyingly the firmware can return
* a range of return codes, hinting at how long we should wait before * a range of return codes, hinting at how long we should wait before
* retrying. If you don't care for the hint, the macro below is a good * retrying. If you don't care for the hint, the macro below is a good
* way to check for the long_busy return codes * way to check for the long_busy return codes
*/ */
#define H_isLongBusy(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange)) #define H_IS_LONG_BUSY(x) ((x >= H_LONG_BUSY_START_RANGE) \
&& (x <= H_LONG_BUSY_END_RANGE))
/* Flags */ /* Flags */
#define H_LARGE_PAGE (1UL<<(63-16)) #define H_LARGE_PAGE (1UL<<(63-16))
...@@ -99,25 +106,25 @@ ...@@ -99,25 +106,25 @@
#define H_PERFMON 0x7c #define H_PERFMON 0x7c
#define H_MIGRATE_DMA 0x78 #define H_MIGRATE_DMA 0x78
#define H_REGISTER_VPA 0xDC #define H_REGISTER_VPA 0xDC
#define H_CEDE 0xE0 #define H_CEDE 0xE0
#define H_CONFER 0xE4 #define H_CONFER 0xE4
#define H_PROD 0xE8 #define H_PROD 0xE8
#define H_GET_PPP 0xEC #define H_GET_PPP 0xEC
#define H_SET_PPP 0xF0 #define H_SET_PPP 0xF0
#define H_PURR 0xF4 #define H_PURR 0xF4
#define H_PIC 0xF8 #define H_PIC 0xF8
#define H_REG_CRQ 0xFC #define H_REG_CRQ 0xFC
#define H_FREE_CRQ 0x100 #define H_FREE_CRQ 0x100
#define H_VIO_SIGNAL 0x104 #define H_VIO_SIGNAL 0x104
#define H_SEND_CRQ 0x108 #define H_SEND_CRQ 0x108
#define H_COPY_RDMA 0x110 #define H_COPY_RDMA 0x110
#define H_SET_XDABR 0x134 #define H_SET_XDABR 0x134
#define H_STUFF_TCE 0x138 #define H_STUFF_TCE 0x138
#define H_PUT_TCE_INDIRECT 0x13C #define H_PUT_TCE_INDIRECT 0x13C
#define H_VTERM_PARTNER_INFO 0x150 #define H_VTERM_PARTNER_INFO 0x150
#define H_REGISTER_VTERM 0x154 #define H_REGISTER_VTERM 0x154
#define H_FREE_VTERM 0x158 #define H_FREE_VTERM 0x158
#define H_POLL_PENDING 0x1D8 #define H_POLL_PENDING 0x1D8
#define H_JOIN 0x298 #define H_JOIN 0x298
#define H_ENABLE_CRQ 0x2B0 #define H_ENABLE_CRQ 0x2B0
...@@ -152,7 +159,7 @@ long plpar_hcall_norets(unsigned long opcode, ...); ...@@ -152,7 +159,7 @@ long plpar_hcall_norets(unsigned long opcode, ...);
*/ */
long plpar_hcall_8arg_2ret(unsigned long opcode, long plpar_hcall_8arg_2ret(unsigned long opcode,
unsigned long arg1, unsigned long arg1,
unsigned long arg2, unsigned long arg2,
unsigned long arg3, unsigned long arg3,
unsigned long arg4, unsigned long arg4,
unsigned long arg5, unsigned long arg5,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment