From 677f8c0d0455a35aaff08a0292ba9c6232ef4eb1 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 12 Jan 2006 13:47:43 +1100 Subject: [PATCH] powerpc: remove bitfields from HvLpEvent Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/block/viodasd.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'drivers/block') diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index d1aaf31bd97..f63e07bd9f9 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -293,6 +293,7 @@ static int send_request(struct request *req) u16 viocmd; HvLpEvent_Rc hvrc; struct vioblocklpevent *bevent; + struct HvLpEvent *hev; struct scatterlist sg[VIOMAXBLOCKDMA]; int sgindex; int statindex; @@ -347,22 +348,19 @@ static int send_request(struct request *req) * token so we can match the response up later */ memset(bevent, 0, sizeof(struct vioblocklpevent)); - bevent->event.xFlags.xValid = 1; - bevent->event.xFlags.xFunction = HvLpEvent_Function_Int; - bevent->event.xFlags.xAckInd = HvLpEvent_AckInd_DoAck; - bevent->event.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck; - bevent->event.xType = HvLpEvent_Type_VirtualIo; - bevent->event.xSubtype = viocmd; - bevent->event.xSourceLp = HvLpConfig_getLpIndex(); - bevent->event.xTargetLp = viopath_hostLp; - bevent->event.xSizeMinus1 = + hev = &bevent->event; + hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | + HV_LP_EVENT_INT; + hev->xType = HvLpEvent_Type_VirtualIo; + hev->xSubtype = viocmd; + hev->xSourceLp = HvLpConfig_getLpIndex(); + hev->xTargetLp = viopath_hostLp; + hev->xSizeMinus1 = offsetof(struct vioblocklpevent, u.rw_data.dma_info) + (sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1; - bevent->event.xSourceInstanceId = - viopath_sourceinst(viopath_hostLp); - bevent->event.xTargetInstanceId = - viopath_targetinst(viopath_hostLp); - bevent->event.xCorrelationToken = (u64)req; + hev->xSourceInstanceId = viopath_sourceinst(viopath_hostLp); + hev->xTargetInstanceId = viopath_targetinst(viopath_hostLp); + hev->xCorrelationToken = (u64)req; bevent->version = VIOVERSION; bevent->disk = DEVICE_NO(d); bevent->u.rw_data.offset = start; @@ -649,10 +647,10 @@ static void handle_block_event(struct HvLpEvent *event) /* Notification that a partition went away! */ return; /* First, we should NEVER get an int here...only acks */ - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { printk(VIOD_KERN_WARNING "Yikes! got an int in viodasd event handler!\n"); - if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } @@ -695,7 +693,7 @@ static void handle_block_event(struct HvLpEvent *event) default: printk(VIOD_KERN_WARNING "invalid subtype!"); - if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } -- cgit v1.2.3