diff options
Diffstat (limited to 'drivers/ieee1394/ieee1394_transactions.c')
-rw-r--r-- | drivers/ieee1394/ieee1394_transactions.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c index 10c3d9f8c038..24021d2f0a75 100644 --- a/drivers/ieee1394/ieee1394_transactions.c +++ b/drivers/ieee1394/ieee1394_transactions.c | |||
@@ -570,3 +570,32 @@ int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, | |||
570 | 570 | ||
571 | return retval; | 571 | return retval; |
572 | } | 572 | } |
573 | |||
574 | int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation, | ||
575 | u64 addr, int extcode, quadlet_t *data, quadlet_t arg) | ||
576 | { | ||
577 | struct hpsb_packet *packet; | ||
578 | int retval = 0; | ||
579 | |||
580 | BUG_ON(in_interrupt()); | ||
581 | |||
582 | packet = hpsb_make_lockpacket(host, node, addr, extcode, data, arg); | ||
583 | if (!packet) | ||
584 | return -ENOMEM; | ||
585 | |||
586 | packet->generation = generation; | ||
587 | retval = hpsb_send_packet_and_wait(packet); | ||
588 | if (retval < 0) | ||
589 | goto hpsb_lock_fail; | ||
590 | |||
591 | retval = hpsb_packet_success(packet); | ||
592 | |||
593 | if (retval == 0) | ||
594 | *data = packet->data[0]; | ||
595 | |||
596 | hpsb_lock_fail: | ||
597 | hpsb_free_tlabel(packet); | ||
598 | hpsb_free_packet(packet); | ||
599 | |||
600 | return retval; | ||
601 | } | ||