aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/ieee1394_transactions.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/ieee1394_transactions.c')
-rw-r--r--drivers/ieee1394/ieee1394_transactions.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c
index 0833fc9f50c4..6f07cd8835a3 100644
--- a/drivers/ieee1394/ieee1394_transactions.c
+++ b/drivers/ieee1394/ieee1394_transactions.c
@@ -212,6 +212,15 @@ void hpsb_free_tlabel(struct hpsb_packet *packet)
212 wake_up_interruptible(&tlabel_wq); 212 wake_up_interruptible(&tlabel_wq);
213} 213}
214 214
215/**
216 * hpsb_packet_success - Make sense of the ack and reply codes
217 *
218 * Make sense of the ack and reply codes and return more convenient error codes:
219 * 0 = success. -%EBUSY = node is busy, try again. -%EAGAIN = error which can
220 * probably resolved by retry. -%EREMOTEIO = node suffers from an internal
221 * error. -%EACCES = this transaction is not allowed on requested address.
222 * -%EINVAL = invalid address at node.
223 */
215int hpsb_packet_success(struct hpsb_packet *packet) 224int hpsb_packet_success(struct hpsb_packet *packet)
216{ 225{
217 switch (packet->ack_code) { 226 switch (packet->ack_code) {
@@ -493,6 +502,16 @@ struct hpsb_packet *hpsb_make_isopacket(struct hpsb_host *host,
493 * avoid in kernel buffers for user space callers 502 * avoid in kernel buffers for user space callers
494 */ 503 */
495 504
505/**
506 * hpsb_read - generic read function
507 *
508 * Recognizes the local node ID and act accordingly. Automatically uses a
509 * quadlet read request if @length == 4 and and a block read request otherwise.
510 * It does not yet support lengths that are not a multiple of 4.
511 *
512 * You must explicitly specifiy the @generation for which the node ID is valid,
513 * to avoid sending packets to the wrong nodes when we race with a bus reset.
514 */
496int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation, 515int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
497 u64 addr, quadlet_t * buffer, size_t length) 516 u64 addr, quadlet_t * buffer, size_t length)
498{ 517{
@@ -532,6 +551,16 @@ int hpsb_read(struct hpsb_host *host, nodeid_t node, unsigned int generation,
532 return retval; 551 return retval;
533} 552}
534 553
554/**
555 * hpsb_write - generic write function
556 *
557 * Recognizes the local node ID and act accordingly. Automatically uses a
558 * quadlet write request if @length == 4 and and a block write request
559 * otherwise. It does not yet support lengths that are not a multiple of 4.
560 *
561 * You must explicitly specifiy the @generation for which the node ID is valid,
562 * to avoid sending packets to the wrong nodes when we race with a bus reset.
563 */
535int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation, 564int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
536 u64 addr, quadlet_t * buffer, size_t length) 565 u64 addr, quadlet_t * buffer, size_t length)
537{ 566{