summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/host.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-09 20:06:58 +0200
committerDan Williams <dan.j.williams@intel.com>2011-07-03 13:04:51 +0200
commitdd047c8e2bca22856050dbe0378a37cf44eecc97 (patch)
tree5dab5c46acd144024f8cc961a34ae8374343a5d9 /drivers/scsi/isci/host.h
parentisci: cleanup/optimize pool implementation (diff)
downloadlinux-dd047c8e2bca22856050dbe0378a37cf44eecc97.tar.xz
linux-dd047c8e2bca22856050dbe0378a37cf44eecc97.zip
isci: cleanup tag macros
A tag is a 16 bit number where the upper four bits is a sequence number and the remainder is the task context index (tci). Sanitize the macro names and shave 256-bytes out of scic_sds_controller by reducing the size of io_request_sequence. scic_sds_io_tag_construct --> ISCI_TAG scic_sds_io_tag_get_sequence --> ISCI_TAG_SEQ scic_sds_io_tag_get_index() --> ISCI_TAG_TCI scic_sds_io_sequence_increment() [delete / open code] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/host.h')
-rw-r--r--drivers/scsi/isci/host.h47
1 files changed, 7 insertions, 40 deletions
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h
index c61a9fa130b7..7d17ab80f1a9 100644
--- a/drivers/scsi/isci/host.h
+++ b/drivers/scsi/isci/host.h
@@ -184,13 +184,8 @@ struct scic_sds_controller {
*/
struct scic_power_control power_control;
- /**
- * This field is the array of sequence values for the IO Tag fields. Even
- * though only 4 bits of the field is used for the sequence the sequence is 16
- * bits in size so the sequence can be bitwise or'd with the TCi to build the
- * IO Tag value.
- */
- u16 io_request_sequence[SCI_MAX_IO_REQUESTS];
+ /* sequence number per tci */
+ u8 io_request_sequence[SCI_MAX_IO_REQUESTS];
/**
* This field in the array of sequence values for the RNi. These are used
@@ -552,40 +547,12 @@ static inline struct isci_host *scic_to_ihost(struct scic_sds_controller *scic)
*/
#define scic_sds_controller_get_protocol_engine_group(controller) 0
-/**
- * scic_sds_io_tag_construct() -
- *
- * This macro constructs an IO tag from the sequence and index values.
- */
-#define scic_sds_io_tag_construct(sequence, task_index) \
- ((sequence) << 12 | (task_index))
-
-/**
- * scic_sds_io_tag_get_sequence() -
- *
- * This macro returns the IO sequence from the IO tag value.
- */
-#define scic_sds_io_tag_get_sequence(io_tag) \
- (((io_tag) & 0xF000) >> 12)
-
-/**
- * scic_sds_io_tag_get_index() -
- *
- * This macro returns the TCi from the io tag value
- */
-#define scic_sds_io_tag_get_index(io_tag) \
- ((io_tag) & 0x0FFF)
+/* see scic_controller_io_tag_allocate|free for how seq and tci are built */
+#define ISCI_TAG(seq, tci) (((u16) (seq)) << 12 | tci)
-/**
- * scic_sds_io_sequence_increment() -
- *
- * This is a helper macro to increment the io sequence count. We may find in
- * the future that it will be faster to store the sequence count in such a way
- * as we dont perform the shift operation to build io tag values so therefore
- * need a way to incrment them correctly
- */
-#define scic_sds_io_sequence_increment(value) \
- ((value) = (((value) + 1) & 0x000F))
+/* these are returned by the hardware, so sanitize them */
+#define ISCI_TAG_SEQ(tag) (((tag) >> 12) & (SCI_MAX_SEQ-1))
+#define ISCI_TAG_TCI(tag) ((tag) & (SCI_MAX_IO_REQUESTS-1))
/* expander attached sata devices require 3 rnc slots */
static inline int scic_sds_remote_device_node_count(struct scic_sds_remote_device *sci_dev)