aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2006-01-11 21:47:43 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-12 04:09:29 -0500
commit677f8c0d0455a35aaff08a0292ba9c6232ef4eb1 (patch)
treeebac30f3413ecc2eeb2b1f8788b379ac6b56a237 /drivers
parent6814350b80e0e7dfb87d2faebbcbef876573897c (diff)
[PATCH] powerpc: remove bitfields from HvLpEvent
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/viodasd.c32
-rw-r--r--drivers/cdrom/viocd.c6
-rw-r--r--drivers/char/viocons.c31
-rw-r--r--drivers/net/iseries_veth.c4
4 files changed, 35 insertions, 38 deletions
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index d1aaf31bd97e..f63e07bd9f9c 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -293,6 +293,7 @@ static int send_request(struct request *req)
293 u16 viocmd; 293 u16 viocmd;
294 HvLpEvent_Rc hvrc; 294 HvLpEvent_Rc hvrc;
295 struct vioblocklpevent *bevent; 295 struct vioblocklpevent *bevent;
296 struct HvLpEvent *hev;
296 struct scatterlist sg[VIOMAXBLOCKDMA]; 297 struct scatterlist sg[VIOMAXBLOCKDMA];
297 int sgindex; 298 int sgindex;
298 int statindex; 299 int statindex;
@@ -347,22 +348,19 @@ static int send_request(struct request *req)
347 * token so we can match the response up later 348 * token so we can match the response up later
348 */ 349 */
349 memset(bevent, 0, sizeof(struct vioblocklpevent)); 350 memset(bevent, 0, sizeof(struct vioblocklpevent));
350 bevent->event.xFlags.xValid = 1; 351 hev = &bevent->event;
351 bevent->event.xFlags.xFunction = HvLpEvent_Function_Int; 352 hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK |
352 bevent->event.xFlags.xAckInd = HvLpEvent_AckInd_DoAck; 353 HV_LP_EVENT_INT;
353 bevent->event.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck; 354 hev->xType = HvLpEvent_Type_VirtualIo;
354 bevent->event.xType = HvLpEvent_Type_VirtualIo; 355 hev->xSubtype = viocmd;
355 bevent->event.xSubtype = viocmd; 356 hev->xSourceLp = HvLpConfig_getLpIndex();
356 bevent->event.xSourceLp = HvLpConfig_getLpIndex(); 357 hev->xTargetLp = viopath_hostLp;
357 bevent->event.xTargetLp = viopath_hostLp; 358 hev->xSizeMinus1 =
358 bevent->event.xSizeMinus1 =
359 offsetof(struct vioblocklpevent, u.rw_data.dma_info) + 359 offsetof(struct vioblocklpevent, u.rw_data.dma_info) +
360 (sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1; 360 (sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1;
361 bevent->event.xSourceInstanceId = 361 hev->xSourceInstanceId = viopath_sourceinst(viopath_hostLp);
362 viopath_sourceinst(viopath_hostLp); 362 hev->xTargetInstanceId = viopath_targetinst(viopath_hostLp);
363 bevent->event.xTargetInstanceId = 363 hev->xCorrelationToken = (u64)req;
364 viopath_targetinst(viopath_hostLp);
365 bevent->event.xCorrelationToken = (u64)req;
366 bevent->version = VIOVERSION; 364 bevent->version = VIOVERSION;
367 bevent->disk = DEVICE_NO(d); 365 bevent->disk = DEVICE_NO(d);
368 bevent->u.rw_data.offset = start; 366 bevent->u.rw_data.offset = start;
@@ -649,10 +647,10 @@ static void handle_block_event(struct HvLpEvent *event)
649 /* Notification that a partition went away! */ 647 /* Notification that a partition went away! */
650 return; 648 return;
651 /* First, we should NEVER get an int here...only acks */ 649 /* First, we should NEVER get an int here...only acks */
652 if (event->xFlags.xFunction == HvLpEvent_Function_Int) { 650 if (hvlpevent_is_int(event)) {
653 printk(VIOD_KERN_WARNING 651 printk(VIOD_KERN_WARNING
654 "Yikes! got an int in viodasd event handler!\n"); 652 "Yikes! got an int in viodasd event handler!\n");
655 if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { 653 if (hvlpevent_need_ack(event)) {
656 event->xRc = HvLpEvent_Rc_InvalidSubtype; 654 event->xRc = HvLpEvent_Rc_InvalidSubtype;
657 HvCallEvent_ackLpEvent(event); 655 HvCallEvent_ackLpEvent(event);
658 } 656 }
@@ -695,7 +693,7 @@ static void handle_block_event(struct HvLpEvent *event)
695 693
696 default: 694 default:
697 printk(VIOD_KERN_WARNING "invalid subtype!"); 695 printk(VIOD_KERN_WARNING "invalid subtype!");
698 if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { 696 if (hvlpevent_need_ack(event)) {
699 event->xRc = HvLpEvent_Rc_InvalidSubtype; 697 event->xRc = HvLpEvent_Rc_InvalidSubtype;
700 HvCallEvent_ackLpEvent(event); 698 HvCallEvent_ackLpEvent(event);
701 } 699 }
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index b5191780ecca..193446e6a08a 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -542,10 +542,10 @@ static void vio_handle_cd_event(struct HvLpEvent *event)
542 /* Notification that a partition went away! */ 542 /* Notification that a partition went away! */
543 return; 543 return;
544 /* First, we should NEVER get an int here...only acks */ 544 /* First, we should NEVER get an int here...only acks */
545 if (event->xFlags.xFunction == HvLpEvent_Function_Int) { 545 if (hvlpevent_is_int(event)) {
546 printk(VIOCD_KERN_WARNING 546 printk(VIOCD_KERN_WARNING
547 "Yikes! got an int in viocd event handler!\n"); 547 "Yikes! got an int in viocd event handler!\n");
548 if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { 548 if (hvlpevent_need_ack(event)) {
549 event->xRc = HvLpEvent_Rc_InvalidSubtype; 549 event->xRc = HvLpEvent_Rc_InvalidSubtype;
550 HvCallEvent_ackLpEvent(event); 550 HvCallEvent_ackLpEvent(event);
551 } 551 }
@@ -616,7 +616,7 @@ return_complete:
616 printk(VIOCD_KERN_WARNING 616 printk(VIOCD_KERN_WARNING
617 "message with invalid subtype %0x04X!\n", 617 "message with invalid subtype %0x04X!\n",
618 event->xSubtype & VIOMINOR_SUBTYPE_MASK); 618 event->xSubtype & VIOMINOR_SUBTYPE_MASK);
619 if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { 619 if (hvlpevent_need_ack(event)) {
620 event->xRc = HvLpEvent_Rc_InvalidSubtype; 620 event->xRc = HvLpEvent_Rc_InvalidSubtype;
621 HvCallEvent_ackLpEvent(event); 621 HvCallEvent_ackLpEvent(event);
622 } 622 }
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c
index faee5e7acaf7..4e5360388748 100644
--- a/drivers/char/viocons.c
+++ b/drivers/char/viocons.c
@@ -476,19 +476,19 @@ static struct port_info *get_port_data(struct tty_struct *tty)
476 */ 476 */
477static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp) 477static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp)
478{ 478{
479 struct HvLpEvent *hev = &viochar->event;
480
479 memset(viochar, 0, sizeof(struct viocharlpevent)); 481 memset(viochar, 0, sizeof(struct viocharlpevent));
480 482
481 viochar->event.xFlags.xValid = 1; 483 hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DEFERRED_ACK |
482 viochar->event.xFlags.xFunction = HvLpEvent_Function_Int; 484 HV_LP_EVENT_INT;
483 viochar->event.xFlags.xAckInd = HvLpEvent_AckInd_NoAck; 485 hev->xType = HvLpEvent_Type_VirtualIo;
484 viochar->event.xFlags.xAckType = HvLpEvent_AckType_DeferredAck; 486 hev->xSubtype = viomajorsubtype_chario | viochardata;
485 viochar->event.xType = HvLpEvent_Type_VirtualIo; 487 hev->xSourceLp = HvLpConfig_getLpIndex();
486 viochar->event.xSubtype = viomajorsubtype_chario | viochardata; 488 hev->xTargetLp = lp;
487 viochar->event.xSourceLp = HvLpConfig_getLpIndex(); 489 hev->xSizeMinus1 = sizeof(struct viocharlpevent);
488 viochar->event.xTargetLp = lp; 490 hev->xSourceInstanceId = viopath_sourceinst(lp);
489 viochar->event.xSizeMinus1 = sizeof(struct viocharlpevent); 491 hev->xTargetInstanceId = viopath_targetinst(lp);
490 viochar->event.xSourceInstanceId = viopath_sourceinst(lp);
491 viochar->event.xTargetInstanceId = viopath_targetinst(lp);
492} 492}
493 493
494/* 494/*
@@ -752,7 +752,7 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
752 struct port_info *pi; 752 struct port_info *pi;
753 int reject = 0; 753 int reject = 0;
754 754
755 if (event->xFlags.xFunction == HvLpEvent_Function_Ack) { 755 if (hvlpevent_is_ack(event)) {
756 if (port >= VTTY_PORTS) 756 if (port >= VTTY_PORTS)
757 return; 757 return;
758 758
@@ -788,7 +788,7 @@ static void vioHandleOpenEvent(struct HvLpEvent *event)
788 } 788 }
789 789
790 /* This had better require an ack, otherwise complain */ 790 /* This had better require an ack, otherwise complain */
791 if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) { 791 if (!hvlpevent_need_ack(event)) {
792 printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n"); 792 printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n");
793 return; 793 return;
794 } 794 }
@@ -856,7 +856,7 @@ static void vioHandleCloseEvent(struct HvLpEvent *event)
856 struct viocharlpevent *cevent = (struct viocharlpevent *)event; 856 struct viocharlpevent *cevent = (struct viocharlpevent *)event;
857 u8 port = cevent->virtual_device; 857 u8 port = cevent->virtual_device;
858 858
859 if (event->xFlags.xFunction == HvLpEvent_Function_Int) { 859 if (hvlpevent_is_int(event)) {
860 if (port >= VTTY_PORTS) { 860 if (port >= VTTY_PORTS) {
861 printk(VIOCONS_KERN_WARN 861 printk(VIOCONS_KERN_WARN
862 "close message from invalid virtual device.\n"); 862 "close message from invalid virtual device.\n");
@@ -1056,8 +1056,7 @@ static void vioHandleCharEvent(struct HvLpEvent *event)
1056 vioHandleConfig(event); 1056 vioHandleConfig(event);
1057 break; 1057 break;
1058 default: 1058 default:
1059 if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && 1059 if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) {
1060 (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
1061 event->xRc = HvLpEvent_Rc_InvalidSubtype; 1060 event->xRc = HvLpEvent_Rc_InvalidSubtype;
1062 HvCallEvent_ackLpEvent(event); 1061 HvCallEvent_ackLpEvent(event);
1063 } 1062 }
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 77eadf84cb2c..f0f04be989d6 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -590,9 +590,9 @@ static void veth_handle_event(struct HvLpEvent *event, struct pt_regs *regs)
590{ 590{
591 struct veth_lpevent *veth_event = (struct veth_lpevent *)event; 591 struct veth_lpevent *veth_event = (struct veth_lpevent *)event;
592 592
593 if (event->xFlags.xFunction == HvLpEvent_Function_Ack) 593 if (hvlpevent_is_ack(event))
594 veth_handle_ack(veth_event); 594 veth_handle_ack(veth_event);
595 else if (event->xFlags.xFunction == HvLpEvent_Function_Int) 595 else
596 veth_handle_int(veth_event); 596 veth_handle_int(veth_event);
597} 597}
598 598