summaryrefslogtreecommitdiff
path: root/drivers/firewire/core-transaction.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-24 12:57:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-24 12:57:47 -0700
commit2f78d8e249973f1eeb88315e6444e616c60177ae (patch)
tree2f6fae6c781622301c40378ea404096d8f231a33 /drivers/firewire/core-transaction.c
parentf2fde3a65e88330017b816faf2ef75f141d21375 (diff)
parent26c72e22c94fbc28604c94e3a96fdae9c6fd0a42 (diff)
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull IEEE 1394 (FireWire) subsystem updates from Stefan Richter: - Fix mismatch between DMA mapping direction (was wrong) and DMA synchronization direction (was correct) of isochronous reception buffers of userspace drivers if vma-mapped for R/W access. For example, libdc1394 was affected. - more consistent retry stategy in device discovery/ rediscovery, and improved failure diagnostics - various small cleanups, e.g. use SCSI layer's DMA mapping API in firewire-sbp2 * tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: sbp2: document the absence of alignment requirements firewire: sbp2: remove superfluous blk_queue_max_segment_size() call firewire: sbp2: use scsi_dma_(un)map firewire: sbp2: give correct DMA device to scsi framework firewire: core: fw_device_refresh(): clean up error handling firewire: core: log config rom reading errors firewire: core: log error in case of failed bus manager lock firewire: move rcode_string() to core firewire: core: improve reread_config_rom() interface firewire: core: wait for inaccessible devices after bus reset firewire: ohci: omit spinlock IRQ flags where possible firewire: ohci: correct signedness of a local variable firewire: core: fix DMA mapping direction firewire: use module_pci_driver
Diffstat (limited to 'drivers/firewire/core-transaction.c')
-rw-r--r--drivers/firewire/core-transaction.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index db8a965cf712..780708dc6e25 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -1003,6 +1003,32 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
}
EXPORT_SYMBOL(fw_core_handle_response);
+/**
+ * fw_rcode_string - convert a firewire result code to an error description
+ * @rcode: the result code
+ */
+const char *fw_rcode_string(int rcode)
+{
+ static const char *const names[] = {
+ [RCODE_COMPLETE] = "no error",
+ [RCODE_CONFLICT_ERROR] = "conflict error",
+ [RCODE_DATA_ERROR] = "data error",
+ [RCODE_TYPE_ERROR] = "type error",
+ [RCODE_ADDRESS_ERROR] = "address error",
+ [RCODE_SEND_ERROR] = "send error",
+ [RCODE_CANCELLED] = "timeout",
+ [RCODE_BUSY] = "busy",
+ [RCODE_GENERATION] = "bus reset",
+ [RCODE_NO_ACK] = "no ack",
+ };
+
+ if ((unsigned int)rcode < ARRAY_SIZE(names) && names[rcode])
+ return names[rcode];
+ else
+ return "unknown";
+}
+EXPORT_SYMBOL(fw_rcode_string);
+
static const struct fw_address_region topology_map_region =
{ .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP,
.end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, };