summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/isci.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-05-10 02:28:45 -0700
committerDan Williams <dan.j.williams@intel.com>2011-07-03 04:04:47 -0700
commitf1f52e75939b56c40b3d153ae99faf2720250242 (patch)
tree9c5ba4f8bb6a589c6a038dac5bbba280f9de3ebe /drivers/scsi/isci/isci.h
parent3bff9d54ecba84e538da822349a9a6fd6e534539 (diff)
downloadblackbird-op-linux-f1f52e75939b56c40b3d153ae99faf2720250242.tar.gz
blackbird-op-linux-f1f52e75939b56c40b3d153ae99faf2720250242.zip
isci: uplevel request infrastructure
* Consolidate tiny header files * Move files out of core/ (drop core/scic_sds_ prefix) * Merge core/scic_sds_request.[ch] into request.[ch] * Cleanup request.c namespace (clean forward declarations and global namespace pollution) Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/isci.h')
-rw-r--r--drivers/scsi/isci/isci.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h
index d288897b85fb..69826eac97b5 100644
--- a/drivers/scsi/isci/isci.h
+++ b/drivers/scsi/isci/isci.h
@@ -521,6 +521,25 @@ enum sci_task_status {
};
+/**
+ * sci_swab32_cpy - convert between scsi and scu-hardware byte format
+ * @dest: receive the 4-byte endian swapped version of src
+ * @src: word aligned source buffer
+ *
+ * scu hardware handles SSP/SMP control, response, and unidentified
+ * frames in "big endian dword" order. Regardless of host endian this
+ * is always a swab32()-per-dword conversion of the standard definition,
+ * i.e. single byte fields swapped and multi-byte fields in little-
+ * endian
+ */
+static inline void sci_swab32_cpy(void *_dest, void *_src, ssize_t word_cnt)
+{
+ u32 *dest = _dest, *src = _src;
+
+ while (--word_cnt >= 0)
+ dest[word_cnt] = swab32(src[word_cnt]);
+}
+
extern unsigned char no_outbound_task_to;
extern u16 ssp_max_occ_to;
extern u16 stp_max_occ_to;
OpenPOWER on IntegriCloud