aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/viodasd.c
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/block/viodasd.c
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/block/viodasd.c')
-rw-r--r--drivers/block/viodasd.c32
1 files changed, 15 insertions, 17 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 }