aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/iseries/irq.c13
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c12
-rw-r--r--arch/powerpc/platforms/iseries/mf.c16
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c12
-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
-rw-r--r--include/asm-powerpc/iseries/hv_lp_event.h41
9 files changed, 82 insertions, 85 deletions
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 42e978e4897a..3d023856405a 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -147,20 +147,11 @@ static void int_received(struct pci_event *event, struct pt_regs *regs)
147static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) 147static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs)
148{ 148{
149 if (event && (event->xType == HvLpEvent_Type_PciIo)) { 149 if (event && (event->xType == HvLpEvent_Type_PciIo)) {
150 switch (event->xFlags.xFunction) { 150 if (hvlpevent_is_int(event))
151 case HvLpEvent_Function_Int:
152 int_received((struct pci_event *)event, regs); 151 int_received((struct pci_event *)event, regs);
153 break; 152 else
154 case HvLpEvent_Function_Ack:
155 printk(KERN_ERR 153 printk(KERN_ERR
156 "pci_event_handler: unexpected ack received\n"); 154 "pci_event_handler: unexpected ack received\n");
157 break;
158 default:
159 printk(KERN_ERR
160 "pci_event_handler: unexpected event function %d\n",
161 (int)event->xFlags.xFunction);
162 break;
163 }
164 } else if (event) 155 } else if (event)
165 printk(KERN_ERR 156 printk(KERN_ERR
166 "pci_event_handler: Unrecognized PCI event type 0x%x\n", 157 "pci_event_handler: Unrecognized PCI event type 0x%x\n",
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index e9fb98bf895f..0b885300d1d1 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -53,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpevent(void)
53 struct HvLpEvent * event; 53 struct HvLpEvent * event;
54 event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; 54 event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
55 55
56 if (event->xFlags.xValid) { 56 if (hvlpevent_is_valid(event)) {
57 /* rmb() needed only for weakly consistent machines (regatta) */ 57 /* rmb() needed only for weakly consistent machines (regatta) */
58 rmb(); 58 rmb();
59 /* Set pointer to next potential event */ 59 /* Set pointer to next potential event */
@@ -84,7 +84,7 @@ int hvlpevent_is_pending(void)
84 84
85 next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; 85 next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
86 86
87 return next_event->xFlags.xValid | 87 return hvlpevent_is_valid(next_event) ||
88 hvlpevent_queue.xPlicOverflowIntPending; 88 hvlpevent_queue.xPlicOverflowIntPending;
89} 89}
90 90
@@ -101,18 +101,18 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event)
101 switch (extra) { 101 switch (extra) {
102 case 3: 102 case 3:
103 tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign); 103 tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);
104 tmp->xFlags.xValid = 0; 104 hvlpevent_invalidate(tmp);
105 case 2: 105 case 2:
106 tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign); 106 tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);
107 tmp->xFlags.xValid = 0; 107 hvlpevent_invalidate(tmp);
108 case 1: 108 case 1:
109 tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign); 109 tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);
110 tmp->xFlags.xValid = 0; 110 hvlpevent_invalidate(tmp);
111 } 111 }
112 112
113 mb(); 113 mb();
114 114
115 event->xFlags.xValid = 0; 115 hvlpevent_invalidate(event);
116} 116}
117 117
118void process_hvlpevents(struct pt_regs *regs) 118void process_hvlpevents(struct pt_regs *regs)
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 49e7e4b85847..a41d8b78c0cd 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -251,10 +251,7 @@ static struct pending_event *new_pending_event(void)
251 } 251 }
252 memset(ev, 0, sizeof(struct pending_event)); 252 memset(ev, 0, sizeof(struct pending_event));
253 hev = &ev->event.hp_lp_event; 253 hev = &ev->event.hp_lp_event;
254 hev->xFlags.xValid = 1; 254 hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | HV_LP_EVENT_INT;
255 hev->xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;
256 hev->xFlags.xAckInd = HvLpEvent_AckInd_DoAck;
257 hev->xFlags.xFunction = HvLpEvent_Function_Int;
258 hev->xType = HvLpEvent_Type_MachineFac; 255 hev->xType = HvLpEvent_Type_MachineFac;
259 hev->xSourceLp = HvLpConfig_getLpIndex(); 256 hev->xSourceLp = HvLpConfig_getLpIndex();
260 hev->xTargetLp = primary_lp; 257 hev->xTargetLp = primary_lp;
@@ -518,17 +515,10 @@ static void handle_ack(struct io_mf_lp_event *event)
518static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) 515static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs)
519{ 516{
520 if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { 517 if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) {
521 switch(event->xFlags.xFunction) { 518 if (hvlpevent_is_ack(event))
522 case HvLpEvent_Function_Ack:
523 handle_ack((struct io_mf_lp_event *)event); 519 handle_ack((struct io_mf_lp_event *)event);
524 break; 520 else
525 case HvLpEvent_Function_Int:
526 handle_int((struct io_mf_lp_event *)event); 521 handle_int((struct io_mf_lp_event *)event);
527 break;
528 default:
529 printk(KERN_ERR "mf.c: non ack/int event received\n");
530 break;
531 }
532 } else 522 } else
533 printk(KERN_ERR "mf.c: alien event received\n"); 523 printk(KERN_ERR "mf.c: alien event received\n");
534} 524}
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 842672695598..622a30149b48 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -270,7 +270,7 @@ static void handleMonitorEvent(struct HvLpEvent *event)
270 * First see if this is just a normal monitor message from the 270 * First see if this is just a normal monitor message from the
271 * other partition 271 * other partition
272 */ 272 */
273 if (event->xFlags.xFunction == HvLpEvent_Function_Int) { 273 if (hvlpevent_is_int(event)) {
274 remoteLp = event->xSourceLp; 274 remoteLp = event->xSourceLp;
275 if (!viopathStatus[remoteLp].isActive) 275 if (!viopathStatus[remoteLp].isActive)
276 sendMonMsg(remoteLp); 276 sendMonMsg(remoteLp);
@@ -331,13 +331,12 @@ static void handleConfig(struct HvLpEvent *event)
331{ 331{
332 if (!event) 332 if (!event)
333 return; 333 return;
334 if (event->xFlags.xFunction == HvLpEvent_Function_Int) { 334 if (hvlpevent_is_int(event)) {
335 printk(VIOPATH_KERN_WARN 335 printk(VIOPATH_KERN_WARN
336 "unexpected config request from partition %d", 336 "unexpected config request from partition %d",
337 event->xSourceLp); 337 event->xSourceLp);
338 338
339 if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && 339 if (hvlpevent_need_ack(event)) {
340 (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
341 event->xRc = HvLpEvent_Rc_InvalidSubtype; 340 event->xRc = HvLpEvent_Rc_InvalidSubtype;
342 HvCallEvent_ackLpEvent(event); 341 HvCallEvent_ackLpEvent(event);
343 } 342 }
@@ -377,7 +376,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
377 int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK) 376 int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK)
378 >> VIOMAJOR_SUBTYPE_SHIFT; 377 >> VIOMAJOR_SUBTYPE_SHIFT;
379 378
380 if (event->xFlags.xFunction == HvLpEvent_Function_Int) { 379 if (hvlpevent_is_int(event)) {
381 remoteLp = event->xSourceLp; 380 remoteLp = event->xSourceLp;
382 /* 381 /*
383 * The isActive is checked because if the hosting partition 382 * The isActive is checked because if the hosting partition
@@ -436,8 +435,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
436 "unexpected virtual io event subtype %d from partition %d\n", 435 "unexpected virtual io event subtype %d from partition %d\n",
437 event->xSubtype, remoteLp); 436 event->xSubtype, remoteLp);
438 /* No handler. Ack if necessary */ 437 /* No handler. Ack if necessary */
439 if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && 438 if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) {
440 (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
441 event->xRc = HvLpEvent_Rc_InvalidSubtype; 439 event->xRc = HvLpEvent_Rc_InvalidSubtype;
442 HvCallEvent_ackLpEvent(event); 440 HvCallEvent_ackLpEvent(event);
443 } 441 }
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
diff --git a/include/asm-powerpc/iseries/hv_lp_event.h b/include/asm-powerpc/iseries/hv_lp_event.h
index 499ab1ad0185..8ee89b67b8fd 100644
--- a/include/asm-powerpc/iseries/hv_lp_event.h
+++ b/include/asm-powerpc/iseries/hv_lp_event.h
@@ -32,17 +32,8 @@
32 * partitions through PLIC. 32 * partitions through PLIC.
33 */ 33 */
34 34
35struct HvEventFlags {
36 u8 xValid:1; /* Indicates a valid request x00-x00 */
37 u8 xRsvd1:4; /* Reserved ... */
38 u8 xAckType:1; /* Immediate or deferred ... */
39 u8 xAckInd:1; /* Indicates if ACK required ... */
40 u8 xFunction:1; /* Interrupt or Acknowledge ... */
41};
42
43
44struct HvLpEvent { 35struct HvLpEvent {
45 struct HvEventFlags xFlags; /* Event flags x00-x00 */ 36 u8 flags; /* Event flags x00-x00 */
46 u8 xType; /* Type of message x01-x01 */ 37 u8 xType; /* Type of message x01-x01 */
47 u16 xSubtype; /* Subtype for event x02-x03 */ 38 u16 xSubtype; /* Subtype for event x02-x03 */
48 u8 xSourceLp; /* Source LP x04-x04 */ 39 u8 xSourceLp; /* Source LP x04-x04 */
@@ -126,6 +117,11 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
126#define HvLpEvent_AckType_ImmediateAck 0 117#define HvLpEvent_AckType_ImmediateAck 0
127#define HvLpEvent_AckType_DeferredAck 1 118#define HvLpEvent_AckType_DeferredAck 1
128 119
120#define HV_LP_EVENT_INT 0x01
121#define HV_LP_EVENT_DO_ACK 0x02
122#define HV_LP_EVENT_DEFERRED_ACK 0x04
123#define HV_LP_EVENT_VALID 0x80
124
129#define HvLpDma_Direction_LocalToRemote 0 125#define HvLpDma_Direction_LocalToRemote 0
130#define HvLpDma_Direction_RemoteToLocal 1 126#define HvLpDma_Direction_RemoteToLocal 1
131 127
@@ -139,4 +135,29 @@ extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
139#define HvLpDma_Rc_InvalidAddress 4 135#define HvLpDma_Rc_InvalidAddress 4
140#define HvLpDma_Rc_InvalidLength 5 136#define HvLpDma_Rc_InvalidLength 5
141 137
138static inline int hvlpevent_is_valid(struct HvLpEvent *h)
139{
140 return h->flags & HV_LP_EVENT_VALID;
141}
142
143static inline void hvlpevent_invalidate(struct HvLpEvent *h)
144{
145 h->flags &= ~ HV_LP_EVENT_VALID;
146}
147
148static inline int hvlpevent_is_int(struct HvLpEvent *h)
149{
150 return h->flags & HV_LP_EVENT_INT;
151}
152
153static inline int hvlpevent_is_ack(struct HvLpEvent *h)
154{
155 return !hvlpevent_is_int(h);
156}
157
158static inline int hvlpevent_need_ack(struct HvLpEvent *h)
159{
160 return h->flags & HV_LP_EVENT_DO_ACK;
161}
162
142#endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */ 163#endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */