aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2006-03-30 07:49:40 -0500
committerPaul Mackerras <paulus@samba.org>2006-04-01 06:36:57 -0500
commit706c8c93ba4865a19e981b9770151a7a63c15794 (patch)
tree63cbae3a74bfe40adcb1efa9ea5a6e7f6898b8ca
parent8df83028cf52e3bf68dfd35a4b1a044b326a4a99 (diff)
[PATCH] powerpc/pseries: Change H_StudlyCaps to H_SHOUTING_CAPS
Also cleans up some nearby whitespace problems. Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/kernel/lparcfg.c22
-rw-r--r--arch/powerpc/kernel/rtas.c12
-rw-r--r--arch/powerpc/platforms/pseries/hvconsole.c6
-rw-r--r--arch/powerpc/platforms/pseries/hvcserver.c22
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c28
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
-rw-r--r--arch/powerpc/platforms/pseries/vio.c4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c8
-rw-r--r--drivers/char/hvcs.c2
-rw-r--r--drivers/net/ibmveth.c30
-rw-r--r--drivers/scsi/ibmvscsi/rpa_vscsi.c10
-rw-r--r--include/asm-powerpc/hvcall.h85
12 files changed, 119 insertions, 112 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 1b73508ecb2b..8be687700a50 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -149,17 +149,17 @@ static void log_plpar_hcall_return(unsigned long rc, char *tag)
149 if (rc == 0) /* success, return */ 149 if (rc == 0) /* success, return */
150 return; 150 return;
151/* check for null tag ? */ 151/* check for null tag ? */
152 if (rc == H_Hardware) 152 if (rc == H_HARDWARE)
153 printk(KERN_INFO 153 printk(KERN_INFO
154 "plpar-hcall (%s) failed with hardware fault\n", tag); 154 "plpar-hcall (%s) failed with hardware fault\n", tag);
155 else if (rc == H_Function) 155 else if (rc == H_FUNCTION)
156 printk(KERN_INFO 156 printk(KERN_INFO
157 "plpar-hcall (%s) failed; function not allowed\n", tag); 157 "plpar-hcall (%s) failed; function not allowed\n", tag);
158 else if (rc == H_Authority) 158 else if (rc == H_AUTHORITY)
159 printk(KERN_INFO 159 printk(KERN_INFO
160 "plpar-hcall (%s) failed; not authorized to this function\n", 160 "plpar-hcall (%s) failed; not authorized to this"
161 tag); 161 " function\n", tag);
162 else if (rc == H_Parameter) 162 else if (rc == H_PARAMETER)
163 printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n", 163 printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",
164 tag); 164 tag);
165 else 165 else
@@ -209,7 +209,7 @@ static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs)
209 unsigned long dummy; 209 unsigned long dummy;
210 rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy); 210 rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
211 211
212 if (rc != H_Authority) 212 if (rc != H_AUTHORITY)
213 log_plpar_hcall_return(rc, "H_PIC"); 213 log_plpar_hcall_return(rc, "H_PIC");
214} 214}
215 215
@@ -529,13 +529,13 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
529 retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr, 529 retval = plpar_hcall_norets(H_SET_PPP, *new_entitled_ptr,
530 *new_weight_ptr); 530 *new_weight_ptr);
531 531
532 if (retval == H_Success || retval == H_Constrained) { 532 if (retval == H_SUCCESS || retval == H_CONSTRAINED) {
533 retval = count; 533 retval = count;
534 } else if (retval == H_Busy) { 534 } else if (retval == H_BUSY) {
535 retval = -EBUSY; 535 retval = -EBUSY;
536 } else if (retval == H_Hardware) { 536 } else if (retval == H_HARDWARE) {
537 retval = -EIO; 537 retval = -EIO;
538 } else if (retval == H_Parameter) { 538 } else if (retval == H_PARAMETER) {
539 retval = -EINVAL; 539 retval = -EINVAL;
540 } else { 540 } else {
541 printk(KERN_WARNING "%s: received unknown hv return code %ld", 541 printk(KERN_WARNING "%s: received unknown hv return code %ld",
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 06636c927a7e..0112318213ab 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -578,18 +578,18 @@ static void rtas_percpu_suspend_me(void *info)
578 * We use "waiting" to indicate our state. As long 578 * We use "waiting" to indicate our state. As long
579 * as it is >0, we are still trying to all join up. 579 * as it is >0, we are still trying to all join up.
580 * If it goes to 0, we have successfully joined up and 580 * If it goes to 0, we have successfully joined up and
581 * one thread got H_Continue. If any error happens, 581 * one thread got H_CONTINUE. If any error happens,
582 * we set it to <0. 582 * we set it to <0.
583 */ 583 */
584 local_irq_save(flags); 584 local_irq_save(flags);
585 do { 585 do {
586 rc = plpar_hcall_norets(H_JOIN); 586 rc = plpar_hcall_norets(H_JOIN);
587 smp_rmb(); 587 smp_rmb();
588 } while (rc == H_Success && data->waiting > 0); 588 } while (rc == H_SUCCESS && data->waiting > 0);
589 if (rc == H_Success) 589 if (rc == H_SUCCESS)
590 goto out; 590 goto out;
591 591
592 if (rc == H_Continue) { 592 if (rc == H_CONTINUE) {
593 data->waiting = 0; 593 data->waiting = 0;
594 data->args->args[data->args->nargs] = 594 data->args->args[data->args->nargs] =
595 rtas_call(ibm_suspend_me_token, 0, 1, NULL); 595 rtas_call(ibm_suspend_me_token, 0, 1, NULL);
@@ -597,7 +597,7 @@ static void rtas_percpu_suspend_me(void *info)
597 plpar_hcall_norets(H_PROD,i); 597 plpar_hcall_norets(H_PROD,i);
598 } else { 598 } else {
599 data->waiting = -EBUSY; 599 data->waiting = -EBUSY;
600 printk(KERN_ERR "Error on H_Join hypervisor call\n"); 600 printk(KERN_ERR "Error on H_JOIN hypervisor call\n");
601 } 601 }
602 602
603out: 603out:
@@ -624,7 +624,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
624 printk(KERN_ERR "Error doing global join\n"); 624 printk(KERN_ERR "Error doing global join\n");
625 625
626 /* Prod each CPU. This won't hurt, and will wake 626 /* Prod each CPU. This won't hurt, and will wake
627 * anyone we successfully put to sleep with H_Join 627 * anyone we successfully put to sleep with H_JOIN.
628 */ 628 */
629 for_each_possible_cpu(i) 629 for_each_possible_cpu(i)
630 plpar_hcall_norets(H_PROD, i); 630 plpar_hcall_norets(H_PROD, i);
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c
index ba6befd96636..a72a987f1d4d 100644
--- a/arch/powerpc/platforms/pseries/hvconsole.c
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -41,7 +41,7 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
41 unsigned long got; 41 unsigned long got;
42 42
43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got, 43 if (plpar_hcall(H_GET_TERM_CHAR, vtermno, 0, 0, 0, &got,
44 (unsigned long *)buf, (unsigned long *)buf+1) == H_Success) 44 (unsigned long *)buf, (unsigned long *)buf+1) == H_SUCCESS)
45 return got; 45 return got;
46 return 0; 46 return 0;
47} 47}
@@ -69,9 +69,9 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
69 69
70 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0], 70 ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
71 lbuf[1]); 71 lbuf[1]);
72 if (ret == H_Success) 72 if (ret == H_SUCCESS)
73 return count; 73 return count;
74 if (ret == H_Busy) 74 if (ret == H_BUSY)
75 return 0; 75 return 0;
76 return -EIO; 76 return -EIO;
77} 77}
diff --git a/arch/powerpc/platforms/pseries/hvcserver.c b/arch/powerpc/platforms/pseries/hvcserver.c
index 22bfb5c89db9..fcf4b4cbeaf3 100644
--- a/arch/powerpc/platforms/pseries/hvcserver.c
+++ b/arch/powerpc/platforms/pseries/hvcserver.c
@@ -43,21 +43,21 @@ MODULE_VERSION(HVCS_ARCH_VERSION);
43static int hvcs_convert(long to_convert) 43static int hvcs_convert(long to_convert)
44{ 44{
45 switch (to_convert) { 45 switch (to_convert) {
46 case H_Success: 46 case H_SUCCESS:
47 return 0; 47 return 0;
48 case H_Parameter: 48 case H_PARAMETER:
49 return -EINVAL; 49 return -EINVAL;
50 case H_Hardware: 50 case H_HARDWARE:
51 return -EIO; 51 return -EIO;
52 case H_Busy: 52 case H_BUSY:
53 case H_LongBusyOrder1msec: 53 case H_LONG_BUSY_ORDER_1_MSEC:
54 case H_LongBusyOrder10msec: 54 case H_LONG_BUSY_ORDER_10_MSEC:
55 case H_LongBusyOrder100msec: 55 case H_LONG_BUSY_ORDER_100_MSEC:
56 case H_LongBusyOrder1sec: 56 case H_LONG_BUSY_ORDER_1_SEC:
57 case H_LongBusyOrder10sec: 57 case H_LONG_BUSY_ORDER_10_SEC:
58 case H_LongBusyOrder100sec: 58 case H_LONG_BUSY_ORDER_100_SEC:
59 return -EBUSY; 59 return -EBUSY;
60 case H_Function: /* fall through */ 60 case H_FUNCTION: /* fall through */
61 default: 61 default:
62 return -EPERM; 62 return -EPERM;
63 } 63 }
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8952528d31ac..c72c0918b44b 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -72,7 +72,7 @@ static void udbg_hvsi_putc(char c)
72 72
73 do { 73 do {
74 rc = plpar_put_term_char(vtermno, sizeof(packet), packet); 74 rc = plpar_put_term_char(vtermno, sizeof(packet), packet);
75 } while (rc == H_Busy); 75 } while (rc == H_BUSY);
76} 76}
77 77
78static long hvsi_udbg_buf_len; 78static long hvsi_udbg_buf_len;
@@ -85,7 +85,7 @@ static int udbg_hvsi_getc_poll(void)
85 85
86 if (hvsi_udbg_buf_len == 0) { 86 if (hvsi_udbg_buf_len == 0) {
87 rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf); 87 rc = plpar_get_term_char(vtermno, &hvsi_udbg_buf_len, hvsi_udbg_buf);
88 if (rc != H_Success || hvsi_udbg_buf[0] != 0xff) { 88 if (rc != H_SUCCESS || hvsi_udbg_buf[0] != 0xff) {
89 /* bad read or non-data packet */ 89 /* bad read or non-data packet */
90 hvsi_udbg_buf_len = 0; 90 hvsi_udbg_buf_len = 0;
91 } else { 91 } else {
@@ -139,7 +139,7 @@ static void udbg_putcLP(char c)
139 buf[0] = c; 139 buf[0] = c;
140 do { 140 do {
141 rc = plpar_put_term_char(vtermno, 1, buf); 141 rc = plpar_put_term_char(vtermno, 1, buf);
142 } while(rc == H_Busy); 142 } while(rc == H_BUSY);
143} 143}
144 144
145/* Buffered chars getc */ 145/* Buffered chars getc */
@@ -158,7 +158,7 @@ static int udbg_getc_pollLP(void)
158 /* get some more chars. */ 158 /* get some more chars. */
159 inbuflen = 0; 159 inbuflen = 0;
160 rc = plpar_get_term_char(vtermno, &inbuflen, buf); 160 rc = plpar_get_term_char(vtermno, &inbuflen, buf);
161 if (rc != H_Success) 161 if (rc != H_SUCCESS)
162 inbuflen = 0; /* otherwise inbuflen is garbage */ 162 inbuflen = 0; /* otherwise inbuflen is garbage */
163 } 163 }
164 if (inbuflen <= 0 || inbuflen > 16) { 164 if (inbuflen <= 0 || inbuflen > 16) {
@@ -304,7 +304,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
304 304
305 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v, 305 lpar_rc = plpar_hcall(H_ENTER, flags, hpte_group, hpte_v,
306 hpte_r, &slot, &dummy0, &dummy1); 306 hpte_r, &slot, &dummy0, &dummy1);
307 if (unlikely(lpar_rc == H_PTEG_Full)) { 307 if (unlikely(lpar_rc == H_PTEG_FULL)) {
308 if (!(vflags & HPTE_V_BOLTED)) 308 if (!(vflags & HPTE_V_BOLTED))
309 DBG_LOW(" full\n"); 309 DBG_LOW(" full\n");
310 return -1; 310 return -1;
@@ -315,7 +315,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
315 * will fail. However we must catch the failure in hash_page 315 * will fail. However we must catch the failure in hash_page
316 * or we will loop forever, so return -2 in this case. 316 * or we will loop forever, so return -2 in this case.
317 */ 317 */
318 if (unlikely(lpar_rc != H_Success)) { 318 if (unlikely(lpar_rc != H_SUCCESS)) {
319 if (!(vflags & HPTE_V_BOLTED)) 319 if (!(vflags & HPTE_V_BOLTED))
320 DBG_LOW(" lpar err %d\n", lpar_rc); 320 DBG_LOW(" lpar err %d\n", lpar_rc);
321 return -2; 321 return -2;
@@ -346,9 +346,9 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
346 /* don't remove a bolted entry */ 346 /* don't remove a bolted entry */
347 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset, 347 lpar_rc = plpar_pte_remove(H_ANDCOND, hpte_group + slot_offset,
348 (0x1UL << 4), &dummy1, &dummy2); 348 (0x1UL << 4), &dummy1, &dummy2);
349 if (lpar_rc == H_Success) 349 if (lpar_rc == H_SUCCESS)
350 return i; 350 return i;
351 BUG_ON(lpar_rc != H_Not_Found); 351 BUG_ON(lpar_rc != H_NOT_FOUND);
352 352
353 slot_offset++; 353 slot_offset++;
354 slot_offset &= 0x7; 354 slot_offset &= 0x7;
@@ -391,14 +391,14 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
391 391
392 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN); 392 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN);
393 393
394 if (lpar_rc == H_Not_Found) { 394 if (lpar_rc == H_NOT_FOUND) {
395 DBG_LOW("not found !\n"); 395 DBG_LOW("not found !\n");
396 return -1; 396 return -1;
397 } 397 }
398 398
399 DBG_LOW("ok\n"); 399 DBG_LOW("ok\n");
400 400
401 BUG_ON(lpar_rc != H_Success); 401 BUG_ON(lpar_rc != H_SUCCESS);
402 402
403 return 0; 403 return 0;
404} 404}
@@ -417,7 +417,7 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
417 417
418 lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1); 418 lpar_rc = plpar_pte_read(flags, slot, &dword0, &dummy_word1);
419 419
420 BUG_ON(lpar_rc != H_Success); 420 BUG_ON(lpar_rc != H_SUCCESS);
421 421
422 return dword0; 422 return dword0;
423} 423}
@@ -468,7 +468,7 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
468 flags = newpp & 7; 468 flags = newpp & 7;
469 lpar_rc = plpar_pte_protect(flags, slot, 0); 469 lpar_rc = plpar_pte_protect(flags, slot, 0);
470 470
471 BUG_ON(lpar_rc != H_Success); 471 BUG_ON(lpar_rc != H_SUCCESS);
472} 472}
473 473
474static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 474static 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 want_v = hpte_encode_v(va, psize); 484 want_v = hpte_encode_v(va, psize);
485 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN, 485 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN,
486 &dummy1, &dummy2); 486 &dummy1, &dummy2);
487 if (lpar_rc == H_Not_Found) 487 if (lpar_rc == H_NOT_FOUND)
488 return; 488 return;
489 489
490 BUG_ON(lpar_rc != H_Success); 490 BUG_ON(lpar_rc != H_SUCCESS);
491} 491}
492 492
493/* 493/*
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index b2fbf8ba8fbb..5eb55ef1c91c 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -463,7 +463,7 @@ static void pseries_dedicated_idle_sleep(void)
463 * very low priority. The cede enables interrupts, which 463 * very low priority. The cede enables interrupts, which
464 * doesn't matter here. 464 * doesn't matter here.
465 */ 465 */
466 if (!lppaca[cpu ^ 1].idle || poll_pending() == H_Pending) 466 if (!lppaca[cpu ^ 1].idle || poll_pending() == H_PENDING)
467 cede_processor(); 467 cede_processor();
468 468
469out: 469out:
diff --git a/arch/powerpc/platforms/pseries/vio.c b/arch/powerpc/platforms/pseries/vio.c
index 866379b80c09..8e53e04ada8b 100644
--- a/arch/powerpc/platforms/pseries/vio.c
+++ b/arch/powerpc/platforms/pseries/vio.c
@@ -258,7 +258,7 @@ EXPORT_SYMBOL(vio_find_node);
258int vio_enable_interrupts(struct vio_dev *dev) 258int vio_enable_interrupts(struct vio_dev *dev)
259{ 259{
260 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE); 260 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_ENABLE);
261 if (rc != H_Success) 261 if (rc != H_SUCCESS)
262 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc); 262 printk(KERN_ERR "vio: Error 0x%x enabling interrupts\n", rc);
263 return rc; 263 return rc;
264} 264}
@@ -267,7 +267,7 @@ EXPORT_SYMBOL(vio_enable_interrupts);
267int vio_disable_interrupts(struct vio_dev *dev) 267int vio_disable_interrupts(struct vio_dev *dev)
268{ 268{
269 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE); 269 int rc = h_vio_signal(dev->unit_address, VIO_IRQ_DISABLE);
270 if (rc != H_Success) 270 if (rc != H_SUCCESS)
271 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc); 271 printk(KERN_ERR "vio: Error 0x%x disabling interrupts\n", rc);
272 return rc; 272 return rc;
273} 273}
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 4864cb32be25..2d60ea30fed6 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -168,7 +168,7 @@ static int pSeriesLP_xirr_info_get(int n_cpu)
168 unsigned long return_value; 168 unsigned long return_value;
169 169
170 lpar_rc = plpar_xirr(&return_value); 170 lpar_rc = plpar_xirr(&return_value);
171 if (lpar_rc != H_Success) 171 if (lpar_rc != H_SUCCESS)
172 panic(" bad return code xirr - rc = %lx \n", lpar_rc); 172 panic(" bad return code xirr - rc = %lx \n", lpar_rc);
173 return (int)return_value; 173 return (int)return_value;
174} 174}
@@ -179,7 +179,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
179 unsigned long val64 = value & 0xffffffff; 179 unsigned long val64 = value & 0xffffffff;
180 180
181 lpar_rc = plpar_eoi(val64); 181 lpar_rc = plpar_eoi(val64);
182 if (lpar_rc != H_Success) 182 if (lpar_rc != H_SUCCESS)
183 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc, 183 panic("bad return code EOI - rc = %ld, value=%lx\n", lpar_rc,
184 val64); 184 val64);
185} 185}
@@ -189,7 +189,7 @@ void pSeriesLP_cppr_info(int n_cpu, u8 value)
189 unsigned long lpar_rc; 189 unsigned long lpar_rc;
190 190
191 lpar_rc = plpar_cppr(value); 191 lpar_rc = plpar_cppr(value);
192 if (lpar_rc != H_Success) 192 if (lpar_rc != H_SUCCESS)
193 panic("bad return code cppr - rc = %lx\n", lpar_rc); 193 panic("bad return code cppr - rc = %lx\n", lpar_rc);
194} 194}
195 195
@@ -198,7 +198,7 @@ static void pSeriesLP_qirr_info(int n_cpu , u8 value)
198 unsigned long lpar_rc; 198 unsigned long lpar_rc;
199 199
200 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value); 200 lpar_rc = plpar_ipi(get_hard_smp_processor_id(n_cpu), value);
201 if (lpar_rc != H_Success) 201 if (lpar_rc != H_SUCCESS)
202 panic("bad return code qirr - rc = %lx\n", lpar_rc); 202 panic("bad return code qirr - rc = %lx\n", lpar_rc);
203} 203}
204 204
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c
index 327b00c3c45e..8d97b3911293 100644
--- a/drivers/char/hvcs.c
+++ b/drivers/char/hvcs.c
@@ -904,7 +904,7 @@ static int hvcs_enable_device(struct hvcs_struct *hvcsd, uint32_t unit_address,
904 * It is possible the vty-server was removed after the irq was 904 * It is possible the vty-server was removed after the irq was
905 * requested but before we have time to enable interrupts. 905 * requested but before we have time to enable interrupts.
906 */ 906 */
907 if (vio_enable_interrupts(vdev) == H_Success) 907 if (vio_enable_interrupts(vdev) == H_SUCCESS)
908 return 0; 908 return 0;
909 else { 909 else {
910 printk(KERN_ERR "HVCS: int enable failed for" 910 printk(KERN_ERR "HVCS: int enable failed for"
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index ceb98fd398af..52d01027d9e7 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -235,7 +235,7 @@ static void ibmveth_replenish_buffer_pool(struct ibmveth_adapter *adapter, struc
235 235
236 lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); 236 lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
237 237
238 if(lpar_rc != H_Success) { 238 if(lpar_rc != H_SUCCESS) {
239 pool->free_map[free_index] = index; 239 pool->free_map[free_index] = index;
240 pool->skbuff[index] = NULL; 240 pool->skbuff[index] = NULL;
241 pool->consumer_index--; 241 pool->consumer_index--;
@@ -373,7 +373,7 @@ static void ibmveth_rxq_recycle_buffer(struct ibmveth_adapter *adapter)
373 373
374 lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc); 374 lpar_rc = h_add_logical_lan_buffer(adapter->vdev->unit_address, desc.desc);
375 375
376 if(lpar_rc != H_Success) { 376 if(lpar_rc != H_SUCCESS) {
377 ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc); 377 ibmveth_debug_printk("h_add_logical_lan_buffer failed during recycle rc=%ld", lpar_rc);
378 ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator); 378 ibmveth_remove_buffer_from_pool(adapter, adapter->rx_queue.queue_addr[adapter->rx_queue.index].correlator);
379 } 379 }
@@ -511,7 +511,7 @@ static int ibmveth_open(struct net_device *netdev)
511 adapter->filter_list_dma, 511 adapter->filter_list_dma,
512 mac_address); 512 mac_address);
513 513
514 if(lpar_rc != H_Success) { 514 if(lpar_rc != H_SUCCESS) {
515 ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); 515 ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc);
516 ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n", 516 ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n",
517 adapter->buffer_list_dma, 517 adapter->buffer_list_dma,
@@ -527,7 +527,7 @@ static int ibmveth_open(struct net_device *netdev)
527 ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc); 527 ibmveth_error_printk("unable to request irq 0x%x, rc %d\n", netdev->irq, rc);
528 do { 528 do {
529 rc = h_free_logical_lan(adapter->vdev->unit_address); 529 rc = h_free_logical_lan(adapter->vdev->unit_address);
530 } while (H_isLongBusy(rc) || (rc == H_Busy)); 530 } while (H_IS_LONG_BUSY(rc) || (rc == H_BUSY));
531 531
532 ibmveth_cleanup(adapter); 532 ibmveth_cleanup(adapter);
533 return rc; 533 return rc;
@@ -556,9 +556,9 @@ static int ibmveth_close(struct net_device *netdev)
556 556
557 do { 557 do {
558 lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); 558 lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
559 } while (H_isLongBusy(lpar_rc) || (lpar_rc == H_Busy)); 559 } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
560 560
561 if(lpar_rc != H_Success) 561 if(lpar_rc != H_SUCCESS)
562 { 562 {
563 ibmveth_error_printk("h_free_logical_lan failed with %lx, continuing with close\n", 563 ibmveth_error_printk("h_free_logical_lan failed with %lx, continuing with close\n",
564 lpar_rc); 564 lpar_rc);
@@ -693,9 +693,9 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
693 desc[4].desc, 693 desc[4].desc,
694 desc[5].desc, 694 desc[5].desc,
695 correlator); 695 correlator);
696 } while ((lpar_rc == H_Busy) && (retry_count--)); 696 } while ((lpar_rc == H_BUSY) && (retry_count--));
697 697
698 if(lpar_rc != H_Success && lpar_rc != H_Dropped) { 698 if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) {
699 int i; 699 int i;
700 ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc); 700 ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc);
701 for(i = 0; i < 6; i++) { 701 for(i = 0; i < 6; i++) {
@@ -786,14 +786,14 @@ static int ibmveth_poll(struct net_device *netdev, int *budget)
786 /* we think we are done - reenable interrupts, then check once more to make sure we are done */ 786 /* we think we are done - reenable interrupts, then check once more to make sure we are done */
787 lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE); 787 lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE);
788 788
789 ibmveth_assert(lpar_rc == H_Success); 789 ibmveth_assert(lpar_rc == H_SUCCESS);
790 790
791 netif_rx_complete(netdev); 791 netif_rx_complete(netdev);
792 792
793 if(ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, frames_processed)) 793 if(ibmveth_rxq_pending_buffer(adapter) && netif_rx_reschedule(netdev, frames_processed))
794 { 794 {
795 lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); 795 lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
796 ibmveth_assert(lpar_rc == H_Success); 796 ibmveth_assert(lpar_rc == H_SUCCESS);
797 more_work = 1; 797 more_work = 1;
798 goto restart_poll; 798 goto restart_poll;
799 } 799 }
@@ -813,7 +813,7 @@ static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance, struct pt_regs
813 813
814 if(netif_rx_schedule_prep(netdev)) { 814 if(netif_rx_schedule_prep(netdev)) {
815 lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE); 815 lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_DISABLE);
816 ibmveth_assert(lpar_rc == H_Success); 816 ibmveth_assert(lpar_rc == H_SUCCESS);
817 __netif_rx_schedule(netdev); 817 __netif_rx_schedule(netdev);
818 } 818 }
819 return IRQ_HANDLED; 819 return IRQ_HANDLED;
@@ -835,7 +835,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
835 IbmVethMcastEnableRecv | 835 IbmVethMcastEnableRecv |
836 IbmVethMcastDisableFiltering, 836 IbmVethMcastDisableFiltering,
837 0); 837 0);
838 if(lpar_rc != H_Success) { 838 if(lpar_rc != H_SUCCESS) {
839 ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc); 839 ibmveth_error_printk("h_multicast_ctrl rc=%ld when entering promisc mode\n", lpar_rc);
840 } 840 }
841 } else { 841 } else {
@@ -847,7 +847,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
847 IbmVethMcastDisableFiltering | 847 IbmVethMcastDisableFiltering |
848 IbmVethMcastClearFilterTable, 848 IbmVethMcastClearFilterTable,
849 0); 849 0);
850 if(lpar_rc != H_Success) { 850 if(lpar_rc != H_SUCCESS) {
851 ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc); 851 ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc);
852 } 852 }
853 /* add the addresses to the filter table */ 853 /* add the addresses to the filter table */
@@ -858,7 +858,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
858 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, 858 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
859 IbmVethMcastAddFilter, 859 IbmVethMcastAddFilter,
860 mcast_addr); 860 mcast_addr);
861 if(lpar_rc != H_Success) { 861 if(lpar_rc != H_SUCCESS) {
862 ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc); 862 ibmveth_error_printk("h_multicast_ctrl rc=%ld when adding an entry to the filter table\n", lpar_rc);
863 } 863 }
864 } 864 }
@@ -867,7 +867,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
867 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address, 867 lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
868 IbmVethMcastEnableFiltering, 868 IbmVethMcastEnableFiltering,
869 0); 869 0);
870 if(lpar_rc != H_Success) { 870 if(lpar_rc != H_SUCCESS) {
871 ibmveth_error_printk("h_multicast_ctrl rc=%ld when enabling filtering\n", lpar_rc); 871 ibmveth_error_printk("h_multicast_ctrl rc=%ld when enabling filtering\n", lpar_rc);
872 } 872 }
873 } 873 }
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index f47dd87c05e7..892e8ed63091 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -80,7 +80,7 @@ void ibmvscsi_release_crq_queue(struct crq_queue *queue,
80 tasklet_kill(&hostdata->srp_task); 80 tasklet_kill(&hostdata->srp_task);
81 do { 81 do {
82 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); 82 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
83 } while ((rc == H_Busy) || (H_isLongBusy(rc))); 83 } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
84 dma_unmap_single(hostdata->dev, 84 dma_unmap_single(hostdata->dev,
85 queue->msg_token, 85 queue->msg_token,
86 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL); 86 queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL);
@@ -230,7 +230,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
230 rc = plpar_hcall_norets(H_REG_CRQ, 230 rc = plpar_hcall_norets(H_REG_CRQ,
231 vdev->unit_address, 231 vdev->unit_address,
232 queue->msg_token, PAGE_SIZE); 232 queue->msg_token, PAGE_SIZE);
233 if (rc == H_Resource) 233 if (rc == H_RESOURCE)
234 /* maybe kexecing and resource is busy. try a reset */ 234 /* maybe kexecing and resource is busy. try a reset */
235 rc = ibmvscsi_reset_crq_queue(queue, 235 rc = ibmvscsi_reset_crq_queue(queue,
236 hostdata); 236 hostdata);
@@ -269,7 +269,7 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
269 req_irq_failed: 269 req_irq_failed:
270 do { 270 do {
271 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); 271 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
272 } while ((rc == H_Busy) || (H_isLongBusy(rc))); 272 } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
273 reg_crq_failed: 273 reg_crq_failed:
274 dma_unmap_single(hostdata->dev, 274 dma_unmap_single(hostdata->dev,
275 queue->msg_token, 275 queue->msg_token,
@@ -295,7 +295,7 @@ int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
295 /* Re-enable the CRQ */ 295 /* Re-enable the CRQ */
296 do { 296 do {
297 rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address); 297 rc = plpar_hcall_norets(H_ENABLE_CRQ, vdev->unit_address);
298 } while ((rc == H_InProgress) || (rc == H_Busy) || (H_isLongBusy(rc))); 298 } while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
299 299
300 if (rc) 300 if (rc)
301 printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc); 301 printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc);
@@ -317,7 +317,7 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
317 /* Close the CRQ */ 317 /* Close the CRQ */
318 do { 318 do {
319 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); 319 rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address);
320 } while ((rc == H_Busy) || (H_isLongBusy(rc))); 320 } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
321 321
322 /* Clean out the queue */ 322 /* Clean out the queue */
323 memset(queue->msgs, 0x00, PAGE_SIZE); 323 memset(queue->msgs, 0x00, PAGE_SIZE);
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index b72c04f3f551..029afaef1e66 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -4,47 +4,54 @@
4 4
5#define HVSC .long 0x44000022 5#define HVSC .long 0x44000022
6 6
7#define H_Success 0 7#define H_SUCCESS 0
8#define H_Busy 1 /* Hardware busy -- retry later */ 8#define H_BUSY 1 /* Hardware busy -- retry later */
9#define H_Closed 2 /* Resource closed */ 9#define H_CLOSED 2 /* Resource closed */
10#define H_Constrained 4 /* Resource request constrained to max allowed */ 10#define H_CONSTRAINED 4 /* Resource request constrained to max allowed */
11#define H_InProgress 14 /* Kind of like busy */ 11#define H_IN_PROGRESS 14 /* Kind of like busy */
12#define H_Pending 17 /* returned from H_POLL_PENDING */ 12#define H_PENDING 17 /* returned from H_POLL_PENDING */
13#define H_Continue 18 /* Returned from H_Join on success */ 13#define H_CONTINUE 18 /* Returned from H_Join on success */
14#define H_LongBusyStartRange 9900 /* Start of long busy range */ 14#define H_LONG_BUSY_START_RANGE 9900 /* Start of long busy range */
15#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ 15#define H_LONG_BUSY_ORDER_1_MSEC 9900 /* Long busy, hint that 1msec \
16#define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ 16 is a good time to retry */
17#define H_LongBusyOrder100msec 9902 /* Long busy, hint that 100msec is a good time to retry */ 17#define H_LONG_BUSY_ORDER_10_MSEC 9901 /* Long busy, hint that 10msec \
18#define H_LongBusyOrder1sec 9903 /* Long busy, hint that 1sec is a good time to retry */ 18 is a good time to retry */
19#define H_LongBusyOrder10sec 9904 /* Long busy, hint that 10sec is a good time to retry */ 19#define H_LONG_BUSY_ORDER_100_MSEC 9902 /* Long busy, hint that 100msec \
20#define H_LongBusyOrder100sec 9905 /* Long busy, hint that 100sec is a good time to retry */ 20 is a good time to retry */
21#define H_LongBusyEndRange 9905 /* End of long busy range */ 21#define H_LONG_BUSY_ORDER_1_SEC 9903 /* Long busy, hint that 1sec \
22#define H_Hardware -1 /* Hardware error */ 22 is a good time to retry */
23#define H_Function -2 /* Function not supported */ 23#define H_LONG_BUSY_ORDER_10_SEC 9904 /* Long busy, hint that 10sec \
24#define H_Privilege -3 /* Caller not privileged */ 24 is a good time to retry */
25#define H_Parameter -4 /* Parameter invalid, out-of-range or conflicting */ 25#define H_LONG_BUSY_ORDER_100_SEC 9905 /* Long busy, hint that 100sec \
26#define H_Bad_Mode -5 /* Illegal msr value */ 26 is a good time to retry */
27#define H_PTEG_Full -6 /* PTEG is full */ 27#define H_LONG_BUSY_END_RANGE 9905 /* End of long busy range */
28#define H_Not_Found -7 /* PTE was not found" */ 28#define H_HARDWARE -1 /* Hardware error */
29#define H_Reserved_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */ 29#define H_FUNCTION -2 /* Function not supported */
30#define H_NoMem -9 30#define H_PRIVILEGE -3 /* Caller not privileged */
31#define H_Authority -10 31#define H_PARAMETER -4 /* Parameter invalid, out-of-range or conflicting */
32#define H_Permission -11 32#define H_BAD_MODE -5 /* Illegal msr value */
33#define H_Dropped -12 33#define H_PTEG_FULL -6 /* PTEG is full */
34#define H_SourceParm -13 34#define H_NOT_FOUND -7 /* PTE was not found" */
35#define H_DestParm -14 35#define H_RESERVED_DABR -8 /* DABR address is reserved by the hypervisor on this processor" */
36#define H_RemoteParm -15 36#define H_NO_MEM -9
37#define H_Resource -16 37#define H_AUTHORITY -10
38#define H_PERMISSION -11
39#define H_DROPPED -12
40#define H_SOURCE_PARM -13
41#define H_DEST_PARM -14
42#define H_REMOTE_PARM -15
43#define H_RESOURCE -16
38 44
39/* Long Busy is a condition that can be returned by the firmware 45/* Long Busy is a condition that can be returned by the firmware
40 * when a call cannot be completed now, but the identical call 46 * when a call cannot be completed now, but the identical call
41 * should be retried later. This prevents calls blocking in the 47 * should be retried later. This prevents calls blocking in the
42 * firmware for long periods of time. Annoyingly the firmware can return 48 * firmware for long periods of time. Annoyingly the firmware can return
43 * a range of return codes, hinting at how long we should wait before 49 * a range of return codes, hinting at how long we should wait before
44 * retrying. If you don't care for the hint, the macro below is a good 50 * retrying. If you don't care for the hint, the macro below is a good
45 * way to check for the long_busy return codes 51 * way to check for the long_busy return codes
46 */ 52 */
47#define H_isLongBusy(x) ((x >= H_LongBusyStartRange) && (x <= H_LongBusyEndRange)) 53#define H_IS_LONG_BUSY(x) ((x >= H_LONG_BUSY_START_RANGE) \
54 && (x <= H_LONG_BUSY_END_RANGE))
48 55
49/* Flags */ 56/* Flags */
50#define H_LARGE_PAGE (1UL<<(63-16)) 57#define H_LARGE_PAGE (1UL<<(63-16))
@@ -99,25 +106,25 @@
99#define H_PERFMON 0x7c 106#define H_PERFMON 0x7c
100#define H_MIGRATE_DMA 0x78 107#define H_MIGRATE_DMA 0x78
101#define H_REGISTER_VPA 0xDC 108#define H_REGISTER_VPA 0xDC
102#define H_CEDE 0xE0 109#define H_CEDE 0xE0
103#define H_CONFER 0xE4 110#define H_CONFER 0xE4
104#define H_PROD 0xE8 111#define H_PROD 0xE8
105#define H_GET_PPP 0xEC 112#define H_GET_PPP 0xEC
106#define H_SET_PPP 0xF0 113#define H_SET_PPP 0xF0
107#define H_PURR 0xF4 114#define H_PURR 0xF4
108#define H_PIC 0xF8 115#define H_PIC 0xF8
109#define H_REG_CRQ 0xFC 116#define H_REG_CRQ 0xFC
110#define H_FREE_CRQ 0x100 117#define H_FREE_CRQ 0x100
111#define H_VIO_SIGNAL 0x104 118#define H_VIO_SIGNAL 0x104
112#define H_SEND_CRQ 0x108 119#define H_SEND_CRQ 0x108
113#define H_COPY_RDMA 0x110 120#define H_COPY_RDMA 0x110
114#define H_SET_XDABR 0x134 121#define H_SET_XDABR 0x134
115#define H_STUFF_TCE 0x138 122#define H_STUFF_TCE 0x138
116#define H_PUT_TCE_INDIRECT 0x13C 123#define H_PUT_TCE_INDIRECT 0x13C
117#define H_VTERM_PARTNER_INFO 0x150 124#define H_VTERM_PARTNER_INFO 0x150
118#define H_REGISTER_VTERM 0x154 125#define H_REGISTER_VTERM 0x154
119#define H_FREE_VTERM 0x158 126#define H_FREE_VTERM 0x158
120#define H_POLL_PENDING 0x1D8 127#define H_POLL_PENDING 0x1D8
121#define H_JOIN 0x298 128#define H_JOIN 0x298
122#define H_ENABLE_CRQ 0x2B0 129#define H_ENABLE_CRQ 0x2B0
123 130
@@ -152,7 +159,7 @@ long plpar_hcall_norets(unsigned long opcode, ...);
152 */ 159 */
153long plpar_hcall_8arg_2ret(unsigned long opcode, 160long plpar_hcall_8arg_2ret(unsigned long opcode,
154 unsigned long arg1, 161 unsigned long arg1,
155 unsigned long arg2, 162 unsigned long arg2,
156 unsigned long arg3, 163 unsigned long arg3,
157 unsigned long arg4, 164 unsigned long arg4,
158 unsigned long arg5, 165 unsigned long arg5,