diff options
Diffstat (limited to 'drivers/ieee1394/ieee1394_transactions.c')
-rw-r--r-- | drivers/ieee1394/ieee1394_transactions.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c index 10c3d9f8c038..675b3135d5f1 100644 --- a/drivers/ieee1394/ieee1394_transactions.c +++ b/drivers/ieee1394/ieee1394_transactions.c | |||
@@ -501,8 +501,6 @@ int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation, | |||
501 | if (length == 0) | 501 | if (length == 0) |
502 | return -EINVAL; | 502 | return -EINVAL; |
503 | 503 | ||
504 | BUG_ON(in_interrupt()); // We can't be called in an interrupt, yet | ||
505 | |||
506 | packet = hpsb_make_readpacket(host, node, addr, length); | 504 | packet = hpsb_make_readpacket(host, node, addr, length); |
507 | 505 | ||
508 | if (!packet) { | 506 | if (!packet) { |
@@ -550,8 +548,6 @@ int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, | |||
550 | if (length == 0) | 548 | if (length == 0) |
551 | return -EINVAL; | 549 | return -EINVAL; |
552 | 550 | ||
553 | BUG_ON(in_interrupt()); // We can't be called in an interrupt, yet | ||
554 | |||
555 | packet = hpsb_make_writepacket(host, node, addr, buffer, length); | 551 | packet = hpsb_make_writepacket(host, node, addr, buffer, length); |
556 | 552 | ||
557 | if (!packet) | 553 | if (!packet) |
@@ -570,3 +566,30 @@ int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, | |||
570 | 566 | ||
571 | return retval; | 567 | return retval; |
572 | } | 568 | } |
569 | |||
570 | int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation, | ||
571 | u64 addr, int extcode, quadlet_t *data, quadlet_t arg) | ||
572 | { | ||
573 | struct hpsb_packet *packet; | ||
574 | int retval = 0; | ||
575 | |||
576 | packet = hpsb_make_lockpacket(host, node, addr, extcode, data, arg); | ||
577 | if (!packet) | ||
578 | return -ENOMEM; | ||
579 | |||
580 | packet->generation = generation; | ||
581 | retval = hpsb_send_packet_and_wait(packet); | ||
582 | if (retval < 0) | ||
583 | goto hpsb_lock_fail; | ||
584 | |||
585 | retval = hpsb_packet_success(packet); | ||
586 | |||
587 | if (retval == 0) | ||
588 | *data = packet->data[0]; | ||
589 | |||
590 | hpsb_lock_fail: | ||
591 | hpsb_free_tlabel(packet); | ||
592 | hpsb_free_packet(packet); | ||
593 | |||
594 | return retval; | ||
595 | } | ||