diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-06-09 14:06:58 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:04:51 -0400 |
commit | dd047c8e2bca22856050dbe0378a37cf44eecc97 (patch) | |
tree | 5dab5c46acd144024f8cc961a34ae8374343a5d9 | |
parent | ac668c69709c7d927015c5cf3d9e87bf4eaaf57d (diff) |
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>
-rw-r--r-- | drivers/scsi/isci/host.c | 88 | ||||
-rw-r--r-- | drivers/scsi/isci/host.h | 47 | ||||
-rw-r--r-- | drivers/scsi/isci/isci.h | 2 | ||||
-rw-r--r-- | drivers/scsi/isci/port.c | 17 | ||||
-rw-r--r-- | drivers/scsi/isci/request.c | 12 |
5 files changed, 52 insertions, 114 deletions
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index 343655bd1a6a..3c7042b8bc0e 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c | |||
@@ -284,23 +284,16 @@ static void scic_sds_controller_task_completion(struct scic_sds_controller *scic | |||
284 | u32 completion_entry) | 284 | u32 completion_entry) |
285 | { | 285 | { |
286 | u32 index; | 286 | u32 index; |
287 | struct scic_sds_request *io_request; | 287 | struct scic_sds_request *sci_req; |
288 | 288 | ||
289 | index = SCU_GET_COMPLETION_INDEX(completion_entry); | 289 | index = SCU_GET_COMPLETION_INDEX(completion_entry); |
290 | io_request = scic->io_request_table[index]; | 290 | sci_req = scic->io_request_table[index]; |
291 | 291 | ||
292 | /* Make sure that we really want to process this IO request */ | 292 | /* Make sure that we really want to process this IO request */ |
293 | if ( | 293 | if (sci_req && sci_req->io_tag != SCI_CONTROLLER_INVALID_IO_TAG && |
294 | (io_request != NULL) | 294 | ISCI_TAG_SEQ(sci_req->io_tag) == scic->io_request_sequence[index]) |
295 | && (io_request->io_tag != SCI_CONTROLLER_INVALID_IO_TAG) | ||
296 | && ( | ||
297 | scic_sds_io_tag_get_sequence(io_request->io_tag) | ||
298 | == scic->io_request_sequence[index] | ||
299 | ) | ||
300 | ) { | ||
301 | /* Yep this is a valid io request pass it along to the io request handler */ | 295 | /* Yep this is a valid io request pass it along to the io request handler */ |
302 | scic_sds_io_request_tc_completion(io_request, completion_entry); | 296 | scic_sds_io_request_tc_completion(sci_req, completion_entry); |
303 | } | ||
304 | } | 297 | } |
305 | 298 | ||
306 | static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic, | 299 | static void scic_sds_controller_sdma_completion(struct scic_sds_controller *scic, |
@@ -2682,37 +2675,28 @@ void scic_sds_controller_copy_task_context( | |||
2682 | sci_req->task_context_buffer = task_context_buffer; | 2675 | sci_req->task_context_buffer = task_context_buffer; |
2683 | } | 2676 | } |
2684 | 2677 | ||
2685 | /** | 2678 | struct scu_task_context *scic_sds_controller_get_task_context_buffer(struct scic_sds_controller *scic, |
2686 | * This method returns the task context buffer for the given io tag. | 2679 | u16 io_tag) |
2687 | * @scic: | 2680 | { |
2688 | * @io_tag: | 2681 | u16 tci = ISCI_TAG_TCI(io_tag); |
2689 | * | ||
2690 | * struct scu_task_context* | ||
2691 | */ | ||
2692 | struct scu_task_context *scic_sds_controller_get_task_context_buffer( | ||
2693 | struct scic_sds_controller *scic, | ||
2694 | u16 io_tag | ||
2695 | ) { | ||
2696 | u16 task_index = scic_sds_io_tag_get_index(io_tag); | ||
2697 | 2682 | ||
2698 | if (task_index < scic->task_context_entries) { | 2683 | if (tci < scic->task_context_entries) { |
2699 | return &scic->task_context_table[task_index]; | 2684 | return &scic->task_context_table[tci]; |
2700 | } | 2685 | } |
2701 | 2686 | ||
2702 | return NULL; | 2687 | return NULL; |
2703 | } | 2688 | } |
2704 | 2689 | ||
2705 | struct scic_sds_request *scic_request_by_tag(struct scic_sds_controller *scic, | 2690 | struct scic_sds_request *scic_request_by_tag(struct scic_sds_controller *scic, u16 io_tag) |
2706 | u16 io_tag) | ||
2707 | { | 2691 | { |
2708 | u16 task_index; | 2692 | u16 task_index; |
2709 | u16 task_sequence; | 2693 | u16 task_sequence; |
2710 | 2694 | ||
2711 | task_index = scic_sds_io_tag_get_index(io_tag); | 2695 | task_index = ISCI_TAG_TCI(io_tag); |
2712 | 2696 | ||
2713 | if (task_index < scic->task_context_entries) { | 2697 | if (task_index < scic->task_context_entries) { |
2714 | if (scic->io_request_table[task_index] != NULL) { | 2698 | if (scic->io_request_table[task_index] != NULL) { |
2715 | task_sequence = scic_sds_io_tag_get_sequence(io_tag); | 2699 | task_sequence = ISCI_TAG_SEQ(io_tag); |
2716 | 2700 | ||
2717 | if (task_sequence == scic->io_request_sequence[task_index]) { | 2701 | if (task_sequence == scic->io_request_sequence[task_index]) { |
2718 | return scic->io_request_table[task_index]; | 2702 | return scic->io_request_table[task_index]; |
@@ -2875,11 +2859,10 @@ void scic_sds_controller_release_frame( | |||
2875 | * successfully started the IO request. SCI_SUCCESS if the IO request was | 2859 | * successfully started the IO request. SCI_SUCCESS if the IO request was |
2876 | * successfully started. Determine the failure situations and return values. | 2860 | * successfully started. Determine the failure situations and return values. |
2877 | */ | 2861 | */ |
2878 | enum sci_status scic_controller_start_io( | 2862 | enum sci_status scic_controller_start_io(struct scic_sds_controller *scic, |
2879 | struct scic_sds_controller *scic, | 2863 | struct scic_sds_remote_device *rdev, |
2880 | struct scic_sds_remote_device *rdev, | 2864 | struct scic_sds_request *req, |
2881 | struct scic_sds_request *req, | 2865 | u16 io_tag) |
2882 | u16 io_tag) | ||
2883 | { | 2866 | { |
2884 | enum sci_status status; | 2867 | enum sci_status status; |
2885 | 2868 | ||
@@ -2892,7 +2875,7 @@ enum sci_status scic_controller_start_io( | |||
2892 | if (status != SCI_SUCCESS) | 2875 | if (status != SCI_SUCCESS) |
2893 | return status; | 2876 | return status; |
2894 | 2877 | ||
2895 | scic->io_request_table[scic_sds_io_tag_get_index(req->io_tag)] = req; | 2878 | scic->io_request_table[ISCI_TAG_TCI(req->io_tag)] = req; |
2896 | scic_sds_controller_post_request(scic, scic_sds_request_get_post_context(req)); | 2879 | scic_sds_controller_post_request(scic, scic_sds_request_get_post_context(req)); |
2897 | return SCI_SUCCESS; | 2880 | return SCI_SUCCESS; |
2898 | } | 2881 | } |
@@ -2979,7 +2962,7 @@ enum sci_status scic_controller_complete_io( | |||
2979 | if (status != SCI_SUCCESS) | 2962 | if (status != SCI_SUCCESS) |
2980 | return status; | 2963 | return status; |
2981 | 2964 | ||
2982 | index = scic_sds_io_tag_get_index(request->io_tag); | 2965 | index = ISCI_TAG_TCI(request->io_tag); |
2983 | scic->io_request_table[index] = NULL; | 2966 | scic->io_request_table[index] = NULL; |
2984 | return SCI_SUCCESS; | 2967 | return SCI_SUCCESS; |
2985 | default: | 2968 | default: |
@@ -2998,7 +2981,7 @@ enum sci_status scic_controller_continue_io(struct scic_sds_request *sci_req) | |||
2998 | return SCI_FAILURE_INVALID_STATE; | 2981 | return SCI_FAILURE_INVALID_STATE; |
2999 | } | 2982 | } |
3000 | 2983 | ||
3001 | scic->io_request_table[scic_sds_io_tag_get_index(sci_req->io_tag)] = sci_req; | 2984 | scic->io_request_table[ISCI_TAG_TCI(sci_req->io_tag)] = sci_req; |
3002 | scic_sds_controller_post_request(scic, scic_sds_request_get_post_context(sci_req)); | 2985 | scic_sds_controller_post_request(scic, scic_sds_request_get_post_context(sci_req)); |
3003 | return SCI_SUCCESS; | 2986 | return SCI_SUCCESS; |
3004 | } | 2987 | } |
@@ -3050,7 +3033,7 @@ enum sci_task_status scic_controller_start_task( | |||
3050 | status = scic_sds_remote_device_start_task(scic, rdev, req); | 3033 | status = scic_sds_remote_device_start_task(scic, rdev, req); |
3051 | switch (status) { | 3034 | switch (status) { |
3052 | case SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS: | 3035 | case SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS: |
3053 | scic->io_request_table[scic_sds_io_tag_get_index(req->io_tag)] = req; | 3036 | scic->io_request_table[ISCI_TAG_TCI(req->io_tag)] = req; |
3054 | 3037 | ||
3055 | /* | 3038 | /* |
3056 | * We will let framework know this task request started successfully, | 3039 | * We will let framework know this task request started successfully, |
@@ -3059,7 +3042,7 @@ enum sci_task_status scic_controller_start_task( | |||
3059 | */ | 3042 | */ |
3060 | return SCI_SUCCESS; | 3043 | return SCI_SUCCESS; |
3061 | case SCI_SUCCESS: | 3044 | case SCI_SUCCESS: |
3062 | scic->io_request_table[scic_sds_io_tag_get_index(req->io_tag)] = req; | 3045 | scic->io_request_table[ISCI_TAG_TCI(req->io_tag)] = req; |
3063 | 3046 | ||
3064 | scic_sds_controller_post_request(scic, | 3047 | scic_sds_controller_post_request(scic, |
3065 | scic_sds_request_get_post_context(req)); | 3048 | scic_sds_request_get_post_context(req)); |
@@ -3096,14 +3079,12 @@ enum sci_task_status scic_controller_start_task( | |||
3096 | u16 scic_controller_allocate_io_tag(struct scic_sds_controller *scic) | 3079 | u16 scic_controller_allocate_io_tag(struct scic_sds_controller *scic) |
3097 | { | 3080 | { |
3098 | struct isci_host *ihost = scic_to_ihost(scic); | 3081 | struct isci_host *ihost = scic_to_ihost(scic); |
3099 | u16 tci; | ||
3100 | u16 seq; | ||
3101 | 3082 | ||
3102 | if (isci_tci_space(ihost)) { | 3083 | if (isci_tci_space(ihost)) { |
3103 | tci = isci_tci_alloc(ihost); | 3084 | u16 tci = isci_tci_alloc(ihost); |
3104 | seq = scic->io_request_sequence[tci]; | 3085 | u8 seq = scic->io_request_sequence[tci]; |
3105 | 3086 | ||
3106 | return scic_sds_io_tag_construct(seq, tci); | 3087 | return ISCI_TAG(seq, tci); |
3107 | } | 3088 | } |
3108 | 3089 | ||
3109 | return SCI_CONTROLLER_INVALID_IO_TAG; | 3090 | return SCI_CONTROLLER_INVALID_IO_TAG; |
@@ -3138,22 +3119,17 @@ enum sci_status scic_controller_free_io_tag(struct scic_sds_controller *scic, | |||
3138 | u16 io_tag) | 3119 | u16 io_tag) |
3139 | { | 3120 | { |
3140 | struct isci_host *ihost = scic_to_ihost(scic); | 3121 | struct isci_host *ihost = scic_to_ihost(scic); |
3141 | u16 sequence; | 3122 | u16 tci = ISCI_TAG_TCI(io_tag); |
3142 | u16 index; | 3123 | u16 seq = ISCI_TAG_SEQ(io_tag); |
3143 | |||
3144 | BUG_ON(io_tag == SCI_CONTROLLER_INVALID_IO_TAG); | ||
3145 | |||
3146 | sequence = scic_sds_io_tag_get_sequence(io_tag); | ||
3147 | index = scic_sds_io_tag_get_index(io_tag); | ||
3148 | 3124 | ||
3149 | /* prevent tail from passing head */ | 3125 | /* prevent tail from passing head */ |
3150 | if (isci_tci_active(ihost) == 0) | 3126 | if (isci_tci_active(ihost) == 0) |
3151 | return SCI_FAILURE_INVALID_IO_TAG; | 3127 | return SCI_FAILURE_INVALID_IO_TAG; |
3152 | 3128 | ||
3153 | if (sequence == scic->io_request_sequence[index]) { | 3129 | if (seq == scic->io_request_sequence[tci]) { |
3154 | scic_sds_io_sequence_increment(scic->io_request_sequence[index]); | 3130 | scic->io_request_sequence[tci] = (seq+1) & (SCI_MAX_SEQ-1); |
3155 | 3131 | ||
3156 | isci_tci_free(ihost, index); | 3132 | isci_tci_free(ihost, ISCI_TAG_TCI(io_tag)); |
3157 | 3133 | ||
3158 | return SCI_SUCCESS; | 3134 | return SCI_SUCCESS; |
3159 | } | 3135 | } |
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 { | |||
184 | */ | 184 | */ |
185 | struct scic_power_control power_control; | 185 | struct scic_power_control power_control; |
186 | 186 | ||
187 | /** | 187 | /* sequence number per tci */ |
188 | * This field is the array of sequence values for the IO Tag fields. Even | 188 | u8 io_request_sequence[SCI_MAX_IO_REQUESTS]; |
189 | * though only 4 bits of the field is used for the sequence the sequence is 16 | ||
190 | * bits in size so the sequence can be bitwise or'd with the TCi to build the | ||
191 | * IO Tag value. | ||
192 | */ | ||
193 | u16 io_request_sequence[SCI_MAX_IO_REQUESTS]; | ||
194 | 189 | ||
195 | /** | 190 | /** |
196 | * This field in the array of sequence values for the RNi. These are used | 191 | * 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) | |||
552 | */ | 547 | */ |
553 | #define scic_sds_controller_get_protocol_engine_group(controller) 0 | 548 | #define scic_sds_controller_get_protocol_engine_group(controller) 0 |
554 | 549 | ||
555 | /** | 550 | /* see scic_controller_io_tag_allocate|free for how seq and tci are built */ |
556 | * scic_sds_io_tag_construct() - | 551 | #define ISCI_TAG(seq, tci) (((u16) (seq)) << 12 | tci) |
557 | * | ||
558 | * This macro constructs an IO tag from the sequence and index values. | ||
559 | */ | ||
560 | #define scic_sds_io_tag_construct(sequence, task_index) \ | ||
561 | ((sequence) << 12 | (task_index)) | ||
562 | |||
563 | /** | ||
564 | * scic_sds_io_tag_get_sequence() - | ||
565 | * | ||
566 | * This macro returns the IO sequence from the IO tag value. | ||
567 | */ | ||
568 | #define scic_sds_io_tag_get_sequence(io_tag) \ | ||
569 | (((io_tag) & 0xF000) >> 12) | ||
570 | |||
571 | /** | ||
572 | * scic_sds_io_tag_get_index() - | ||
573 | * | ||
574 | * This macro returns the TCi from the io tag value | ||
575 | */ | ||
576 | #define scic_sds_io_tag_get_index(io_tag) \ | ||
577 | ((io_tag) & 0x0FFF) | ||
578 | 552 | ||
579 | /** | 553 | /* these are returned by the hardware, so sanitize them */ |
580 | * scic_sds_io_sequence_increment() - | 554 | #define ISCI_TAG_SEQ(tag) (((tag) >> 12) & (SCI_MAX_SEQ-1)) |
581 | * | 555 | #define ISCI_TAG_TCI(tag) ((tag) & (SCI_MAX_IO_REQUESTS-1)) |
582 | * This is a helper macro to increment the io sequence count. We may find in | ||
583 | * the future that it will be faster to store the sequence count in such a way | ||
584 | * as we dont perform the shift operation to build io tag values so therefore | ||
585 | * need a way to incrment them correctly | ||
586 | */ | ||
587 | #define scic_sds_io_sequence_increment(value) \ | ||
588 | ((value) = (((value) + 1) & 0x000F)) | ||
589 | 556 | ||
590 | /* expander attached sata devices require 3 rnc slots */ | 557 | /* expander attached sata devices require 3 rnc slots */ |
591 | static inline int scic_sds_remote_device_node_count(struct scic_sds_remote_device *sci_dev) | 558 | static inline int scic_sds_remote_device_node_count(struct scic_sds_remote_device *sci_dev) |
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h index 84ba533ca51e..81bade421b96 100644 --- a/drivers/scsi/isci/isci.h +++ b/drivers/scsi/isci/isci.h | |||
@@ -83,6 +83,7 @@ enum sci_controller_mode { | |||
83 | #define SCI_MAX_SMP_PHYS (384) /* not silicon constrained */ | 83 | #define SCI_MAX_SMP_PHYS (384) /* not silicon constrained */ |
84 | #define SCI_MAX_REMOTE_DEVICES (256UL) | 84 | #define SCI_MAX_REMOTE_DEVICES (256UL) |
85 | #define SCI_MAX_IO_REQUESTS (256UL) | 85 | #define SCI_MAX_IO_REQUESTS (256UL) |
86 | #define SCI_MAX_SEQ (16) | ||
86 | #define SCI_MAX_MSIX_MESSAGES (2) | 87 | #define SCI_MAX_MSIX_MESSAGES (2) |
87 | #define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 /* not silicon constrained */ | 88 | #define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 /* not silicon constrained */ |
88 | #define SCI_MAX_CONTROLLERS 2 | 89 | #define SCI_MAX_CONTROLLERS 2 |
@@ -113,6 +114,7 @@ static inline void check_sizes(void) | |||
113 | BUILD_BUG_ON_NOT_POWER_OF_2(SCU_MAX_COMPLETION_QUEUE_ENTRIES); | 114 | BUILD_BUG_ON_NOT_POWER_OF_2(SCU_MAX_COMPLETION_QUEUE_ENTRIES); |
114 | BUILD_BUG_ON(SCU_MAX_UNSOLICITED_FRAMES > SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES); | 115 | BUILD_BUG_ON(SCU_MAX_UNSOLICITED_FRAMES > SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES); |
115 | BUILD_BUG_ON_NOT_POWER_OF_2(SCI_MAX_IO_REQUESTS); | 116 | BUILD_BUG_ON_NOT_POWER_OF_2(SCI_MAX_IO_REQUESTS); |
117 | BUILD_BUG_ON_NOT_POWER_OF_2(SCI_MAX_SEQ); | ||
116 | } | 118 | } |
117 | 119 | ||
118 | /** | 120 | /** |
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index e540281ebd49..fb66e30da075 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c | |||
@@ -689,23 +689,16 @@ static void scic_sds_port_construct_dummy_rnc(struct scic_sds_port *sci_port, u1 | |||
689 | rnc->ssp.arbitration_wait_time = 0; | 689 | rnc->ssp.arbitration_wait_time = 0; |
690 | } | 690 | } |
691 | 691 | ||
692 | /** | 692 | /* |
693 | * scic_sds_port_construct_dummy_task() - create dummy task for si workaround | 693 | * construct a dummy task context data structure. This |
694 | * @sci_port The logical port on which we need to create the | ||
695 | * remote node context. | ||
696 | * context. | ||
697 | * @tci The remote node index for this remote node context. | ||
698 | * | ||
699 | * This routine will construct a dummy task context data structure. This | ||
700 | * structure will be posted to the hardwre to work around a scheduler error | 694 | * structure will be posted to the hardwre to work around a scheduler error |
701 | * in the hardware. | 695 | * in the hardware. |
702 | * | ||
703 | */ | 696 | */ |
704 | static void scic_sds_port_construct_dummy_task(struct scic_sds_port *sci_port, u16 tci) | 697 | static void scic_sds_port_construct_dummy_task(struct scic_sds_port *sci_port, u16 tag) |
705 | { | 698 | { |
706 | struct scu_task_context *task_context; | 699 | struct scu_task_context *task_context; |
707 | 700 | ||
708 | task_context = scic_sds_controller_get_task_context_buffer(sci_port->owning_controller, tci); | 701 | task_context = scic_sds_controller_get_task_context_buffer(sci_port->owning_controller, tag); |
709 | 702 | ||
710 | memset(task_context, 0, sizeof(struct scu_task_context)); | 703 | memset(task_context, 0, sizeof(struct scu_task_context)); |
711 | 704 | ||
@@ -716,7 +709,7 @@ static void scic_sds_port_construct_dummy_task(struct scic_sds_port *sci_port, u | |||
716 | task_context->protocol_engine_index = 0; | 709 | task_context->protocol_engine_index = 0; |
717 | task_context->logical_port_index = sci_port->physical_port_index; | 710 | task_context->logical_port_index = sci_port->physical_port_index; |
718 | task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SSP; | 711 | task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SSP; |
719 | task_context->task_index = scic_sds_io_tag_get_index(tci); | 712 | task_context->task_index = ISCI_TAG_TCI(tag); |
720 | task_context->valid = SCU_TASK_CONTEXT_VALID; | 713 | task_context->valid = SCU_TASK_CONTEXT_VALID; |
721 | task_context->context_type = SCU_TASK_CONTEXT_TYPE; | 714 | task_context->context_type = SCU_TASK_CONTEXT_TYPE; |
722 | 715 | ||
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index 433565c2b343..9d7531ad9a74 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c | |||
@@ -258,7 +258,7 @@ static void scu_ssp_reqeust_construct_task_context( | |||
258 | SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | | 258 | SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | |
259 | (scic_sds_port_get_index(target_port) << | 259 | (scic_sds_port_get_index(target_port) << |
260 | SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | | 260 | SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | |
261 | scic_sds_io_tag_get_index(sds_request->io_tag)); | 261 | ISCI_TAG_TCI(sds_request->io_tag)); |
262 | } else { | 262 | } else { |
263 | /* | 263 | /* |
264 | * Build the task context now since we have already read | 264 | * Build the task context now since we have already read |
@@ -433,7 +433,7 @@ static void scu_sata_reqeust_construct_task_context( | |||
433 | SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | | 433 | SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | |
434 | (scic_sds_port_get_index(target_port) << | 434 | (scic_sds_port_get_index(target_port) << |
435 | SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | | 435 | SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | |
436 | scic_sds_io_tag_get_index(sci_req->io_tag)); | 436 | ISCI_TAG_TCI(sci_req->io_tag)); |
437 | } else { | 437 | } else { |
438 | /* | 438 | /* |
439 | * Build the task context now since we have already read | 439 | * Build the task context now since we have already read |
@@ -741,7 +741,7 @@ static u32 sci_req_tx_bytes(struct scic_sds_request *sci_req) | |||
741 | */ | 741 | */ |
742 | ret_val = readl(scu_reg_base + | 742 | ret_val = readl(scu_reg_base + |
743 | (SCU_TASK_CONTEXT_SRAM + offsetof(struct scu_task_context, type.ssp.data_offset)) + | 743 | (SCU_TASK_CONTEXT_SRAM + offsetof(struct scu_task_context, type.ssp.data_offset)) + |
744 | ((sizeof(struct scu_task_context)) * scic_sds_io_tag_get_index(sci_req->io_tag))); | 744 | ((sizeof(struct scu_task_context)) * ISCI_TAG_TCI(sci_req->io_tag))); |
745 | } | 745 | } |
746 | 746 | ||
747 | return ret_val; | 747 | return ret_val; |
@@ -777,7 +777,7 @@ enum sci_status scic_sds_request_start(struct scic_sds_request *sci_req) | |||
777 | if (sci_req->io_tag != SCI_CONTROLLER_INVALID_IO_TAG) { | 777 | if (sci_req->io_tag != SCI_CONTROLLER_INVALID_IO_TAG) { |
778 | task_context = sci_req->task_context_buffer; | 778 | task_context = sci_req->task_context_buffer; |
779 | 779 | ||
780 | task_context->task_index = scic_sds_io_tag_get_index(sci_req->io_tag); | 780 | task_context->task_index = ISCI_TAG_TCI(sci_req->io_tag); |
781 | 781 | ||
782 | switch (task_context->protocol_type) { | 782 | switch (task_context->protocol_type) { |
783 | case SCU_TASK_CONTEXT_PROTOCOL_SMP: | 783 | case SCU_TASK_CONTEXT_PROTOCOL_SMP: |
@@ -811,7 +811,7 @@ enum sci_status scic_sds_request_start(struct scic_sds_request *sci_req) | |||
811 | scic_sds_controller_copy_task_context(scic, sci_req); | 811 | scic_sds_controller_copy_task_context(scic, sci_req); |
812 | 812 | ||
813 | /* Add to the post_context the io tag value */ | 813 | /* Add to the post_context the io tag value */ |
814 | sci_req->post_context |= scic_sds_io_tag_get_index(sci_req->io_tag); | 814 | sci_req->post_context |= ISCI_TAG_TCI(sci_req->io_tag); |
815 | 815 | ||
816 | /* Everything is good go ahead and change state */ | 816 | /* Everything is good go ahead and change state */ |
817 | sci_change_state(&sci_req->sm, SCI_REQ_STARTED); | 817 | sci_change_state(&sci_req->sm, SCI_REQ_STARTED); |
@@ -3325,7 +3325,7 @@ scu_smp_request_construct_task_context(struct scic_sds_request *sci_req, | |||
3325 | SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | | 3325 | SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) | |
3326 | (scic_sds_port_get_index(sci_port) << | 3326 | (scic_sds_port_get_index(sci_port) << |
3327 | SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | | 3327 | SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) | |
3328 | scic_sds_io_tag_get_index(sci_req->io_tag)); | 3328 | ISCI_TAG_TCI(sci_req->io_tag)); |
3329 | } else { | 3329 | } else { |
3330 | /* | 3330 | /* |
3331 | * Build the task context now since we have already read | 3331 | * Build the task context now since we have already read |