aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2011-04-21 01:34:49 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:00:37 -0400
commite2023b8735956bb78f167d0fdc575364e69b02c4 (patch)
tree339ddc0b6aab6a31235918e1cdc30be6ff1c5d5c /drivers/scsi
parent2d70de5a0f03072289015917b059c155936c894d (diff)
isci: replace this_* and the_* variables with more meaningful names
Removed any instances of the_* and this_* to variable names that are more meaningful and tell us what they actually are. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/isci/core/sci_pool.h60
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.c395
-rw-r--r--drivers/scsi/isci/core/scic_sds_controller.h18
-rw-r--r--drivers/scsi/isci/core/scic_sds_phy.c396
-rw-r--r--drivers/scsi/isci/core/scic_sds_port.c294
-rw-r--r--drivers/scsi/isci/core/scic_sds_port.h58
-rw-r--r--drivers/scsi/isci/core/scic_sds_remote_device.c186
-rw-r--r--drivers/scsi/isci/core/scic_sds_remote_device.h102
-rw-r--r--drivers/scsi/isci/core/scic_sds_remote_node_context.c374
-rw-r--r--drivers/scsi/isci/core/scic_sds_remote_node_context.h16
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.c196
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.h40
-rw-r--r--drivers/scsi/isci/core/scic_sds_smp_remote_device.c16
-rw-r--r--drivers/scsi/isci/core/scic_sds_smp_request.c116
-rw-r--r--drivers/scsi/isci/core/scic_sds_smp_request.h3
-rw-r--r--drivers/scsi/isci/core/scic_sds_ssp_request.c30
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_packet_request.c194
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_packet_request.h10
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_remote_device.c76
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_request.c370
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_request.h8
21 files changed, 1481 insertions, 1477 deletions
diff --git a/drivers/scsi/isci/core/sci_pool.h b/drivers/scsi/isci/core/sci_pool.h
index c0d2ea32529b..016ec832f74f 100644
--- a/drivers/scsi/isci/core/sci_pool.h
+++ b/drivers/scsi/isci/core/sci_pool.h
@@ -73,8 +73,8 @@
73 * 73 *
74 * Private operation for the pool 74 * Private operation for the pool
75 */ 75 */
76#define SCI_POOL_INCREMENT(this_pool, index) \ 76#define SCI_POOL_INCREMENT(pool, index) \
77 (((index) + 1) == (this_pool).size ? 0 : (index) + 1) 77 (((index) + 1) == (pool).size ? 0 : (index) + 1)
78 78
79/** 79/**
80 * SCI_POOL_CREATE() - 80 * SCI_POOL_CREATE() -
@@ -98,8 +98,8 @@
98 * This macro evaluates the pool and returns true if the pool is empty. If the 98 * This macro evaluates the pool and returns true if the pool is empty. If the
99 * pool is empty the user should not perform any get operation on the pool. 99 * pool is empty the user should not perform any get operation on the pool.
100 */ 100 */
101#define sci_pool_empty(this_pool) \ 101#define sci_pool_empty(pool) \
102 ((this_pool).get == (this_pool).put) 102 ((pool).get == (pool).put)
103 103
104/** 104/**
105 * sci_pool_full() - 105 * sci_pool_full() -
@@ -107,8 +107,8 @@
107 * This macro evaluates the pool and returns true if the pool is full. If the 107 * This macro evaluates the pool and returns true if the pool is full. If the
108 * pool is full the user should not perform any put operation. 108 * pool is full the user should not perform any put operation.
109 */ 109 */
110#define sci_pool_full(this_pool) \ 110#define sci_pool_full(pool) \
111 (SCI_POOL_INCREMENT(this_pool, (this_pool).put) == (this_pool).get) 111 (SCI_POOL_INCREMENT(pool, (pool).put) == (pool).get)
112 112
113/** 113/**
114 * sci_pool_size() - 114 * sci_pool_size() -
@@ -118,25 +118,25 @@
118 * pointers can be written simultaneously by different users. As a result, 118 * pointers can be written simultaneously by different users. As a result,
119 * this macro subtracts 1 from the internal size 119 * this macro subtracts 1 from the internal size
120 */ 120 */
121#define sci_pool_size(this_pool) \ 121#define sci_pool_size(pool) \
122 ((this_pool).size - 1) 122 ((pool).size - 1)
123 123
124/** 124/**
125 * sci_pool_count() - 125 * sci_pool_count() -
126 * 126 *
127 * This macro indicates the number of elements currently contained in the pool. 127 * This macro indicates the number of elements currently contained in the pool.
128 */ 128 */
129#define sci_pool_count(this_pool) \ 129#define sci_pool_count(pool) \
130 (\ 130 (\
131 sci_pool_empty((this_pool)) \ 131 sci_pool_empty((pool)) \
132 ? 0 \ 132 ? 0 \
133 : (\ 133 : (\
134 sci_pool_full((this_pool)) \ 134 sci_pool_full((pool)) \
135 ? sci_pool_size((this_pool)) \ 135 ? sci_pool_size((pool)) \
136 : (\ 136 : (\
137 (this_pool).get > (this_pool).put \ 137 (pool).get > (pool).put \
138 ? ((this_pool).size - (this_pool).get + (this_pool).put) \ 138 ? ((pool).size - (pool).get + (pool).put) \
139 : ((this_pool).put - (this_pool).get) \ 139 : ((pool).put - (pool).get) \
140 ) \ 140 ) \
141 ) \ 141 ) \
142 ) 142 )
@@ -146,11 +146,11 @@
146 * 146 *
147 * This macro initializes the pool to an empty condition. 147 * This macro initializes the pool to an empty condition.
148 */ 148 */
149#define sci_pool_initialize(this_pool) \ 149#define sci_pool_initialize(pool) \
150 { \ 150 { \
151 (this_pool).size = (sizeof((this_pool).array) / sizeof((this_pool).array[0])); \ 151 (pool).size = (sizeof((pool).array) / sizeof((pool).array[0])); \
152 (this_pool).get = 0; \ 152 (pool).get = 0; \
153 (this_pool).put = 0; \ 153 (pool).put = 0; \
154 } 154 }
155 155
156/** 156/**
@@ -159,10 +159,10 @@
159 * This macro will get the next free element from the pool. This should only be 159 * This macro will get the next free element from the pool. This should only be
160 * called if the pool is not empty. 160 * called if the pool is not empty.
161 */ 161 */
162#define sci_pool_get(this_pool, my_value) \ 162#define sci_pool_get(pool, my_value) \
163 { \ 163 { \
164 (my_value) = (this_pool).array[(this_pool).get]; \ 164 (my_value) = (pool).array[(pool).get]; \
165 (this_pool).get = SCI_POOL_INCREMENT((this_pool), (this_pool).get); \ 165 (pool).get = SCI_POOL_INCREMENT((pool), (pool).get); \
166 } 166 }
167 167
168/** 168/**
@@ -171,10 +171,10 @@
171 * This macro will put the value into the pool. This should only be called if 171 * This macro will put the value into the pool. This should only be called if
172 * the pool is not full. 172 * the pool is not full.
173 */ 173 */
174#define sci_pool_put(this_pool, the_value) \ 174#define sci_pool_put(pool, value) \
175 { \ 175 { \
176 (this_pool).array[(this_pool).put] = (the_value); \ 176 (pool).array[(pool).put] = (value); \
177 (this_pool).put = SCI_POOL_INCREMENT((this_pool), (this_pool).put); \ 177 (pool).put = SCI_POOL_INCREMENT((pool), (pool).put); \
178 } 178 }
179 179
180/** 180/**
@@ -183,16 +183,16 @@
183 * This macro will search the pool and remove any elements in the pool matching 183 * This macro will search the pool and remove any elements in the pool matching
184 * the supplied value. This method can only be utilized on pools 184 * the supplied value. This method can only be utilized on pools
185 */ 185 */
186#define sci_pool_erase(this_pool, type, the_value) \ 186#define sci_pool_erase(pool, type, value) \
187 { \ 187 { \
188 type tmp_value; \ 188 type tmp_value; \
189 u32 index; \ 189 u32 index; \
190 u32 element_count = sci_pool_count((this_pool)); \ 190 u32 element_count = sci_pool_count((pool)); \
191 \ 191 \
192 for (index = 0; index < element_count; index++) { \ 192 for (index = 0; index < element_count; index++) { \
193 sci_pool_get((this_pool), tmp_value); \ 193 sci_pool_get((pool), tmp_value); \
194 if (tmp_value != (the_value)) \ 194 if (tmp_value != (value)) \
195 sci_pool_put((this_pool), tmp_value); \ 195 sci_pool_put((pool), tmp_value); \
196 } \ 196 } \
197 } 197 }
198 198
diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c
index 9bb78a2e6ff7..63f4cd130d1d 100644
--- a/drivers/scsi/isci/core/scic_sds_controller.c
+++ b/drivers/scsi/isci/core/scic_sds_controller.c
@@ -290,7 +290,7 @@ int scic_controller_mem_init(struct scic_sds_controller *scic)
290 290
291/** 291/**
292 * This method initializes the task context data for the controller. 292 * This method initializes the task context data for the controller.
293 * @this_controller: 293 * @scic:
294 * 294 *
295 */ 295 */
296static void 296static void
@@ -321,22 +321,22 @@ scic_sds_controller_assign_task_entries(struct scic_sds_controller *controller)
321 * 321 *
322 */ 322 */
323static void scic_sds_controller_initialize_completion_queue( 323static void scic_sds_controller_initialize_completion_queue(
324 struct scic_sds_controller *this_controller) 324 struct scic_sds_controller *scic)
325{ 325{
326 u32 index; 326 u32 index;
327 u32 completion_queue_control_value; 327 u32 completion_queue_control_value;
328 u32 completion_queue_get_value; 328 u32 completion_queue_get_value;
329 u32 completion_queue_put_value; 329 u32 completion_queue_put_value;
330 330
331 this_controller->completion_queue_get = 0; 331 scic->completion_queue_get = 0;
332 332
333 completion_queue_control_value = ( 333 completion_queue_control_value = (
334 SMU_CQC_QUEUE_LIMIT_SET(this_controller->completion_queue_entries - 1) 334 SMU_CQC_QUEUE_LIMIT_SET(scic->completion_queue_entries - 1)
335 | SMU_CQC_EVENT_LIMIT_SET(this_controller->completion_event_entries - 1) 335 | SMU_CQC_EVENT_LIMIT_SET(scic->completion_event_entries - 1)
336 ); 336 );
337 337
338 writel(completion_queue_control_value, 338 writel(completion_queue_control_value,
339 &this_controller->smu_registers->completion_queue_control); 339 &scic->smu_registers->completion_queue_control);
340 340
341 341
342 /* Set the completion queue get pointer and enable the queue */ 342 /* Set the completion queue get pointer and enable the queue */
@@ -348,7 +348,7 @@ static void scic_sds_controller_initialize_completion_queue(
348 ); 348 );
349 349
350 writel(completion_queue_get_value, 350 writel(completion_queue_get_value,
351 &this_controller->smu_registers->completion_queue_get); 351 &scic->smu_registers->completion_queue_get);
352 352
353 /* Set the completion queue put pointer */ 353 /* Set the completion queue put pointer */
354 completion_queue_put_value = ( 354 completion_queue_put_value = (
@@ -357,16 +357,15 @@ static void scic_sds_controller_initialize_completion_queue(
357 ); 357 );
358 358
359 writel(completion_queue_put_value, 359 writel(completion_queue_put_value,
360 &this_controller->smu_registers->completion_queue_put); 360 &scic->smu_registers->completion_queue_put);
361
362 361
363 /* Initialize the cycle bit of the completion queue entries */ 362 /* Initialize the cycle bit of the completion queue entries */
364 for (index = 0; index < this_controller->completion_queue_entries; index++) { 363 for (index = 0; index < scic->completion_queue_entries; index++) {
365 /* 364 /*
366 * If get.cycle_bit != completion_queue.cycle_bit 365 * If get.cycle_bit != completion_queue.cycle_bit
367 * its not a valid completion queue entry 366 * its not a valid completion queue entry
368 * so at system start all entries are invalid */ 367 * so at system start all entries are invalid */
369 this_controller->completion_queue[index] = 0x80000000; 368 scic->completion_queue[index] = 0x80000000;
370 } 369 }
371} 370}
372 371
@@ -376,7 +375,7 @@ static void scic_sds_controller_initialize_completion_queue(
376 * 375 *
377 */ 376 */
378static void scic_sds_controller_initialize_unsolicited_frame_queue( 377static void scic_sds_controller_initialize_unsolicited_frame_queue(
379 struct scic_sds_controller *this_controller) 378 struct scic_sds_controller *scic)
380{ 379{
381 u32 frame_queue_control_value; 380 u32 frame_queue_control_value;
382 u32 frame_queue_get_value; 381 u32 frame_queue_get_value;
@@ -384,10 +383,11 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(
384 383
385 /* Write the queue size */ 384 /* Write the queue size */
386 frame_queue_control_value = 385 frame_queue_control_value =
387 SCU_UFQC_GEN_VAL(QUEUE_SIZE, this_controller->uf_control.address_table.count); 386 SCU_UFQC_GEN_VAL(QUEUE_SIZE,
387 scic->uf_control.address_table.count);
388 388
389 writel(frame_queue_control_value, 389 writel(frame_queue_control_value,
390 &this_controller->scu_registers->sdma.unsolicited_frame_queue_control); 390 &scic->scu_registers->sdma.unsolicited_frame_queue_control);
391 391
392 /* Setup the get pointer for the unsolicited frame queue */ 392 /* Setup the get pointer for the unsolicited frame queue */
393 frame_queue_get_value = ( 393 frame_queue_get_value = (
@@ -396,11 +396,11 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(
396 ); 396 );
397 397
398 writel(frame_queue_get_value, 398 writel(frame_queue_get_value,
399 &this_controller->scu_registers->sdma.unsolicited_frame_get_pointer); 399 &scic->scu_registers->sdma.unsolicited_frame_get_pointer);
400 /* Setup the put pointer for the unsolicited frame queue */ 400 /* Setup the put pointer for the unsolicited frame queue */
401 frame_queue_put_value = SCU_UFQPP_GEN_VAL(POINTER, 0); 401 frame_queue_put_value = SCU_UFQPP_GEN_VAL(POINTER, 0);
402 writel(frame_queue_put_value, 402 writel(frame_queue_put_value,
403 &this_controller->scu_registers->sdma.unsolicited_frame_put_pointer); 403 &scic->scu_registers->sdma.unsolicited_frame_put_pointer);
404} 404}
405 405
406/** 406/**
@@ -409,16 +409,17 @@ static void scic_sds_controller_initialize_unsolicited_frame_queue(
409 * 409 *
410 */ 410 */
411static void scic_sds_controller_enable_port_task_scheduler( 411static void scic_sds_controller_enable_port_task_scheduler(
412 struct scic_sds_controller *this_controller) 412 struct scic_sds_controller *scic)
413{ 413{
414 u32 port_task_scheduler_value; 414 u32 port_task_scheduler_value;
415 415
416 port_task_scheduler_value = 416 port_task_scheduler_value =
417 readl(&this_controller->scu_registers->peg0.ptsg.control); 417 readl(&scic->scu_registers->peg0.ptsg.control);
418 port_task_scheduler_value |= 418 port_task_scheduler_value |=
419 (SCU_PTSGCR_GEN_BIT(ETM_ENABLE) | SCU_PTSGCR_GEN_BIT(PTSG_ENABLE)); 419 (SCU_PTSGCR_GEN_BIT(ETM_ENABLE) |
420 SCU_PTSGCR_GEN_BIT(PTSG_ENABLE));
420 writel(port_task_scheduler_value, 421 writel(port_task_scheduler_value,
421 &this_controller->scu_registers->peg0.ptsg.control); 422 &scic->scu_registers->peg0.ptsg.control);
422} 423}
423 424
424/** 425/**
@@ -564,7 +565,7 @@ static void scic_sds_controller_afe_initialization(struct scic_sds_controller *s
564 * This method will attempt to transition into the ready state for the 565 * This method will attempt to transition into the ready state for the
565 * controller and indicate that the controller start operation has completed 566 * controller and indicate that the controller start operation has completed
566 * if all criteria are met. 567 * if all criteria are met.
567 * @this_controller: This parameter indicates the controller object for which 568 * @scic: This parameter indicates the controller object for which
568 * to transition to ready. 569 * to transition to ready.
569 * @status: This parameter indicates the status value to be pass into the call 570 * @status: This parameter indicates the status value to be pass into the call
570 * to scic_cb_controller_start_complete(). 571 * to scic_cb_controller_start_complete().
@@ -858,30 +859,30 @@ static void scic_sds_controller_power_control_timer_restart(struct scic_sds_cont
858static void scic_sds_controller_power_control_timer_handler( 859static void scic_sds_controller_power_control_timer_handler(
859 void *controller) 860 void *controller)
860{ 861{
861 struct scic_sds_controller *this_controller; 862 struct scic_sds_controller *scic;
862 863
863 this_controller = (struct scic_sds_controller *)controller; 864 scic = (struct scic_sds_controller *)controller;
864 865
865 this_controller->power_control.phys_granted_power = 0; 866 scic->power_control.phys_granted_power = 0;
866 867
867 if (this_controller->power_control.phys_waiting == 0) { 868 if (scic->power_control.phys_waiting == 0) {
868 this_controller->power_control.timer_started = false; 869 scic->power_control.timer_started = false;
869 } else { 870 } else {
870 struct scic_sds_phy *the_phy = NULL; 871 struct scic_sds_phy *sci_phy = NULL;
871 u8 i; 872 u8 i;
872 873
873 for (i = 0; 874 for (i = 0;
874 (i < SCI_MAX_PHYS) 875 (i < SCI_MAX_PHYS)
875 && (this_controller->power_control.phys_waiting != 0); 876 && (scic->power_control.phys_waiting != 0);
876 i++) { 877 i++) {
877 if (this_controller->power_control.requesters[i] != NULL) { 878 if (scic->power_control.requesters[i] != NULL) {
878 if (this_controller->power_control.phys_granted_power < 879 if (scic->power_control.phys_granted_power <
879 this_controller->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) { 880 scic->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) {
880 the_phy = this_controller->power_control.requesters[i]; 881 sci_phy = scic->power_control.requesters[i];
881 this_controller->power_control.requesters[i] = NULL; 882 scic->power_control.requesters[i] = NULL;
882 this_controller->power_control.phys_waiting--; 883 scic->power_control.phys_waiting--;
883 this_controller->power_control.phys_granted_power++; 884 scic->power_control.phys_granted_power++;
884 scic_sds_phy_consume_power_handler(the_phy); 885 scic_sds_phy_consume_power_handler(sci_phy);
885 } else { 886 } else {
886 break; 887 break;
887 } 888 }
@@ -892,56 +893,56 @@ static void scic_sds_controller_power_control_timer_handler(
892 * It doesn't matter if the power list is empty, we need to start the 893 * It doesn't matter if the power list is empty, we need to start the
893 * timer in case another phy becomes ready. 894 * timer in case another phy becomes ready.
894 */ 895 */
895 scic_sds_controller_power_control_timer_start(this_controller); 896 scic_sds_controller_power_control_timer_start(scic);
896 } 897 }
897} 898}
898 899
899/** 900/**
900 * This method inserts the phy in the stagger spinup control queue. 901 * This method inserts the phy in the stagger spinup control queue.
901 * @this_controller: 902 * @scic:
902 * 903 *
903 * 904 *
904 */ 905 */
905void scic_sds_controller_power_control_queue_insert( 906void scic_sds_controller_power_control_queue_insert(
906 struct scic_sds_controller *this_controller, 907 struct scic_sds_controller *scic,
907 struct scic_sds_phy *the_phy) 908 struct scic_sds_phy *sci_phy)
908{ 909{
909 BUG_ON(the_phy == NULL); 910 BUG_ON(sci_phy == NULL);
910 911
911 if (this_controller->power_control.phys_granted_power < 912 if (scic->power_control.phys_granted_power <
912 this_controller->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) { 913 scic->oem_parameters.sds1.controller.max_concurrent_dev_spin_up) {
913 this_controller->power_control.phys_granted_power++; 914 scic->power_control.phys_granted_power++;
914 scic_sds_phy_consume_power_handler(the_phy); 915 scic_sds_phy_consume_power_handler(sci_phy);
915 916
916 /* 917 /*
917 * stop and start the power_control timer. When the timer fires, the 918 * stop and start the power_control timer. When the timer fires, the
918 * no_of_phys_granted_power will be set to 0 919 * no_of_phys_granted_power will be set to 0
919 */ 920 */
920 scic_sds_controller_power_control_timer_restart(this_controller); 921 scic_sds_controller_power_control_timer_restart(scic);
921 } else { 922 } else {
922 /* Add the phy in the waiting list */ 923 /* Add the phy in the waiting list */
923 this_controller->power_control.requesters[the_phy->phy_index] = the_phy; 924 scic->power_control.requesters[sci_phy->phy_index] = sci_phy;
924 this_controller->power_control.phys_waiting++; 925 scic->power_control.phys_waiting++;
925 } 926 }
926} 927}
927 928
928/** 929/**
929 * This method removes the phy from the stagger spinup control queue. 930 * This method removes the phy from the stagger spinup control queue.
930 * @this_controller: 931 * @scic:
931 * 932 *
932 * 933 *
933 */ 934 */
934void scic_sds_controller_power_control_queue_remove( 935void scic_sds_controller_power_control_queue_remove(
935 struct scic_sds_controller *this_controller, 936 struct scic_sds_controller *scic,
936 struct scic_sds_phy *the_phy) 937 struct scic_sds_phy *sci_phy)
937{ 938{
938 BUG_ON(the_phy == NULL); 939 BUG_ON(sci_phy == NULL);
939 940
940 if (this_controller->power_control.requesters[the_phy->phy_index] != NULL) { 941 if (scic->power_control.requesters[sci_phy->phy_index] != NULL) {
941 this_controller->power_control.phys_waiting--; 942 scic->power_control.phys_waiting--;
942 } 943 }
943 944
944 this_controller->power_control.requesters[the_phy->phy_index] = NULL; 945 scic->power_control.requesters[sci_phy->phy_index] = NULL;
945} 946}
946 947
947/* 948/*
@@ -952,23 +953,20 @@ void scic_sds_controller_power_control_queue_remove(
952/** 953/**
953 * This method returns a true value if the completion queue has entries that 954 * This method returns a true value if the completion queue has entries that
954 * can be processed 955 * can be processed
955 * @this_controller: 956 * @scic:
956 * 957 *
957 * bool true if the completion queue has entries to process false if the 958 * bool true if the completion queue has entries to process false if the
958 * completion queue has no entries to process 959 * completion queue has no entries to process
959 */ 960 */
960static bool scic_sds_controller_completion_queue_has_entries( 961static bool scic_sds_controller_completion_queue_has_entries(
961 struct scic_sds_controller *this_controller) 962 struct scic_sds_controller *scic)
962{ 963{
963 u32 get_value = this_controller->completion_queue_get; 964 u32 get_value = scic->completion_queue_get;
964 u32 get_index = get_value & SMU_COMPLETION_QUEUE_GET_POINTER_MASK; 965 u32 get_index = get_value & SMU_COMPLETION_QUEUE_GET_POINTER_MASK;
965 966
966 if ( 967 if (NORMALIZE_GET_POINTER_CYCLE_BIT(get_value) ==
967 NORMALIZE_GET_POINTER_CYCLE_BIT(get_value) 968 COMPLETION_QUEUE_CYCLE_BIT(scic->completion_queue[get_index]))
968 == COMPLETION_QUEUE_CYCLE_BIT(this_controller->completion_queue[get_index])
969 ) {
970 return true; 969 return true;
971 }
972 970
973 return false; 971 return false;
974} 972}
@@ -976,19 +974,19 @@ static bool scic_sds_controller_completion_queue_has_entries(
976/** 974/**
977 * This method processes a task completion notification. This is called from 975 * This method processes a task completion notification. This is called from
978 * within the controller completion handler. 976 * within the controller completion handler.
979 * @this_controller: 977 * @scic:
980 * @completion_entry: 978 * @completion_entry:
981 * 979 *
982 */ 980 */
983static void scic_sds_controller_task_completion( 981static void scic_sds_controller_task_completion(
984 struct scic_sds_controller *this_controller, 982 struct scic_sds_controller *scic,
985 u32 completion_entry) 983 u32 completion_entry)
986{ 984{
987 u32 index; 985 u32 index;
988 struct scic_sds_request *io_request; 986 struct scic_sds_request *io_request;
989 987
990 index = SCU_GET_COMPLETION_INDEX(completion_entry); 988 index = SCU_GET_COMPLETION_INDEX(completion_entry);
991 io_request = this_controller->io_request_table[index]; 989 io_request = scic->io_request_table[index];
992 990
993 /* Make sure that we really want to process this IO request */ 991 /* Make sure that we really want to process this IO request */
994 if ( 992 if (
@@ -996,7 +994,7 @@ static void scic_sds_controller_task_completion(
996 && (io_request->io_tag != SCI_CONTROLLER_INVALID_IO_TAG) 994 && (io_request->io_tag != SCI_CONTROLLER_INVALID_IO_TAG)
997 && ( 995 && (
998 scic_sds_io_tag_get_sequence(io_request->io_tag) 996 scic_sds_io_tag_get_sequence(io_request->io_tag)
999 == this_controller->io_request_sequence[index] 997 == scic->io_request_sequence[index]
1000 ) 998 )
1001 ) { 999 ) {
1002 /* Yep this is a valid io request pass it along to the io request handler */ 1000 /* Yep this is a valid io request pass it along to the io request handler */
@@ -1007,12 +1005,12 @@ static void scic_sds_controller_task_completion(
1007/** 1005/**
1008 * This method processes an SDMA completion event. This is called from within 1006 * This method processes an SDMA completion event. This is called from within
1009 * the controller completion handler. 1007 * the controller completion handler.
1010 * @this_controller: 1008 * @scic:
1011 * @completion_entry: 1009 * @completion_entry:
1012 * 1010 *
1013 */ 1011 */
1014static void scic_sds_controller_sdma_completion( 1012static void scic_sds_controller_sdma_completion(
1015 struct scic_sds_controller *this_controller, 1013 struct scic_sds_controller *scic,
1016 u32 completion_entry) 1014 u32 completion_entry)
1017{ 1015{
1018 u32 index; 1016 u32 index;
@@ -1024,8 +1022,8 @@ static void scic_sds_controller_sdma_completion(
1024 switch (scu_get_command_request_type(completion_entry)) { 1022 switch (scu_get_command_request_type(completion_entry)) {
1025 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC: 1023 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC:
1026 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC: 1024 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC:
1027 io_request = this_controller->io_request_table[index]; 1025 io_request = scic->io_request_table[index];
1028 dev_warn(scic_to_dev(this_controller), 1026 dev_warn(scic_to_dev(scic),
1029 "%s: SCIC SDS Completion type SDMA %x for io request " 1027 "%s: SCIC SDS Completion type SDMA %x for io request "
1030 "%p\n", 1028 "%p\n",
1031 __func__, 1029 __func__,
@@ -1039,8 +1037,8 @@ static void scic_sds_controller_sdma_completion(
1039 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC: 1037 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC:
1040 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC: 1038 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC:
1041 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC: 1039 case SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC:
1042 device = this_controller->device_table[index]; 1040 device = scic->device_table[index];
1043 dev_warn(scic_to_dev(this_controller), 1041 dev_warn(scic_to_dev(scic),
1044 "%s: SCIC SDS Completion type SDMA %x for remote " 1042 "%s: SCIC SDS Completion type SDMA %x for remote "
1045 "device %p\n", 1043 "device %p\n",
1046 __func__, 1044 __func__,
@@ -1052,7 +1050,7 @@ static void scic_sds_controller_sdma_completion(
1052 break; 1050 break;
1053 1051
1054 default: 1052 default:
1055 dev_warn(scic_to_dev(this_controller), 1053 dev_warn(scic_to_dev(scic),
1056 "%s: SCIC SDS Completion unknown SDMA completion " 1054 "%s: SCIC SDS Completion unknown SDMA completion "
1057 "type %x\n", 1055 "type %x\n",
1058 __func__, 1056 __func__,
@@ -1064,14 +1062,14 @@ static void scic_sds_controller_sdma_completion(
1064 1062
1065/** 1063/**
1066 * 1064 *
1067 * @this_controller: 1065 * @scic:
1068 * @completion_entry: 1066 * @completion_entry:
1069 * 1067 *
1070 * This method processes an unsolicited frame message. This is called from 1068 * This method processes an unsolicited frame message. This is called from
1071 * within the controller completion handler. none 1069 * within the controller completion handler. none
1072 */ 1070 */
1073static void scic_sds_controller_unsolicited_frame( 1071static void scic_sds_controller_unsolicited_frame(
1074 struct scic_sds_controller *this_controller, 1072 struct scic_sds_controller *scic,
1075 u32 completion_entry) 1073 u32 completion_entry)
1076{ 1074{
1077 u32 index; 1075 u32 index;
@@ -1086,8 +1084,8 @@ static void scic_sds_controller_unsolicited_frame(
1086 frame_index = SCU_GET_FRAME_INDEX(completion_entry); 1084 frame_index = SCU_GET_FRAME_INDEX(completion_entry);
1087 1085
1088 frame_header 1086 frame_header
1089 = this_controller->uf_control.buffers.array[frame_index].header; 1087 = scic->uf_control.buffers.array[frame_index].header;
1090 this_controller->uf_control.buffers.array[frame_index].state 1088 scic->uf_control.buffers.array[frame_index].state
1091 = UNSOLICITED_FRAME_IN_USE; 1089 = UNSOLICITED_FRAME_IN_USE;
1092 1090
1093 if (SCU_GET_FRAME_ERROR(completion_entry)) { 1091 if (SCU_GET_FRAME_ERROR(completion_entry)) {
@@ -1095,13 +1093,13 @@ static void scic_sds_controller_unsolicited_frame(
1095 * / @todo If the IAF frame or SIGNATURE FIS frame has an error will 1093 * / @todo If the IAF frame or SIGNATURE FIS frame has an error will
1096 * / this cause a problem? We expect the phy initialization will 1094 * / this cause a problem? We expect the phy initialization will
1097 * / fail if there is an error in the frame. */ 1095 * / fail if there is an error in the frame. */
1098 scic_sds_controller_release_frame(this_controller, frame_index); 1096 scic_sds_controller_release_frame(scic, frame_index);
1099 return; 1097 return;
1100 } 1098 }
1101 1099
1102 if (frame_header->is_address_frame) { 1100 if (frame_header->is_address_frame) {
1103 index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry); 1101 index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry);
1104 phy = &this_controller->phy_table[index]; 1102 phy = &scic->phy_table[index];
1105 if (phy != NULL) { 1103 if (phy != NULL) {
1106 result = scic_sds_phy_frame_handler(phy, frame_index); 1104 result = scic_sds_phy_frame_handler(phy, frame_index);
1107 } 1105 }
@@ -1115,18 +1113,18 @@ static void scic_sds_controller_unsolicited_frame(
1115 * device that has not yet been created. In either case forwared 1113 * device that has not yet been created. In either case forwared
1116 * the frame to the PE and let it take care of the frame data. */ 1114 * the frame to the PE and let it take care of the frame data. */
1117 index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry); 1115 index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry);
1118 phy = &this_controller->phy_table[index]; 1116 phy = &scic->phy_table[index];
1119 result = scic_sds_phy_frame_handler(phy, frame_index); 1117 result = scic_sds_phy_frame_handler(phy, frame_index);
1120 } else { 1118 } else {
1121 if (index < this_controller->remote_node_entries) 1119 if (index < scic->remote_node_entries)
1122 device = this_controller->device_table[index]; 1120 device = scic->device_table[index];
1123 else 1121 else
1124 device = NULL; 1122 device = NULL;
1125 1123
1126 if (device != NULL) 1124 if (device != NULL)
1127 result = scic_sds_remote_device_frame_handler(device, frame_index); 1125 result = scic_sds_remote_device_frame_handler(device, frame_index);
1128 else 1126 else
1129 scic_sds_controller_release_frame(this_controller, frame_index); 1127 scic_sds_controller_release_frame(scic, frame_index);
1130 } 1128 }
1131 } 1129 }
1132 1130
@@ -1140,12 +1138,12 @@ static void scic_sds_controller_unsolicited_frame(
1140/** 1138/**
1141 * This method processes an event completion entry. This is called from within 1139 * This method processes an event completion entry. This is called from within
1142 * the controller completion handler. 1140 * the controller completion handler.
1143 * @this_controller: 1141 * @scic:
1144 * @completion_entry: 1142 * @completion_entry:
1145 * 1143 *
1146 */ 1144 */
1147static void scic_sds_controller_event_completion( 1145static void scic_sds_controller_event_completion(
1148 struct scic_sds_controller *this_controller, 1146 struct scic_sds_controller *scic,
1149 u32 completion_entry) 1147 u32 completion_entry)
1150{ 1148{
1151 u32 index; 1149 u32 index;
@@ -1158,11 +1156,11 @@ static void scic_sds_controller_event_completion(
1158 switch (scu_get_event_type(completion_entry)) { 1156 switch (scu_get_event_type(completion_entry)) {
1159 case SCU_EVENT_TYPE_SMU_COMMAND_ERROR: 1157 case SCU_EVENT_TYPE_SMU_COMMAND_ERROR:
1160 /* / @todo The driver did something wrong and we need to fix the condtion. */ 1158 /* / @todo The driver did something wrong and we need to fix the condtion. */
1161 dev_err(scic_to_dev(this_controller), 1159 dev_err(scic_to_dev(scic),
1162 "%s: SCIC Controller 0x%p received SMU command error " 1160 "%s: SCIC Controller 0x%p received SMU command error "
1163 "0x%x\n", 1161 "0x%x\n",
1164 __func__, 1162 __func__,
1165 this_controller, 1163 scic,
1166 completion_entry); 1164 completion_entry);
1167 break; 1165 break;
1168 1166
@@ -1172,16 +1170,16 @@ static void scic_sds_controller_event_completion(
1172 /* 1170 /*
1173 * / @todo This is a hardware failure and its likely that we want to 1171 * / @todo This is a hardware failure and its likely that we want to
1174 * / reset the controller. */ 1172 * / reset the controller. */
1175 dev_err(scic_to_dev(this_controller), 1173 dev_err(scic_to_dev(scic),
1176 "%s: SCIC Controller 0x%p received fatal controller " 1174 "%s: SCIC Controller 0x%p received fatal controller "
1177 "event 0x%x\n", 1175 "event 0x%x\n",
1178 __func__, 1176 __func__,
1179 this_controller, 1177 scic,
1180 completion_entry); 1178 completion_entry);
1181 break; 1179 break;
1182 1180
1183 case SCU_EVENT_TYPE_TRANSPORT_ERROR: 1181 case SCU_EVENT_TYPE_TRANSPORT_ERROR:
1184 io_request = this_controller->io_request_table[index]; 1182 io_request = scic->io_request_table[index];
1185 scic_sds_io_request_event_handler(io_request, completion_entry); 1183 scic_sds_io_request_event_handler(io_request, completion_entry);
1186 break; 1184 break;
1187 1185
@@ -1189,31 +1187,31 @@ static void scic_sds_controller_event_completion(
1189 switch (scu_get_event_specifier(completion_entry)) { 1187 switch (scu_get_event_specifier(completion_entry)) {
1190 case SCU_EVENT_SPECIFIC_SMP_RESPONSE_NO_PE: 1188 case SCU_EVENT_SPECIFIC_SMP_RESPONSE_NO_PE:
1191 case SCU_EVENT_SPECIFIC_TASK_TIMEOUT: 1189 case SCU_EVENT_SPECIFIC_TASK_TIMEOUT:
1192 io_request = this_controller->io_request_table[index]; 1190 io_request = scic->io_request_table[index];
1193 if (io_request != NULL) 1191 if (io_request != NULL)
1194 scic_sds_io_request_event_handler(io_request, completion_entry); 1192 scic_sds_io_request_event_handler(io_request, completion_entry);
1195 else 1193 else
1196 dev_warn(scic_to_dev(this_controller), 1194 dev_warn(scic_to_dev(scic),
1197 "%s: SCIC Controller 0x%p received " 1195 "%s: SCIC Controller 0x%p received "
1198 "event 0x%x for io request object " 1196 "event 0x%x for io request object "
1199 "that doesnt exist.\n", 1197 "that doesnt exist.\n",
1200 __func__, 1198 __func__,
1201 this_controller, 1199 scic,
1202 completion_entry); 1200 completion_entry);
1203 1201
1204 break; 1202 break;
1205 1203
1206 case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT: 1204 case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT:
1207 device = this_controller->device_table[index]; 1205 device = scic->device_table[index];
1208 if (device != NULL) 1206 if (device != NULL)
1209 scic_sds_remote_device_event_handler(device, completion_entry); 1207 scic_sds_remote_device_event_handler(device, completion_entry);
1210 else 1208 else
1211 dev_warn(scic_to_dev(this_controller), 1209 dev_warn(scic_to_dev(scic),
1212 "%s: SCIC Controller 0x%p received " 1210 "%s: SCIC Controller 0x%p received "
1213 "event 0x%x for remote device object " 1211 "event 0x%x for remote device object "
1214 "that doesnt exist.\n", 1212 "that doesnt exist.\n",
1215 __func__, 1213 __func__,
1216 this_controller, 1214 scic,
1217 completion_entry); 1215 completion_entry);
1218 1216
1219 break; 1217 break;
@@ -1230,32 +1228,32 @@ static void scic_sds_controller_event_completion(
1230 * we get the event notification. This is a type 4 event. */ 1228 * we get the event notification. This is a type 4 event. */
1231 case SCU_EVENT_TYPE_OSSP_EVENT: 1229 case SCU_EVENT_TYPE_OSSP_EVENT:
1232 index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry); 1230 index = SCU_GET_PROTOCOL_ENGINE_INDEX(completion_entry);
1233 phy = &this_controller->phy_table[index]; 1231 phy = &scic->phy_table[index];
1234 scic_sds_phy_event_handler(phy, completion_entry); 1232 scic_sds_phy_event_handler(phy, completion_entry);
1235 break; 1233 break;
1236 1234
1237 case SCU_EVENT_TYPE_RNC_SUSPEND_TX: 1235 case SCU_EVENT_TYPE_RNC_SUSPEND_TX:
1238 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: 1236 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX:
1239 case SCU_EVENT_TYPE_RNC_OPS_MISC: 1237 case SCU_EVENT_TYPE_RNC_OPS_MISC:
1240 if (index < this_controller->remote_node_entries) { 1238 if (index < scic->remote_node_entries) {
1241 device = this_controller->device_table[index]; 1239 device = scic->device_table[index];
1242 1240
1243 if (device != NULL) 1241 if (device != NULL)
1244 scic_sds_remote_device_event_handler(device, completion_entry); 1242 scic_sds_remote_device_event_handler(device, completion_entry);
1245 } else 1243 } else
1246 dev_err(scic_to_dev(this_controller), 1244 dev_err(scic_to_dev(scic),
1247 "%s: SCIC Controller 0x%p received event 0x%x " 1245 "%s: SCIC Controller 0x%p received event 0x%x "
1248 "for remote device object 0x%0x that doesnt " 1246 "for remote device object 0x%0x that doesnt "
1249 "exist.\n", 1247 "exist.\n",
1250 __func__, 1248 __func__,
1251 this_controller, 1249 scic,
1252 completion_entry, 1250 completion_entry,
1253 index); 1251 index);
1254 1252
1255 break; 1253 break;
1256 1254
1257 default: 1255 default:
1258 dev_warn(scic_to_dev(this_controller), 1256 dev_warn(scic_to_dev(scic),
1259 "%s: SCIC Controller received unknown event code %x\n", 1257 "%s: SCIC Controller received unknown event code %x\n",
1260 __func__, 1258 __func__,
1261 completion_entry); 1259 completion_entry);
@@ -1265,11 +1263,11 @@ static void scic_sds_controller_event_completion(
1265 1263
1266/** 1264/**
1267 * This method is a private routine for processing the completion queue entries. 1265 * This method is a private routine for processing the completion queue entries.
1268 * @this_controller: 1266 * @scic:
1269 * 1267 *
1270 */ 1268 */
1271static void scic_sds_controller_process_completions( 1269static void scic_sds_controller_process_completions(
1272 struct scic_sds_controller *this_controller) 1270 struct scic_sds_controller *scic)
1273{ 1271{
1274 u32 completion_count = 0; 1272 u32 completion_count = 0;
1275 u32 completion_entry; 1273 u32 completion_entry;
@@ -1278,60 +1276,60 @@ static void scic_sds_controller_process_completions(
1278 u32 event_index; 1276 u32 event_index;
1279 u32 event_cycle; 1277 u32 event_cycle;
1280 1278
1281 dev_dbg(scic_to_dev(this_controller), 1279 dev_dbg(scic_to_dev(scic),
1282 "%s: completion queue begining get:0x%08x\n", 1280 "%s: completion queue begining get:0x%08x\n",
1283 __func__, 1281 __func__,
1284 this_controller->completion_queue_get); 1282 scic->completion_queue_get);
1285 1283
1286 /* Get the component parts of the completion queue */ 1284 /* Get the component parts of the completion queue */
1287 get_index = NORMALIZE_GET_POINTER(this_controller->completion_queue_get); 1285 get_index = NORMALIZE_GET_POINTER(scic->completion_queue_get);
1288 get_cycle = SMU_CQGR_CYCLE_BIT & this_controller->completion_queue_get; 1286 get_cycle = SMU_CQGR_CYCLE_BIT & scic->completion_queue_get;
1289 1287
1290 event_index = NORMALIZE_EVENT_POINTER(this_controller->completion_queue_get); 1288 event_index = NORMALIZE_EVENT_POINTER(scic->completion_queue_get);
1291 event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & this_controller->completion_queue_get; 1289 event_cycle = SMU_CQGR_EVENT_CYCLE_BIT & scic->completion_queue_get;
1292 1290
1293 while ( 1291 while (
1294 NORMALIZE_GET_POINTER_CYCLE_BIT(get_cycle) 1292 NORMALIZE_GET_POINTER_CYCLE_BIT(get_cycle)
1295 == COMPLETION_QUEUE_CYCLE_BIT(this_controller->completion_queue[get_index]) 1293 == COMPLETION_QUEUE_CYCLE_BIT(scic->completion_queue[get_index])
1296 ) { 1294 ) {
1297 completion_count++; 1295 completion_count++;
1298 1296
1299 completion_entry = this_controller->completion_queue[get_index]; 1297 completion_entry = scic->completion_queue[get_index];
1300 INCREMENT_COMPLETION_QUEUE_GET(this_controller, get_index, get_cycle); 1298 INCREMENT_COMPLETION_QUEUE_GET(scic, get_index, get_cycle);
1301 1299
1302 dev_dbg(scic_to_dev(this_controller), 1300 dev_dbg(scic_to_dev(scic),
1303 "%s: completion queue entry:0x%08x\n", 1301 "%s: completion queue entry:0x%08x\n",
1304 __func__, 1302 __func__,
1305 completion_entry); 1303 completion_entry);
1306 1304
1307 switch (SCU_GET_COMPLETION_TYPE(completion_entry)) { 1305 switch (SCU_GET_COMPLETION_TYPE(completion_entry)) {
1308 case SCU_COMPLETION_TYPE_TASK: 1306 case SCU_COMPLETION_TYPE_TASK:
1309 scic_sds_controller_task_completion(this_controller, completion_entry); 1307 scic_sds_controller_task_completion(scic, completion_entry);
1310 break; 1308 break;
1311 1309
1312 case SCU_COMPLETION_TYPE_SDMA: 1310 case SCU_COMPLETION_TYPE_SDMA:
1313 scic_sds_controller_sdma_completion(this_controller, completion_entry); 1311 scic_sds_controller_sdma_completion(scic, completion_entry);
1314 break; 1312 break;
1315 1313
1316 case SCU_COMPLETION_TYPE_UFI: 1314 case SCU_COMPLETION_TYPE_UFI:
1317 scic_sds_controller_unsolicited_frame(this_controller, completion_entry); 1315 scic_sds_controller_unsolicited_frame(scic, completion_entry);
1318 break; 1316 break;
1319 1317
1320 case SCU_COMPLETION_TYPE_EVENT: 1318 case SCU_COMPLETION_TYPE_EVENT:
1321 INCREMENT_EVENT_QUEUE_GET(this_controller, event_index, event_cycle); 1319 INCREMENT_EVENT_QUEUE_GET(scic, event_index, event_cycle);
1322 scic_sds_controller_event_completion(this_controller, completion_entry); 1320 scic_sds_controller_event_completion(scic, completion_entry);
1323 break; 1321 break;
1324 1322
1325 case SCU_COMPLETION_TYPE_NOTIFY: 1323 case SCU_COMPLETION_TYPE_NOTIFY:
1326 /* 1324 /*
1327 * Presently we do the same thing with a notify event that we do with the 1325 * Presently we do the same thing with a notify event that we do with the
1328 * other event codes. */ 1326 * other event codes. */
1329 INCREMENT_EVENT_QUEUE_GET(this_controller, event_index, event_cycle); 1327 INCREMENT_EVENT_QUEUE_GET(scic, event_index, event_cycle);
1330 scic_sds_controller_event_completion(this_controller, completion_entry); 1328 scic_sds_controller_event_completion(scic, completion_entry);
1331 break; 1329 break;
1332 1330
1333 default: 1331 default:
1334 dev_warn(scic_to_dev(this_controller), 1332 dev_warn(scic_to_dev(scic),
1335 "%s: SCIC Controller received unknown " 1333 "%s: SCIC Controller received unknown "
1336 "completion type %x\n", 1334 "completion type %x\n",
1337 __func__, 1335 __func__,
@@ -1342,21 +1340,23 @@ static void scic_sds_controller_process_completions(
1342 1340
1343 /* Update the get register if we completed one or more entries */ 1341 /* Update the get register if we completed one or more entries */
1344 if (completion_count > 0) { 1342 if (completion_count > 0) {
1345 this_controller->completion_queue_get = 1343 scic->completion_queue_get =
1346 SMU_CQGR_GEN_BIT(ENABLE) 1344 SMU_CQGR_GEN_BIT(ENABLE) |
1347 | SMU_CQGR_GEN_BIT(EVENT_ENABLE) 1345 SMU_CQGR_GEN_BIT(EVENT_ENABLE) |
1348 | event_cycle | SMU_CQGR_GEN_VAL(EVENT_POINTER, event_index) 1346 event_cycle |
1349 | get_cycle | SMU_CQGR_GEN_VAL(POINTER, get_index); 1347 SMU_CQGR_GEN_VAL(EVENT_POINTER, event_index) |
1348 get_cycle |
1349 SMU_CQGR_GEN_VAL(POINTER, get_index);
1350 1350
1351 writel(this_controller->completion_queue_get, 1351 writel(scic->completion_queue_get,
1352 &this_controller->smu_registers->completion_queue_get); 1352 &scic->smu_registers->completion_queue_get);
1353 1353
1354 } 1354 }
1355 1355
1356 dev_dbg(scic_to_dev(this_controller), 1356 dev_dbg(scic_to_dev(scic),
1357 "%s: completion queue ending get:0x%08x\n", 1357 "%s: completion queue ending get:0x%08x\n",
1358 __func__, 1358 __func__,
1359 this_controller->completion_queue_get); 1359 scic->completion_queue_get);
1360 1360
1361} 1361}
1362 1362
@@ -1540,29 +1540,29 @@ void scic_sds_controller_remote_device_stopped(struct scic_sds_controller *scic,
1540/** 1540/**
1541 * This method will write to the SCU PCP register the request value. The method 1541 * This method will write to the SCU PCP register the request value. The method
1542 * is used to suspend/resume ports, devices, and phys. 1542 * is used to suspend/resume ports, devices, and phys.
1543 * @this_controller: 1543 * @scic:
1544 * 1544 *
1545 * 1545 *
1546 */ 1546 */
1547void scic_sds_controller_post_request( 1547void scic_sds_controller_post_request(
1548 struct scic_sds_controller *this_controller, 1548 struct scic_sds_controller *scic,
1549 u32 request) 1549 u32 request)
1550{ 1550{
1551 dev_dbg(scic_to_dev(this_controller), 1551 dev_dbg(scic_to_dev(scic),
1552 "%s: SCIC Controller 0x%p post request 0x%08x\n", 1552 "%s: SCIC Controller 0x%p post request 0x%08x\n",
1553 __func__, 1553 __func__,
1554 this_controller, 1554 scic,
1555 request); 1555 request);
1556 1556
1557 writel(request, &this_controller->smu_registers->post_context_port); 1557 writel(request, &scic->smu_registers->post_context_port);
1558} 1558}
1559 1559
1560/** 1560/**
1561 * This method will copy the soft copy of the task context into the physical 1561 * This method will copy the soft copy of the task context into the physical
1562 * memory accessible by the controller. 1562 * memory accessible by the controller.
1563 * @this_controller: This parameter specifies the controller for which to copy 1563 * @scic: This parameter specifies the controller for which to copy
1564 * the task context. 1564 * the task context.
1565 * @this_request: This parameter specifies the request for which the task 1565 * @sci_req: This parameter specifies the request for which the task
1566 * context is being copied. 1566 * context is being copied.
1567 * 1567 *
1568 * After this call is made the SCIC_SDS_IO_REQUEST object will always point to 1568 * After this call is made the SCIC_SDS_IO_REQUEST object will always point to
@@ -1571,43 +1571,40 @@ void scic_sds_controller_post_request(
1571 * memory). none 1571 * memory). none
1572 */ 1572 */
1573void scic_sds_controller_copy_task_context( 1573void scic_sds_controller_copy_task_context(
1574 struct scic_sds_controller *this_controller, 1574 struct scic_sds_controller *scic,
1575 struct scic_sds_request *this_request) 1575 struct scic_sds_request *sci_req)
1576{ 1576{
1577 struct scu_task_context *task_context_buffer; 1577 struct scu_task_context *task_context_buffer;
1578 1578
1579 task_context_buffer = scic_sds_controller_get_task_context_buffer( 1579 task_context_buffer = scic_sds_controller_get_task_context_buffer(
1580 this_controller, this_request->io_tag 1580 scic, sci_req->io_tag);
1581 );
1582 1581
1583 memcpy( 1582 memcpy(task_context_buffer,
1584 task_context_buffer, 1583 sci_req->task_context_buffer,
1585 this_request->task_context_buffer, 1584 SCI_FIELD_OFFSET(struct scu_task_context, sgl_snapshot_ac));
1586 SCI_FIELD_OFFSET(struct scu_task_context, sgl_snapshot_ac)
1587 );
1588 1585
1589 /* 1586 /*
1590 * Now that the soft copy of the TC has been copied into the TC 1587 * Now that the soft copy of the TC has been copied into the TC
1591 * table accessible by the silicon. Thus, any further changes to 1588 * table accessible by the silicon. Thus, any further changes to
1592 * the TC (e.g. TC termination) occur in the appropriate location. */ 1589 * the TC (e.g. TC termination) occur in the appropriate location. */
1593 this_request->task_context_buffer = task_context_buffer; 1590 sci_req->task_context_buffer = task_context_buffer;
1594} 1591}
1595 1592
1596/** 1593/**
1597 * This method returns the task context buffer for the given io tag. 1594 * This method returns the task context buffer for the given io tag.
1598 * @this_controller: 1595 * @scic:
1599 * @io_tag: 1596 * @io_tag:
1600 * 1597 *
1601 * struct scu_task_context* 1598 * struct scu_task_context*
1602 */ 1599 */
1603struct scu_task_context *scic_sds_controller_get_task_context_buffer( 1600struct scu_task_context *scic_sds_controller_get_task_context_buffer(
1604 struct scic_sds_controller *this_controller, 1601 struct scic_sds_controller *scic,
1605 u16 io_tag 1602 u16 io_tag
1606 ) { 1603 ) {
1607 u16 task_index = scic_sds_io_tag_get_index(io_tag); 1604 u16 task_index = scic_sds_io_tag_get_index(io_tag);
1608 1605
1609 if (task_index < this_controller->task_context_entries) { 1606 if (task_index < scic->task_context_entries) {
1610 return &this_controller->task_context_table[task_index]; 1607 return &scic->task_context_table[task_index];
1611 } 1608 }
1612 1609
1613 return NULL; 1610 return NULL;
@@ -1615,7 +1612,7 @@ struct scu_task_context *scic_sds_controller_get_task_context_buffer(
1615 1612
1616/** 1613/**
1617 * This method returnst the sequence value from the io tag value 1614 * This method returnst the sequence value from the io tag value
1618 * @this_controller: 1615 * @scic:
1619 * @io_tag: 1616 * @io_tag:
1620 * 1617 *
1621 * u16 1618 * u16
@@ -1623,13 +1620,13 @@ struct scu_task_context *scic_sds_controller_get_task_context_buffer(
1623 1620
1624/** 1621/**
1625 * This method returns the IO request associated with the tag value 1622 * This method returns the IO request associated with the tag value
1626 * @this_controller: 1623 * @scic:
1627 * @io_tag: 1624 * @io_tag:
1628 * 1625 *
1629 * SCIC_SDS_IO_REQUEST_T* NULL if there is no valid IO request at the tag value 1626 * SCIC_SDS_IO_REQUEST_T* NULL if there is no valid IO request at the tag value
1630 */ 1627 */
1631struct scic_sds_request *scic_sds_controller_get_io_request_from_tag( 1628struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
1632 struct scic_sds_controller *this_controller, 1629 struct scic_sds_controller *scic,
1633 u16 io_tag 1630 u16 io_tag
1634 ) { 1631 ) {
1635 u16 task_index; 1632 u16 task_index;
@@ -1637,12 +1634,12 @@ struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
1637 1634
1638 task_index = scic_sds_io_tag_get_index(io_tag); 1635 task_index = scic_sds_io_tag_get_index(io_tag);
1639 1636
1640 if (task_index < this_controller->task_context_entries) { 1637 if (task_index < scic->task_context_entries) {
1641 if (this_controller->io_request_table[task_index] != NULL) { 1638 if (scic->io_request_table[task_index] != NULL) {
1642 task_sequence = scic_sds_io_tag_get_sequence(io_tag); 1639 task_sequence = scic_sds_io_tag_get_sequence(io_tag);
1643 1640
1644 if (task_sequence == this_controller->io_request_sequence[task_index]) { 1641 if (task_sequence == scic->io_request_sequence[task_index]) {
1645 return this_controller->io_request_table[task_index]; 1642 return scic->io_request_table[task_index];
1646 } 1643 }
1647 } 1644 }
1648 } 1645 }
@@ -1654,9 +1651,9 @@ struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
1654 * This method allocates remote node index and the reserves the remote node 1651 * This method allocates remote node index and the reserves the remote node
1655 * context space for use. This method can fail if there are no more remote 1652 * context space for use. This method can fail if there are no more remote
1656 * node index available. 1653 * node index available.
1657 * @this_controller: This is the controller object which contains the set of 1654 * @scic: This is the controller object which contains the set of
1658 * free remote node ids 1655 * free remote node ids
1659 * @the_devce: This is the device object which is requesting the a remote node 1656 * @sci_dev: This is the device object which is requesting the a remote node
1660 * id 1657 * id
1661 * @node_id: This is the remote node id that is assinged to the device if one 1658 * @node_id: This is the remote node id that is assinged to the device if one
1662 * is available 1659 * is available
@@ -1665,19 +1662,19 @@ struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
1665 * node index available. 1662 * node index available.
1666 */ 1663 */
1667enum sci_status scic_sds_controller_allocate_remote_node_context( 1664enum sci_status scic_sds_controller_allocate_remote_node_context(
1668 struct scic_sds_controller *this_controller, 1665 struct scic_sds_controller *scic,
1669 struct scic_sds_remote_device *the_device, 1666 struct scic_sds_remote_device *sci_dev,
1670 u16 *node_id) 1667 u16 *node_id)
1671{ 1668{
1672 u16 node_index; 1669 u16 node_index;
1673 u32 remote_node_count = scic_sds_remote_device_node_count(the_device); 1670 u32 remote_node_count = scic_sds_remote_device_node_count(sci_dev);
1674 1671
1675 node_index = scic_sds_remote_node_table_allocate_remote_node( 1672 node_index = scic_sds_remote_node_table_allocate_remote_node(
1676 &this_controller->available_remote_nodes, remote_node_count 1673 &scic->available_remote_nodes, remote_node_count
1677 ); 1674 );
1678 1675
1679 if (node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { 1676 if (node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
1680 this_controller->device_table[node_index] = the_device; 1677 scic->device_table[node_index] = sci_dev;
1681 1678
1682 *node_id = node_index; 1679 *node_id = node_index;
1683 1680
@@ -1691,23 +1688,23 @@ enum sci_status scic_sds_controller_allocate_remote_node_context(
1691 * This method frees the remote node index back to the available pool. Once 1688 * This method frees the remote node index back to the available pool. Once
1692 * this is done the remote node context buffer is no longer valid and can 1689 * this is done the remote node context buffer is no longer valid and can
1693 * not be used. 1690 * not be used.
1694 * @this_controller: 1691 * @scic:
1695 * @the_device: 1692 * @sci_dev:
1696 * @node_id: 1693 * @node_id:
1697 * 1694 *
1698 */ 1695 */
1699void scic_sds_controller_free_remote_node_context( 1696void scic_sds_controller_free_remote_node_context(
1700 struct scic_sds_controller *this_controller, 1697 struct scic_sds_controller *scic,
1701 struct scic_sds_remote_device *the_device, 1698 struct scic_sds_remote_device *sci_dev,
1702 u16 node_id) 1699 u16 node_id)
1703{ 1700{
1704 u32 remote_node_count = scic_sds_remote_device_node_count(the_device); 1701 u32 remote_node_count = scic_sds_remote_device_node_count(sci_dev);
1705 1702
1706 if (this_controller->device_table[node_id] == the_device) { 1703 if (scic->device_table[node_id] == sci_dev) {
1707 this_controller->device_table[node_id] = NULL; 1704 scic->device_table[node_id] = NULL;
1708 1705
1709 scic_sds_remote_node_table_release_remote_node_index( 1706 scic_sds_remote_node_table_release_remote_node_index(
1710 &this_controller->available_remote_nodes, remote_node_count, node_id 1707 &scic->available_remote_nodes, remote_node_count, node_id
1711 ); 1708 );
1712 } 1709 }
1713} 1710}
@@ -1715,20 +1712,20 @@ void scic_sds_controller_free_remote_node_context(
1715/** 1712/**
1716 * This method returns the union scu_remote_node_context for the specified remote 1713 * This method returns the union scu_remote_node_context for the specified remote
1717 * node id. 1714 * node id.
1718 * @this_controller: 1715 * @scic:
1719 * @node_id: 1716 * @node_id:
1720 * 1717 *
1721 * union scu_remote_node_context* 1718 * union scu_remote_node_context*
1722 */ 1719 */
1723union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer( 1720union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
1724 struct scic_sds_controller *this_controller, 1721 struct scic_sds_controller *scic,
1725 u16 node_id 1722 u16 node_id
1726 ) { 1723 ) {
1727 if ( 1724 if (
1728 (node_id < this_controller->remote_node_entries) 1725 (node_id < scic->remote_node_entries)
1729 && (this_controller->device_table[node_id] != NULL) 1726 && (scic->device_table[node_id] != NULL)
1730 ) { 1727 ) {
1731 return &this_controller->remote_node_context_table[node_id]; 1728 return &scic->remote_node_context_table[node_id];
1732 } 1729 }
1733 1730
1734 return NULL; 1731 return NULL;
@@ -1767,18 +1764,18 @@ void scic_sds_controller_copy_sata_response(
1767 * re-use by the hardware. The data contained in the frame header and frame 1764 * re-use by the hardware. The data contained in the frame header and frame
1768 * buffer is no longer valid. The UF queue get pointer is only updated if UF 1765 * buffer is no longer valid. The UF queue get pointer is only updated if UF
1769 * control indicates this is appropriate. 1766 * control indicates this is appropriate.
1770 * @this_controller: 1767 * @scic:
1771 * @frame_index: 1768 * @frame_index:
1772 * 1769 *
1773 */ 1770 */
1774void scic_sds_controller_release_frame( 1771void scic_sds_controller_release_frame(
1775 struct scic_sds_controller *this_controller, 1772 struct scic_sds_controller *scic,
1776 u32 frame_index) 1773 u32 frame_index)
1777{ 1774{
1778 if (scic_sds_unsolicited_frame_control_release_frame( 1775 if (scic_sds_unsolicited_frame_control_release_frame(
1779 &this_controller->uf_control, frame_index) == true) 1776 &scic->uf_control, frame_index) == true)
1780 writel(this_controller->uf_control.get, 1777 writel(scic->uf_control.get,
1781 &this_controller->scu_registers->sdma.unsolicited_frame_get_pointer); 1778 &scic->scu_registers->sdma.unsolicited_frame_get_pointer);
1782} 1779}
1783 1780
1784/** 1781/**
@@ -2888,11 +2885,11 @@ enum sci_status scic_controller_start(struct scic_sds_controller *scic,
2888static void scic_sds_controller_initial_state_enter( 2885static void scic_sds_controller_initial_state_enter(
2889 struct sci_base_object *object) 2886 struct sci_base_object *object)
2890{ 2887{
2891 struct scic_sds_controller *this_controller; 2888 struct scic_sds_controller *scic;
2892 2889
2893 this_controller = (struct scic_sds_controller *)object; 2890 scic = (struct scic_sds_controller *)object;
2894 2891
2895 sci_base_state_machine_change_state(&this_controller->state_machine, 2892 sci_base_state_machine_change_state(&scic->state_machine,
2896 SCI_BASE_CONTROLLER_STATE_RESET); 2893 SCI_BASE_CONTROLLER_STATE_RESET);
2897} 2894}
2898 2895
@@ -2925,13 +2922,13 @@ static inline void scic_sds_controller_starting_state_exit(
2925static void scic_sds_controller_ready_state_enter( 2922static void scic_sds_controller_ready_state_enter(
2926 struct sci_base_object *object) 2923 struct sci_base_object *object)
2927{ 2924{
2928 struct scic_sds_controller *this_controller; 2925 struct scic_sds_controller *scic;
2929 2926
2930 this_controller = (struct scic_sds_controller *)object; 2927 scic = (struct scic_sds_controller *)object;
2931 2928
2932 /* set the default interrupt coalescence number and timeout value. */ 2929 /* set the default interrupt coalescence number and timeout value. */
2933 scic_controller_set_interrupt_coalescence( 2930 scic_controller_set_interrupt_coalescence(
2934 this_controller, 0x10, 250); 2931 scic, 0x10, 250);
2935} 2932}
2936 2933
2937/** 2934/**
@@ -2945,12 +2942,12 @@ static void scic_sds_controller_ready_state_enter(
2945static void scic_sds_controller_ready_state_exit( 2942static void scic_sds_controller_ready_state_exit(
2946 struct sci_base_object *object) 2943 struct sci_base_object *object)
2947{ 2944{
2948 struct scic_sds_controller *this_controller; 2945 struct scic_sds_controller *scic;
2949 2946
2950 this_controller = (struct scic_sds_controller *)object; 2947 scic = (struct scic_sds_controller *)object;
2951 2948
2952 /* disable interrupt coalescence. */ 2949 /* disable interrupt coalescence. */
2953 scic_controller_set_interrupt_coalescence(this_controller, 0, 0); 2950 scic_controller_set_interrupt_coalescence(scic, 0, 0);
2954} 2951}
2955 2952
2956/** 2953/**
@@ -2966,14 +2963,14 @@ static void scic_sds_controller_ready_state_exit(
2966static void scic_sds_controller_stopping_state_enter( 2963static void scic_sds_controller_stopping_state_enter(
2967 struct sci_base_object *object) 2964 struct sci_base_object *object)
2968{ 2965{
2969 struct scic_sds_controller *this_controller; 2966 struct scic_sds_controller *scic;
2970 2967
2971 this_controller = (struct scic_sds_controller *)object; 2968 scic = (struct scic_sds_controller *)object;
2972 2969
2973 /* Stop all of the components for this controller */ 2970 /* Stop all of the components for this controller */
2974 scic_sds_controller_stop_phys(this_controller); 2971 scic_sds_controller_stop_phys(scic);
2975 scic_sds_controller_stop_ports(this_controller); 2972 scic_sds_controller_stop_ports(scic);
2976 scic_sds_controller_stop_devices(this_controller); 2973 scic_sds_controller_stop_devices(scic);
2977} 2974}
2978 2975
2979/** 2976/**
diff --git a/drivers/scsi/isci/core/scic_sds_controller.h b/drivers/scsi/isci/core/scic_sds_controller.h
index 9a646e5c7f45..4bb9a43fbe4d 100644
--- a/drivers/scsi/isci/core/scic_sds_controller.h
+++ b/drivers/scsi/isci/core/scic_sds_controller.h
@@ -542,12 +542,12 @@ void scic_sds_controller_copy_sata_response(
542 542
543enum sci_status scic_sds_controller_allocate_remote_node_context( 543enum sci_status scic_sds_controller_allocate_remote_node_context(
544 struct scic_sds_controller *this_controller, 544 struct scic_sds_controller *this_controller,
545 struct scic_sds_remote_device *the_device, 545 struct scic_sds_remote_device *sci_dev,
546 u16 *node_id); 546 u16 *node_id);
547 547
548void scic_sds_controller_free_remote_node_context( 548void scic_sds_controller_free_remote_node_context(
549 struct scic_sds_controller *this_controller, 549 struct scic_sds_controller *this_controller,
550 struct scic_sds_remote_device *the_device, 550 struct scic_sds_remote_device *sci_dev,
551 u16 node_id); 551 u16 node_id);
552 552
553union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer( 553union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
@@ -565,25 +565,25 @@ struct scu_task_context *scic_sds_controller_get_task_context_buffer(
565 565
566void scic_sds_controller_power_control_queue_insert( 566void scic_sds_controller_power_control_queue_insert(
567 struct scic_sds_controller *this_controller, 567 struct scic_sds_controller *this_controller,
568 struct scic_sds_phy *the_phy); 568 struct scic_sds_phy *sci_phy);
569 569
570void scic_sds_controller_power_control_queue_remove( 570void scic_sds_controller_power_control_queue_remove(
571 struct scic_sds_controller *this_controller, 571 struct scic_sds_controller *this_controller,
572 struct scic_sds_phy *the_phy); 572 struct scic_sds_phy *sci_phy);
573 573
574void scic_sds_controller_link_up( 574void scic_sds_controller_link_up(
575 struct scic_sds_controller *this_controller, 575 struct scic_sds_controller *this_controller,
576 struct scic_sds_port *the_port, 576 struct scic_sds_port *sci_port,
577 struct scic_sds_phy *the_phy); 577 struct scic_sds_phy *sci_phy);
578 578
579void scic_sds_controller_link_down( 579void scic_sds_controller_link_down(
580 struct scic_sds_controller *this_controller, 580 struct scic_sds_controller *this_controller,
581 struct scic_sds_port *the_port, 581 struct scic_sds_port *sci_port,
582 struct scic_sds_phy *the_phy); 582 struct scic_sds_phy *sci_phy);
583 583
584void scic_sds_controller_remote_device_stopped( 584void scic_sds_controller_remote_device_stopped(
585 struct scic_sds_controller *this_controller, 585 struct scic_sds_controller *this_controller,
586 struct scic_sds_remote_device *the_device); 586 struct scic_sds_remote_device *sci_dev);
587 587
588void scic_sds_controller_copy_task_context( 588void scic_sds_controller_copy_task_context(
589 struct scic_sds_controller *this_controller, 589 struct scic_sds_controller *this_controller,
diff --git a/drivers/scsi/isci/core/scic_sds_phy.c b/drivers/scsi/isci/core/scic_sds_phy.c
index 40176f0729c1..34bd3b25ccf6 100644
--- a/drivers/scsi/isci/core/scic_sds_phy.c
+++ b/drivers/scsi/isci/core/scic_sds_phy.c
@@ -84,26 +84,29 @@ enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy)
84 84
85/** 85/**
86 * This method will initialize the phy transport layer registers 86 * This method will initialize the phy transport layer registers
87 * @this_phy: 87 * @sci_phy:
88 * @transport_layer_registers 88 * @transport_layer_registers
89 * 89 *
90 * enum sci_status 90 * enum sci_status
91 */ 91 */
92static enum sci_status scic_sds_phy_transport_layer_initialization( 92static enum sci_status scic_sds_phy_transport_layer_initialization(
93 struct scic_sds_phy *this_phy, 93 struct scic_sds_phy *sci_phy,
94 struct scu_transport_layer_registers __iomem *transport_layer_registers) 94 struct scu_transport_layer_registers __iomem *transport_layer_registers)
95{ 95{
96 u32 tl_control; 96 u32 tl_control;
97 97
98 this_phy->transport_layer_registers = transport_layer_registers; 98 sci_phy->transport_layer_registers = transport_layer_registers;
99 99
100 writel(SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX, 100 writel(SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX,
101 &this_phy->transport_layer_registers->stp_rni); 101 &sci_phy->transport_layer_registers->stp_rni);
102 102
103 /* Hardware team recommends that we enable the STP prefetch for all transports */ 103 /*
104 tl_control = readl(&this_phy->transport_layer_registers->control); 104 * Hardware team recommends that we enable the STP prefetch for all
105 * transports
106 */
107 tl_control = readl(&sci_phy->transport_layer_registers->control);
105 tl_control |= SCU_TLCR_GEN_BIT(STP_WRITE_DATA_PREFETCH); 108 tl_control |= SCU_TLCR_GEN_BIT(STP_WRITE_DATA_PREFETCH);
106 writel(tl_control, &this_phy->transport_layer_registers->control); 109 writel(tl_control, &sci_phy->transport_layer_registers->control);
107 110
108 return SCI_SUCCESS; 111 return SCI_SUCCESS;
109} 112}
@@ -284,7 +287,7 @@ static void scic_sds_phy_sata_timeout(void *phy)
284 * This method returns the port currently containing this phy. If the phy is 287 * This method returns the port currently containing this phy. If the phy is
285 * currently contained by the dummy port, then the phy is considered to not 288 * currently contained by the dummy port, then the phy is considered to not
286 * be part of a port. 289 * be part of a port.
287 * @this_phy: This parameter specifies the phy for which to retrieve the 290 * @sci_phy: This parameter specifies the phy for which to retrieve the
288 * containing port. 291 * containing port.
289 * 292 *
290 * This method returns a handle to a port that contains the supplied phy. 293 * This method returns a handle to a port that contains the supplied phy.
@@ -293,30 +296,30 @@ static void scic_sds_phy_sata_timeout(void *phy)
293 * values indicate a handle/pointer to the port containing the phy. 296 * values indicate a handle/pointer to the port containing the phy.
294 */ 297 */
295struct scic_sds_port *scic_sds_phy_get_port( 298struct scic_sds_port *scic_sds_phy_get_port(
296 struct scic_sds_phy *this_phy) 299 struct scic_sds_phy *sci_phy)
297{ 300{
298 if (scic_sds_port_get_index(this_phy->owning_port) == SCIC_SDS_DUMMY_PORT) 301 if (scic_sds_port_get_index(sci_phy->owning_port) == SCIC_SDS_DUMMY_PORT)
299 return NULL; 302 return NULL;
300 303
301 return this_phy->owning_port; 304 return sci_phy->owning_port;
302} 305}
303 306
304/** 307/**
305 * This method will assign a port to the phy object. 308 * This method will assign a port to the phy object.
306 * @out]: this_phy This parameter specifies the phy for which to assign a port 309 * @out]: sci_phy This parameter specifies the phy for which to assign a port
307 * object. 310 * object.
308 * 311 *
309 * 312 *
310 */ 313 */
311void scic_sds_phy_set_port( 314void scic_sds_phy_set_port(
312 struct scic_sds_phy *this_phy, 315 struct scic_sds_phy *sci_phy,
313 struct scic_sds_port *the_port) 316 struct scic_sds_port *sci_port)
314{ 317{
315 this_phy->owning_port = the_port; 318 sci_phy->owning_port = sci_port;
316 319
317 if (this_phy->bcn_received_while_port_unassigned) { 320 if (sci_phy->bcn_received_while_port_unassigned) {
318 this_phy->bcn_received_while_port_unassigned = false; 321 sci_phy->bcn_received_while_port_unassigned = false;
319 scic_sds_port_broadcast_change_received(this_phy->owning_port, this_phy); 322 scic_sds_port_broadcast_change_received(sci_phy->owning_port, sci_phy);
320 } 323 }
321} 324}
322 325
@@ -362,123 +365,125 @@ enum sci_status scic_sds_phy_initialize(
362/** 365/**
363 * This method assigns the direct attached device ID for this phy. 366 * This method assigns the direct attached device ID for this phy.
364 * 367 *
365 * @this_phy The phy for which the direct attached device id is to 368 * @sci_phy The phy for which the direct attached device id is to
366 * be assigned. 369 * be assigned.
367 * @device_id The direct attached device ID to assign to the phy. 370 * @device_id The direct attached device ID to assign to the phy.
368 * This will either be the RNi for the device or an invalid RNi if there 371 * This will either be the RNi for the device or an invalid RNi if there
369 * is no current device assigned to the phy. 372 * is no current device assigned to the phy.
370 */ 373 */
371void scic_sds_phy_setup_transport( 374void scic_sds_phy_setup_transport(
372 struct scic_sds_phy *this_phy, 375 struct scic_sds_phy *sci_phy,
373 u32 device_id) 376 u32 device_id)
374{ 377{
375 u32 tl_control; 378 u32 tl_control;
376 379
377 writel(device_id, &this_phy->transport_layer_registers->stp_rni); 380 writel(device_id, &sci_phy->transport_layer_registers->stp_rni);
378 381
379 /* 382 /*
380 * The read should guarantee that the first write gets posted 383 * The read should guarantee that the first write gets posted
381 * before the next write 384 * before the next write
382 */ 385 */
383 tl_control = readl(&this_phy->transport_layer_registers->control); 386 tl_control = readl(&sci_phy->transport_layer_registers->control);
384 tl_control |= SCU_TLCR_GEN_BIT(CLEAR_TCI_NCQ_MAPPING_TABLE); 387 tl_control |= SCU_TLCR_GEN_BIT(CLEAR_TCI_NCQ_MAPPING_TABLE);
385 writel(tl_control, &this_phy->transport_layer_registers->control); 388 writel(tl_control, &sci_phy->transport_layer_registers->control);
386} 389}
387 390
388/** 391/**
389 * 392 *
390 * @this_phy: The phy object to be suspended. 393 * @sci_phy: The phy object to be suspended.
391 * 394 *
392 * This function will perform the register reads/writes to suspend the SCU 395 * This function will perform the register reads/writes to suspend the SCU
393 * hardware protocol engine. none 396 * hardware protocol engine. none
394 */ 397 */
395static void scic_sds_phy_suspend( 398static void scic_sds_phy_suspend(
396 struct scic_sds_phy *this_phy) 399 struct scic_sds_phy *sci_phy)
397{ 400{
398 u32 scu_sas_pcfg_value; 401 u32 scu_sas_pcfg_value;
399 402
400 scu_sas_pcfg_value = 403 scu_sas_pcfg_value =
401 readl(&this_phy->link_layer_registers->phy_configuration); 404 readl(&sci_phy->link_layer_registers->phy_configuration);
402 scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE); 405 scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE);
403 writel(scu_sas_pcfg_value, 406 writel(scu_sas_pcfg_value,
404 &this_phy->link_layer_registers->phy_configuration); 407 &sci_phy->link_layer_registers->phy_configuration);
405 408
406 scic_sds_phy_setup_transport(this_phy, SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX); 409 scic_sds_phy_setup_transport(
410 sci_phy,
411 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX);
407} 412}
408 413
409/** 414/**
410 * 415 *
411 * @this_phy: The phy object to resume. 416 * @sci_phy: The phy object to resume.
412 * 417 *
413 * This function will perform the register reads/writes required to resume the 418 * This function will perform the register reads/writes required to resume the
414 * SCU hardware protocol engine. none 419 * SCU hardware protocol engine. none
415 */ 420 */
416void scic_sds_phy_resume( 421void scic_sds_phy_resume(
417 struct scic_sds_phy *this_phy) 422 struct scic_sds_phy *sci_phy)
418{ 423{
419 u32 scu_sas_pcfg_value; 424 u32 scu_sas_pcfg_value;
420 425
421 scu_sas_pcfg_value = 426 scu_sas_pcfg_value =
422 readl(&this_phy->link_layer_registers->phy_configuration); 427 readl(&sci_phy->link_layer_registers->phy_configuration);
423 scu_sas_pcfg_value &= ~SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE); 428 scu_sas_pcfg_value &= ~SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE);
424 writel(scu_sas_pcfg_value, 429 writel(scu_sas_pcfg_value,
425 &this_phy->link_layer_registers->phy_configuration); 430 &sci_phy->link_layer_registers->phy_configuration);
426} 431}
427 432
428/** 433/**
429 * This method returns the local sas address assigned to this phy. 434 * This method returns the local sas address assigned to this phy.
430 * @this_phy: This parameter specifies the phy for which to retrieve the local 435 * @sci_phy: This parameter specifies the phy for which to retrieve the local
431 * SAS address. 436 * SAS address.
432 * @sas_address: This parameter specifies the location into which to copy the 437 * @sas_address: This parameter specifies the location into which to copy the
433 * local SAS address. 438 * local SAS address.
434 * 439 *
435 */ 440 */
436void scic_sds_phy_get_sas_address( 441void scic_sds_phy_get_sas_address(
437 struct scic_sds_phy *this_phy, 442 struct scic_sds_phy *sci_phy,
438 struct sci_sas_address *sas_address) 443 struct sci_sas_address *sas_address)
439{ 444{
440 sas_address->high = readl(&this_phy->link_layer_registers->source_sas_address_high); 445 sas_address->high = readl(&sci_phy->link_layer_registers->source_sas_address_high);
441 sas_address->low = readl(&this_phy->link_layer_registers->source_sas_address_low); 446 sas_address->low = readl(&sci_phy->link_layer_registers->source_sas_address_low);
442} 447}
443 448
444/** 449/**
445 * This method returns the remote end-point (i.e. attached) sas address 450 * This method returns the remote end-point (i.e. attached) sas address
446 * assigned to this phy. 451 * assigned to this phy.
447 * @this_phy: This parameter specifies the phy for which to retrieve the remote 452 * @sci_phy: This parameter specifies the phy for which to retrieve the remote
448 * end-point SAS address. 453 * end-point SAS address.
449 * @sas_address: This parameter specifies the location into which to copy the 454 * @sas_address: This parameter specifies the location into which to copy the
450 * remote end-point SAS address. 455 * remote end-point SAS address.
451 * 456 *
452 */ 457 */
453void scic_sds_phy_get_attached_sas_address( 458void scic_sds_phy_get_attached_sas_address(
454 struct scic_sds_phy *this_phy, 459 struct scic_sds_phy *sci_phy,
455 struct sci_sas_address *sas_address) 460 struct sci_sas_address *sas_address)
456{ 461{
457 sas_address->high 462 sas_address->high
458 = this_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high; 463 = sci_phy->phy_type.sas.identify_address_frame_buffer.sas_address.high;
459 sas_address->low 464 sas_address->low
460 = this_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low; 465 = sci_phy->phy_type.sas.identify_address_frame_buffer.sas_address.low;
461} 466}
462 467
463/** 468/**
464 * This method returns the supported protocols assigned to this phy 469 * This method returns the supported protocols assigned to this phy
465 * @this_phy: 470 * @sci_phy:
466 * 471 *
467 * 472 *
468 */ 473 */
469void scic_sds_phy_get_protocols( 474void scic_sds_phy_get_protocols(
470 struct scic_sds_phy *this_phy, 475 struct scic_sds_phy *sci_phy,
471 struct sci_sas_identify_address_frame_protocols *protocols) 476 struct sci_sas_identify_address_frame_protocols *protocols)
472{ 477{
473 protocols->u.all = 478 protocols->u.all =
474 (u16)(readl(&this_phy-> 479 (u16)(readl(&sci_phy->
475 link_layer_registers->transmit_identification) & 480 link_layer_registers->transmit_identification) &
476 0x0000FFFF); 481 0x0000FFFF);
477} 482}
478 483
479/** 484/**
480 * 485 *
481 * @this_phy: The parameter is the phy object for which the attached phy 486 * @sci_phy: The parameter is the phy object for which the attached phy
482 * protcols are to be returned. 487 * protcols are to be returned.
483 * 488 *
484 * This method returns the supported protocols for the attached phy. If this 489 * This method returns the supported protocols for the attached phy. If this
@@ -488,15 +493,15 @@ void scic_sds_phy_get_protocols(
488 * value. 493 * value.
489 */ 494 */
490void scic_sds_phy_get_attached_phy_protocols( 495void scic_sds_phy_get_attached_phy_protocols(
491 struct scic_sds_phy *this_phy, 496 struct scic_sds_phy *sci_phy,
492 struct sci_sas_identify_address_frame_protocols *protocols) 497 struct sci_sas_identify_address_frame_protocols *protocols)
493{ 498{
494 protocols->u.all = 0; 499 protocols->u.all = 0;
495 500
496 if (this_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { 501 if (sci_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) {
497 protocols->u.all = 502 protocols->u.all =
498 this_phy->phy_type.sas.identify_address_frame_buffer.protocols.u.all; 503 sci_phy->phy_type.sas.identify_address_frame_buffer.protocols.u.all;
499 } else if (this_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) { 504 } else if (sci_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) {
500 protocols->u.bits.stp_target = 1; 505 protocols->u.bits.stp_target = 1;
501 } 506 }
502} 507}
@@ -533,54 +538,54 @@ enum sci_status scic_sds_phy_stop(struct scic_sds_phy *sci_phy)
533/** 538/**
534 * This method will attempt to reset the phy. This request is only valid when 539 * This method will attempt to reset the phy. This request is only valid when
535 * the phy is in an ready state 540 * the phy is in an ready state
536 * @this_phy: 541 * @sci_phy:
537 * 542 *
538 * enum sci_status 543 * enum sci_status
539 */ 544 */
540enum sci_status scic_sds_phy_reset( 545enum sci_status scic_sds_phy_reset(
541 struct scic_sds_phy *this_phy) 546 struct scic_sds_phy *sci_phy)
542{ 547{
543 return this_phy->state_handlers->reset_handler(this_phy); 548 return sci_phy->state_handlers->reset_handler(sci_phy);
544} 549}
545 550
546/** 551/**
547 * This method will process the event code received. 552 * This method will process the event code received.
548 * @this_phy: 553 * @sci_phy:
549 * @event_code: 554 * @event_code:
550 * 555 *
551 * enum sci_status 556 * enum sci_status
552 */ 557 */
553enum sci_status scic_sds_phy_event_handler( 558enum sci_status scic_sds_phy_event_handler(
554 struct scic_sds_phy *this_phy, 559 struct scic_sds_phy *sci_phy,
555 u32 event_code) 560 u32 event_code)
556{ 561{
557 return this_phy->state_handlers->event_handler(this_phy, event_code); 562 return sci_phy->state_handlers->event_handler(sci_phy, event_code);
558} 563}
559 564
560/** 565/**
561 * This method will process the frame index received. 566 * This method will process the frame index received.
562 * @this_phy: 567 * @sci_phy:
563 * @frame_index: 568 * @frame_index:
564 * 569 *
565 * enum sci_status 570 * enum sci_status
566 */ 571 */
567enum sci_status scic_sds_phy_frame_handler( 572enum sci_status scic_sds_phy_frame_handler(
568 struct scic_sds_phy *this_phy, 573 struct scic_sds_phy *sci_phy,
569 u32 frame_index) 574 u32 frame_index)
570{ 575{
571 return this_phy->state_handlers->frame_handler(this_phy, frame_index); 576 return sci_phy->state_handlers->frame_handler(sci_phy, frame_index);
572} 577}
573 578
574/** 579/**
575 * This method will give the phy permission to consume power 580 * This method will give the phy permission to consume power
576 * @this_phy: 581 * @sci_phy:
577 * 582 *
578 * enum sci_status 583 * enum sci_status
579 */ 584 */
580enum sci_status scic_sds_phy_consume_power_handler( 585enum sci_status scic_sds_phy_consume_power_handler(
581 struct scic_sds_phy *this_phy) 586 struct scic_sds_phy *sci_phy)
582{ 587{
583 return this_phy->state_handlers->consume_power_handler(this_phy); 588 return sci_phy->state_handlers->consume_power_handler(sci_phy);
584} 589}
585 590
586/* 591/*
@@ -638,7 +643,7 @@ enum sci_status scic_sata_phy_get_properties(
638 643
639/** 644/**
640 * 645 *
641 * @this_phy: The phy object that received SAS PHY DETECTED. 646 * @sci_phy: The phy object that received SAS PHY DETECTED.
642 * 647 *
643 * This method continues the link training for the phy as if it were a SAS PHY 648 * This method continues the link training for the phy as if it were a SAS PHY
644 * instead of a SATA PHY. This is done because the completion queue had a SAS 649 * instead of a SATA PHY. This is done because the completion queue had a SAS
@@ -646,41 +651,41 @@ enum sci_status scic_sata_phy_get_properties(
646 * none 651 * none
647 */ 652 */
648static void scic_sds_phy_start_sas_link_training( 653static void scic_sds_phy_start_sas_link_training(
649 struct scic_sds_phy *this_phy) 654 struct scic_sds_phy *sci_phy)
650{ 655{
651 u32 phy_control; 656 u32 phy_control;
652 657
653 phy_control = 658 phy_control =
654 readl(&this_phy->link_layer_registers->phy_configuration); 659 readl(&sci_phy->link_layer_registers->phy_configuration);
655 phy_control |= SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD); 660 phy_control |= SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD);
656 writel(phy_control, 661 writel(phy_control,
657 &this_phy->link_layer_registers->phy_configuration); 662 &sci_phy->link_layer_registers->phy_configuration);
658 663
659 sci_base_state_machine_change_state( 664 sci_base_state_machine_change_state(
660 &this_phy->starting_substate_machine, 665 &sci_phy->starting_substate_machine,
661 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_SPEED_EN 666 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_SPEED_EN
662 ); 667 );
663 668
664 this_phy->protocol = SCIC_SDS_PHY_PROTOCOL_SAS; 669 sci_phy->protocol = SCIC_SDS_PHY_PROTOCOL_SAS;
665} 670}
666 671
667/** 672/**
668 * 673 *
669 * @this_phy: The phy object that received a SATA SPINUP HOLD event 674 * @sci_phy: The phy object that received a SATA SPINUP HOLD event
670 * 675 *
671 * This method continues the link training for the phy as if it were a SATA PHY 676 * This method continues the link training for the phy as if it were a SATA PHY
672 * instead of a SAS PHY. This is done because the completion queue had a SATA 677 * instead of a SAS PHY. This is done because the completion queue had a SATA
673 * SPINUP HOLD event when the state machine was expecting a SAS PHY event. none 678 * SPINUP HOLD event when the state machine was expecting a SAS PHY event. none
674 */ 679 */
675static void scic_sds_phy_start_sata_link_training( 680static void scic_sds_phy_start_sata_link_training(
676 struct scic_sds_phy *this_phy) 681 struct scic_sds_phy *sci_phy)
677{ 682{
678 sci_base_state_machine_change_state( 683 sci_base_state_machine_change_state(
679 &this_phy->starting_substate_machine, 684 &sci_phy->starting_substate_machine,
680 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_POWER 685 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_POWER
681 ); 686 );
682 687
683 this_phy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA; 688 sci_phy->protocol = SCIC_SDS_PHY_PROTOCOL_SATA;
684} 689}
685 690
686/** 691/**
@@ -748,24 +753,24 @@ static enum sci_status scic_sds_phy_starting_substate_general_stop_handler(
748 * SCI_FAILURE on any unexpected event notifation 753 * SCI_FAILURE on any unexpected event notifation
749 */ 754 */
750static enum sci_status scic_sds_phy_starting_substate_await_ossp_event_handler( 755static enum sci_status scic_sds_phy_starting_substate_await_ossp_event_handler(
751 struct scic_sds_phy *this_phy, 756 struct scic_sds_phy *sci_phy,
752 u32 event_code) 757 u32 event_code)
753{ 758{
754 u32 result = SCI_SUCCESS; 759 u32 result = SCI_SUCCESS;
755 760
756 switch (scu_get_event_code(event_code)) { 761 switch (scu_get_event_code(event_code)) {
757 case SCU_EVENT_SAS_PHY_DETECTED: 762 case SCU_EVENT_SAS_PHY_DETECTED:
758 scic_sds_phy_start_sas_link_training(this_phy); 763 scic_sds_phy_start_sas_link_training(sci_phy);
759 this_phy->is_in_link_training = true; 764 sci_phy->is_in_link_training = true;
760 break; 765 break;
761 766
762 case SCU_EVENT_SATA_SPINUP_HOLD: 767 case SCU_EVENT_SATA_SPINUP_HOLD:
763 scic_sds_phy_start_sata_link_training(this_phy); 768 scic_sds_phy_start_sata_link_training(sci_phy);
764 this_phy->is_in_link_training = true; 769 sci_phy->is_in_link_training = true;
765 break; 770 break;
766 771
767 default: 772 default:
768 dev_dbg(sciphy_to_dev(this_phy), 773 dev_dbg(sciphy_to_dev(sci_phy),
769 "%s: PHY starting substate machine received " 774 "%s: PHY starting substate machine received "
770 "unexpected event_code %x\n", 775 "unexpected event_code %x\n",
771 __func__, 776 __func__,
@@ -793,7 +798,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_ossp_event_handler(
793 * event notification SCI_FAILURE on any unexpected event notifation 798 * event notification SCI_FAILURE on any unexpected event notifation
794 */ 799 */
795static enum sci_status scic_sds_phy_starting_substate_await_sas_phy_speed_event_handler( 800static enum sci_status scic_sds_phy_starting_substate_await_sas_phy_speed_event_handler(
796 struct scic_sds_phy *this_phy, 801 struct scic_sds_phy *sci_phy,
797 u32 event_code) 802 u32 event_code)
798{ 803{
799 u32 result = SCI_SUCCESS; 804 u32 result = SCI_SUCCESS;
@@ -808,38 +813,41 @@ static enum sci_status scic_sds_phy_starting_substate_await_sas_phy_speed_event_
808 case SCU_EVENT_SAS_15: 813 case SCU_EVENT_SAS_15:
809 case SCU_EVENT_SAS_15_SSC: 814 case SCU_EVENT_SAS_15_SSC:
810 scic_sds_phy_complete_link_training( 815 scic_sds_phy_complete_link_training(
811 this_phy, SAS_LINK_RATE_1_5_GBPS, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF 816 sci_phy,
812 ); 817 SAS_LINK_RATE_1_5_GBPS,
818 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF);
813 break; 819 break;
814 820
815 case SCU_EVENT_SAS_30: 821 case SCU_EVENT_SAS_30:
816 case SCU_EVENT_SAS_30_SSC: 822 case SCU_EVENT_SAS_30_SSC:
817 scic_sds_phy_complete_link_training( 823 scic_sds_phy_complete_link_training(
818 this_phy, SAS_LINK_RATE_3_0_GBPS, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF 824 sci_phy,
819 ); 825 SAS_LINK_RATE_3_0_GBPS,
826 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF);
820 break; 827 break;
821 828
822 case SCU_EVENT_SAS_60: 829 case SCU_EVENT_SAS_60:
823 case SCU_EVENT_SAS_60_SSC: 830 case SCU_EVENT_SAS_60_SSC:
824 scic_sds_phy_complete_link_training( 831 scic_sds_phy_complete_link_training(
825 this_phy, SAS_LINK_RATE_6_0_GBPS, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF 832 sci_phy,
826 ); 833 SAS_LINK_RATE_6_0_GBPS,
834 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF);
827 break; 835 break;
828 836
829 case SCU_EVENT_SATA_SPINUP_HOLD: 837 case SCU_EVENT_SATA_SPINUP_HOLD:
830 /* 838 /*
831 * We were doing SAS PHY link training and received a SATA PHY event 839 * We were doing SAS PHY link training and received a SATA PHY event
832 * continue OOB/SN as if this were a SATA PHY */ 840 * continue OOB/SN as if this were a SATA PHY */
833 scic_sds_phy_start_sata_link_training(this_phy); 841 scic_sds_phy_start_sata_link_training(sci_phy);
834 break; 842 break;
835 843
836 case SCU_EVENT_LINK_FAILURE: 844 case SCU_EVENT_LINK_FAILURE:
837 /* Link failure change state back to the starting state */ 845 /* Link failure change state back to the starting state */
838 scic_sds_phy_restart_starting_state(this_phy); 846 scic_sds_phy_restart_starting_state(sci_phy);
839 break; 847 break;
840 848
841 default: 849 default:
842 dev_warn(sciphy_to_dev(this_phy), 850 dev_warn(sciphy_to_dev(sci_phy),
843 "%s: PHY starting substate machine received " 851 "%s: PHY starting substate machine received "
844 "unexpected event_code %x\n", 852 "unexpected event_code %x\n",
845 __func__, 853 __func__,
@@ -867,7 +875,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sas_phy_speed_event_
867 * unexpected event notifation 875 * unexpected event notifation
868 */ 876 */
869static enum sci_status scic_sds_phy_starting_substate_await_iaf_uf_event_handler( 877static enum sci_status scic_sds_phy_starting_substate_await_iaf_uf_event_handler(
870 struct scic_sds_phy *this_phy, 878 struct scic_sds_phy *sci_phy,
871 u32 event_code) 879 u32 event_code)
872{ 880{
873 u32 result = SCI_SUCCESS; 881 u32 result = SCI_SUCCESS;
@@ -875,25 +883,25 @@ static enum sci_status scic_sds_phy_starting_substate_await_iaf_uf_event_handler
875 switch (scu_get_event_code(event_code)) { 883 switch (scu_get_event_code(event_code)) {
876 case SCU_EVENT_SAS_PHY_DETECTED: 884 case SCU_EVENT_SAS_PHY_DETECTED:
877 /* Backup the state machine */ 885 /* Backup the state machine */
878 scic_sds_phy_start_sas_link_training(this_phy); 886 scic_sds_phy_start_sas_link_training(sci_phy);
879 break; 887 break;
880 888
881 case SCU_EVENT_SATA_SPINUP_HOLD: 889 case SCU_EVENT_SATA_SPINUP_HOLD:
882 /* 890 /*
883 * We were doing SAS PHY link training and received a SATA PHY event 891 * We were doing SAS PHY link training and received a SATA PHY event
884 * continue OOB/SN as if this were a SATA PHY */ 892 * continue OOB/SN as if this were a SATA PHY */
885 scic_sds_phy_start_sata_link_training(this_phy); 893 scic_sds_phy_start_sata_link_training(sci_phy);
886 break; 894 break;
887 895
888 case SCU_EVENT_RECEIVED_IDENTIFY_TIMEOUT: 896 case SCU_EVENT_RECEIVED_IDENTIFY_TIMEOUT:
889 case SCU_EVENT_LINK_FAILURE: 897 case SCU_EVENT_LINK_FAILURE:
890 case SCU_EVENT_HARD_RESET_RECEIVED: 898 case SCU_EVENT_HARD_RESET_RECEIVED:
891 /* Start the oob/sn state machine over again */ 899 /* Start the oob/sn state machine over again */
892 scic_sds_phy_restart_starting_state(this_phy); 900 scic_sds_phy_restart_starting_state(sci_phy);
893 break; 901 break;
894 902
895 default: 903 default:
896 dev_warn(sciphy_to_dev(this_phy), 904 dev_warn(sciphy_to_dev(sci_phy),
897 "%s: PHY starting substate machine received " 905 "%s: PHY starting substate machine received "
898 "unexpected event_code %x\n", 906 "unexpected event_code %x\n",
899 __func__, 907 __func__,
@@ -919,7 +927,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_iaf_uf_event_handler
919 * notifation 927 * notifation
920 */ 928 */
921static enum sci_status scic_sds_phy_starting_substate_await_sas_power_event_handler( 929static enum sci_status scic_sds_phy_starting_substate_await_sas_power_event_handler(
922 struct scic_sds_phy *this_phy, 930 struct scic_sds_phy *sci_phy,
923 u32 event_code) 931 u32 event_code)
924{ 932{
925 u32 result = SCI_SUCCESS; 933 u32 result = SCI_SUCCESS;
@@ -927,11 +935,11 @@ static enum sci_status scic_sds_phy_starting_substate_await_sas_power_event_hand
927 switch (scu_get_event_code(event_code)) { 935 switch (scu_get_event_code(event_code)) {
928 case SCU_EVENT_LINK_FAILURE: 936 case SCU_EVENT_LINK_FAILURE:
929 /* Link failure change state back to the starting state */ 937 /* Link failure change state back to the starting state */
930 scic_sds_phy_restart_starting_state(this_phy); 938 scic_sds_phy_restart_starting_state(sci_phy);
931 break; 939 break;
932 940
933 default: 941 default:
934 dev_warn(sciphy_to_dev(this_phy), 942 dev_warn(sciphy_to_dev(sci_phy),
935 "%s: PHY starting substate machine received unexpected " 943 "%s: PHY starting substate machine received unexpected "
936 "event_code %x\n", 944 "event_code %x\n",
937 __func__, 945 __func__,
@@ -957,7 +965,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sas_power_event_hand
957 * on a link failure event SCI_FAILURE on any unexpected event notifation 965 * on a link failure event SCI_FAILURE on any unexpected event notifation
958 */ 966 */
959static enum sci_status scic_sds_phy_starting_substate_await_sata_power_event_handler( 967static enum sci_status scic_sds_phy_starting_substate_await_sata_power_event_handler(
960 struct scic_sds_phy *this_phy, 968 struct scic_sds_phy *sci_phy,
961 u32 event_code) 969 u32 event_code)
962{ 970{
963 u32 result = SCI_SUCCESS; 971 u32 result = SCI_SUCCESS;
@@ -965,7 +973,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_power_event_han
965 switch (scu_get_event_code(event_code)) { 973 switch (scu_get_event_code(event_code)) {
966 case SCU_EVENT_LINK_FAILURE: 974 case SCU_EVENT_LINK_FAILURE:
967 /* Link failure change state back to the starting state */ 975 /* Link failure change state back to the starting state */
968 scic_sds_phy_restart_starting_state(this_phy); 976 scic_sds_phy_restart_starting_state(sci_phy);
969 break; 977 break;
970 978
971 case SCU_EVENT_SATA_SPINUP_HOLD: 979 case SCU_EVENT_SATA_SPINUP_HOLD:
@@ -976,11 +984,11 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_power_event_han
976 /* 984 /*
977 * There has been a change in the phy type before OOB/SN for the 985 * There has been a change in the phy type before OOB/SN for the
978 * SATA finished start down the SAS link traning path. */ 986 * SATA finished start down the SAS link traning path. */
979 scic_sds_phy_start_sas_link_training(this_phy); 987 scic_sds_phy_start_sas_link_training(sci_phy);
980 break; 988 break;
981 989
982 default: 990 default:
983 dev_warn(sciphy_to_dev(this_phy), 991 dev_warn(sciphy_to_dev(sci_phy),
984 "%s: PHY starting substate machine received " 992 "%s: PHY starting substate machine received "
985 "unexpected event_code %x\n", 993 "unexpected event_code %x\n",
986 __func__, 994 __func__,
@@ -1066,7 +1074,7 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_phy_event_handl
1066 * valid event notification SCI_FAILURE on any unexpected event notifation 1074 * valid event notification SCI_FAILURE on any unexpected event notifation
1067 */ 1075 */
1068static enum sci_status scic_sds_phy_starting_substate_await_sata_speed_event_handler( 1076static enum sci_status scic_sds_phy_starting_substate_await_sata_speed_event_handler(
1069 struct scic_sds_phy *this_phy, 1077 struct scic_sds_phy *sci_phy,
1070 u32 event_code) 1078 u32 event_code)
1071{ 1079{
1072 u32 result = SCI_SUCCESS; 1080 u32 result = SCI_SUCCESS;
@@ -1081,44 +1089,41 @@ static enum sci_status scic_sds_phy_starting_substate_await_sata_speed_event_han
1081 case SCU_EVENT_SATA_15: 1089 case SCU_EVENT_SATA_15:
1082 case SCU_EVENT_SATA_15_SSC: 1090 case SCU_EVENT_SATA_15_SSC:
1083 scic_sds_phy_complete_link_training( 1091 scic_sds_phy_complete_link_training(
1084 this_phy, 1092 sci_phy,
1085 SAS_LINK_RATE_1_5_GBPS, 1093 SAS_LINK_RATE_1_5_GBPS,
1086 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF 1094 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF);
1087 );
1088 break; 1095 break;
1089 1096
1090 case SCU_EVENT_SATA_30: 1097 case SCU_EVENT_SATA_30:
1091 case SCU_EVENT_SATA_30_SSC: 1098 case SCU_EVENT_SATA_30_SSC:
1092 scic_sds_phy_complete_link_training( 1099 scic_sds_phy_complete_link_training(
1093 this_phy, 1100 sci_phy,
1094 SAS_LINK_RATE_3_0_GBPS, 1101 SAS_LINK_RATE_3_0_GBPS,
1095 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF 1102 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF);
1096 );
1097 break; 1103 break;
1098 1104
1099 case SCU_EVENT_SATA_60: 1105 case SCU_EVENT_SATA_60:
1100 case SCU_EVENT_SATA_60_SSC: 1106 case SCU_EVENT_SATA_60_SSC:
1101 scic_sds_phy_complete_link_training( 1107 scic_sds_phy_complete_link_training(
1102 this_phy, 1108 sci_phy,
1103 SAS_LINK_RATE_6_0_GBPS, 1109 SAS_LINK_RATE_6_0_GBPS,
1104 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF 1110 SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SIG_FIS_UF);
1105 );
1106 break; 1111 break;
1107 1112
1108 case SCU_EVENT_LINK_FAILURE: 1113 case SCU_EVENT_LINK_FAILURE:
1109 /* Link failure change state back to the starting state */ 1114 /* Link failure change state back to the starting state */
1110 scic_sds_phy_restart_starting_state(this_phy); 1115 scic_sds_phy_restart_starting_state(sci_phy);
1111 break; 1116 break;
1112 1117
1113 case SCU_EVENT_SAS_PHY_DETECTED: 1118 case SCU_EVENT_SAS_PHY_DETECTED:
1114 /* 1119 /*
1115 * There has been a change in the phy type before OOB/SN for the 1120 * There has been a change in the phy type before OOB/SN for the
1116 * SATA finished start down the SAS link traning path. */ 1121 * SATA finished start down the SAS link traning path. */
1117 scic_sds_phy_start_sas_link_training(this_phy); 1122 scic_sds_phy_start_sas_link_training(sci_phy);
1118 break; 1123 break;
1119 1124
1120 default: 1125 default:
1121 dev_warn(sciphy_to_dev(this_phy), 1126 dev_warn(sciphy_to_dev(sci_phy),
1122 "%s: PHY starting substate machine received " 1127 "%s: PHY starting substate machine received "
1123 "unexpected event_code %x\n", 1128 "unexpected event_code %x\n",
1124 __func__, 1129 __func__,
@@ -1583,12 +1588,12 @@ static void scic_sds_phy_starting_initial_substate_enter(struct sci_base_object
1583static void scic_sds_phy_starting_await_ossp_en_substate_enter( 1588static void scic_sds_phy_starting_await_ossp_en_substate_enter(
1584 struct sci_base_object *object) 1589 struct sci_base_object *object)
1585{ 1590{
1586 struct scic_sds_phy *this_phy; 1591 struct scic_sds_phy *sci_phy;
1587 1592
1588 this_phy = (struct scic_sds_phy *)object; 1593 sci_phy = (struct scic_sds_phy *)object;
1589 1594
1590 scic_sds_phy_set_starting_substate_handlers( 1595 scic_sds_phy_set_starting_substate_handlers(
1591 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_OSSP_EN 1596 sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_OSSP_EN
1592 ); 1597 );
1593} 1598}
1594 1599
@@ -1603,12 +1608,12 @@ static void scic_sds_phy_starting_await_ossp_en_substate_enter(
1603static void scic_sds_phy_starting_await_sas_speed_en_substate_enter( 1608static void scic_sds_phy_starting_await_sas_speed_en_substate_enter(
1604 struct sci_base_object *object) 1609 struct sci_base_object *object)
1605{ 1610{
1606 struct scic_sds_phy *this_phy; 1611 struct scic_sds_phy *sci_phy;
1607 1612
1608 this_phy = (struct scic_sds_phy *)object; 1613 sci_phy = (struct scic_sds_phy *)object;
1609 1614
1610 scic_sds_phy_set_starting_substate_handlers( 1615 scic_sds_phy_set_starting_substate_handlers(
1611 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_SPEED_EN 1616 sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_SPEED_EN
1612 ); 1617 );
1613} 1618}
1614 1619
@@ -1623,12 +1628,12 @@ static void scic_sds_phy_starting_await_sas_speed_en_substate_enter(
1623static void scic_sds_phy_starting_await_iaf_uf_substate_enter( 1628static void scic_sds_phy_starting_await_iaf_uf_substate_enter(
1624 struct sci_base_object *object) 1629 struct sci_base_object *object)
1625{ 1630{
1626 struct scic_sds_phy *this_phy; 1631 struct scic_sds_phy *sci_phy;
1627 1632
1628 this_phy = (struct scic_sds_phy *)object; 1633 sci_phy = (struct scic_sds_phy *)object;
1629 1634
1630 scic_sds_phy_set_starting_substate_handlers( 1635 scic_sds_phy_set_starting_substate_handlers(
1631 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF 1636 sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_IAF_UF
1632 ); 1637 );
1633} 1638}
1634 1639
@@ -1644,17 +1649,17 @@ static void scic_sds_phy_starting_await_iaf_uf_substate_enter(
1644static void scic_sds_phy_starting_await_sas_power_substate_enter( 1649static void scic_sds_phy_starting_await_sas_power_substate_enter(
1645 struct sci_base_object *object) 1650 struct sci_base_object *object)
1646{ 1651{
1647 struct scic_sds_phy *this_phy; 1652 struct scic_sds_phy *sci_phy;
1648 1653
1649 this_phy = (struct scic_sds_phy *)object; 1654 sci_phy = (struct scic_sds_phy *)object;
1650 1655
1651 scic_sds_phy_set_starting_substate_handlers( 1656 scic_sds_phy_set_starting_substate_handlers(
1652 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_POWER 1657 sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SAS_POWER
1653 ); 1658 );
1654 1659
1655 scic_sds_controller_power_control_queue_insert( 1660 scic_sds_controller_power_control_queue_insert(
1656 scic_sds_phy_get_controller(this_phy), 1661 scic_sds_phy_get_controller(sci_phy),
1657 this_phy 1662 sci_phy
1658 ); 1663 );
1659} 1664}
1660 1665
@@ -1669,12 +1674,12 @@ static void scic_sds_phy_starting_await_sas_power_substate_enter(
1669static void scic_sds_phy_starting_await_sas_power_substate_exit( 1674static void scic_sds_phy_starting_await_sas_power_substate_exit(
1670 struct sci_base_object *object) 1675 struct sci_base_object *object)
1671{ 1676{
1672 struct scic_sds_phy *this_phy; 1677 struct scic_sds_phy *sci_phy;
1673 1678
1674 this_phy = (struct scic_sds_phy *)object; 1679 sci_phy = (struct scic_sds_phy *)object;
1675 1680
1676 scic_sds_controller_power_control_queue_remove( 1681 scic_sds_controller_power_control_queue_remove(
1677 scic_sds_phy_get_controller(this_phy), this_phy 1682 scic_sds_phy_get_controller(sci_phy), sci_phy
1678 ); 1683 );
1679} 1684}
1680 1685
@@ -1690,17 +1695,17 @@ static void scic_sds_phy_starting_await_sas_power_substate_exit(
1690static void scic_sds_phy_starting_await_sata_power_substate_enter( 1695static void scic_sds_phy_starting_await_sata_power_substate_enter(
1691 struct sci_base_object *object) 1696 struct sci_base_object *object)
1692{ 1697{
1693 struct scic_sds_phy *this_phy; 1698 struct scic_sds_phy *sci_phy;
1694 1699
1695 this_phy = (struct scic_sds_phy *)object; 1700 sci_phy = (struct scic_sds_phy *)object;
1696 1701
1697 scic_sds_phy_set_starting_substate_handlers( 1702 scic_sds_phy_set_starting_substate_handlers(
1698 this_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_POWER 1703 sci_phy, SCIC_SDS_PHY_STARTING_SUBSTATE_AWAIT_SATA_POWER
1699 ); 1704 );
1700 1705
1701 scic_sds_controller_power_control_queue_insert( 1706 scic_sds_controller_power_control_queue_insert(
1702 scic_sds_phy_get_controller(this_phy), 1707 scic_sds_phy_get_controller(sci_phy),
1703 this_phy 1708 sci_phy
1704 ); 1709 );
1705} 1710}
1706 1711
@@ -1715,13 +1720,13 @@ static void scic_sds_phy_starting_await_sata_power_substate_enter(
1715static void scic_sds_phy_starting_await_sata_power_substate_exit( 1720static void scic_sds_phy_starting_await_sata_power_substate_exit(
1716 struct sci_base_object *object) 1721 struct sci_base_object *object)
1717{ 1722{
1718 struct scic_sds_phy *this_phy; 1723 struct scic_sds_phy *sci_phy;
1719 1724
1720 this_phy = (struct scic_sds_phy *)object; 1725 sci_phy = (struct scic_sds_phy *)object;
1721 1726
1722 scic_sds_controller_power_control_queue_remove( 1727 scic_sds_controller_power_control_queue_remove(
1723 scic_sds_phy_get_controller(this_phy), 1728 scic_sds_phy_get_controller(sci_phy),
1724 this_phy 1729 sci_phy
1725 ); 1730 );
1726} 1731}
1727 1732
@@ -2115,33 +2120,32 @@ static const struct scic_sds_phy_state_handler scic_sds_phy_state_handler_table[
2115 2120
2116/** 2121/**
2117 * 2122 *
2118 * @this_phy: This is the struct scic_sds_phy object to stop. 2123 * @sci_phy: This is the struct scic_sds_phy object to stop.
2119 * 2124 *
2120 * This method will stop the struct scic_sds_phy object. This does not reset the 2125 * This method will stop the struct scic_sds_phy object. This does not reset the
2121 * protocol engine it just suspends it and places it in a state where it will 2126 * protocol engine it just suspends it and places it in a state where it will
2122 * not cause the end device to power up. none 2127 * not cause the end device to power up. none
2123 */ 2128 */
2124static void scu_link_layer_stop_protocol_engine( 2129static void scu_link_layer_stop_protocol_engine(
2125 struct scic_sds_phy *this_phy) 2130 struct scic_sds_phy *sci_phy)
2126{ 2131{
2127 u32 scu_sas_pcfg_value; 2132 u32 scu_sas_pcfg_value;
2128 u32 enable_spinup_value; 2133 u32 enable_spinup_value;
2129 2134
2130 /* Suspend the protocol engine and place it in a sata spinup hold state */ 2135 /* Suspend the protocol engine and place it in a sata spinup hold state */
2131 scu_sas_pcfg_value = 2136 scu_sas_pcfg_value =
2132 readl(&this_phy->link_layer_registers->phy_configuration); 2137 readl(&sci_phy->link_layer_registers->phy_configuration);
2133 scu_sas_pcfg_value |= ( 2138 scu_sas_pcfg_value |=
2134 SCU_SAS_PCFG_GEN_BIT(OOB_RESET) 2139 (SCU_SAS_PCFG_GEN_BIT(OOB_RESET) |
2135 | SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE) 2140 SCU_SAS_PCFG_GEN_BIT(SUSPEND_PROTOCOL_ENGINE) |
2136 | SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD) 2141 SCU_SAS_PCFG_GEN_BIT(SATA_SPINUP_HOLD));
2137 );
2138 writel(scu_sas_pcfg_value, 2142 writel(scu_sas_pcfg_value,
2139 &this_phy->link_layer_registers->phy_configuration); 2143 &sci_phy->link_layer_registers->phy_configuration);
2140 2144
2141 /* Disable the notify enable spinup primitives */ 2145 /* Disable the notify enable spinup primitives */
2142 enable_spinup_value = readl(&this_phy->link_layer_registers->notify_enable_spinup_control); 2146 enable_spinup_value = readl(&sci_phy->link_layer_registers->notify_enable_spinup_control);
2143 enable_spinup_value &= ~SCU_ENSPINUP_GEN_BIT(ENABLE); 2147 enable_spinup_value &= ~SCU_ENSPINUP_GEN_BIT(ENABLE);
2144 writel(enable_spinup_value, &this_phy->link_layer_registers->notify_enable_spinup_control); 2148 writel(enable_spinup_value, &sci_phy->link_layer_registers->notify_enable_spinup_control);
2145} 2149}
2146 2150
2147/** 2151/**
@@ -2150,17 +2154,18 @@ static void scu_link_layer_stop_protocol_engine(
2150 * This method will start the OOB/SN state machine for this struct scic_sds_phy object. 2154 * This method will start the OOB/SN state machine for this struct scic_sds_phy object.
2151 */ 2155 */
2152static void scu_link_layer_start_oob( 2156static void scu_link_layer_start_oob(
2153 struct scic_sds_phy *this_phy) 2157 struct scic_sds_phy *sci_phy)
2154{ 2158{
2155 u32 scu_sas_pcfg_value; 2159 u32 scu_sas_pcfg_value;
2156 2160
2157 scu_sas_pcfg_value = 2161 scu_sas_pcfg_value =
2158 readl(&this_phy->link_layer_registers->phy_configuration); 2162 readl(&sci_phy->link_layer_registers->phy_configuration);
2159 scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); 2163 scu_sas_pcfg_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE);
2160 scu_sas_pcfg_value &= 2164 scu_sas_pcfg_value &=
2161 ~(SCU_SAS_PCFG_GEN_BIT(OOB_RESET) | SCU_SAS_PCFG_GEN_BIT(HARD_RESET)); 2165 ~(SCU_SAS_PCFG_GEN_BIT(OOB_RESET) |
2166 SCU_SAS_PCFG_GEN_BIT(HARD_RESET));
2162 writel(scu_sas_pcfg_value, 2167 writel(scu_sas_pcfg_value,
2163 &this_phy->link_layer_registers->phy_configuration); 2168 &sci_phy->link_layer_registers->phy_configuration);
2164} 2169}
2165 2170
2166/** 2171/**
@@ -2172,7 +2177,7 @@ static void scu_link_layer_start_oob(
2172 * hard reset bit set. 2177 * hard reset bit set.
2173 */ 2178 */
2174static void scu_link_layer_tx_hard_reset( 2179static void scu_link_layer_tx_hard_reset(
2175 struct scic_sds_phy *this_phy) 2180 struct scic_sds_phy *sci_phy)
2176{ 2181{
2177 u32 phy_configuration_value; 2182 u32 phy_configuration_value;
2178 2183
@@ -2180,17 +2185,18 @@ static void scu_link_layer_tx_hard_reset(
2180 * SAS Phys must wait for the HARD_RESET_TX event notification to transition 2185 * SAS Phys must wait for the HARD_RESET_TX event notification to transition
2181 * to the starting state. */ 2186 * to the starting state. */
2182 phy_configuration_value = 2187 phy_configuration_value =
2183 readl(&this_phy->link_layer_registers->phy_configuration); 2188 readl(&sci_phy->link_layer_registers->phy_configuration);
2184 phy_configuration_value |= 2189 phy_configuration_value |=
2185 (SCU_SAS_PCFG_GEN_BIT(HARD_RESET) | SCU_SAS_PCFG_GEN_BIT(OOB_RESET)); 2190 (SCU_SAS_PCFG_GEN_BIT(HARD_RESET) |
2191 SCU_SAS_PCFG_GEN_BIT(OOB_RESET));
2186 writel(phy_configuration_value, 2192 writel(phy_configuration_value,
2187 &this_phy->link_layer_registers->phy_configuration); 2193 &sci_phy->link_layer_registers->phy_configuration);
2188 2194
2189 /* Now take the OOB state machine out of reset */ 2195 /* Now take the OOB state machine out of reset */
2190 phy_configuration_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE); 2196 phy_configuration_value |= SCU_SAS_PCFG_GEN_BIT(OOB_ENABLE);
2191 phy_configuration_value &= ~SCU_SAS_PCFG_GEN_BIT(OOB_RESET); 2197 phy_configuration_value &= ~SCU_SAS_PCFG_GEN_BIT(OOB_RESET);
2192 writel(phy_configuration_value, 2198 writel(phy_configuration_value,
2193 &this_phy->link_layer_registers->phy_configuration); 2199 &sci_phy->link_layer_registers->phy_configuration);
2194} 2200}
2195 2201
2196/* 2202/*
@@ -2209,11 +2215,11 @@ static void scu_link_layer_tx_hard_reset(
2209static void scic_sds_phy_initial_state_enter( 2215static void scic_sds_phy_initial_state_enter(
2210 struct sci_base_object *object) 2216 struct sci_base_object *object)
2211{ 2217{
2212 struct scic_sds_phy *this_phy; 2218 struct scic_sds_phy *sci_phy;
2213 2219
2214 this_phy = (struct scic_sds_phy *)object; 2220 sci_phy = (struct scic_sds_phy *)object;
2215 2221
2216 scic_sds_phy_set_base_state_handlers(this_phy, SCI_BASE_PHY_STATE_INITIAL); 2222 scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_INITIAL);
2217} 2223}
2218 2224
2219/** 2225/**
@@ -2273,28 +2279,28 @@ static void scic_sds_phy_stopped_state_enter(struct sci_base_object *object)
2273static void scic_sds_phy_starting_state_enter( 2279static void scic_sds_phy_starting_state_enter(
2274 struct sci_base_object *object) 2280 struct sci_base_object *object)
2275{ 2281{
2276 struct scic_sds_phy *this_phy; 2282 struct scic_sds_phy *sci_phy;
2277 2283
2278 this_phy = (struct scic_sds_phy *)object; 2284 sci_phy = (struct scic_sds_phy *)object;
2279 2285
2280 scic_sds_phy_set_base_state_handlers(this_phy, SCI_BASE_PHY_STATE_STARTING); 2286 scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_STARTING);
2281 2287
2282 scu_link_layer_stop_protocol_engine(this_phy); 2288 scu_link_layer_stop_protocol_engine(sci_phy);
2283 scu_link_layer_start_oob(this_phy); 2289 scu_link_layer_start_oob(sci_phy);
2284 2290
2285 /* We don't know what kind of phy we are going to be just yet */ 2291 /* We don't know what kind of phy we are going to be just yet */
2286 this_phy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN; 2292 sci_phy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN;
2287 this_phy->bcn_received_while_port_unassigned = false; 2293 sci_phy->bcn_received_while_port_unassigned = false;
2288 2294
2289 /* Change over to the starting substate machine to continue */ 2295 /* Change over to the starting substate machine to continue */
2290 sci_base_state_machine_start(&this_phy->starting_substate_machine); 2296 sci_base_state_machine_start(&sci_phy->starting_substate_machine);
2291 2297
2292 if (this_phy->state_machine.previous_state_id 2298 if (sci_phy->state_machine.previous_state_id
2293 == SCI_BASE_PHY_STATE_READY) { 2299 == SCI_BASE_PHY_STATE_READY) {
2294 scic_sds_controller_link_down( 2300 scic_sds_controller_link_down(
2295 scic_sds_phy_get_controller(this_phy), 2301 scic_sds_phy_get_controller(sci_phy),
2296 scic_sds_phy_get_port(this_phy), 2302 scic_sds_phy_get_port(sci_phy),
2297 this_phy 2303 sci_phy
2298 ); 2304 );
2299 } 2305 }
2300} 2306}
@@ -2312,16 +2318,16 @@ static void scic_sds_phy_starting_state_enter(
2312static void scic_sds_phy_ready_state_enter( 2318static void scic_sds_phy_ready_state_enter(
2313 struct sci_base_object *object) 2319 struct sci_base_object *object)
2314{ 2320{
2315 struct scic_sds_phy *this_phy; 2321 struct scic_sds_phy *sci_phy;
2316 2322
2317 this_phy = (struct scic_sds_phy *)object; 2323 sci_phy = (struct scic_sds_phy *)object;
2318 2324
2319 scic_sds_phy_set_base_state_handlers(this_phy, SCI_BASE_PHY_STATE_READY); 2325 scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_READY);
2320 2326
2321 scic_sds_controller_link_up( 2327 scic_sds_controller_link_up(
2322 scic_sds_phy_get_controller(this_phy), 2328 scic_sds_phy_get_controller(sci_phy),
2323 scic_sds_phy_get_port(this_phy), 2329 scic_sds_phy_get_port(sci_phy),
2324 this_phy 2330 sci_phy
2325 ); 2331 );
2326} 2332}
2327 2333
@@ -2336,11 +2342,11 @@ static void scic_sds_phy_ready_state_enter(
2336static void scic_sds_phy_ready_state_exit( 2342static void scic_sds_phy_ready_state_exit(
2337 struct sci_base_object *object) 2343 struct sci_base_object *object)
2338{ 2344{
2339 struct scic_sds_phy *this_phy; 2345 struct scic_sds_phy *sci_phy;
2340 2346
2341 this_phy = (struct scic_sds_phy *)object; 2347 sci_phy = (struct scic_sds_phy *)object;
2342 2348
2343 scic_sds_phy_suspend(this_phy); 2349 scic_sds_phy_suspend(sci_phy);
2344} 2350}
2345 2351
2346/** 2352/**
@@ -2354,26 +2360,28 @@ static void scic_sds_phy_ready_state_exit(
2354static void scic_sds_phy_resetting_state_enter( 2360static void scic_sds_phy_resetting_state_enter(
2355 struct sci_base_object *object) 2361 struct sci_base_object *object)
2356{ 2362{
2357 struct scic_sds_phy *this_phy; 2363 struct scic_sds_phy *sci_phy;
2358 2364
2359 this_phy = (struct scic_sds_phy *)object; 2365 sci_phy = (struct scic_sds_phy *)object;
2360 2366
2361 scic_sds_phy_set_base_state_handlers(this_phy, SCI_BASE_PHY_STATE_RESETTING); 2367 scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_RESETTING);
2362 2368
2363 /* 2369 /*
2364 * The phy is being reset, therefore deactivate it from the port. 2370 * The phy is being reset, therefore deactivate it from the port.
2365 * In the resetting state we don't notify the user regarding 2371 * In the resetting state we don't notify the user regarding
2366 * link up and link down notifications. */ 2372 * link up and link down notifications. */
2367 scic_sds_port_deactivate_phy(this_phy->owning_port, this_phy, false); 2373 scic_sds_port_deactivate_phy(sci_phy->owning_port, sci_phy, false);
2368 2374
2369 if (this_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) { 2375 if (sci_phy->protocol == SCIC_SDS_PHY_PROTOCOL_SAS) {
2370 scu_link_layer_tx_hard_reset(this_phy); 2376 scu_link_layer_tx_hard_reset(sci_phy);
2371 } else { 2377 } else {
2372 /* 2378 /*
2373 * The SCU does not need to have a discrete reset state so just go back to 2379 * The SCU does not need to have a discrete reset state so
2374 * the starting state. */ 2380 * just go back to the starting state.
2375 sci_base_state_machine_change_state(&this_phy->state_machine, 2381 */
2376 SCI_BASE_PHY_STATE_STARTING); 2382 sci_base_state_machine_change_state(
2383 &sci_phy->state_machine,
2384 SCI_BASE_PHY_STATE_STARTING);
2377 } 2385 }
2378} 2386}
2379 2387
@@ -2388,11 +2396,11 @@ static void scic_sds_phy_resetting_state_enter(
2388static void scic_sds_phy_final_state_enter( 2396static void scic_sds_phy_final_state_enter(
2389 struct sci_base_object *object) 2397 struct sci_base_object *object)
2390{ 2398{
2391 struct scic_sds_phy *this_phy; 2399 struct scic_sds_phy *sci_phy;
2392 2400
2393 this_phy = (struct scic_sds_phy *)object; 2401 sci_phy = (struct scic_sds_phy *)object;
2394 2402
2395 scic_sds_phy_set_base_state_handlers(this_phy, SCI_BASE_PHY_STATE_FINAL); 2403 scic_sds_phy_set_base_state_handlers(sci_phy, SCI_BASE_PHY_STATE_FINAL);
2396 2404
2397 /* Nothing to do here */ 2405 /* Nothing to do here */
2398} 2406}
diff --git a/drivers/scsi/isci/core/scic_sds_port.c b/drivers/scsi/isci/core/scic_sds_port.c
index 40c1297849f3..a8d7e51bdf7b 100644
--- a/drivers/scsi/isci/core/scic_sds_port.c
+++ b/drivers/scsi/isci/core/scic_sds_port.c
@@ -75,7 +75,7 @@
75 75
76/** 76/**
77 * 77 *
78 * @this_port: This is the port object to which the phy is being assigned. 78 * @sci_port: This is the port object to which the phy is being assigned.
79 * @phy_index: This is the phy index that is being assigned to the port. 79 * @phy_index: This is the phy index that is being assigned to the port.
80 * 80 *
81 * This method will return a true value if the specified phy can be assigned to 81 * This method will return a true value if the specified phy can be assigned to
@@ -90,30 +90,30 @@
90 * port 90 * port
91 */ 91 */
92bool scic_sds_port_is_valid_phy_assignment( 92bool scic_sds_port_is_valid_phy_assignment(
93 struct scic_sds_port *this_port, 93 struct scic_sds_port *sci_port,
94 u32 phy_index) 94 u32 phy_index)
95{ 95{
96 /* Initialize to invalid value. */ 96 /* Initialize to invalid value. */
97 u32 existing_phy_index = SCI_MAX_PHYS; 97 u32 existing_phy_index = SCI_MAX_PHYS;
98 u32 index; 98 u32 index;
99 99
100 if ((this_port->physical_port_index == 1) && (phy_index != 1)) { 100 if ((sci_port->physical_port_index == 1) && (phy_index != 1)) {
101 return false; 101 return false;
102 } 102 }
103 103
104 if (this_port->physical_port_index == 3 && phy_index != 3) { 104 if (sci_port->physical_port_index == 3 && phy_index != 3) {
105 return false; 105 return false;
106 } 106 }
107 107
108 if ( 108 if (
109 (this_port->physical_port_index == 2) 109 (sci_port->physical_port_index == 2)
110 && ((phy_index == 0) || (phy_index == 1)) 110 && ((phy_index == 0) || (phy_index == 1))
111 ) { 111 ) {
112 return false; 112 return false;
113 } 113 }
114 114
115 for (index = 0; index < SCI_MAX_PHYS; index++) { 115 for (index = 0; index < SCI_MAX_PHYS; index++) {
116 if ((this_port->phy_table[index] != NULL) 116 if ((sci_port->phy_table[index] != NULL)
117 && (index != phy_index)) { 117 && (index != phy_index)) {
118 existing_phy_index = index; 118 existing_phy_index = index;
119 } 119 }
@@ -124,9 +124,9 @@ bool scic_sds_port_is_valid_phy_assignment(
124 * operating at the same maximum link rate. */ 124 * operating at the same maximum link rate. */
125 if ( 125 if (
126 (existing_phy_index < SCI_MAX_PHYS) 126 (existing_phy_index < SCI_MAX_PHYS)
127 && (this_port->owning_controller->user_parameters.sds1.phys[ 127 && (sci_port->owning_controller->user_parameters.sds1.phys[
128 phy_index].max_speed_generation != 128 phy_index].max_speed_generation !=
129 this_port->owning_controller->user_parameters.sds1.phys[ 129 sci_port->owning_controller->user_parameters.sds1.phys[
130 existing_phy_index].max_speed_generation) 130 existing_phy_index].max_speed_generation)
131 ) 131 )
132 return false; 132 return false;
@@ -137,13 +137,13 @@ bool scic_sds_port_is_valid_phy_assignment(
137/** 137/**
138 * This method requests a list (mask) of the phys contained in the supplied SAS 138 * This method requests a list (mask) of the phys contained in the supplied SAS
139 * port. 139 * port.
140 * @this_port: a handle corresponding to the SAS port for which to return the 140 * @sci_port: a handle corresponding to the SAS port for which to return the
141 * phy mask. 141 * phy mask.
142 * 142 *
143 * Return a bit mask indicating which phys are a part of this port. Each bit 143 * Return a bit mask indicating which phys are a part of this port. Each bit
144 * corresponds to a phy identifier (e.g. bit 0 = phy id 0). 144 * corresponds to a phy identifier (e.g. bit 0 = phy id 0).
145 */ 145 */
146static u32 scic_sds_port_get_phys(struct scic_sds_port *this_port) 146static u32 scic_sds_port_get_phys(struct scic_sds_port *sci_port)
147{ 147{
148 u32 index; 148 u32 index;
149 u32 mask; 149 u32 mask;
@@ -151,7 +151,7 @@ static u32 scic_sds_port_get_phys(struct scic_sds_port *this_port)
151 mask = 0; 151 mask = 0;
152 152
153 for (index = 0; index < SCI_MAX_PHYS; index++) { 153 for (index = 0; index < SCI_MAX_PHYS; index++) {
154 if (this_port->phy_table[index] != NULL) { 154 if (sci_port->phy_table[index] != NULL) {
155 mask |= (1 << index); 155 mask |= (1 << index);
156 } 156 }
157 } 157 }
@@ -161,7 +161,7 @@ static u32 scic_sds_port_get_phys(struct scic_sds_port *this_port)
161 161
162/** 162/**
163 * 163 *
164 * @this_port: This is the port object for which to determine if the phy mask 164 * @sci_port: This is the port object for which to determine if the phy mask
165 * can be supported. 165 * can be supported.
166 * 166 *
167 * This method will return a true value if the port's phy mask can be supported 167 * This method will return a true value if the port's phy mask can be supported
@@ -172,25 +172,25 @@ static u32 scic_sds_port_get_phys(struct scic_sds_port *this_port)
172 * port false if this is not a valid phy assignment for the port 172 * port false if this is not a valid phy assignment for the port
173 */ 173 */
174static bool scic_sds_port_is_phy_mask_valid( 174static bool scic_sds_port_is_phy_mask_valid(
175 struct scic_sds_port *this_port, 175 struct scic_sds_port *sci_port,
176 u32 phy_mask) 176 u32 phy_mask)
177{ 177{
178 if (this_port->physical_port_index == 0) { 178 if (sci_port->physical_port_index == 0) {
179 if (((phy_mask & 0x0F) == 0x0F) 179 if (((phy_mask & 0x0F) == 0x0F)
180 || ((phy_mask & 0x03) == 0x03) 180 || ((phy_mask & 0x03) == 0x03)
181 || ((phy_mask & 0x01) == 0x01) 181 || ((phy_mask & 0x01) == 0x01)
182 || (phy_mask == 0)) 182 || (phy_mask == 0))
183 return true; 183 return true;
184 } else if (this_port->physical_port_index == 1) { 184 } else if (sci_port->physical_port_index == 1) {
185 if (((phy_mask & 0x02) == 0x02) 185 if (((phy_mask & 0x02) == 0x02)
186 || (phy_mask == 0)) 186 || (phy_mask == 0))
187 return true; 187 return true;
188 } else if (this_port->physical_port_index == 2) { 188 } else if (sci_port->physical_port_index == 2) {
189 if (((phy_mask & 0x0C) == 0x0C) 189 if (((phy_mask & 0x0C) == 0x0C)
190 || ((phy_mask & 0x04) == 0x04) 190 || ((phy_mask & 0x04) == 0x04)
191 || (phy_mask == 0)) 191 || (phy_mask == 0))
192 return true; 192 return true;
193 } else if (this_port->physical_port_index == 3) { 193 } else if (sci_port->physical_port_index == 3) {
194 if (((phy_mask & 0x08) == 0x08) 194 if (((phy_mask & 0x08) == 0x08)
195 || (phy_mask == 0)) 195 || (phy_mask == 0))
196 return true; 196 return true;
@@ -201,7 +201,7 @@ static bool scic_sds_port_is_phy_mask_valid(
201 201
202/** 202/**
203 * 203 *
204 * @this_port: This parameter specifies the port from which to return a 204 * @sci_port: This parameter specifies the port from which to return a
205 * connected phy. 205 * connected phy.
206 * 206 *
207 * This method retrieves a currently active (i.e. connected) phy contained in 207 * This method retrieves a currently active (i.e. connected) phy contained in
@@ -212,7 +212,7 @@ static bool scic_sds_port_is_phy_mask_valid(
212 * object that is active in the port. 212 * object that is active in the port.
213 */ 213 */
214static struct scic_sds_phy *scic_sds_port_get_a_connected_phy( 214static struct scic_sds_phy *scic_sds_port_get_a_connected_phy(
215 struct scic_sds_port *this_port 215 struct scic_sds_port *sci_port
216 ) { 216 ) {
217 u32 index; 217 u32 index;
218 struct scic_sds_phy *phy; 218 struct scic_sds_phy *phy;
@@ -221,10 +221,10 @@ static struct scic_sds_phy *scic_sds_port_get_a_connected_phy(
221 /* 221 /*
222 * Ensure that the phy is both part of the port and currently 222 * Ensure that the phy is both part of the port and currently
223 * connected to the remote end-point. */ 223 * connected to the remote end-point. */
224 phy = this_port->phy_table[index]; 224 phy = sci_port->phy_table[index];
225 if ( 225 if (
226 (phy != NULL) 226 (phy != NULL)
227 && scic_sds_port_active_phy(this_port, phy) 227 && scic_sds_port_active_phy(sci_port, phy)
228 ) { 228 ) {
229 return phy; 229 return phy;
230 } 230 }
@@ -304,50 +304,50 @@ static enum sci_status scic_sds_port_clear_phy(
304 304
305/** 305/**
306 * scic_sds_port_add_phy() - 306 * scic_sds_port_add_phy() -
307 * @this_port: This parameter specifies the port in which the phy will be added. 307 * @sci_port: This parameter specifies the port in which the phy will be added.
308 * @the_phy: This parameter is the phy which is to be added to the port. 308 * @sci_phy: This parameter is the phy which is to be added to the port.
309 * 309 *
310 * This method will add a PHY to the selected port. This method returns an 310 * This method will add a PHY to the selected port. This method returns an
311 * enum sci_status. SCI_SUCCESS the phy has been added to the port. Any other status 311 * enum sci_status. SCI_SUCCESS the phy has been added to the port. Any other status
312 * is failre to add the phy to the port. 312 * is failre to add the phy to the port.
313 */ 313 */
314enum sci_status scic_sds_port_add_phy( 314enum sci_status scic_sds_port_add_phy(
315 struct scic_sds_port *this_port, 315 struct scic_sds_port *sci_port,
316 struct scic_sds_phy *the_phy) 316 struct scic_sds_phy *sci_phy)
317{ 317{
318 return this_port->state_handlers->add_phy_handler( 318 return sci_port->state_handlers->add_phy_handler(
319 this_port, the_phy); 319 sci_port, sci_phy);
320} 320}
321 321
322 322
323/** 323/**
324 * scic_sds_port_remove_phy() - 324 * scic_sds_port_remove_phy() -
325 * @this_port: This parameter specifies the port in which the phy will be added. 325 * @sci_port: This parameter specifies the port in which the phy will be added.
326 * @the_phy: This parameter is the phy which is to be added to the port. 326 * @sci_phy: This parameter is the phy which is to be added to the port.
327 * 327 *
328 * This method will remove the PHY from the selected PORT. This method returns 328 * This method will remove the PHY from the selected PORT. This method returns
329 * an enum sci_status. SCI_SUCCESS the phy has been removed from the port. Any other 329 * an enum sci_status. SCI_SUCCESS the phy has been removed from the port. Any other
330 * status is failre to add the phy to the port. 330 * status is failre to add the phy to the port.
331 */ 331 */
332enum sci_status scic_sds_port_remove_phy( 332enum sci_status scic_sds_port_remove_phy(
333 struct scic_sds_port *this_port, 333 struct scic_sds_port *sci_port,
334 struct scic_sds_phy *the_phy) 334 struct scic_sds_phy *sci_phy)
335{ 335{
336 return this_port->state_handlers->remove_phy_handler( 336 return sci_port->state_handlers->remove_phy_handler(
337 this_port, the_phy); 337 sci_port, sci_phy);
338} 338}
339 339
340/** 340/**
341 * This method requests the SAS address for the supplied SAS port from the SCI 341 * This method requests the SAS address for the supplied SAS port from the SCI
342 * implementation. 342 * implementation.
343 * @this_port: a handle corresponding to the SAS port for which to return the 343 * @sci_port: a handle corresponding to the SAS port for which to return the
344 * SAS address. 344 * SAS address.
345 * @sas_address: This parameter specifies a pointer to a SAS address structure 345 * @sas_address: This parameter specifies a pointer to a SAS address structure
346 * into which the core will copy the SAS address for the port. 346 * into which the core will copy the SAS address for the port.
347 * 347 *
348 */ 348 */
349void scic_sds_port_get_sas_address( 349void scic_sds_port_get_sas_address(
350 struct scic_sds_port *this_port, 350 struct scic_sds_port *sci_port,
351 struct sci_sas_address *sas_address) 351 struct sci_sas_address *sas_address)
352{ 352{
353 u32 index; 353 u32 index;
@@ -356,15 +356,15 @@ void scic_sds_port_get_sas_address(
356 sas_address->low = 0; 356 sas_address->low = 0;
357 357
358 for (index = 0; index < SCI_MAX_PHYS; index++) { 358 for (index = 0; index < SCI_MAX_PHYS; index++) {
359 if (this_port->phy_table[index] != NULL) { 359 if (sci_port->phy_table[index] != NULL) {
360 scic_sds_phy_get_sas_address(this_port->phy_table[index], sas_address); 360 scic_sds_phy_get_sas_address(sci_port->phy_table[index], sas_address);
361 } 361 }
362 } 362 }
363} 363}
364 364
365/** 365/**
366 * This method will indicate which protocols are supported by this port. 366 * This method will indicate which protocols are supported by this port.
367 * @this_port: a handle corresponding to the SAS port for which to return the 367 * @sci_port: a handle corresponding to the SAS port for which to return the
368 * supported protocols. 368 * supported protocols.
369 * @protocols: This parameter specifies a pointer to an IAF protocol field 369 * @protocols: This parameter specifies a pointer to an IAF protocol field
370 * structure into which the core will copy the protocol values for the port. 370 * structure into which the core will copy the protocol values for the port.
@@ -373,7 +373,7 @@ void scic_sds_port_get_sas_address(
373 * 373 *
374 */ 374 */
375static void scic_sds_port_get_protocols( 375static void scic_sds_port_get_protocols(
376 struct scic_sds_port *this_port, 376 struct scic_sds_port *sci_port,
377 struct sci_sas_identify_address_frame_protocols *protocols) 377 struct sci_sas_identify_address_frame_protocols *protocols)
378{ 378{
379 u8 index; 379 u8 index;
@@ -381,8 +381,8 @@ static void scic_sds_port_get_protocols(
381 protocols->u.all = 0; 381 protocols->u.all = 0;
382 382
383 for (index = 0; index < SCI_MAX_PHYS; index++) { 383 for (index = 0; index < SCI_MAX_PHYS; index++) {
384 if (this_port->phy_table[index] != NULL) { 384 if (sci_port->phy_table[index] != NULL) {
385 scic_sds_phy_get_protocols(this_port->phy_table[index], protocols); 385 scic_sds_phy_get_protocols(sci_port->phy_table[index], protocols);
386 } 386 }
387 } 387 }
388} 388}
@@ -390,7 +390,7 @@ static void scic_sds_port_get_protocols(
390/** 390/**
391 * This method requests the SAS address for the device directly attached to 391 * This method requests the SAS address for the device directly attached to
392 * this SAS port. 392 * this SAS port.
393 * @this_port: a handle corresponding to the SAS port for which to return the 393 * @sci_port: a handle corresponding to the SAS port for which to return the
394 * SAS address. 394 * SAS address.
395 * @sas_address: This parameter specifies a pointer to a SAS address structure 395 * @sas_address: This parameter specifies a pointer to a SAS address structure
396 * into which the core will copy the SAS address for the device directly 396 * into which the core will copy the SAS address for the device directly
@@ -398,7 +398,7 @@ static void scic_sds_port_get_protocols(
398 * 398 *
399 */ 399 */
400void scic_sds_port_get_attached_sas_address( 400void scic_sds_port_get_attached_sas_address(
401 struct scic_sds_port *this_port, 401 struct scic_sds_port *sci_port,
402 struct sci_sas_address *sas_address) 402 struct sci_sas_address *sas_address)
403{ 403{
404 struct sci_sas_identify_address_frame_protocols protocols; 404 struct sci_sas_identify_address_frame_protocols protocols;
@@ -407,7 +407,7 @@ void scic_sds_port_get_attached_sas_address(
407 /* 407 /*
408 * Ensure that the phy is both part of the port and currently 408 * Ensure that the phy is both part of the port and currently
409 * connected to the remote end-point. */ 409 * connected to the remote end-point. */
410 phy = scic_sds_port_get_a_connected_phy(this_port); 410 phy = scic_sds_port_get_a_connected_phy(sci_port);
411 if (phy != NULL) { 411 if (phy != NULL) {
412 scic_sds_phy_get_attached_phy_protocols(phy, &protocols); 412 scic_sds_phy_get_attached_phy_protocols(phy, &protocols);
413 413
@@ -426,7 +426,7 @@ void scic_sds_port_get_attached_sas_address(
426/** 426/**
427 * This method will indicate which protocols are supported by this remote 427 * This method will indicate which protocols are supported by this remote
428 * device. 428 * device.
429 * @this_port: a handle corresponding to the SAS port for which to return the 429 * @sci_port: a handle corresponding to the SAS port for which to return the
430 * supported protocols. 430 * supported protocols.
431 * @protocols: This parameter specifies a pointer to an IAF protocol field 431 * @protocols: This parameter specifies a pointer to an IAF protocol field
432 * structure into which the core will copy the protocol values for the port. 432 * structure into which the core will copy the protocol values for the port.
@@ -435,7 +435,7 @@ void scic_sds_port_get_attached_sas_address(
435 * 435 *
436 */ 436 */
437void scic_sds_port_get_attached_protocols( 437void scic_sds_port_get_attached_protocols(
438 struct scic_sds_port *this_port, 438 struct scic_sds_port *sci_port,
439 struct sci_sas_identify_address_frame_protocols *protocols) 439 struct sci_sas_identify_address_frame_protocols *protocols)
440{ 440{
441 struct scic_sds_phy *phy; 441 struct scic_sds_phy *phy;
@@ -443,7 +443,7 @@ void scic_sds_port_get_attached_protocols(
443 /* 443 /*
444 * Ensure that the phy is both part of the port and currently 444 * Ensure that the phy is both part of the port and currently
445 * connected to the remote end-point. */ 445 * connected to the remote end-point. */
446 phy = scic_sds_port_get_a_connected_phy(this_port); 446 phy = scic_sds_port_get_a_connected_phy(sci_port);
447 if (phy != NULL) 447 if (phy != NULL)
448 scic_sds_phy_get_attached_phy_protocols(phy, protocols); 448 scic_sds_phy_get_attached_phy_protocols(phy, protocols);
449 else 449 else
@@ -548,7 +548,7 @@ static void scic_sds_port_destroy_dummy_resources(struct scic_sds_port *sci_port
548 * This method performs initialization of the supplied port. Initialization 548 * This method performs initialization of the supplied port. Initialization
549 * includes: - state machine initialization - member variable initialization 549 * includes: - state machine initialization - member variable initialization
550 * - configuring the phy_mask 550 * - configuring the phy_mask
551 * @this_port: 551 * @sci_port:
552 * @transport_layer_registers: 552 * @transport_layer_registers:
553 * @port_task_scheduler_registers: 553 * @port_task_scheduler_registers:
554 * @port_configuration_regsiter: 554 * @port_configuration_regsiter:
@@ -557,14 +557,14 @@ static void scic_sds_port_destroy_dummy_resources(struct scic_sds_port *sci_port
557 * if the phy being added to the port 557 * if the phy being added to the port
558 */ 558 */
559enum sci_status scic_sds_port_initialize( 559enum sci_status scic_sds_port_initialize(
560 struct scic_sds_port *this_port, 560 struct scic_sds_port *sci_port,
561 void __iomem *port_task_scheduler_registers, 561 void __iomem *port_task_scheduler_registers,
562 void __iomem *port_configuration_regsiter, 562 void __iomem *port_configuration_regsiter,
563 void __iomem *viit_registers) 563 void __iomem *viit_registers)
564{ 564{
565 this_port->port_task_scheduler_registers = port_task_scheduler_registers; 565 sci_port->port_task_scheduler_registers = port_task_scheduler_registers;
566 this_port->port_pe_configuration_register = port_configuration_regsiter; 566 sci_port->port_pe_configuration_register = port_configuration_regsiter;
567 this_port->viit_registers = viit_registers; 567 sci_port->viit_registers = viit_registers;
568 568
569 return SCI_SUCCESS; 569 return SCI_SUCCESS;
570} 570}
@@ -622,27 +622,27 @@ enum sci_status scic_port_hard_reset(
622/** 622/**
623 * This method assigns the direct attached device ID for this port. 623 * This method assigns the direct attached device ID for this port.
624 * 624 *
625 * @param[in] this_port The port for which the direct attached device id is to 625 * @param[in] sci_port The port for which the direct attached device id is to
626 * be assigned. 626 * be assigned.
627 * @param[in] device_id The direct attached device ID to assign to the port. 627 * @param[in] device_id The direct attached device ID to assign to the port.
628 * This will be the RNi for the device 628 * This will be the RNi for the device
629 */ 629 */
630void scic_sds_port_setup_transports( 630void scic_sds_port_setup_transports(
631 struct scic_sds_port *this_port, 631 struct scic_sds_port *sci_port,
632 u32 device_id) 632 u32 device_id)
633{ 633{
634 u8 index; 634 u8 index;
635 635
636 for (index = 0; index < SCI_MAX_PHYS; index++) { 636 for (index = 0; index < SCI_MAX_PHYS; index++) {
637 if (this_port->active_phy_mask & (1 << index)) 637 if (sci_port->active_phy_mask & (1 << index))
638 scic_sds_phy_setup_transport(this_port->phy_table[index], device_id); 638 scic_sds_phy_setup_transport(sci_port->phy_table[index], device_id);
639 } 639 }
640} 640}
641 641
642/** 642/**
643 * 643 *
644 * @this_port: This is the port on which the phy should be enabled. 644 * @sci_port: This is the port on which the phy should be enabled.
645 * @the_phy: This is the specific phy which to enable. 645 * @sci_phy: This is the specific phy which to enable.
646 * @do_notify_user: This parameter specifies whether to inform the user (via 646 * @do_notify_user: This parameter specifies whether to inform the user (via
647 * scic_cb_port_link_up()) as to the fact that a new phy as become ready. 647 * scic_cb_port_link_up()) as to the fact that a new phy as become ready.
648 * 648 *
@@ -696,8 +696,8 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
696 696
697/** 697/**
698 * 698 *
699 * @this_port: This is the port on which the phy should be disabled. 699 * @sci_port: This is the port on which the phy should be disabled.
700 * @the_phy: This is the specific phy which to disabled. 700 * @sci_phy: This is the specific phy which to disabled.
701 * 701 *
702 * This function will disable the phy and report that the phy is not valid for 702 * This function will disable the phy and report that the phy is not valid for
703 * this port object. None 703 * this port object. None
@@ -766,18 +766,18 @@ static void scic_sds_port_general_link_up_handler(struct scic_sds_port *sci_port
766 * This method returns false if the port only has a single phy object assigned. 766 * This method returns false if the port only has a single phy object assigned.
767 * If there are no phys or more than one phy then the method will return 767 * If there are no phys or more than one phy then the method will return
768 * true. 768 * true.
769 * @this_port: The port for which the wide port condition is to be checked. 769 * @sci_port: The port for which the wide port condition is to be checked.
770 * 770 *
771 * bool true Is returned if this is a wide ported port. false Is returned if 771 * bool true Is returned if this is a wide ported port. false Is returned if
772 * this is a narrow port. 772 * this is a narrow port.
773 */ 773 */
774static bool scic_sds_port_is_wide(struct scic_sds_port *this_port) 774static bool scic_sds_port_is_wide(struct scic_sds_port *sci_port)
775{ 775{
776 u32 index; 776 u32 index;
777 u32 phy_count = 0; 777 u32 phy_count = 0;
778 778
779 for (index = 0; index < SCI_MAX_PHYS; index++) { 779 for (index = 0; index < SCI_MAX_PHYS; index++) {
780 if (this_port->phy_table[index] != NULL) { 780 if (sci_port->phy_table[index] != NULL) {
781 phy_count++; 781 phy_count++;
782 } 782 }
783 } 783 }
@@ -790,8 +790,8 @@ static bool scic_sds_port_is_wide(struct scic_sds_port *this_port)
790 * port wants the PHY to continue on to the link up state then the port 790 * port wants the PHY to continue on to the link up state then the port
791 * layer must return true. If the port object returns false the phy object 791 * layer must return true. If the port object returns false the phy object
792 * must halt its attempt to go link up. 792 * must halt its attempt to go link up.
793 * @this_port: The port associated with the phy object. 793 * @sci_port: The port associated with the phy object.
794 * @the_phy: The phy object that is trying to go link up. 794 * @sci_phy: The phy object that is trying to go link up.
795 * 795 *
796 * true if the phy object can continue to the link up condition. true Is 796 * true if the phy object can continue to the link up condition. true Is
797 * returned if this phy can continue to the ready state. false Is returned if 797 * returned if this phy can continue to the ready state. false Is returned if
@@ -800,19 +800,19 @@ static bool scic_sds_port_is_wide(struct scic_sds_port *this_port)
800 * devices this could become an invalid port configuration. 800 * devices this could become an invalid port configuration.
801 */ 801 */
802bool scic_sds_port_link_detected( 802bool scic_sds_port_link_detected(
803 struct scic_sds_port *this_port, 803 struct scic_sds_port *sci_port,
804 struct scic_sds_phy *the_phy) 804 struct scic_sds_phy *sci_phy)
805{ 805{
806 struct sci_sas_identify_address_frame_protocols protocols; 806 struct sci_sas_identify_address_frame_protocols protocols;
807 807
808 scic_sds_phy_get_attached_phy_protocols(the_phy, &protocols); 808 scic_sds_phy_get_attached_phy_protocols(sci_phy, &protocols);
809 809
810 if ( 810 if (
811 (this_port->logical_port_index != SCIC_SDS_DUMMY_PORT) 811 (sci_port->logical_port_index != SCIC_SDS_DUMMY_PORT)
812 && (protocols.u.bits.stp_target) 812 && (protocols.u.bits.stp_target)
813 && scic_sds_port_is_wide(this_port) 813 && scic_sds_port_is_wide(sci_port)
814 ) { 814 ) {
815 scic_sds_port_invalid_link_up(this_port, the_phy); 815 scic_sds_port_invalid_link_up(sci_port, sci_phy);
816 816
817 return false; 817 return false;
818 } 818 }
@@ -823,65 +823,65 @@ bool scic_sds_port_link_detected(
823/** 823/**
824 * This method is the entry point for the phy to inform the port that it is now 824 * This method is the entry point for the phy to inform the port that it is now
825 * in a ready state 825 * in a ready state
826 * @this_port: 826 * @sci_port:
827 * 827 *
828 * 828 *
829 */ 829 */
830void scic_sds_port_link_up( 830void scic_sds_port_link_up(
831 struct scic_sds_port *this_port, 831 struct scic_sds_port *sci_port,
832 struct scic_sds_phy *the_phy) 832 struct scic_sds_phy *sci_phy)
833{ 833{
834 the_phy->is_in_link_training = false; 834 sci_phy->is_in_link_training = false;
835 835
836 this_port->state_handlers->link_up_handler(this_port, the_phy); 836 sci_port->state_handlers->link_up_handler(sci_port, sci_phy);
837} 837}
838 838
839/** 839/**
840 * This method is the entry point for the phy to inform the port that it is no 840 * This method is the entry point for the phy to inform the port that it is no
841 * longer in a ready state 841 * longer in a ready state
842 * @this_port: 842 * @sci_port:
843 * 843 *
844 * 844 *
845 */ 845 */
846void scic_sds_port_link_down( 846void scic_sds_port_link_down(
847 struct scic_sds_port *this_port, 847 struct scic_sds_port *sci_port,
848 struct scic_sds_phy *the_phy) 848 struct scic_sds_phy *sci_phy)
849{ 849{
850 this_port->state_handlers->link_down_handler(this_port, the_phy); 850 sci_port->state_handlers->link_down_handler(sci_port, sci_phy);
851} 851}
852 852
853/** 853/**
854 * This method is called to start an IO request on this port. 854 * This method is called to start an IO request on this port.
855 * @this_port: 855 * @sci_port:
856 * @the_device: 856 * @sci_dev:
857 * @the_io_request: 857 * @sci_req:
858 * 858 *
859 * enum sci_status 859 * enum sci_status
860 */ 860 */
861enum sci_status scic_sds_port_start_io( 861enum sci_status scic_sds_port_start_io(
862 struct scic_sds_port *this_port, 862 struct scic_sds_port *sci_port,
863 struct scic_sds_remote_device *the_device, 863 struct scic_sds_remote_device *sci_dev,
864 struct scic_sds_request *the_io_request) 864 struct scic_sds_request *sci_req)
865{ 865{
866 return this_port->state_handlers->start_io_handler( 866 return sci_port->state_handlers->start_io_handler(
867 this_port, the_device, the_io_request); 867 sci_port, sci_dev, sci_req);
868} 868}
869 869
870/** 870/**
871 * This method is called to complete an IO request to the port. 871 * This method is called to complete an IO request to the port.
872 * @this_port: 872 * @sci_port:
873 * @the_device: 873 * @sci_dev:
874 * @the_io_request: 874 * @sci_req:
875 * 875 *
876 * enum sci_status 876 * enum sci_status
877 */ 877 */
878enum sci_status scic_sds_port_complete_io( 878enum sci_status scic_sds_port_complete_io(
879 struct scic_sds_port *this_port, 879 struct scic_sds_port *sci_port,
880 struct scic_sds_remote_device *the_device, 880 struct scic_sds_remote_device *sci_dev,
881 struct scic_sds_request *the_io_request) 881 struct scic_sds_request *sci_req)
882{ 882{
883 return this_port->state_handlers->complete_io_handler( 883 return sci_port->state_handlers->complete_io_handler(
884 this_port, the_device, the_io_request); 884 sci_port, sci_dev, sci_req);
885} 885}
886 886
887/** 887/**
@@ -945,40 +945,40 @@ static void scic_sds_port_timeout_handler(void *port)
945 * 945 *
946 * 946 *
947 */ 947 */
948static void scic_sds_port_update_viit_entry(struct scic_sds_port *this_port) 948static void scic_sds_port_update_viit_entry(struct scic_sds_port *sci_port)
949{ 949{
950 struct sci_sas_address sas_address; 950 struct sci_sas_address sas_address;
951 951
952 scic_sds_port_get_sas_address(this_port, &sas_address); 952 scic_sds_port_get_sas_address(sci_port, &sas_address);
953 953
954 writel(sas_address.high, 954 writel(sas_address.high,
955 &this_port->viit_registers->initiator_sas_address_hi); 955 &sci_port->viit_registers->initiator_sas_address_hi);
956 writel(sas_address.low, 956 writel(sas_address.low,
957 &this_port->viit_registers->initiator_sas_address_lo); 957 &sci_port->viit_registers->initiator_sas_address_lo);
958 958
959 /* This value get cleared just in case its not already cleared */ 959 /* This value get cleared just in case its not already cleared */
960 writel(0, &this_port->viit_registers->reserved); 960 writel(0, &sci_port->viit_registers->reserved);
961 961
962 /* We are required to update the status register last */ 962 /* We are required to update the status register last */
963 writel(SCU_VIIT_ENTRY_ID_VIIT | 963 writel(SCU_VIIT_ENTRY_ID_VIIT |
964 SCU_VIIT_IPPT_INITIATOR | 964 SCU_VIIT_IPPT_INITIATOR |
965 ((1 << this_port->physical_port_index) << SCU_VIIT_ENTRY_LPVIE_SHIFT) | 965 ((1 << sci_port->physical_port_index) << SCU_VIIT_ENTRY_LPVIE_SHIFT) |
966 SCU_VIIT_STATUS_ALL_VALID, 966 SCU_VIIT_STATUS_ALL_VALID,
967 &this_port->viit_registers->status); 967 &sci_port->viit_registers->status);
968} 968}
969 969
970/** 970/**
971 * This method returns the maximum allowed speed for data transfers on this 971 * This method returns the maximum allowed speed for data transfers on this
972 * port. This maximum allowed speed evaluates to the maximum speed of the 972 * port. This maximum allowed speed evaluates to the maximum speed of the
973 * slowest phy in the port. 973 * slowest phy in the port.
974 * @this_port: This parameter specifies the port for which to retrieve the 974 * @sci_port: This parameter specifies the port for which to retrieve the
975 * maximum allowed speed. 975 * maximum allowed speed.
976 * 976 *
977 * This method returns the maximum negotiated speed of the slowest phy in the 977 * This method returns the maximum negotiated speed of the slowest phy in the
978 * port. 978 * port.
979 */ 979 */
980enum sas_linkrate scic_sds_port_get_max_allowed_speed( 980enum sas_linkrate scic_sds_port_get_max_allowed_speed(
981 struct scic_sds_port *this_port) 981 struct scic_sds_port *sci_port)
982{ 982{
983 u16 index; 983 u16 index;
984 enum sas_linkrate max_allowed_speed = SAS_LINK_RATE_6_0_GBPS; 984 enum sas_linkrate max_allowed_speed = SAS_LINK_RATE_6_0_GBPS;
@@ -988,10 +988,10 @@ enum sas_linkrate scic_sds_port_get_max_allowed_speed(
988 * Loop through all of the phys in this port and find the phy with the 988 * Loop through all of the phys in this port and find the phy with the
989 * lowest maximum link rate. */ 989 * lowest maximum link rate. */
990 for (index = 0; index < SCI_MAX_PHYS; index++) { 990 for (index = 0; index < SCI_MAX_PHYS; index++) {
991 phy = this_port->phy_table[index]; 991 phy = sci_port->phy_table[index];
992 if ( 992 if (
993 (phy != NULL) 993 (phy != NULL)
994 && (scic_sds_port_active_phy(this_port, phy) == true) 994 && (scic_sds_port_active_phy(sci_port, phy) == true)
995 && (phy->max_negotiated_speed < max_allowed_speed) 995 && (phy->max_negotiated_speed < max_allowed_speed)
996 ) 996 )
997 max_allowed_speed = phy->max_negotiated_speed; 997 max_allowed_speed = phy->max_negotiated_speed;
@@ -1003,8 +1003,8 @@ enum sas_linkrate scic_sds_port_get_max_allowed_speed(
1003 1003
1004/** 1004/**
1005 * This method passes the event to core user. 1005 * This method passes the event to core user.
1006 * @this_port: The port that a BCN happens. 1006 * @sci_port: The port that a BCN happens.
1007 * @this_phy: The phy that receives BCN. 1007 * @sci_phy: The phy that receives BCN.
1008 * 1008 *
1009 */ 1009 */
1010void scic_sds_port_broadcast_change_received( 1010void scic_sds_port_broadcast_change_received(
@@ -1022,7 +1022,7 @@ void scic_sds_port_broadcast_change_received(
1022/** 1022/**
1023 * This API methhod enables the broadcast change notification from underneath 1023 * This API methhod enables the broadcast change notification from underneath
1024 * hardware. 1024 * hardware.
1025 * @this_port: The port that a BCN had been disabled from. 1025 * @sci_port: The port that a BCN had been disabled from.
1026 * 1026 *
1027 */ 1027 */
1028void scic_port_enable_broadcast_change_notification( 1028void scic_port_enable_broadcast_change_notification(
@@ -1134,25 +1134,25 @@ static enum sci_status scic_sds_port_ready_substate_remove_phy_handler(
1134 1134
1135/** 1135/**
1136 * 1136 *
1137 * @this_port: This is the struct scic_sds_port object that which has a phy that has 1137 * @sci_port: This is the struct scic_sds_port object that which has a phy that has
1138 * gone link up. 1138 * gone link up.
1139 * @the_phy: This is the struct scic_sds_phy object that has gone link up. 1139 * @sci_phy: This is the struct scic_sds_phy object that has gone link up.
1140 * 1140 *
1141 * This method is the ready waiting substate link up handler for the 1141 * This method is the ready waiting substate link up handler for the
1142 * struct scic_sds_port object. This methos will report the link up condition for 1142 * struct scic_sds_port object. This methos will report the link up condition for
1143 * this port and will transition to the ready operational substate. none 1143 * this port and will transition to the ready operational substate. none
1144 */ 1144 */
1145static void scic_sds_port_ready_waiting_substate_link_up_handler( 1145static void scic_sds_port_ready_waiting_substate_link_up_handler(
1146 struct scic_sds_port *this_port, 1146 struct scic_sds_port *sci_port,
1147 struct scic_sds_phy *the_phy) 1147 struct scic_sds_phy *sci_phy)
1148{ 1148{
1149 /* 1149 /*
1150 * Since this is the first phy going link up for the port we can just enable 1150 * Since this is the first phy going link up for the port we can just enable
1151 * it and continue. */ 1151 * it and continue. */
1152 scic_sds_port_activate_phy(this_port, the_phy, true); 1152 scic_sds_port_activate_phy(sci_port, sci_phy, true);
1153 1153
1154 sci_base_state_machine_change_state( 1154 sci_base_state_machine_change_state(
1155 &this_port->ready_substate_machine, 1155 &sci_port->ready_substate_machine,
1156 SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL 1156 SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL
1157 ); 1157 );
1158} 1158}
@@ -1224,19 +1224,19 @@ sci_status scic_sds_port_ready_operational_substate_reset_handler(
1224 1224
1225/** 1225/**
1226 * scic_sds_port_ready_operational_substate_link_up_handler() - 1226 * scic_sds_port_ready_operational_substate_link_up_handler() -
1227 * @this_port: This is the struct scic_sds_port object that which has a phy that has 1227 * @sci_port: This is the struct scic_sds_port object that which has a phy that has
1228 * gone link up. 1228 * gone link up.
1229 * @the_phy: This is the struct scic_sds_phy object that has gone link up. 1229 * @sci_phy: This is the struct scic_sds_phy object that has gone link up.
1230 * 1230 *
1231 * This method is the ready operational substate link up handler for the 1231 * This method is the ready operational substate link up handler for the
1232 * struct scic_sds_port object. This function notifies the SCI User that the phy has 1232 * struct scic_sds_port object. This function notifies the SCI User that the phy has
1233 * gone link up. none 1233 * gone link up. none
1234 */ 1234 */
1235static void scic_sds_port_ready_operational_substate_link_up_handler( 1235static void scic_sds_port_ready_operational_substate_link_up_handler(
1236 struct scic_sds_port *this_port, 1236 struct scic_sds_port *sci_port,
1237 struct scic_sds_phy *the_phy) 1237 struct scic_sds_phy *sci_phy)
1238{ 1238{
1239 scic_sds_port_general_link_up_handler(this_port, the_phy, true); 1239 scic_sds_port_general_link_up_handler(sci_port, sci_phy, true);
1240} 1240}
1241 1241
1242/** 1242/**
@@ -1534,7 +1534,7 @@ scic_sds_port_ready_substate_handler_table[SCIC_SDS_PORT_READY_MAX_SUBSTATES] =
1534 1534
1535/** 1535/**
1536 * 1536 *
1537 * @this_port: This is the struct scic_sds_port object to suspend. 1537 * @sci_port: This is the struct scic_sds_port object to suspend.
1538 * 1538 *
1539 * This method will susped the port task scheduler for this port object. none 1539 * This method will susped the port task scheduler for this port object. none
1540 */ 1540 */
@@ -1602,7 +1602,7 @@ static void scic_sds_port_abort_dummy_request(struct scic_sds_port *sci_port)
1602 1602
1603/** 1603/**
1604 * 1604 *
1605 * @this_port: This is the struct scic_sds_port object to resume. 1605 * @sci_port: This is the struct scic_sds_port object to resume.
1606 * 1606 *
1607 * This method will resume the port task scheduler for this port object. none 1607 * This method will resume the port task scheduler for this port object. none
1608 */ 1608 */
@@ -1633,20 +1633,20 @@ scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port)
1633static void scic_sds_port_ready_substate_waiting_enter( 1633static void scic_sds_port_ready_substate_waiting_enter(
1634 struct sci_base_object *object) 1634 struct sci_base_object *object)
1635{ 1635{
1636 struct scic_sds_port *this_port = (struct scic_sds_port *)object; 1636 struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
1637 1637
1638 scic_sds_port_set_ready_state_handlers( 1638 scic_sds_port_set_ready_state_handlers(
1639 this_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING 1639 sci_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING
1640 ); 1640 );
1641 1641
1642 scic_sds_port_suspend_port_task_scheduler(this_port); 1642 scic_sds_port_suspend_port_task_scheduler(sci_port);
1643 1643
1644 this_port->not_ready_reason = SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS; 1644 sci_port->not_ready_reason = SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS;
1645 1645
1646 if (this_port->active_phy_mask != 0) { 1646 if (sci_port->active_phy_mask != 0) {
1647 /* At least one of the phys on the port is ready */ 1647 /* At least one of the phys on the port is ready */
1648 sci_base_state_machine_change_state( 1648 sci_base_state_machine_change_state(
1649 &this_port->ready_substate_machine, 1649 &sci_port->ready_substate_machine,
1650 SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL 1650 SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL
1651 ); 1651 );
1652 } 1652 }
@@ -1766,9 +1766,9 @@ static void scic_sds_port_ready_substate_configuring_enter(
1766static void scic_sds_port_ready_substate_configuring_exit( 1766static void scic_sds_port_ready_substate_configuring_exit(
1767 struct sci_base_object *object) 1767 struct sci_base_object *object)
1768{ 1768{
1769 struct scic_sds_port *this_port = (struct scic_sds_port *)object; 1769 struct scic_sds_port *sci_port = (struct scic_sds_port *)object;
1770 1770
1771 scic_sds_port_suspend_port_task_scheduler(this_port); 1771 scic_sds_port_suspend_port_task_scheduler(sci_port);
1772} 1772}
1773 1773
1774/* --------------------------------------------------------------------------- */ 1774/* --------------------------------------------------------------------------- */
@@ -2160,7 +2160,7 @@ scic_sds_port_state_handler_table[SCI_BASE_PORT_MAX_STATES] =
2160 2160
2161/** 2161/**
2162 * 2162 *
2163 * @this_port: This is the port object which to suspend. 2163 * @sci_port: This is the port object which to suspend.
2164 * 2164 *
2165 * This method will enable the SCU Port Task Scheduler for this port object but 2165 * This method will enable the SCU Port Task Scheduler for this port object but
2166 * will leave the port task scheduler in a suspended state. none 2166 * will leave the port task scheduler in a suspended state. none
@@ -2177,7 +2177,7 @@ scic_sds_port_enable_port_task_scheduler(struct scic_sds_port *port)
2177 2177
2178/** 2178/**
2179 * 2179 *
2180 * @this_port: This is the port object which to resume. 2180 * @sci_port: This is the port object which to resume.
2181 * 2181 *
2182 * This method will disable the SCU port task scheduler for this port object. 2182 * This method will disable the SCU port task scheduler for this port object.
2183 * none 2183 * none
@@ -2263,23 +2263,23 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci
2263static void scic_sds_port_stopped_state_enter( 2263static void scic_sds_port_stopped_state_enter(
2264 struct sci_base_object *object) 2264 struct sci_base_object *object)
2265{ 2265{
2266 struct scic_sds_port *this_port; 2266 struct scic_sds_port *sci_port;
2267 2267
2268 this_port = (struct scic_sds_port *)object; 2268 sci_port = (struct scic_sds_port *)object;
2269 2269
2270 scic_sds_port_set_base_state_handlers( 2270 scic_sds_port_set_base_state_handlers(
2271 this_port, SCI_BASE_PORT_STATE_STOPPED 2271 sci_port, SCI_BASE_PORT_STATE_STOPPED
2272 ); 2272 );
2273 2273
2274 if ( 2274 if (
2275 SCI_BASE_PORT_STATE_STOPPING 2275 SCI_BASE_PORT_STATE_STOPPING
2276 == this_port->state_machine.previous_state_id 2276 == sci_port->state_machine.previous_state_id
2277 ) { 2277 ) {
2278 /* 2278 /*
2279 * If we enter this state becasuse of a request to stop 2279 * If we enter this state becasuse of a request to stop
2280 * the port then we want to disable the hardwares port 2280 * the port then we want to disable the hardwares port
2281 * task scheduler. */ 2281 * task scheduler. */
2282 scic_sds_port_disable_port_task_scheduler(this_port); 2282 scic_sds_port_disable_port_task_scheduler(sci_port);
2283 } 2283 }
2284} 2284}
2285 2285
@@ -2294,12 +2294,12 @@ static void scic_sds_port_stopped_state_enter(
2294static void scic_sds_port_stopped_state_exit( 2294static void scic_sds_port_stopped_state_exit(
2295 struct sci_base_object *object) 2295 struct sci_base_object *object)
2296{ 2296{
2297 struct scic_sds_port *this_port; 2297 struct scic_sds_port *sci_port;
2298 2298
2299 this_port = (struct scic_sds_port *)object; 2299 sci_port = (struct scic_sds_port *)object;
2300 2300
2301 /* Enable and suspend the port task scheduler */ 2301 /* Enable and suspend the port task scheduler */
2302 scic_sds_port_enable_port_task_scheduler(this_port); 2302 scic_sds_port_enable_port_task_scheduler(sci_port);
2303} 2303}
2304 2304
2305/** 2305/**
@@ -2360,12 +2360,12 @@ static void scic_sds_port_ready_state_exit(struct sci_base_object *object)
2360static void scic_sds_port_resetting_state_enter( 2360static void scic_sds_port_resetting_state_enter(
2361 struct sci_base_object *object) 2361 struct sci_base_object *object)
2362{ 2362{
2363 struct scic_sds_port *this_port; 2363 struct scic_sds_port *sci_port;
2364 2364
2365 this_port = (struct scic_sds_port *)object; 2365 sci_port = (struct scic_sds_port *)object;
2366 2366
2367 scic_sds_port_set_base_state_handlers( 2367 scic_sds_port_set_base_state_handlers(
2368 this_port, SCI_BASE_PORT_STATE_RESETTING 2368 sci_port, SCI_BASE_PORT_STATE_RESETTING
2369 ); 2369 );
2370} 2370}
2371 2371
@@ -2397,12 +2397,12 @@ static inline void scic_sds_port_resetting_state_exit(
2397static void scic_sds_port_stopping_state_enter( 2397static void scic_sds_port_stopping_state_enter(
2398 struct sci_base_object *object) 2398 struct sci_base_object *object)
2399{ 2399{
2400 struct scic_sds_port *this_port; 2400 struct scic_sds_port *sci_port;
2401 2401
2402 this_port = (struct scic_sds_port *)object; 2402 sci_port = (struct scic_sds_port *)object;
2403 2403
2404 scic_sds_port_set_base_state_handlers( 2404 scic_sds_port_set_base_state_handlers(
2405 this_port, SCI_BASE_PORT_STATE_STOPPING 2405 sci_port, SCI_BASE_PORT_STATE_STOPPING
2406 ); 2406 );
2407} 2407}
2408 2408
diff --git a/drivers/scsi/isci/core/scic_sds_port.h b/drivers/scsi/isci/core/scic_sds_port.h
index c7741e81336e..964e3885dbf2 100644
--- a/drivers/scsi/isci/core/scic_sds_port.h
+++ b/drivers/scsi/isci/core/scic_sds_port.h
@@ -378,77 +378,77 @@ static inline void scic_sds_port_decrement_request_count(struct scic_sds_port *s
378 (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0) 378 (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0)
379 379
380void scic_sds_port_construct( 380void scic_sds_port_construct(
381 struct scic_sds_port *this_port, 381 struct scic_sds_port *sci_port,
382 u8 port_index, 382 u8 port_index,
383 struct scic_sds_controller *owning_controller); 383 struct scic_sds_controller *scic);
384 384
385enum sci_status scic_sds_port_initialize( 385enum sci_status scic_sds_port_initialize(
386 struct scic_sds_port *this_port, 386 struct scic_sds_port *sci_port,
387 void __iomem *port_task_scheduler_registers, 387 void __iomem *port_task_scheduler_registers,
388 void __iomem *port_configuration_regsiter, 388 void __iomem *port_configuration_regsiter,
389 void __iomem *viit_registers); 389 void __iomem *viit_registers);
390 390
391enum sci_status scic_sds_port_add_phy( 391enum sci_status scic_sds_port_add_phy(
392 struct scic_sds_port *this_port, 392 struct scic_sds_port *sci_port,
393 struct scic_sds_phy *the_phy); 393 struct scic_sds_phy *sci_phy);
394 394
395enum sci_status scic_sds_port_remove_phy( 395enum sci_status scic_sds_port_remove_phy(
396 struct scic_sds_port *this_port, 396 struct scic_sds_port *sci_port,
397 struct scic_sds_phy *the_phy); 397 struct scic_sds_phy *sci_phy);
398 398
399void scic_sds_port_setup_transports( 399void scic_sds_port_setup_transports(
400 struct scic_sds_port *this_port, 400 struct scic_sds_port *sci_port,
401 u32 device_id); 401 u32 device_id);
402 402
403 403
404void scic_sds_port_deactivate_phy( 404void scic_sds_port_deactivate_phy(
405 struct scic_sds_port *this_port, 405 struct scic_sds_port *sci_port,
406 struct scic_sds_phy *phy, 406 struct scic_sds_phy *sci_phy,
407 bool do_notify_user); 407 bool do_notify_user);
408 408
409bool scic_sds_port_link_detected( 409bool scic_sds_port_link_detected(
410 struct scic_sds_port *this_port, 410 struct scic_sds_port *sci_port,
411 struct scic_sds_phy *phy); 411 struct scic_sds_phy *sci_phy);
412 412
413void scic_sds_port_link_up( 413void scic_sds_port_link_up(
414 struct scic_sds_port *this_port, 414 struct scic_sds_port *sci_port,
415 struct scic_sds_phy *phy); 415 struct scic_sds_phy *sci_phy);
416 416
417void scic_sds_port_link_down( 417void scic_sds_port_link_down(
418 struct scic_sds_port *this_port, 418 struct scic_sds_port *sci_port,
419 struct scic_sds_phy *phy); 419 struct scic_sds_phy *sci_phy);
420 420
421enum sci_status scic_sds_port_start_io( 421enum sci_status scic_sds_port_start_io(
422 struct scic_sds_port *this_port, 422 struct scic_sds_port *sci_port,
423 struct scic_sds_remote_device *the_device, 423 struct scic_sds_remote_device *sci_dev,
424 struct scic_sds_request *the_io_request); 424 struct scic_sds_request *sci_req);
425 425
426enum sci_status scic_sds_port_complete_io( 426enum sci_status scic_sds_port_complete_io(
427 struct scic_sds_port *this_port, 427 struct scic_sds_port *sci_port,
428 struct scic_sds_remote_device *the_device, 428 struct scic_sds_remote_device *sci_dev,
429 struct scic_sds_request *the_io_request); 429 struct scic_sds_request *sci_req);
430 430
431enum sas_linkrate scic_sds_port_get_max_allowed_speed( 431enum sas_linkrate scic_sds_port_get_max_allowed_speed(
432 struct scic_sds_port *this_port); 432 struct scic_sds_port *sci_port);
433 433
434void scic_sds_port_broadcast_change_received( 434void scic_sds_port_broadcast_change_received(
435 struct scic_sds_port *this_port, 435 struct scic_sds_port *sci_port,
436 struct scic_sds_phy *this_phy); 436 struct scic_sds_phy *sci_phy);
437 437
438bool scic_sds_port_is_valid_phy_assignment( 438bool scic_sds_port_is_valid_phy_assignment(
439 struct scic_sds_port *this_port, 439 struct scic_sds_port *sci_port,
440 u32 phy_index); 440 u32 phy_index);
441 441
442void scic_sds_port_get_sas_address( 442void scic_sds_port_get_sas_address(
443 struct scic_sds_port *this_port, 443 struct scic_sds_port *sci_port,
444 struct sci_sas_address *sas_address); 444 struct sci_sas_address *sas_address);
445 445
446void scic_sds_port_get_attached_sas_address( 446void scic_sds_port_get_attached_sas_address(
447 struct scic_sds_port *this_port, 447 struct scic_sds_port *sci_port,
448 struct sci_sas_address *sas_address); 448 struct sci_sas_address *sas_address);
449 449
450void scic_sds_port_get_attached_protocols( 450void scic_sds_port_get_attached_protocols(
451 struct scic_sds_port *this_port, 451 struct scic_sds_port *sci_port,
452 struct sci_sas_identify_address_frame_protocols *protocols); 452 struct sci_sas_identify_address_frame_protocols *protocols);
453 453
454#endif /* _SCIC_SDS_PORT_H_ */ 454#endif /* _SCIC_SDS_PORT_H_ */
diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.c b/drivers/scsi/isci/core/scic_sds_remote_device.c
index 0976faeb4064..fa7828d4d975 100644
--- a/drivers/scsi/isci/core/scic_sds_remote_device.c
+++ b/drivers/scsi/isci/core/scic_sds_remote_device.c
@@ -149,17 +149,17 @@ enum sci_status scic_remote_device_da_construct(
149 149
150 150
151static void scic_sds_remote_device_get_info_from_smp_discover_response( 151static void scic_sds_remote_device_get_info_from_smp_discover_response(
152 struct scic_sds_remote_device *this_device, 152 struct scic_sds_remote_device *sci_dev,
153 struct smp_response_discover *discover_response) 153 struct smp_response_discover *discover_response)
154{ 154{
155 /* decode discover_response to set sas_address to this_device. */ 155 /* decode discover_response to set sas_address to sci_dev. */
156 this_device->device_address.high = 156 sci_dev->device_address.high =
157 discover_response->attached_sas_address.high; 157 discover_response->attached_sas_address.high;
158 158
159 this_device->device_address.low = 159 sci_dev->device_address.low =
160 discover_response->attached_sas_address.low; 160 discover_response->attached_sas_address.low;
161 161
162 this_device->target_protocols.u.all = discover_response->protocols.u.all; 162 sci_dev->target_protocols.u.all = discover_response->protocols.u.all;
163} 163}
164 164
165 165
@@ -168,15 +168,15 @@ enum sci_status scic_remote_device_ea_construct(
168 struct smp_response_discover *discover_response) 168 struct smp_response_discover *discover_response)
169{ 169{
170 enum sci_status status; 170 enum sci_status status;
171 struct scic_sds_controller *the_controller; 171 struct scic_sds_controller *scic;
172 172
173 the_controller = scic_sds_port_get_controller(sci_dev->owning_port); 173 scic = scic_sds_port_get_controller(sci_dev->owning_port);
174 174
175 scic_sds_remote_device_get_info_from_smp_discover_response( 175 scic_sds_remote_device_get_info_from_smp_discover_response(
176 sci_dev, discover_response); 176 sci_dev, discover_response);
177 177
178 status = scic_sds_controller_allocate_remote_node_context( 178 status = scic_sds_controller_allocate_remote_node_context(
179 the_controller, sci_dev, &sci_dev->rnc->remote_node_index); 179 scic, sci_dev, &sci_dev->rnc->remote_node_index);
180 180
181 if (status == SCI_SUCCESS) { 181 if (status == SCI_SUCCESS) {
182 if (sci_dev->target_protocols.u.bits.attached_ssp_target) { 182 if (sci_dev->target_protocols.u.bits.attached_ssp_target) {
@@ -294,32 +294,32 @@ bool scic_remote_device_is_atapi(struct scic_sds_remote_device *sci_dev)
294 294
295/** 295/**
296 * 296 *
297 * @this_device: The remote device for which the suspend is being requested. 297 * @sci_dev: The remote device for which the suspend is being requested.
298 * 298 *
299 * This method invokes the remote device suspend state handler. enum sci_status 299 * This method invokes the remote device suspend state handler. enum sci_status
300 */ 300 */
301enum sci_status scic_sds_remote_device_suspend( 301enum sci_status scic_sds_remote_device_suspend(
302 struct scic_sds_remote_device *this_device, 302 struct scic_sds_remote_device *sci_dev,
303 u32 suspend_type) 303 u32 suspend_type)
304{ 304{
305 return this_device->state_handlers->suspend_handler(this_device, suspend_type); 305 return sci_dev->state_handlers->suspend_handler(sci_dev, suspend_type);
306} 306}
307 307
308/** 308/**
309 * 309 *
310 * @this_device: The remote device for which the resume is being requested. 310 * @sci_dev: The remote device for which the resume is being requested.
311 * 311 *
312 * This method invokes the remote device resume state handler. enum sci_status 312 * This method invokes the remote device resume state handler. enum sci_status
313 */ 313 */
314enum sci_status scic_sds_remote_device_resume( 314enum sci_status scic_sds_remote_device_resume(
315 struct scic_sds_remote_device *this_device) 315 struct scic_sds_remote_device *sci_dev)
316{ 316{
317 return this_device->state_handlers->resume_handler(this_device); 317 return sci_dev->state_handlers->resume_handler(sci_dev);
318} 318}
319 319
320/** 320/**
321 * 321 *
322 * @this_device: The remote device for which the event handling is being 322 * @sci_dev: The remote device for which the event handling is being
323 * requested. 323 * requested.
324 * @frame_index: This is the frame index that is being processed. 324 * @frame_index: This is the frame index that is being processed.
325 * 325 *
@@ -327,31 +327,31 @@ enum sci_status scic_sds_remote_device_resume(
327 * enum sci_status 327 * enum sci_status
328 */ 328 */
329enum sci_status scic_sds_remote_device_frame_handler( 329enum sci_status scic_sds_remote_device_frame_handler(
330 struct scic_sds_remote_device *this_device, 330 struct scic_sds_remote_device *sci_dev,
331 u32 frame_index) 331 u32 frame_index)
332{ 332{
333 return this_device->state_handlers->frame_handler(this_device, frame_index); 333 return sci_dev->state_handlers->frame_handler(sci_dev, frame_index);
334} 334}
335 335
336/** 336/**
337 * 337 *
338 * @this_device: The remote device for which the event handling is being 338 * @sci_dev: The remote device for which the event handling is being
339 * requested. 339 * requested.
340 * @event_code: This is the event code that is to be processed. 340 * @event_code: This is the event code that is to be processed.
341 * 341 *
342 * This method invokes the remote device event handler. enum sci_status 342 * This method invokes the remote device event handler. enum sci_status
343 */ 343 */
344enum sci_status scic_sds_remote_device_event_handler( 344enum sci_status scic_sds_remote_device_event_handler(
345 struct scic_sds_remote_device *this_device, 345 struct scic_sds_remote_device *sci_dev,
346 u32 event_code) 346 u32 event_code)
347{ 347{
348 return this_device->state_handlers->event_handler(this_device, event_code); 348 return sci_dev->state_handlers->event_handler(sci_dev, event_code);
349} 349}
350 350
351/** 351/**
352 * 352 *
353 * @controller: The controller that is starting the io request. 353 * @controller: The controller that is starting the io request.
354 * @this_device: The remote device for which the start io handling is being 354 * @sci_dev: The remote device for which the start io handling is being
355 * requested. 355 * requested.
356 * @io_request: The io request that is being started. 356 * @io_request: The io request that is being started.
357 * 357 *
@@ -359,17 +359,17 @@ enum sci_status scic_sds_remote_device_event_handler(
359 */ 359 */
360enum sci_status scic_sds_remote_device_start_io( 360enum sci_status scic_sds_remote_device_start_io(
361 struct scic_sds_controller *controller, 361 struct scic_sds_controller *controller,
362 struct scic_sds_remote_device *this_device, 362 struct scic_sds_remote_device *sci_dev,
363 struct scic_sds_request *io_request) 363 struct scic_sds_request *io_request)
364{ 364{
365 return this_device->state_handlers->start_io_handler( 365 return sci_dev->state_handlers->start_io_handler(
366 this_device, io_request); 366 sci_dev, io_request);
367} 367}
368 368
369/** 369/**
370 * 370 *
371 * @controller: The controller that is completing the io request. 371 * @controller: The controller that is completing the io request.
372 * @this_device: The remote device for which the complete io handling is being 372 * @sci_dev: The remote device for which the complete io handling is being
373 * requested. 373 * requested.
374 * @io_request: The io request that is being completed. 374 * @io_request: The io request that is being completed.
375 * 375 *
@@ -377,17 +377,17 @@ enum sci_status scic_sds_remote_device_start_io(
377 */ 377 */
378enum sci_status scic_sds_remote_device_complete_io( 378enum sci_status scic_sds_remote_device_complete_io(
379 struct scic_sds_controller *controller, 379 struct scic_sds_controller *controller,
380 struct scic_sds_remote_device *this_device, 380 struct scic_sds_remote_device *sci_dev,
381 struct scic_sds_request *io_request) 381 struct scic_sds_request *io_request)
382{ 382{
383 return this_device->state_handlers->complete_io_handler( 383 return sci_dev->state_handlers->complete_io_handler(
384 this_device, io_request); 384 sci_dev, io_request);
385} 385}
386 386
387/** 387/**
388 * 388 *
389 * @controller: The controller that is starting the task request. 389 * @controller: The controller that is starting the task request.
390 * @this_device: The remote device for which the start task handling is being 390 * @sci_dev: The remote device for which the start task handling is being
391 * requested. 391 * requested.
392 * @io_request: The task request that is being started. 392 * @io_request: The task request that is being started.
393 * 393 *
@@ -395,17 +395,17 @@ enum sci_status scic_sds_remote_device_complete_io(
395 */ 395 */
396enum sci_status scic_sds_remote_device_start_task( 396enum sci_status scic_sds_remote_device_start_task(
397 struct scic_sds_controller *controller, 397 struct scic_sds_controller *controller,
398 struct scic_sds_remote_device *this_device, 398 struct scic_sds_remote_device *sci_dev,
399 struct scic_sds_request *io_request) 399 struct scic_sds_request *io_request)
400{ 400{
401 return this_device->state_handlers->start_task_handler( 401 return sci_dev->state_handlers->start_task_handler(
402 this_device, io_request); 402 sci_dev, io_request);
403} 403}
404 404
405/** 405/**
406 * 406 *
407 * @controller: The controller that is completing the task request. 407 * @controller: The controller that is completing the task request.
408 * @this_device: The remote device for which the complete task handling is 408 * @sci_dev: The remote device for which the complete task handling is
409 * being requested. 409 * being requested.
410 * @io_request: The task request that is being completed. 410 * @io_request: The task request that is being completed.
411 * 411 *
@@ -414,22 +414,22 @@ enum sci_status scic_sds_remote_device_start_task(
414 414
415/** 415/**
416 * 416 *
417 * @this_device: 417 * @sci_dev:
418 * @request: 418 * @request:
419 * 419 *
420 * This method takes the request and bulids an appropriate SCU context for the 420 * This method takes the request and bulids an appropriate SCU context for the
421 * request and then requests the controller to post the request. none 421 * request and then requests the controller to post the request. none
422 */ 422 */
423void scic_sds_remote_device_post_request( 423void scic_sds_remote_device_post_request(
424 struct scic_sds_remote_device *this_device, 424 struct scic_sds_remote_device *sci_dev,
425 u32 request) 425 u32 request)
426{ 426{
427 u32 context; 427 u32 context;
428 428
429 context = scic_sds_remote_device_build_command_context(this_device, request); 429 context = scic_sds_remote_device_build_command_context(sci_dev, request);
430 430
431 scic_sds_controller_post_request( 431 scic_sds_controller_post_request(
432 scic_sds_remote_device_get_controller(this_device), 432 scic_sds_remote_device_get_controller(sci_dev),
433 context 433 context
434 ); 434 );
435} 435}
@@ -437,22 +437,22 @@ void scic_sds_remote_device_post_request(
437#if !defined(DISABLE_ATAPI) 437#if !defined(DISABLE_ATAPI)
438/** 438/**
439 * 439 *
440 * @this_device: The device to be checked. 440 * @sci_dev: The device to be checked.
441 * 441 *
442 * This method check the signature fis of a stp device to decide whether a 442 * This method check the signature fis of a stp device to decide whether a
443 * device is atapi or not. true if a device is atapi device. False if a device 443 * device is atapi or not. true if a device is atapi device. False if a device
444 * is not atapi. 444 * is not atapi.
445 */ 445 */
446bool scic_sds_remote_device_is_atapi( 446bool scic_sds_remote_device_is_atapi(
447 struct scic_sds_remote_device *this_device) 447 struct scic_sds_remote_device *sci_dev)
448{ 448{
449 if (!this_device->target_protocols.u.bits.attached_stp_target) 449 if (!sci_dev->target_protocols.u.bits.attached_stp_target)
450 return false; 450 return false;
451 else if (this_device->is_direct_attached) { 451 else if (sci_dev->is_direct_attached) {
452 struct scic_sds_phy *phy; 452 struct scic_sds_phy *phy;
453 struct scic_sata_phy_properties properties; 453 struct scic_sata_phy_properties properties;
454 struct sata_fis_reg_d2h *signature_fis; 454 struct sata_fis_reg_d2h *signature_fis;
455 phy = scic_sds_port_get_a_connected_phy(this_device->owning_port); 455 phy = scic_sds_port_get_a_connected_phy(sci_dev->owning_port);
456 scic_sata_phy_get_properties(phy, &properties); 456 scic_sata_phy_get_properties(phy, &properties);
457 457
458 /* decode the signature fis. */ 458 /* decode the signature fis. */
@@ -506,16 +506,16 @@ static void scic_sds_cb_remote_device_rnc_destruct_complete(
506static void scic_sds_remote_device_resume_complete_handler( 506static void scic_sds_remote_device_resume_complete_handler(
507 void *user_parameter) 507 void *user_parameter)
508{ 508{
509 struct scic_sds_remote_device *this_device; 509 struct scic_sds_remote_device *sci_dev;
510 510
511 this_device = (struct scic_sds_remote_device *)user_parameter; 511 sci_dev = (struct scic_sds_remote_device *)user_parameter;
512 512
513 if ( 513 if (
514 sci_base_state_machine_get_state(&this_device->state_machine) 514 sci_base_state_machine_get_state(&sci_dev->state_machine)
515 != SCI_BASE_REMOTE_DEVICE_STATE_READY 515 != SCI_BASE_REMOTE_DEVICE_STATE_READY
516 ) { 516 ) {
517 sci_base_state_machine_change_state( 517 sci_base_state_machine_change_state(
518 &this_device->state_machine, 518 &sci_dev->state_machine,
519 SCI_BASE_REMOTE_DEVICE_STATE_READY 519 SCI_BASE_REMOTE_DEVICE_STATE_READY
520 ); 520 );
521 } 521 }
@@ -532,16 +532,16 @@ static void scic_sds_remote_device_resume_complete_handler(
532 * requests and task requests of all types. none 532 * requests and task requests of all types. none
533 */ 533 */
534void scic_sds_remote_device_start_request( 534void scic_sds_remote_device_start_request(
535 struct scic_sds_remote_device *this_device, 535 struct scic_sds_remote_device *sci_dev,
536 struct scic_sds_request *the_request, 536 struct scic_sds_request *sci_req,
537 enum sci_status status) 537 enum sci_status status)
538{ 538{
539 /* We still have a fault in starting the io complete it on the port */ 539 /* We still have a fault in starting the io complete it on the port */
540 if (status == SCI_SUCCESS) 540 if (status == SCI_SUCCESS)
541 scic_sds_remote_device_increment_request_count(this_device); 541 scic_sds_remote_device_increment_request_count(sci_dev);
542 else{ 542 else{
543 this_device->owning_port->state_handlers->complete_io_handler( 543 sci_dev->owning_port->state_handlers->complete_io_handler(
544 this_device->owning_port, this_device, the_request 544 sci_dev->owning_port, sci_dev, sci_req
545 ); 545 );
546 } 546 }
547} 547}
@@ -576,7 +576,7 @@ void scic_sds_remote_device_continue_request(void *dev)
576/** 576/**
577 * This method will terminate all of the IO requests in the controllers IO 577 * This method will terminate all of the IO requests in the controllers IO
578 * request table that were targeted for this device. 578 * request table that were targeted for this device.
579 * @this_device: This parameter specifies the remote device for which to 579 * @sci_dev: This parameter specifies the remote device for which to
580 * attempt to terminate all requests. 580 * attempt to terminate all requests.
581 * 581 *
582 * This method returns an indication as to whether all requests were 582 * This method returns an indication as to whether all requests were
@@ -584,24 +584,24 @@ void scic_sds_remote_device_continue_request(void *dev)
584 * this method will return the failure. 584 * this method will return the failure.
585 */ 585 */
586static enum sci_status scic_sds_remote_device_terminate_requests( 586static enum sci_status scic_sds_remote_device_terminate_requests(
587 struct scic_sds_remote_device *this_device) 587 struct scic_sds_remote_device *sci_dev)
588{ 588{
589 enum sci_status status = SCI_SUCCESS; 589 enum sci_status status = SCI_SUCCESS;
590 enum sci_status terminate_status = SCI_SUCCESS; 590 enum sci_status terminate_status = SCI_SUCCESS;
591 struct scic_sds_request *the_request; 591 struct scic_sds_request *sci_req;
592 u32 index; 592 u32 index;
593 u32 request_count = this_device->started_request_count; 593 u32 request_count = sci_dev->started_request_count;
594 594
595 for (index = 0; 595 for (index = 0;
596 (index < SCI_MAX_IO_REQUESTS) && (request_count > 0); 596 (index < SCI_MAX_IO_REQUESTS) && (request_count > 0);
597 index++) { 597 index++) {
598 the_request = this_device->owning_port->owning_controller->io_request_table[index]; 598 sci_req = sci_dev->owning_port->owning_controller->io_request_table[index];
599 599
600 if ((the_request != NULL) && (the_request->target_device == this_device)) { 600 if ((sci_req != NULL) && (sci_req->target_device == sci_dev)) {
601 terminate_status = scic_controller_terminate_request( 601 terminate_status = scic_controller_terminate_request(
602 this_device->owning_port->owning_controller, 602 sci_dev->owning_port->owning_controller,
603 this_device, 603 sci_dev,
604 the_request 604 sci_req
605 ); 605 );
606 606
607 if (terminate_status != SCI_SUCCESS) 607 if (terminate_status != SCI_SUCCESS)
@@ -684,7 +684,7 @@ enum sci_status scic_sds_remote_device_default_resume_handler(
684 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE 684 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
685 */ 685 */
686static enum sci_status scic_sds_remote_device_core_event_handler( 686static enum sci_status scic_sds_remote_device_core_event_handler(
687 struct scic_sds_remote_device *this_device, 687 struct scic_sds_remote_device *sci_dev,
688 u32 event_code, 688 u32 event_code,
689 bool is_ready_state) 689 bool is_ready_state)
690{ 690{
@@ -694,7 +694,7 @@ static enum sci_status scic_sds_remote_device_core_event_handler(
694 case SCU_EVENT_TYPE_RNC_OPS_MISC: 694 case SCU_EVENT_TYPE_RNC_OPS_MISC:
695 case SCU_EVENT_TYPE_RNC_SUSPEND_TX: 695 case SCU_EVENT_TYPE_RNC_SUSPEND_TX:
696 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX: 696 case SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX:
697 status = scic_sds_remote_node_context_event_handler(this_device->rnc, event_code); 697 status = scic_sds_remote_node_context_event_handler(sci_dev->rnc, event_code);
698 break; 698 break;
699 case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT: 699 case SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT:
700 700
@@ -702,13 +702,13 @@ static enum sci_status scic_sds_remote_device_core_event_handler(
702 status = SCI_SUCCESS; 702 status = SCI_SUCCESS;
703 703
704 /* Suspend the associated RNC */ 704 /* Suspend the associated RNC */
705 scic_sds_remote_node_context_suspend(this_device->rnc, 705 scic_sds_remote_node_context_suspend(sci_dev->rnc,
706 SCI_SOFTWARE_SUSPENSION, 706 SCI_SOFTWARE_SUSPENSION,
707 NULL, NULL); 707 NULL, NULL);
708 708
709 dev_dbg(scirdev_to_dev(this_device), 709 dev_dbg(scirdev_to_dev(sci_dev),
710 "%s: device: %p event code: %x: %s\n", 710 "%s: device: %p event code: %x: %s\n",
711 __func__, this_device, event_code, 711 __func__, sci_dev, event_code,
712 (is_ready_state) 712 (is_ready_state)
713 ? "I_T_Nexus_Timeout event" 713 ? "I_T_Nexus_Timeout event"
714 : "I_T_Nexus_Timeout event in wrong state"); 714 : "I_T_Nexus_Timeout event in wrong state");
@@ -718,9 +718,9 @@ static enum sci_status scic_sds_remote_device_core_event_handler(
718 /* Else, fall through and treat as unhandled... */ 718 /* Else, fall through and treat as unhandled... */
719 719
720 default: 720 default:
721 dev_dbg(scirdev_to_dev(this_device), 721 dev_dbg(scirdev_to_dev(sci_dev),
722 "%s: device: %p event code: %x: %s\n", 722 "%s: device: %p event code: %x: %s\n",
723 __func__, this_device, event_code, 723 __func__, sci_dev, event_code,
724 (is_ready_state) 724 (is_ready_state)
725 ? "unexpected event" 725 ? "unexpected event"
726 : "unexpected event in wrong state"); 726 : "unexpected event in wrong state");
@@ -742,10 +742,10 @@ static enum sci_status scic_sds_remote_device_core_event_handler(
742 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE 742 * returns a failure. enum sci_status SCI_FAILURE_INVALID_STATE
743 */ 743 */
744static enum sci_status scic_sds_remote_device_default_event_handler( 744static enum sci_status scic_sds_remote_device_default_event_handler(
745 struct scic_sds_remote_device *this_device, 745 struct scic_sds_remote_device *sci_dev,
746 u32 event_code) 746 u32 event_code)
747{ 747{
748 return scic_sds_remote_device_core_event_handler(this_device, 748 return scic_sds_remote_device_core_event_handler(sci_dev,
749 event_code, 749 event_code,
750 false); 750 false);
751} 751}
@@ -762,20 +762,20 @@ static enum sci_status scic_sds_remote_device_default_event_handler(
762 * SCI_FAILURE_INVALID_STATE 762 * SCI_FAILURE_INVALID_STATE
763 */ 763 */
764enum sci_status scic_sds_remote_device_default_frame_handler( 764enum sci_status scic_sds_remote_device_default_frame_handler(
765 struct scic_sds_remote_device *this_device, 765 struct scic_sds_remote_device *sci_dev,
766 u32 frame_index) 766 u32 frame_index)
767{ 767{
768 dev_warn(scirdev_to_dev(this_device), 768 dev_warn(scirdev_to_dev(sci_dev),
769 "%s: SCIC Remote Device requested to handle frame %x " 769 "%s: SCIC Remote Device requested to handle frame %x "
770 "while in wrong state %d\n", 770 "while in wrong state %d\n",
771 __func__, 771 __func__,
772 frame_index, 772 frame_index,
773 sci_base_state_machine_get_state( 773 sci_base_state_machine_get_state(
774 &this_device->state_machine)); 774 &sci_dev->state_machine));
775 775
776 /* Return the frame back to the controller */ 776 /* Return the frame back to the controller */
777 scic_sds_controller_release_frame( 777 scic_sds_controller_release_frame(
778 scic_sds_remote_device_get_controller(this_device), frame_index 778 scic_sds_remote_device_get_controller(sci_dev), frame_index
779 ); 779 );
780 780
781 return SCI_FAILURE_INVALID_STATE; 781 return SCI_FAILURE_INVALID_STATE;
@@ -815,7 +815,7 @@ enum sci_status scic_sds_remote_device_default_continue_request_handler(
815 * unsolicited frame to that object. enum sci_status SCI_FAILURE_INVALID_STATE 815 * unsolicited frame to that object. enum sci_status SCI_FAILURE_INVALID_STATE
816 */ 816 */
817enum sci_status scic_sds_remote_device_general_frame_handler( 817enum sci_status scic_sds_remote_device_general_frame_handler(
818 struct scic_sds_remote_device *this_device, 818 struct scic_sds_remote_device *sci_dev,
819 u32 frame_index) 819 u32 frame_index)
820{ 820{
821 enum sci_status result; 821 enum sci_status result;
@@ -823,22 +823,22 @@ enum sci_status scic_sds_remote_device_general_frame_handler(
823 struct scic_sds_request *io_request; 823 struct scic_sds_request *io_request;
824 824
825 result = scic_sds_unsolicited_frame_control_get_header( 825 result = scic_sds_unsolicited_frame_control_get_header(
826 &(scic_sds_remote_device_get_controller(this_device)->uf_control), 826 &(scic_sds_remote_device_get_controller(sci_dev)->uf_control),
827 frame_index, 827 frame_index,
828 (void **)&frame_header 828 (void **)&frame_header
829 ); 829 );
830 830
831 if (SCI_SUCCESS == result) { 831 if (SCI_SUCCESS == result) {
832 io_request = scic_sds_controller_get_io_request_from_tag( 832 io_request = scic_sds_controller_get_io_request_from_tag(
833 scic_sds_remote_device_get_controller(this_device), frame_header->tag); 833 scic_sds_remote_device_get_controller(sci_dev), frame_header->tag);
834 834
835 if ((io_request == NULL) 835 if ((io_request == NULL)
836 || (io_request->target_device != this_device)) { 836 || (io_request->target_device != sci_dev)) {
837 /* 837 /*
838 * We could not map this tag to a valid IO request 838 * We could not map this tag to a valid IO request
839 * Just toss the frame and continue */ 839 * Just toss the frame and continue */
840 scic_sds_controller_release_frame( 840 scic_sds_controller_release_frame(
841 scic_sds_remote_device_get_controller(this_device), frame_index 841 scic_sds_remote_device_get_controller(sci_dev), frame_index
842 ); 842 );
843 } else { 843 } else {
844 /* The IO request is now in charge of releasing the frame */ 844 /* The IO request is now in charge of releasing the frame */
@@ -852,17 +852,17 @@ enum sci_status scic_sds_remote_device_general_frame_handler(
852 852
853/** 853/**
854 * 854 *
855 * @[in]: this_device This is the device object that is receiving the event. 855 * @[in]: sci_dev This is the device object that is receiving the event.
856 * @[in]: event_code The event code to process. 856 * @[in]: event_code The event code to process.
857 * 857 *
858 * This is a common method for handling events reported to the remote device 858 * This is a common method for handling events reported to the remote device
859 * from the controller object. enum sci_status 859 * from the controller object. enum sci_status
860 */ 860 */
861enum sci_status scic_sds_remote_device_general_event_handler( 861enum sci_status scic_sds_remote_device_general_event_handler(
862 struct scic_sds_remote_device *this_device, 862 struct scic_sds_remote_device *sci_dev,
863 u32 event_code) 863 u32 event_code)
864{ 864{
865 return scic_sds_remote_device_core_event_handler(this_device, 865 return scic_sds_remote_device_core_event_handler(sci_dev,
866 event_code, 866 event_code,
867 true); 867 true);
868} 868}
@@ -1093,7 +1093,7 @@ static enum sci_status scic_sds_remote_device_ready_state_complete_request_handl
1093 1093
1094/** 1094/**
1095 * 1095 *
1096 * @this_device: The struct scic_sds_remote_device which is cast into a 1096 * @sci_dev: The struct scic_sds_remote_device which is cast into a
1097 * struct scic_sds_remote_device. 1097 * struct scic_sds_remote_device.
1098 * 1098 *
1099 * This method will stop a struct scic_sds_remote_device that is already in the 1099 * This method will stop a struct scic_sds_remote_device that is already in the
@@ -1536,10 +1536,10 @@ static void scic_sds_remote_device_ready_state_exit(
1536static void scic_sds_remote_device_stopping_state_enter( 1536static void scic_sds_remote_device_stopping_state_enter(
1537 struct sci_base_object *object) 1537 struct sci_base_object *object)
1538{ 1538{
1539 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; 1539 struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
1540 1540
1541 SET_STATE_HANDLER( 1541 SET_STATE_HANDLER(
1542 this_device, 1542 sci_dev,
1543 scic_sds_remote_device_state_handler_table, 1543 scic_sds_remote_device_state_handler_table,
1544 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING 1544 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING
1545 ); 1545 );
@@ -1556,10 +1556,10 @@ static void scic_sds_remote_device_stopping_state_enter(
1556static void scic_sds_remote_device_failed_state_enter( 1556static void scic_sds_remote_device_failed_state_enter(
1557 struct sci_base_object *object) 1557 struct sci_base_object *object)
1558{ 1558{
1559 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; 1559 struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
1560 1560
1561 SET_STATE_HANDLER( 1561 SET_STATE_HANDLER(
1562 this_device, 1562 sci_dev,
1563 scic_sds_remote_device_state_handler_table, 1563 scic_sds_remote_device_state_handler_table,
1564 SCI_BASE_REMOTE_DEVICE_STATE_FAILED 1564 SCI_BASE_REMOTE_DEVICE_STATE_FAILED
1565 ); 1565 );
@@ -1576,16 +1576,16 @@ static void scic_sds_remote_device_failed_state_enter(
1576static void scic_sds_remote_device_resetting_state_enter( 1576static void scic_sds_remote_device_resetting_state_enter(
1577 struct sci_base_object *object) 1577 struct sci_base_object *object)
1578{ 1578{
1579 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; 1579 struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
1580 1580
1581 SET_STATE_HANDLER( 1581 SET_STATE_HANDLER(
1582 this_device, 1582 sci_dev,
1583 scic_sds_remote_device_state_handler_table, 1583 scic_sds_remote_device_state_handler_table,
1584 SCI_BASE_REMOTE_DEVICE_STATE_RESETTING 1584 SCI_BASE_REMOTE_DEVICE_STATE_RESETTING
1585 ); 1585 );
1586 1586
1587 scic_sds_remote_node_context_suspend( 1587 scic_sds_remote_node_context_suspend(
1588 this_device->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL); 1588 sci_dev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
1589} 1589}
1590 1590
1591/** 1591/**
@@ -1599,9 +1599,9 @@ static void scic_sds_remote_device_resetting_state_enter(
1599static void scic_sds_remote_device_resetting_state_exit( 1599static void scic_sds_remote_device_resetting_state_exit(
1600 struct sci_base_object *object) 1600 struct sci_base_object *object)
1601{ 1601{
1602 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; 1602 struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
1603 1603
1604 scic_sds_remote_node_context_resume(this_device->rnc, NULL, NULL); 1604 scic_sds_remote_node_context_resume(sci_dev->rnc, NULL, NULL);
1605} 1605}
1606 1606
1607/** 1607/**
@@ -1615,10 +1615,10 @@ static void scic_sds_remote_device_resetting_state_exit(
1615static void scic_sds_remote_device_final_state_enter( 1615static void scic_sds_remote_device_final_state_enter(
1616 struct sci_base_object *object) 1616 struct sci_base_object *object)
1617{ 1617{
1618 struct scic_sds_remote_device *this_device = (struct scic_sds_remote_device *)object; 1618 struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object;
1619 1619
1620 SET_STATE_HANDLER( 1620 SET_STATE_HANDLER(
1621 this_device, 1621 sci_dev,
1622 scic_sds_remote_device_state_handler_table, 1622 scic_sds_remote_device_state_handler_table,
1623 SCI_BASE_REMOTE_DEVICE_STATE_FINAL 1623 SCI_BASE_REMOTE_DEVICE_STATE_FINAL
1624 ); 1624 );
diff --git a/drivers/scsi/isci/core/scic_sds_remote_device.h b/drivers/scsi/isci/core/scic_sds_remote_device.h
index ebb0ac8ef3a6..5d3df92212eb 100644
--- a/drivers/scsi/isci/core/scic_sds_remote_device.h
+++ b/drivers/scsi/isci/core/scic_sds_remote_device.h
@@ -350,25 +350,25 @@ typedef enum sci_status (*scic_sds_remote_device_high_priority_request_complete_
350 enum sci_io_status); 350 enum sci_io_status);
351 351
352typedef enum sci_status (*scic_sds_remote_device_handler_t)( 352typedef enum sci_status (*scic_sds_remote_device_handler_t)(
353 struct scic_sds_remote_device *this_device); 353 struct scic_sds_remote_device *sci_dev);
354 354
355typedef enum sci_status (*scic_sds_remote_device_suspend_handler_t)( 355typedef enum sci_status (*scic_sds_remote_device_suspend_handler_t)(
356 struct scic_sds_remote_device *this_device, 356 struct scic_sds_remote_device *sci_dev,
357 u32 suspend_type); 357 u32 suspend_type);
358 358
359typedef enum sci_status (*scic_sds_remote_device_resume_handler_t)( 359typedef enum sci_status (*scic_sds_remote_device_resume_handler_t)(
360 struct scic_sds_remote_device *this_device); 360 struct scic_sds_remote_device *sci_dev);
361 361
362typedef enum sci_status (*scic_sds_remote_device_frame_handler_t)( 362typedef enum sci_status (*scic_sds_remote_device_frame_handler_t)(
363 struct scic_sds_remote_device *this_device, 363 struct scic_sds_remote_device *sci_dev,
364 u32 frame_index); 364 u32 frame_index);
365 365
366typedef enum sci_status (*scic_sds_remote_device_event_handler_t)( 366typedef enum sci_status (*scic_sds_remote_device_event_handler_t)(
367 struct scic_sds_remote_device *this_device, 367 struct scic_sds_remote_device *sci_dev,
368 u32 event_code); 368 u32 event_code);
369 369
370typedef void (*scic_sds_remote_device_ready_not_ready_handler_t)( 370typedef void (*scic_sds_remote_device_ready_not_ready_handler_t)(
371 struct scic_sds_remote_device *this_device); 371 struct scic_sds_remote_device *sci_dev);
372 372
373/** 373/**
374 * struct scic_sds_remote_device_state_handler - This structure conains the 374 * struct scic_sds_remote_device_state_handler - This structure conains the
@@ -461,8 +461,8 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
461 * 461 *
462 * This macro incrments the request count for this device 462 * This macro incrments the request count for this device
463 */ 463 */
464#define scic_sds_remote_device_increment_request_count(this_device) \ 464#define scic_sds_remote_device_increment_request_count(sci_dev) \
465 ((this_device)->started_request_count++) 465 ((sci_dev)->started_request_count++)
466 466
467/** 467/**
468 * scic_sds_remote_device_decrement_request_count() - 468 * scic_sds_remote_device_decrement_request_count() -
@@ -470,33 +470,33 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
470 * This macro decrements the request count for this device. This count will 470 * This macro decrements the request count for this device. This count will
471 * never decrment past 0. 471 * never decrment past 0.
472 */ 472 */
473#define scic_sds_remote_device_decrement_request_count(this_device) \ 473#define scic_sds_remote_device_decrement_request_count(sci_dev) \
474 ((this_device)->started_request_count > 0 ? \ 474 ((sci_dev)->started_request_count > 0 ? \
475 (this_device)->started_request_count-- : 0) 475 (sci_dev)->started_request_count-- : 0)
476 476
477/** 477/**
478 * scic_sds_remote_device_get_request_count() - 478 * scic_sds_remote_device_get_request_count() -
479 * 479 *
480 * This is a helper macro to return the current device request count. 480 * This is a helper macro to return the current device request count.
481 */ 481 */
482#define scic_sds_remote_device_get_request_count(this_device) \ 482#define scic_sds_remote_device_get_request_count(sci_dev) \
483 ((this_device)->started_request_count) 483 ((sci_dev)->started_request_count)
484 484
485/** 485/**
486 * scic_sds_remote_device_get_port() - 486 * scic_sds_remote_device_get_port() -
487 * 487 *
488 * This macro returns the owning port of this remote device obejct. 488 * This macro returns the owning port of this remote device obejct.
489 */ 489 */
490#define scic_sds_remote_device_get_port(this_device) \ 490#define scic_sds_remote_device_get_port(sci_dev) \
491 ((this_device)->owning_port) 491 ((sci_dev)->owning_port)
492 492
493/** 493/**
494 * scic_sds_remote_device_get_controller() - 494 * scic_sds_remote_device_get_controller() -
495 * 495 *
496 * This macro returns the controller object that contains this device object 496 * This macro returns the controller object that contains this device object
497 */ 497 */
498#define scic_sds_remote_device_get_controller(this_device) \ 498#define scic_sds_remote_device_get_controller(sci_dev) \
499 scic_sds_port_get_controller(scic_sds_remote_device_get_port(this_device)) 499 scic_sds_port_get_controller(scic_sds_remote_device_get_port(sci_dev))
500 500
501/** 501/**
502 * scic_sds_remote_device_set_state_handlers() - 502 * scic_sds_remote_device_set_state_handlers() -
@@ -504,26 +504,26 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
504 * This macro sets the remote device state handlers pointer and is set on entry 504 * This macro sets the remote device state handlers pointer and is set on entry
505 * to each device state. 505 * to each device state.
506 */ 506 */
507#define scic_sds_remote_device_set_state_handlers(this_device, handlers) \ 507#define scic_sds_remote_device_set_state_handlers(sci_dev, handlers) \
508 ((this_device)->state_handlers = (handlers)) 508 ((sci_dev)->state_handlers = (handlers))
509 509
510/** 510/**
511 * scic_sds_remote_device_get_port() - 511 * scic_sds_remote_device_get_port() -
512 * 512 *
513 * This macro returns the owning port of this device 513 * This macro returns the owning port of this device
514 */ 514 */
515#define scic_sds_remote_device_get_port(this_device) \ 515#define scic_sds_remote_device_get_port(sci_dev) \
516 ((this_device)->owning_port) 516 ((sci_dev)->owning_port)
517 517
518/** 518/**
519 * scic_sds_remote_device_get_sequence() - 519 * scic_sds_remote_device_get_sequence() -
520 * 520 *
521 * This macro returns the remote device sequence value 521 * This macro returns the remote device sequence value
522 */ 522 */
523#define scic_sds_remote_device_get_sequence(this_device) \ 523#define scic_sds_remote_device_get_sequence(sci_dev) \
524 (\ 524 (\
525 scic_sds_remote_device_get_controller(this_device)-> \ 525 scic_sds_remote_device_get_controller(sci_dev)-> \
526 remote_device_sequence[(this_device)->rnc->remote_node_index] \ 526 remote_device_sequence[(sci_dev)->rnc->remote_node_index] \
527 ) 527 )
528 528
529/** 529/**
@@ -531,11 +531,11 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
531 * 531 *
532 * This macro returns the controllers protocol engine group 532 * This macro returns the controllers protocol engine group
533 */ 533 */
534#define scic_sds_remote_device_get_controller_peg(this_device) \ 534#define scic_sds_remote_device_get_controller_peg(sci_dev) \
535 (\ 535 (\
536 scic_sds_controller_get_protocol_engine_group(\ 536 scic_sds_controller_get_protocol_engine_group(\
537 scic_sds_port_get_controller(\ 537 scic_sds_port_get_controller(\
538 scic_sds_remote_device_get_port(this_device) \ 538 scic_sds_remote_device_get_port(sci_dev) \
539 ) \ 539 ) \
540 ) \ 540 ) \
541 ) 541 )
@@ -545,16 +545,16 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
545 * 545 *
546 * This macro returns the port index for the devices owning port 546 * This macro returns the port index for the devices owning port
547 */ 547 */
548#define scic_sds_remote_device_get_port_index(this_device) \ 548#define scic_sds_remote_device_get_port_index(sci_dev) \
549 (scic_sds_port_get_index(scic_sds_remote_device_get_port(this_device))) 549 (scic_sds_port_get_index(scic_sds_remote_device_get_port(sci_dev)))
550 550
551/** 551/**
552 * scic_sds_remote_device_get_index() - 552 * scic_sds_remote_device_get_index() -
553 * 553 *
554 * This macro returns the remote node index for this device object 554 * This macro returns the remote node index for this device object
555 */ 555 */
556#define scic_sds_remote_device_get_index(this_device) \ 556#define scic_sds_remote_device_get_index(sci_dev) \
557 ((this_device)->rnc->remote_node_index) 557 ((sci_dev)->rnc->remote_node_index)
558 558
559/** 559/**
560 * scic_sds_remote_device_build_command_context() - 560 * scic_sds_remote_device_build_command_context() -
@@ -579,61 +579,61 @@ extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_tab
579 ((device)->working_request = (request)) 579 ((device)->working_request = (request))
580 580
581enum sci_status scic_sds_remote_device_frame_handler( 581enum sci_status scic_sds_remote_device_frame_handler(
582 struct scic_sds_remote_device *this_device, 582 struct scic_sds_remote_device *sci_dev,
583 u32 frame_index); 583 u32 frame_index);
584 584
585enum sci_status scic_sds_remote_device_event_handler( 585enum sci_status scic_sds_remote_device_event_handler(
586 struct scic_sds_remote_device *this_device, 586 struct scic_sds_remote_device *sci_dev,
587 u32 event_code); 587 u32 event_code);
588 588
589enum sci_status scic_sds_remote_device_start_io( 589enum sci_status scic_sds_remote_device_start_io(
590 struct scic_sds_controller *controller, 590 struct scic_sds_controller *controller,
591 struct scic_sds_remote_device *this_device, 591 struct scic_sds_remote_device *sci_dev,
592 struct scic_sds_request *io_request); 592 struct scic_sds_request *io_request);
593 593
594enum sci_status scic_sds_remote_device_complete_io( 594enum sci_status scic_sds_remote_device_complete_io(
595 struct scic_sds_controller *controller, 595 struct scic_sds_controller *controller,
596 struct scic_sds_remote_device *this_device, 596 struct scic_sds_remote_device *sci_dev,
597 struct scic_sds_request *io_request); 597 struct scic_sds_request *io_request);
598 598
599enum sci_status scic_sds_remote_device_resume( 599enum sci_status scic_sds_remote_device_resume(
600 struct scic_sds_remote_device *this_device); 600 struct scic_sds_remote_device *sci_dev);
601 601
602enum sci_status scic_sds_remote_device_suspend( 602enum sci_status scic_sds_remote_device_suspend(
603 struct scic_sds_remote_device *this_device, 603 struct scic_sds_remote_device *sci_dev,
604 u32 suspend_type); 604 u32 suspend_type);
605 605
606enum sci_status scic_sds_remote_device_start_task( 606enum sci_status scic_sds_remote_device_start_task(
607 struct scic_sds_controller *controller, 607 struct scic_sds_controller *controller,
608 struct scic_sds_remote_device *this_device, 608 struct scic_sds_remote_device *sci_dev,
609 struct scic_sds_request *io_request); 609 struct scic_sds_request *io_request);
610 610
611void scic_sds_remote_device_post_request( 611void scic_sds_remote_device_post_request(
612 struct scic_sds_remote_device *this_device, 612 struct scic_sds_remote_device *sci_dev,
613 u32 request); 613 u32 request);
614 614
615#if !defined(DISABLE_ATAPI) 615#if !defined(DISABLE_ATAPI)
616bool scic_sds_remote_device_is_atapi( 616bool scic_sds_remote_device_is_atapi(
617 struct scic_sds_remote_device *this_device); 617 struct scic_sds_remote_device *sci_dev);
618#else /* !defined(DISABLE_ATAPI) */ 618#else /* !defined(DISABLE_ATAPI) */
619#define scic_sds_remote_device_is_atapi(this_device) false 619#define scic_sds_remote_device_is_atapi(sci_dev) false
620#endif /* !defined(DISABLE_ATAPI) */ 620#endif /* !defined(DISABLE_ATAPI) */
621 621
622void scic_sds_remote_device_start_request( 622void scic_sds_remote_device_start_request(
623 struct scic_sds_remote_device *this_device, 623 struct scic_sds_remote_device *sci_dev,
624 struct scic_sds_request *the_request, 624 struct scic_sds_request *sci_req,
625 enum sci_status status); 625 enum sci_status status);
626 626
627void scic_sds_remote_device_continue_request(void *sci_dev); 627void scic_sds_remote_device_continue_request(void *sci_dev);
628 628
629enum sci_status scic_sds_remote_device_default_start_handler( 629enum sci_status scic_sds_remote_device_default_start_handler(
630 struct scic_sds_remote_device *this_device); 630 struct scic_sds_remote_device *sci_dev);
631 631
632enum sci_status scic_sds_remote_device_default_fail_handler( 632enum sci_status scic_sds_remote_device_default_fail_handler(
633 struct scic_sds_remote_device *this_device); 633 struct scic_sds_remote_device *sci_dev);
634 634
635enum sci_status scic_sds_remote_device_default_destruct_handler( 635enum sci_status scic_sds_remote_device_default_destruct_handler(
636 struct scic_sds_remote_device *this_device); 636 struct scic_sds_remote_device *sci_dev);
637 637
638enum sci_status scic_sds_remote_device_default_reset_handler( 638enum sci_status scic_sds_remote_device_default_reset_handler(
639 struct scic_sds_remote_device *device); 639 struct scic_sds_remote_device *device);
@@ -654,15 +654,15 @@ enum sci_status scic_sds_remote_device_default_continue_request_handler(
654 struct scic_sds_request *request); 654 struct scic_sds_request *request);
655 655
656enum sci_status scic_sds_remote_device_default_suspend_handler( 656enum sci_status scic_sds_remote_device_default_suspend_handler(
657 struct scic_sds_remote_device *this_device, 657 struct scic_sds_remote_device *sci_dev,
658 u32 suspend_type); 658 u32 suspend_type);
659 659
660enum sci_status scic_sds_remote_device_default_resume_handler( 660enum sci_status scic_sds_remote_device_default_resume_handler(
661 struct scic_sds_remote_device *this_device); 661 struct scic_sds_remote_device *sci_dev);
662 662
663 663
664enum sci_status scic_sds_remote_device_default_frame_handler( 664enum sci_status scic_sds_remote_device_default_frame_handler(
665 struct scic_sds_remote_device *this_device, 665 struct scic_sds_remote_device *sci_dev,
666 u32 frame_index); 666 u32 frame_index);
667 667
668enum sci_status scic_sds_remote_device_ready_state_stop_handler( 668enum sci_status scic_sds_remote_device_ready_state_stop_handler(
@@ -672,14 +672,14 @@ enum sci_status scic_sds_remote_device_ready_state_reset_handler(
672 struct scic_sds_remote_device *device); 672 struct scic_sds_remote_device *device);
673 673
674enum sci_status scic_sds_remote_device_general_frame_handler( 674enum sci_status scic_sds_remote_device_general_frame_handler(
675 struct scic_sds_remote_device *this_device, 675 struct scic_sds_remote_device *sci_dev,
676 u32 frame_index); 676 u32 frame_index);
677 677
678enum sci_status scic_sds_remote_device_general_event_handler( 678enum sci_status scic_sds_remote_device_general_event_handler(
679 struct scic_sds_remote_device *this_device, 679 struct scic_sds_remote_device *sci_dev,
680 u32 event_code); 680 u32 event_code);
681 681
682enum sci_status scic_sds_ssp_remote_device_ready_suspended_substate_resume_handler( 682enum sci_status scic_sds_ssp_remote_device_ready_suspended_substate_resume_handler(
683 struct scic_sds_remote_device *this_device); 683 struct scic_sds_remote_device *sci_dev);
684 684
685#endif /* _SCIC_SDS_REMOTE_DEVICE_H_ */ 685#endif /* _SCIC_SDS_REMOTE_DEVICE_H_ */
diff --git a/drivers/scsi/isci/core/scic_sds_remote_node_context.c b/drivers/scsi/isci/core/scic_sds_remote_node_context.c
index 81e4ab34dd30..e329296fa386 100644
--- a/drivers/scsi/isci/core/scic_sds_remote_node_context.c
+++ b/drivers/scsi/isci/core/scic_sds_remote_node_context.c
@@ -67,7 +67,7 @@
67 67
68/** 68/**
69 * 69 *
70 * @this_rnc: The RNC for which the is posted request is being made. 70 * @sci_rnc: The RNC for which the is posted request is being made.
71 * 71 *
72 * This method will return true if the RNC is not in the initial state. In all 72 * This method will return true if the RNC is not in the initial state. In all
73 * other states the RNC is considered active and this will return true. The 73 * other states the RNC is considered active and this will return true. The
@@ -79,16 +79,16 @@
79 79
80/** 80/**
81 * 81 *
82 * @this_rnc: The state of the remote node context object to check. 82 * @sci_rnc: The state of the remote node context object to check.
83 * 83 *
84 * This method will return true if the remote node context is in a READY state 84 * This method will return true if the remote node context is in a READY state
85 * otherwise it will return false bool true if the remote node context is in 85 * otherwise it will return false bool true if the remote node context is in
86 * the ready state. false if the remote node context is not in the ready state. 86 * the ready state. false if the remote node context is not in the ready state.
87 */ 87 */
88bool scic_sds_remote_node_context_is_ready( 88bool scic_sds_remote_node_context_is_ready(
89 struct scic_sds_remote_node_context *this_rnc) 89 struct scic_sds_remote_node_context *sci_rnc)
90{ 90{
91 u32 current_state = sci_base_state_machine_get_state(&this_rnc->state_machine); 91 u32 current_state = sci_base_state_machine_get_state(&sci_rnc->state_machine);
92 92
93 if (current_state == SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE) { 93 if (current_state == SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE) {
94 return true; 94 return true;
@@ -99,36 +99,36 @@ bool scic_sds_remote_node_context_is_ready(
99 99
100/** 100/**
101 * 101 *
102 * @this_device: The remote device to use to construct the RNC buffer. 102 * @sci_dev: The remote device to use to construct the RNC buffer.
103 * @rnc: The buffer into which the remote device data will be copied. 103 * @rnc: The buffer into which the remote device data will be copied.
104 * 104 *
105 * This method will construct the RNC buffer for this remote device object. none 105 * This method will construct the RNC buffer for this remote device object. none
106 */ 106 */
107static void scic_sds_remote_node_context_construct_buffer( 107static void scic_sds_remote_node_context_construct_buffer(
108 struct scic_sds_remote_node_context *this_rnc) 108 struct scic_sds_remote_node_context *sci_rnc)
109{ 109{
110 union scu_remote_node_context *rnc; 110 union scu_remote_node_context *rnc;
111 struct scic_sds_controller *the_controller; 111 struct scic_sds_controller *scic;
112 112
113 the_controller = scic_sds_remote_device_get_controller(this_rnc->device); 113 scic = scic_sds_remote_device_get_controller(sci_rnc->device);
114 114
115 rnc = scic_sds_controller_get_remote_node_context_buffer( 115 rnc = scic_sds_controller_get_remote_node_context_buffer(
116 the_controller, this_rnc->remote_node_index); 116 scic, sci_rnc->remote_node_index);
117 117
118 memset( 118 memset(
119 rnc, 119 rnc,
120 0x00, 120 0x00,
121 sizeof(union scu_remote_node_context) 121 sizeof(union scu_remote_node_context)
122 * scic_sds_remote_device_node_count(this_rnc->device) 122 * scic_sds_remote_device_node_count(sci_rnc->device)
123 ); 123 );
124 124
125 rnc->ssp.remote_node_index = this_rnc->remote_node_index; 125 rnc->ssp.remote_node_index = sci_rnc->remote_node_index;
126 rnc->ssp.remote_node_port_width = this_rnc->device->device_port_width; 126 rnc->ssp.remote_node_port_width = sci_rnc->device->device_port_width;
127 rnc->ssp.logical_port_index = 127 rnc->ssp.logical_port_index =
128 scic_sds_remote_device_get_port_index(this_rnc->device); 128 scic_sds_remote_device_get_port_index(sci_rnc->device);
129 129
130 rnc->ssp.remote_sas_address_hi = SCIC_SWAP_DWORD(this_rnc->device->device_address.high); 130 rnc->ssp.remote_sas_address_hi = SCIC_SWAP_DWORD(sci_rnc->device->device_address.high);
131 rnc->ssp.remote_sas_address_lo = SCIC_SWAP_DWORD(this_rnc->device->device_address.low); 131 rnc->ssp.remote_sas_address_lo = SCIC_SWAP_DWORD(sci_rnc->device->device_address.low);
132 132
133 rnc->ssp.nexus_loss_timer_enable = true; 133 rnc->ssp.nexus_loss_timer_enable = true;
134 rnc->ssp.check_bit = false; 134 rnc->ssp.check_bit = false;
@@ -140,24 +140,24 @@ static void scic_sds_remote_node_context_construct_buffer(
140 140
141 141
142 if ( 142 if (
143 this_rnc->device->target_protocols.u.bits.attached_sata_device 143 sci_rnc->device->target_protocols.u.bits.attached_sata_device
144 || this_rnc->device->target_protocols.u.bits.attached_stp_target 144 || sci_rnc->device->target_protocols.u.bits.attached_stp_target
145 ) { 145 ) {
146 rnc->ssp.connection_occupancy_timeout = 146 rnc->ssp.connection_occupancy_timeout =
147 the_controller->user_parameters.sds1.stp_max_occupancy_timeout; 147 scic->user_parameters.sds1.stp_max_occupancy_timeout;
148 rnc->ssp.connection_inactivity_timeout = 148 rnc->ssp.connection_inactivity_timeout =
149 the_controller->user_parameters.sds1.stp_inactivity_timeout; 149 scic->user_parameters.sds1.stp_inactivity_timeout;
150 } else { 150 } else {
151 rnc->ssp.connection_occupancy_timeout = 151 rnc->ssp.connection_occupancy_timeout =
152 the_controller->user_parameters.sds1.ssp_max_occupancy_timeout; 152 scic->user_parameters.sds1.ssp_max_occupancy_timeout;
153 rnc->ssp.connection_inactivity_timeout = 153 rnc->ssp.connection_inactivity_timeout =
154 the_controller->user_parameters.sds1.ssp_inactivity_timeout; 154 scic->user_parameters.sds1.ssp_inactivity_timeout;
155 } 155 }
156 156
157 rnc->ssp.initial_arbitration_wait_time = 0; 157 rnc->ssp.initial_arbitration_wait_time = 0;
158 158
159 /* Open Address Frame Parameters */ 159 /* Open Address Frame Parameters */
160 rnc->ssp.oaf_connection_rate = this_rnc->device->connection_rate; 160 rnc->ssp.oaf_connection_rate = sci_rnc->device->connection_rate;
161 rnc->ssp.oaf_features = 0; 161 rnc->ssp.oaf_features = 0;
162 rnc->ssp.oaf_source_zone_group = 0; 162 rnc->ssp.oaf_source_zone_group = 0;
163 rnc->ssp.oaf_more_compatibility_features = 0; 163 rnc->ssp.oaf_more_compatibility_features = 0;
@@ -165,8 +165,8 @@ static void scic_sds_remote_node_context_construct_buffer(
165 165
166/** 166/**
167 * 167 *
168 * @this_rnc: 168 * @sci_rnc:
169 * @the_callback: 169 * @callback:
170 * @callback_parameter: 170 * @callback_parameter:
171 * 171 *
172 * This method will setup the remote node context object so it will transition 172 * This method will setup the remote node context object so it will transition
@@ -174,52 +174,52 @@ static void scic_sds_remote_node_context_construct_buffer(
174 * transition to its final state then this function does nothing. none 174 * transition to its final state then this function does nothing. none
175 */ 175 */
176static void scic_sds_remote_node_context_setup_to_resume( 176static void scic_sds_remote_node_context_setup_to_resume(
177 struct scic_sds_remote_node_context *this_rnc, 177 struct scic_sds_remote_node_context *sci_rnc,
178 scics_sds_remote_node_context_callback the_callback, 178 scics_sds_remote_node_context_callback callback,
179 void *callback_parameter) 179 void *callback_parameter)
180{ 180{
181 if (this_rnc->destination_state != SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) { 181 if (sci_rnc->destination_state != SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) {
182 this_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY; 182 sci_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY;
183 this_rnc->user_callback = the_callback; 183 sci_rnc->user_callback = callback;
184 this_rnc->user_cookie = callback_parameter; 184 sci_rnc->user_cookie = callback_parameter;
185 } 185 }
186} 186}
187 187
188/** 188/**
189 * 189 *
190 * @this_rnc: 190 * @sci_rnc:
191 * @the_callback: 191 * @callback:
192 * @callback_parameter: 192 * @callback_parameter:
193 * 193 *
194 * This method will setup the remote node context object so it will transistion 194 * This method will setup the remote node context object so it will transistion
195 * to its final state. none 195 * to its final state. none
196 */ 196 */
197static void scic_sds_remote_node_context_setup_to_destory( 197static void scic_sds_remote_node_context_setup_to_destory(
198 struct scic_sds_remote_node_context *this_rnc, 198 struct scic_sds_remote_node_context *sci_rnc,
199 scics_sds_remote_node_context_callback the_callback, 199 scics_sds_remote_node_context_callback callback,
200 void *callback_parameter) 200 void *callback_parameter)
201{ 201{
202 this_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL; 202 sci_rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL;
203 this_rnc->user_callback = the_callback; 203 sci_rnc->user_callback = callback;
204 this_rnc->user_cookie = callback_parameter; 204 sci_rnc->user_cookie = callback_parameter;
205} 205}
206 206
207/** 207/**
208 * 208 *
209 * @this_rnc: 209 * @sci_rnc:
210 * @the_callback: 210 * @callback:
211 * 211 *
212 * This method will continue to resume a remote node context. This is used in 212 * This method will continue to resume a remote node context. This is used in
213 * the states where a resume is requested while a resume is in progress. 213 * the states where a resume is requested while a resume is in progress.
214 */ 214 */
215static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler( 215static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler(
216 struct scic_sds_remote_node_context *this_rnc, 216 struct scic_sds_remote_node_context *sci_rnc,
217 scics_sds_remote_node_context_callback the_callback, 217 scics_sds_remote_node_context_callback callback,
218 void *callback_parameter) 218 void *callback_parameter)
219{ 219{
220 if (this_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) { 220 if (sci_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) {
221 this_rnc->user_callback = the_callback; 221 sci_rnc->user_callback = callback;
222 this_rnc->user_cookie = callback_parameter; 222 sci_rnc->user_cookie = callback_parameter;
223 223
224 return SCI_SUCCESS; 224 return SCI_SUCCESS;
225 } 225 }
@@ -230,16 +230,16 @@ static enum sci_status scic_sds_remote_node_context_continue_to_resume_handler(
230/* --------------------------------------------------------------------------- */ 230/* --------------------------------------------------------------------------- */
231 231
232static enum sci_status scic_sds_remote_node_context_default_destruct_handler( 232static enum sci_status scic_sds_remote_node_context_default_destruct_handler(
233 struct scic_sds_remote_node_context *this_rnc, 233 struct scic_sds_remote_node_context *sci_rnc,
234 scics_sds_remote_node_context_callback the_callback, 234 scics_sds_remote_node_context_callback callback,
235 void *callback_parameter) 235 void *callback_parameter)
236{ 236{
237 dev_warn(scirdev_to_dev(this_rnc->device), 237 dev_warn(scirdev_to_dev(sci_rnc->device),
238 "%s: SCIC Remote Node Context 0x%p requested to stop while " 238 "%s: SCIC Remote Node Context 0x%p requested to stop while "
239 "in unexpected state %d\n", 239 "in unexpected state %d\n",
240 __func__, 240 __func__,
241 this_rnc, 241 sci_rnc,
242 sci_base_state_machine_get_state(&this_rnc->state_machine)); 242 sci_base_state_machine_get_state(&sci_rnc->state_machine));
243 243
244 /* 244 /*
245 * We have decided that the destruct request on the remote node context can not fail 245 * We have decided that the destruct request on the remote node context can not fail
@@ -248,101 +248,101 @@ static enum sci_status scic_sds_remote_node_context_default_destruct_handler(
248} 248}
249 249
250static enum sci_status scic_sds_remote_node_context_default_suspend_handler( 250static enum sci_status scic_sds_remote_node_context_default_suspend_handler(
251 struct scic_sds_remote_node_context *this_rnc, 251 struct scic_sds_remote_node_context *sci_rnc,
252 u32 suspend_type, 252 u32 suspend_type,
253 scics_sds_remote_node_context_callback the_callback, 253 scics_sds_remote_node_context_callback callback,
254 void *callback_parameter) 254 void *callback_parameter)
255{ 255{
256 dev_warn(scirdev_to_dev(this_rnc->device), 256 dev_warn(scirdev_to_dev(sci_rnc->device),
257 "%s: SCIC Remote Node Context 0x%p requested to suspend " 257 "%s: SCIC Remote Node Context 0x%p requested to suspend "
258 "while in wrong state %d\n", 258 "while in wrong state %d\n",
259 __func__, 259 __func__,
260 this_rnc, 260 sci_rnc,
261 sci_base_state_machine_get_state(&this_rnc->state_machine)); 261 sci_base_state_machine_get_state(&sci_rnc->state_machine));
262 262
263 return SCI_FAILURE_INVALID_STATE; 263 return SCI_FAILURE_INVALID_STATE;
264} 264}
265 265
266static enum sci_status scic_sds_remote_node_context_default_resume_handler( 266static enum sci_status scic_sds_remote_node_context_default_resume_handler(
267 struct scic_sds_remote_node_context *this_rnc, 267 struct scic_sds_remote_node_context *sci_rnc,
268 scics_sds_remote_node_context_callback the_callback, 268 scics_sds_remote_node_context_callback callback,
269 void *callback_parameter) 269 void *callback_parameter)
270{ 270{
271 dev_warn(scirdev_to_dev(this_rnc->device), 271 dev_warn(scirdev_to_dev(sci_rnc->device),
272 "%s: SCIC Remote Node Context 0x%p requested to resume " 272 "%s: SCIC Remote Node Context 0x%p requested to resume "
273 "while in wrong state %d\n", 273 "while in wrong state %d\n",
274 __func__, 274 __func__,
275 this_rnc, 275 sci_rnc,
276 sci_base_state_machine_get_state(&this_rnc->state_machine)); 276 sci_base_state_machine_get_state(&sci_rnc->state_machine));
277 277
278 return SCI_FAILURE_INVALID_STATE; 278 return SCI_FAILURE_INVALID_STATE;
279} 279}
280 280
281static enum sci_status scic_sds_remote_node_context_default_start_io_handler( 281static enum sci_status scic_sds_remote_node_context_default_start_io_handler(
282 struct scic_sds_remote_node_context *this_rnc, 282 struct scic_sds_remote_node_context *sci_rnc,
283 struct scic_sds_request *the_request) 283 struct scic_sds_request *sci_req)
284{ 284{
285 dev_warn(scirdev_to_dev(this_rnc->device), 285 dev_warn(scirdev_to_dev(sci_rnc->device),
286 "%s: SCIC Remote Node Context 0x%p requested to start io " 286 "%s: SCIC Remote Node Context 0x%p requested to start io "
287 "0x%p while in wrong state %d\n", 287 "0x%p while in wrong state %d\n",
288 __func__, 288 __func__,
289 this_rnc, 289 sci_rnc,
290 the_request, 290 sci_req,
291 sci_base_state_machine_get_state(&this_rnc->state_machine)); 291 sci_base_state_machine_get_state(&sci_rnc->state_machine));
292 292
293 return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; 293 return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED;
294} 294}
295 295
296static enum sci_status scic_sds_remote_node_context_default_start_task_handler( 296static enum sci_status scic_sds_remote_node_context_default_start_task_handler(
297 struct scic_sds_remote_node_context *this_rnc, 297 struct scic_sds_remote_node_context *sci_rnc,
298 struct scic_sds_request *the_request) 298 struct scic_sds_request *sci_req)
299{ 299{
300 dev_warn(scirdev_to_dev(this_rnc->device), 300 dev_warn(scirdev_to_dev(sci_rnc->device),
301 "%s: SCIC Remote Node Context 0x%p requested to start " 301 "%s: SCIC Remote Node Context 0x%p requested to start "
302 "task 0x%p while in wrong state %d\n", 302 "task 0x%p while in wrong state %d\n",
303 __func__, 303 __func__,
304 this_rnc, 304 sci_rnc,
305 the_request, 305 sci_req,
306 sci_base_state_machine_get_state(&this_rnc->state_machine)); 306 sci_base_state_machine_get_state(&sci_rnc->state_machine));
307 307
308 return SCI_FAILURE; 308 return SCI_FAILURE;
309} 309}
310 310
311static enum sci_status scic_sds_remote_node_context_default_event_handler( 311static enum sci_status scic_sds_remote_node_context_default_event_handler(
312 struct scic_sds_remote_node_context *this_rnc, 312 struct scic_sds_remote_node_context *sci_rnc,
313 u32 event_code) 313 u32 event_code)
314{ 314{
315 dev_warn(scirdev_to_dev(this_rnc->device), 315 dev_warn(scirdev_to_dev(sci_rnc->device),
316 "%s: SCIC Remote Node Context 0x%p requested to process " 316 "%s: SCIC Remote Node Context 0x%p requested to process "
317 "event 0x%x while in wrong state %d\n", 317 "event 0x%x while in wrong state %d\n",
318 __func__, 318 __func__,
319 this_rnc, 319 sci_rnc,
320 event_code, 320 event_code,
321 sci_base_state_machine_get_state(&this_rnc->state_machine)); 321 sci_base_state_machine_get_state(&sci_rnc->state_machine));
322 322
323 return SCI_FAILURE_INVALID_STATE; 323 return SCI_FAILURE_INVALID_STATE;
324} 324}
325 325
326/** 326/**
327 * 327 *
328 * @this_rnc: The rnc for which the task request is targeted. 328 * @sci_rnc: The rnc for which the task request is targeted.
329 * @the_request: The request which is going to be started. 329 * @sci_req: The request which is going to be started.
330 * 330 *
331 * This method determines if the task request can be started by the SCU 331 * This method determines if the task request can be started by the SCU
332 * hardware. When the RNC is in the ready state any task can be started. 332 * hardware. When the RNC is in the ready state any task can be started.
333 * enum sci_status SCI_SUCCESS 333 * enum sci_status SCI_SUCCESS
334 */ 334 */
335static enum sci_status scic_sds_remote_node_context_success_start_task_handler( 335static enum sci_status scic_sds_remote_node_context_success_start_task_handler(
336 struct scic_sds_remote_node_context *this_rnc, 336 struct scic_sds_remote_node_context *sci_rnc,
337 struct scic_sds_request *the_request) 337 struct scic_sds_request *sci_req)
338{ 338{
339 return SCI_SUCCESS; 339 return SCI_SUCCESS;
340} 340}
341 341
342/** 342/**
343 * 343 *
344 * @this_rnc: 344 * @sci_rnc:
345 * @the_callback: 345 * @callback:
346 * @callback_parameter: 346 * @callback_parameter:
347 * 347 *
348 * This method handles destruct calls from the various state handlers. The 348 * This method handles destruct calls from the various state handlers. The
@@ -351,16 +351,16 @@ static enum sci_status scic_sds_remote_node_context_success_start_task_handler(
351 * callback. enum sci_status 351 * callback. enum sci_status
352 */ 352 */
353static enum sci_status scic_sds_remote_node_context_general_destruct_handler( 353static enum sci_status scic_sds_remote_node_context_general_destruct_handler(
354 struct scic_sds_remote_node_context *this_rnc, 354 struct scic_sds_remote_node_context *sci_rnc,
355 scics_sds_remote_node_context_callback the_callback, 355 scics_sds_remote_node_context_callback callback,
356 void *callback_parameter) 356 void *callback_parameter)
357{ 357{
358 scic_sds_remote_node_context_setup_to_destory( 358 scic_sds_remote_node_context_setup_to_destory(
359 this_rnc, the_callback, callback_parameter 359 sci_rnc, callback, callback_parameter
360 ); 360 );
361 361
362 sci_base_state_machine_change_state( 362 sci_base_state_machine_change_state(
363 &this_rnc->state_machine, 363 &sci_rnc->state_machine,
364 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALIDATING_STATE 364 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALIDATING_STATE
365 ); 365 );
366 366
@@ -370,19 +370,19 @@ static enum sci_status scic_sds_remote_node_context_general_destruct_handler(
370/* --------------------------------------------------------------------------- */ 370/* --------------------------------------------------------------------------- */
371 371
372static enum sci_status scic_sds_remote_node_context_initial_state_resume_handler( 372static enum sci_status scic_sds_remote_node_context_initial_state_resume_handler(
373 struct scic_sds_remote_node_context *this_rnc, 373 struct scic_sds_remote_node_context *sci_rnc,
374 scics_sds_remote_node_context_callback the_callback, 374 scics_sds_remote_node_context_callback callback,
375 void *callback_parameter) 375 void *callback_parameter)
376{ 376{
377 if (this_rnc->remote_node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) { 377 if (sci_rnc->remote_node_index != SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
378 scic_sds_remote_node_context_setup_to_resume( 378 scic_sds_remote_node_context_setup_to_resume(
379 this_rnc, the_callback, callback_parameter 379 sci_rnc, callback, callback_parameter
380 ); 380 );
381 381
382 scic_sds_remote_node_context_construct_buffer(this_rnc); 382 scic_sds_remote_node_context_construct_buffer(sci_rnc);
383 383
384 sci_base_state_machine_change_state( 384 sci_base_state_machine_change_state(
385 &this_rnc->state_machine, 385 &sci_rnc->state_machine,
386 SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE 386 SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE
387 ); 387 );
388 388
@@ -395,7 +395,7 @@ static enum sci_status scic_sds_remote_node_context_initial_state_resume_handler
395/* --------------------------------------------------------------------------- */ 395/* --------------------------------------------------------------------------- */
396 396
397static enum sci_status scic_sds_remote_node_context_posting_state_event_handler( 397static enum sci_status scic_sds_remote_node_context_posting_state_event_handler(
398 struct scic_sds_remote_node_context *this_rnc, 398 struct scic_sds_remote_node_context *sci_rnc,
399 u32 event_code) 399 u32 event_code)
400{ 400{
401 enum sci_status status; 401 enum sci_status status;
@@ -405,19 +405,19 @@ static enum sci_status scic_sds_remote_node_context_posting_state_event_handler(
405 status = SCI_SUCCESS; 405 status = SCI_SUCCESS;
406 406
407 sci_base_state_machine_change_state( 407 sci_base_state_machine_change_state(
408 &this_rnc->state_machine, 408 &sci_rnc->state_machine,
409 SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE 409 SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE
410 ); 410 );
411 break; 411 break;
412 412
413 default: 413 default:
414 status = SCI_FAILURE; 414 status = SCI_FAILURE;
415 dev_warn(scirdev_to_dev(this_rnc->device), 415 dev_warn(scirdev_to_dev(sci_rnc->device),
416 "%s: SCIC Remote Node Context 0x%p requested to " 416 "%s: SCIC Remote Node Context 0x%p requested to "
417 "process unexpected event 0x%x while in posting " 417 "process unexpected event 0x%x while in posting "
418 "state\n", 418 "state\n",
419 __func__, 419 __func__,
420 this_rnc, 420 sci_rnc,
421 event_code); 421 event_code);
422 break; 422 break;
423 } 423 }
@@ -428,19 +428,19 @@ static enum sci_status scic_sds_remote_node_context_posting_state_event_handler(
428/* --------------------------------------------------------------------------- */ 428/* --------------------------------------------------------------------------- */
429 429
430static enum sci_status scic_sds_remote_node_context_invalidating_state_destruct_handler( 430static enum sci_status scic_sds_remote_node_context_invalidating_state_destruct_handler(
431 struct scic_sds_remote_node_context *this_rnc, 431 struct scic_sds_remote_node_context *sci_rnc,
432 scics_sds_remote_node_context_callback the_callback, 432 scics_sds_remote_node_context_callback callback,
433 void *callback_parameter) 433 void *callback_parameter)
434{ 434{
435 scic_sds_remote_node_context_setup_to_destory( 435 scic_sds_remote_node_context_setup_to_destory(
436 this_rnc, the_callback, callback_parameter 436 sci_rnc, callback, callback_parameter
437 ); 437 );
438 438
439 return SCI_SUCCESS; 439 return SCI_SUCCESS;
440} 440}
441 441
442static enum sci_status scic_sds_remote_node_context_invalidating_state_event_handler( 442static enum sci_status scic_sds_remote_node_context_invalidating_state_event_handler(
443 struct scic_sds_remote_node_context *this_rnc, 443 struct scic_sds_remote_node_context *sci_rnc,
444 u32 event_code) 444 u32 event_code)
445{ 445{
446 enum sci_status status; 446 enum sci_status status;
@@ -448,14 +448,14 @@ static enum sci_status scic_sds_remote_node_context_invalidating_state_event_han
448 if (scu_get_event_code(event_code) == SCU_EVENT_POST_RNC_INVALIDATE_COMPLETE) { 448 if (scu_get_event_code(event_code) == SCU_EVENT_POST_RNC_INVALIDATE_COMPLETE) {
449 status = SCI_SUCCESS; 449 status = SCI_SUCCESS;
450 450
451 if (this_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) { 451 if (sci_rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_FINAL) {
452 sci_base_state_machine_change_state( 452 sci_base_state_machine_change_state(
453 &this_rnc->state_machine, 453 &sci_rnc->state_machine,
454 SCIC_SDS_REMOTE_NODE_CONTEXT_INITIAL_STATE 454 SCIC_SDS_REMOTE_NODE_CONTEXT_INITIAL_STATE
455 ); 455 );
456 } else { 456 } else {
457 sci_base_state_machine_change_state( 457 sci_base_state_machine_change_state(
458 &this_rnc->state_machine, 458 &sci_rnc->state_machine,
459 SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE 459 SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE
460 ); 460 );
461 } 461 }
@@ -466,25 +466,25 @@ static enum sci_status scic_sds_remote_node_context_invalidating_state_event_han
466 /* 466 /*
467 * We really dont care if the hardware is going to suspend 467 * We really dont care if the hardware is going to suspend
468 * the device since it's being invalidated anyway */ 468 * the device since it's being invalidated anyway */
469 dev_dbg(scirdev_to_dev(this_rnc->device), 469 dev_dbg(scirdev_to_dev(sci_rnc->device),
470 "%s: SCIC Remote Node Context 0x%p was " 470 "%s: SCIC Remote Node Context 0x%p was "
471 "suspeneded by hardware while being " 471 "suspeneded by hardware while being "
472 "invalidated.\n", 472 "invalidated.\n",
473 __func__, 473 __func__,
474 this_rnc); 474 sci_rnc);
475 status = SCI_SUCCESS; 475 status = SCI_SUCCESS;
476 break; 476 break;
477 477
478 default: 478 default:
479 dev_warn(scirdev_to_dev(this_rnc->device), 479 dev_warn(scirdev_to_dev(sci_rnc->device),
480 "%s: SCIC Remote Node Context 0x%p " 480 "%s: SCIC Remote Node Context 0x%p "
481 "requested to process event 0x%x while " 481 "requested to process event 0x%x while "
482 "in state %d.\n", 482 "in state %d.\n",
483 __func__, 483 __func__,
484 this_rnc, 484 sci_rnc,
485 event_code, 485 event_code,
486 sci_base_state_machine_get_state( 486 sci_base_state_machine_get_state(
487 &this_rnc->state_machine)); 487 &sci_rnc->state_machine));
488 status = SCI_FAILURE; 488 status = SCI_FAILURE;
489 break; 489 break;
490 } 490 }
@@ -497,7 +497,7 @@ static enum sci_status scic_sds_remote_node_context_invalidating_state_event_han
497 497
498 498
499static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler( 499static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler(
500 struct scic_sds_remote_node_context *this_rnc, 500 struct scic_sds_remote_node_context *sci_rnc,
501 u32 event_code) 501 u32 event_code)
502{ 502{
503 enum sci_status status; 503 enum sci_status status;
@@ -506,7 +506,7 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler
506 status = SCI_SUCCESS; 506 status = SCI_SUCCESS;
507 507
508 sci_base_state_machine_change_state( 508 sci_base_state_machine_change_state(
509 &this_rnc->state_machine, 509 &sci_rnc->state_machine,
510 SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE 510 SCIC_SDS_REMOTE_NODE_CONTEXT_READY_STATE
511 ); 511 );
512 } else { 512 } else {
@@ -516,23 +516,23 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler
516 /* 516 /*
517 * We really dont care if the hardware is going to suspend 517 * We really dont care if the hardware is going to suspend
518 * the device since it's being resumed anyway */ 518 * the device since it's being resumed anyway */
519 dev_dbg(scirdev_to_dev(this_rnc->device), 519 dev_dbg(scirdev_to_dev(sci_rnc->device),
520 "%s: SCIC Remote Node Context 0x%p was " 520 "%s: SCIC Remote Node Context 0x%p was "
521 "suspeneded by hardware while being resumed.\n", 521 "suspeneded by hardware while being resumed.\n",
522 __func__, 522 __func__,
523 this_rnc); 523 sci_rnc);
524 status = SCI_SUCCESS; 524 status = SCI_SUCCESS;
525 break; 525 break;
526 526
527 default: 527 default:
528 dev_warn(scirdev_to_dev(this_rnc->device), 528 dev_warn(scirdev_to_dev(sci_rnc->device),
529 "%s: SCIC Remote Node Context 0x%p requested " 529 "%s: SCIC Remote Node Context 0x%p requested "
530 "to process event 0x%x while in state %d.\n", 530 "to process event 0x%x while in state %d.\n",
531 __func__, 531 __func__,
532 this_rnc, 532 sci_rnc,
533 event_code, 533 event_code,
534 sci_base_state_machine_get_state( 534 sci_base_state_machine_get_state(
535 &this_rnc->state_machine)); 535 &sci_rnc->state_machine));
536 status = SCI_FAILURE; 536 status = SCI_FAILURE;
537 break; 537 break;
538 } 538 }
@@ -545,32 +545,32 @@ static enum sci_status scic_sds_remote_node_context_resuming_state_event_handler
545 545
546/** 546/**
547 * 547 *
548 * @this_rnc: The remote node context object being suspended. 548 * @sci_rnc: The remote node context object being suspended.
549 * @the_callback: The callback when the suspension is complete. 549 * @callback: The callback when the suspension is complete.
550 * @callback_parameter: The parameter that is to be passed into the callback. 550 * @callback_parameter: The parameter that is to be passed into the callback.
551 * 551 *
552 * This method will handle the suspend requests from the ready state. 552 * This method will handle the suspend requests from the ready state.
553 * SCI_SUCCESS 553 * SCI_SUCCESS
554 */ 554 */
555static enum sci_status scic_sds_remote_node_context_ready_state_suspend_handler( 555static enum sci_status scic_sds_remote_node_context_ready_state_suspend_handler(
556 struct scic_sds_remote_node_context *this_rnc, 556 struct scic_sds_remote_node_context *sci_rnc,
557 u32 suspend_type, 557 u32 suspend_type,
558 scics_sds_remote_node_context_callback the_callback, 558 scics_sds_remote_node_context_callback callback,
559 void *callback_parameter) 559 void *callback_parameter)
560{ 560{
561 this_rnc->user_callback = the_callback; 561 sci_rnc->user_callback = callback;
562 this_rnc->user_cookie = callback_parameter; 562 sci_rnc->user_cookie = callback_parameter;
563 this_rnc->suspension_code = suspend_type; 563 sci_rnc->suspension_code = suspend_type;
564 564
565 if (suspend_type == SCI_SOFTWARE_SUSPENSION) { 565 if (suspend_type == SCI_SOFTWARE_SUSPENSION) {
566 scic_sds_remote_device_post_request( 566 scic_sds_remote_device_post_request(
567 this_rnc->device, 567 sci_rnc->device,
568 SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX 568 SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX
569 ); 569 );
570 } 570 }
571 571
572 sci_base_state_machine_change_state( 572 sci_base_state_machine_change_state(
573 &this_rnc->state_machine, 573 &sci_rnc->state_machine,
574 SCIC_SDS_REMOTE_NODE_CONTEXT_AWAIT_SUSPENSION_STATE 574 SCIC_SDS_REMOTE_NODE_CONTEXT_AWAIT_SUSPENSION_STATE
575 ); 575 );
576 576
@@ -579,23 +579,23 @@ static enum sci_status scic_sds_remote_node_context_ready_state_suspend_handler(
579 579
580/** 580/**
581 * 581 *
582 * @this_rnc: The rnc for which the io request is targeted. 582 * @sci_rnc: The rnc for which the io request is targeted.
583 * @the_request: The request which is going to be started. 583 * @sci_req: The request which is going to be started.
584 * 584 *
585 * This method determines if the io request can be started by the SCU hardware. 585 * This method determines if the io request can be started by the SCU hardware.
586 * When the RNC is in the ready state any io request can be started. enum sci_status 586 * When the RNC is in the ready state any io request can be started. enum sci_status
587 * SCI_SUCCESS 587 * SCI_SUCCESS
588 */ 588 */
589static enum sci_status scic_sds_remote_node_context_ready_state_start_io_handler( 589static enum sci_status scic_sds_remote_node_context_ready_state_start_io_handler(
590 struct scic_sds_remote_node_context *this_rnc, 590 struct scic_sds_remote_node_context *sci_rnc,
591 struct scic_sds_request *the_request) 591 struct scic_sds_request *sci_req)
592{ 592{
593 return SCI_SUCCESS; 593 return SCI_SUCCESS;
594} 594}
595 595
596 596
597static enum sci_status scic_sds_remote_node_context_ready_state_event_handler( 597static enum sci_status scic_sds_remote_node_context_ready_state_event_handler(
598 struct scic_sds_remote_node_context *this_rnc, 598 struct scic_sds_remote_node_context *sci_rnc,
599 u32 event_code) 599 u32 event_code)
600{ 600{
601 enum sci_status status; 601 enum sci_status status;
@@ -603,33 +603,33 @@ static enum sci_status scic_sds_remote_node_context_ready_state_event_handler(
603 switch (scu_get_event_type(event_code)) { 603 switch (scu_get_event_type(event_code)) {
604 case SCU_EVENT_TL_RNC_SUSPEND_TX: 604 case SCU_EVENT_TL_RNC_SUSPEND_TX:
605 sci_base_state_machine_change_state( 605 sci_base_state_machine_change_state(
606 &this_rnc->state_machine, 606 &sci_rnc->state_machine,
607 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_SUSPENDED_STATE 607 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_SUSPENDED_STATE
608 ); 608 );
609 609
610 this_rnc->suspension_code = scu_get_event_specifier(event_code); 610 sci_rnc->suspension_code = scu_get_event_specifier(event_code);
611 status = SCI_SUCCESS; 611 status = SCI_SUCCESS;
612 break; 612 break;
613 613
614 case SCU_EVENT_TL_RNC_SUSPEND_TX_RX: 614 case SCU_EVENT_TL_RNC_SUSPEND_TX_RX:
615 sci_base_state_machine_change_state( 615 sci_base_state_machine_change_state(
616 &this_rnc->state_machine, 616 &sci_rnc->state_machine,
617 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_RX_SUSPENDED_STATE 617 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_RX_SUSPENDED_STATE
618 ); 618 );
619 619
620 this_rnc->suspension_code = scu_get_event_specifier(event_code); 620 sci_rnc->suspension_code = scu_get_event_specifier(event_code);
621 status = SCI_SUCCESS; 621 status = SCI_SUCCESS;
622 break; 622 break;
623 623
624 default: 624 default:
625 dev_warn(scirdev_to_dev(this_rnc->device), 625 dev_warn(scirdev_to_dev(sci_rnc->device),
626 "%s: SCIC Remote Node Context 0x%p requested to " 626 "%s: SCIC Remote Node Context 0x%p requested to "
627 "process event 0x%x while in state %d.\n", 627 "process event 0x%x while in state %d.\n",
628 __func__, 628 __func__,
629 this_rnc, 629 sci_rnc,
630 event_code, 630 event_code,
631 sci_base_state_machine_get_state( 631 sci_base_state_machine_get_state(
632 &this_rnc->state_machine)); 632 &sci_rnc->state_machine));
633 633
634 status = SCI_FAILURE; 634 status = SCI_FAILURE;
635 break; 635 break;
@@ -641,41 +641,41 @@ static enum sci_status scic_sds_remote_node_context_ready_state_event_handler(
641/* --------------------------------------------------------------------------- */ 641/* --------------------------------------------------------------------------- */
642 642
643static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_handler( 643static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_handler(
644 struct scic_sds_remote_node_context *this_rnc, 644 struct scic_sds_remote_node_context *sci_rnc,
645 scics_sds_remote_node_context_callback the_callback, 645 scics_sds_remote_node_context_callback callback,
646 void *callback_parameter) 646 void *callback_parameter)
647{ 647{
648 enum sci_status status; 648 enum sci_status status;
649 struct smp_discover_response_protocols protocols; 649 struct smp_discover_response_protocols protocols;
650 650
651 scic_sds_remote_node_context_setup_to_resume( 651 scic_sds_remote_node_context_setup_to_resume(
652 this_rnc, the_callback, callback_parameter 652 sci_rnc, callback, callback_parameter
653 ); 653 );
654 654
655 /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */ 655 /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */
656 656
657 scic_remote_device_get_protocols(this_rnc->device, &protocols); 657 scic_remote_device_get_protocols(sci_rnc->device, &protocols);
658 658
659 if ( 659 if (
660 (protocols.u.bits.attached_ssp_target == 1) 660 (protocols.u.bits.attached_ssp_target == 1)
661 || (protocols.u.bits.attached_smp_target == 1) 661 || (protocols.u.bits.attached_smp_target == 1)
662 ) { 662 ) {
663 sci_base_state_machine_change_state( 663 sci_base_state_machine_change_state(
664 &this_rnc->state_machine, 664 &sci_rnc->state_machine,
665 SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE 665 SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE
666 ); 666 );
667 667
668 status = SCI_SUCCESS; 668 status = SCI_SUCCESS;
669 } else if (protocols.u.bits.attached_stp_target == 1) { 669 } else if (protocols.u.bits.attached_stp_target == 1) {
670 if (this_rnc->device->is_direct_attached) { 670 if (sci_rnc->device->is_direct_attached) {
671 /* @todo Fix this since I am being silly in writing to the STPTLDARNI register. */ 671 /* @todo Fix this since I am being silly in writing to the STPTLDARNI register. */
672 sci_base_state_machine_change_state( 672 sci_base_state_machine_change_state(
673 &this_rnc->state_machine, 673 &sci_rnc->state_machine,
674 SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE 674 SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE
675 ); 675 );
676 } else { 676 } else {
677 sci_base_state_machine_change_state( 677 sci_base_state_machine_change_state(
678 &this_rnc->state_machine, 678 &sci_rnc->state_machine,
679 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALIDATING_STATE 679 SCIC_SDS_REMOTE_NODE_CONTEXT_INVALIDATING_STATE
680 ); 680 );
681 } 681 }
@@ -690,8 +690,8 @@ static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_ha
690 690
691/** 691/**
692 * 692 *
693 * @this_rnc: The remote node context which is to receive the task request. 693 * @sci_rnc: The remote node context which is to receive the task request.
694 * @the_request: The task request to be transmitted to to the remote target 694 * @sci_req: The task request to be transmitted to to the remote target
695 * device. 695 * device.
696 * 696 *
697 * This method will report a success or failure attempt to start a new task 697 * This method will report a success or failure attempt to start a new task
@@ -700,10 +700,10 @@ static enum sci_status scic_sds_remote_node_context_tx_suspended_state_resume_ha
700 * enum sci_status SCI_SUCCESS 700 * enum sci_status SCI_SUCCESS
701 */ 701 */
702static enum sci_status scic_sds_remote_node_context_suspended_start_task_handler( 702static enum sci_status scic_sds_remote_node_context_suspended_start_task_handler(
703 struct scic_sds_remote_node_context *this_rnc, 703 struct scic_sds_remote_node_context *sci_rnc,
704 struct scic_sds_request *the_request) 704 struct scic_sds_request *sci_req)
705{ 705{
706 scic_sds_remote_node_context_resume(this_rnc, NULL, NULL); 706 scic_sds_remote_node_context_resume(sci_rnc, NULL, NULL);
707 707
708 return SCI_SUCCESS; 708 return SCI_SUCCESS;
709} 709}
@@ -711,16 +711,16 @@ static enum sci_status scic_sds_remote_node_context_suspended_start_task_handler
711/* --------------------------------------------------------------------------- */ 711/* --------------------------------------------------------------------------- */
712 712
713static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume_handler( 713static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume_handler(
714 struct scic_sds_remote_node_context *this_rnc, 714 struct scic_sds_remote_node_context *sci_rnc,
715 scics_sds_remote_node_context_callback the_callback, 715 scics_sds_remote_node_context_callback callback,
716 void *callback_parameter) 716 void *callback_parameter)
717{ 717{
718 scic_sds_remote_node_context_setup_to_resume( 718 scic_sds_remote_node_context_setup_to_resume(
719 this_rnc, the_callback, callback_parameter 719 sci_rnc, callback, callback_parameter
720 ); 720 );
721 721
722 sci_base_state_machine_change_state( 722 sci_base_state_machine_change_state(
723 &this_rnc->state_machine, 723 &sci_rnc->state_machine,
724 SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE 724 SCIC_SDS_REMOTE_NODE_CONTEXT_RESUMING_STATE
725 ); 725 );
726 726
@@ -735,12 +735,12 @@ static enum sci_status scic_sds_remote_node_context_tx_rx_suspended_state_resume
735 * 735 *
736 */ 736 */
737static enum sci_status scic_sds_remote_node_context_await_suspension_state_resume_handler( 737static enum sci_status scic_sds_remote_node_context_await_suspension_state_resume_handler(
738 struct scic_sds_remote_node_context *this_rnc, 738 struct scic_sds_remote_node_context *sci_rnc,
739 scics_sds_remote_node_context_callback the_callback, 739 scics_sds_remote_node_context_callback callback,
740 void *callback_parameter) 740 void *callback_parameter)
741{ 741{
742 scic_sds_remote_node_context_setup_to_resume( 742 scic_sds_remote_node_context_setup_to_resume(
743 this_rnc, the_callback, callback_parameter 743 sci_rnc, callback, callback_parameter
744 ); 744 );
745 745
746 return SCI_SUCCESS; 746 return SCI_SUCCESS;
@@ -748,8 +748,8 @@ static enum sci_status scic_sds_remote_node_context_await_suspension_state_resum
748 748
749/** 749/**
750 * 750 *
751 * @this_rnc: The remote node context which is to receive the task request. 751 * @sci_rnc: The remote node context which is to receive the task request.
752 * @the_request: The task request to be transmitted to to the remote target 752 * @sci_req: The task request to be transmitted to to the remote target
753 * device. 753 * device.
754 * 754 *
755 * This method will report a success or failure attempt to start a new task 755 * This method will report a success or failure attempt to start a new task
@@ -758,14 +758,14 @@ static enum sci_status scic_sds_remote_node_context_await_suspension_state_resum
758 * enum sci_status SCI_SUCCESS 758 * enum sci_status SCI_SUCCESS
759 */ 759 */
760static enum sci_status scic_sds_remote_node_context_await_suspension_state_start_task_handler( 760static enum sci_status scic_sds_remote_node_context_await_suspension_state_start_task_handler(
761 struct scic_sds_remote_node_context *this_rnc, 761 struct scic_sds_remote_node_context *sci_rnc,
762 struct scic_sds_request *the_request) 762 struct scic_sds_request *sci_req)
763{ 763{
764 return SCI_SUCCESS; 764 return SCI_SUCCESS;
765} 765}
766 766
767static enum sci_status scic_sds_remote_node_context_await_suspension_state_event_handler( 767static enum sci_status scic_sds_remote_node_context_await_suspension_state_event_handler(
768 struct scic_sds_remote_node_context *this_rnc, 768 struct scic_sds_remote_node_context *sci_rnc,
769 u32 event_code) 769 u32 event_code)
770{ 770{
771 enum sci_status status; 771 enum sci_status status;
@@ -773,33 +773,33 @@ static enum sci_status scic_sds_remote_node_context_await_suspension_state_event
773 switch (scu_get_event_type(event_code)) { 773 switch (scu_get_event_type(event_code)) {
774 case SCU_EVENT_TL_RNC_SUSPEND_TX: 774 case SCU_EVENT_TL_RNC_SUSPEND_TX:
775 sci_base_state_machine_change_state( 775 sci_base_state_machine_change_state(
776 &this_rnc->state_machine, 776 &sci_rnc->state_machine,
777 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_SUSPENDED_STATE 777 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_SUSPENDED_STATE
778 ); 778 );
779 779
780 this_rnc->suspension_code = scu_get_event_specifier(event_code); 780 sci_rnc->suspension_code = scu_get_event_specifier(event_code);
781 status = SCI_SUCCESS; 781 status = SCI_SUCCESS;
782 break; 782 break;
783 783
784 case SCU_EVENT_TL_RNC_SUSPEND_TX_RX: 784 case SCU_EVENT_TL_RNC_SUSPEND_TX_RX:
785 sci_base_state_machine_change_state( 785 sci_base_state_machine_change_state(
786 &this_rnc->state_machine, 786 &sci_rnc->state_machine,
787 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_RX_SUSPENDED_STATE 787 SCIC_SDS_REMOTE_NODE_CONTEXT_TX_RX_SUSPENDED_STATE
788 ); 788 );
789 789
790 this_rnc->suspension_code = scu_get_event_specifier(event_code); 790 sci_rnc->suspension_code = scu_get_event_specifier(event_code);
791 status = SCI_SUCCESS; 791 status = SCI_SUCCESS;
792 break; 792 break;
793 793
794 default: 794 default:
795 dev_warn(scirdev_to_dev(this_rnc->device), 795 dev_warn(scirdev_to_dev(sci_rnc->device),
796 "%s: SCIC Remote Node Context 0x%p requested to " 796 "%s: SCIC Remote Node Context 0x%p requested to "
797 "process event 0x%x while in state %d.\n", 797 "process event 0x%x while in state %d.\n",
798 __func__, 798 __func__,
799 this_rnc, 799 sci_rnc,
800 event_code, 800 event_code,
801 sci_base_state_machine_get_state( 801 sci_base_state_machine_get_state(
802 &this_rnc->state_machine)); 802 &sci_rnc->state_machine));
803 803
804 status = SCI_FAILURE; 804 status = SCI_FAILURE;
805 break; 805 break;
@@ -929,41 +929,41 @@ static void scic_sds_remote_node_context_continue_state_transitions(
929 929
930/** 930/**
931 * 931 *
932 * @this_rnc: The remote node context object that is to be validated. 932 * @sci_rnc: The remote node context object that is to be validated.
933 * 933 *
934 * This method will mark the rnc buffer as being valid and post the request to 934 * This method will mark the rnc buffer as being valid and post the request to
935 * the hardware. none 935 * the hardware. none
936 */ 936 */
937static void scic_sds_remote_node_context_validate_context_buffer( 937static void scic_sds_remote_node_context_validate_context_buffer(
938 struct scic_sds_remote_node_context *this_rnc) 938 struct scic_sds_remote_node_context *sci_rnc)
939{ 939{
940 union scu_remote_node_context *rnc_buffer; 940 union scu_remote_node_context *rnc_buffer;
941 941
942 rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( 942 rnc_buffer = scic_sds_controller_get_remote_node_context_buffer(
943 scic_sds_remote_device_get_controller(this_rnc->device), 943 scic_sds_remote_device_get_controller(sci_rnc->device),
944 this_rnc->remote_node_index 944 sci_rnc->remote_node_index
945 ); 945 );
946 946
947 rnc_buffer->ssp.is_valid = true; 947 rnc_buffer->ssp.is_valid = true;
948 948
949 if ( 949 if (
950 !this_rnc->device->is_direct_attached 950 !sci_rnc->device->is_direct_attached
951 && this_rnc->device->target_protocols.u.bits.attached_stp_target 951 && sci_rnc->device->target_protocols.u.bits.attached_stp_target
952 ) { 952 ) {
953 scic_sds_remote_device_post_request( 953 scic_sds_remote_device_post_request(
954 this_rnc->device, 954 sci_rnc->device,
955 SCU_CONTEXT_COMMAND_POST_RNC_96 955 SCU_CONTEXT_COMMAND_POST_RNC_96
956 ); 956 );
957 } else { 957 } else {
958 scic_sds_remote_device_post_request( 958 scic_sds_remote_device_post_request(
959 this_rnc->device, 959 sci_rnc->device,
960 SCU_CONTEXT_COMMAND_POST_RNC_32 960 SCU_CONTEXT_COMMAND_POST_RNC_32
961 ); 961 );
962 962
963 if (this_rnc->device->is_direct_attached) { 963 if (sci_rnc->device->is_direct_attached) {
964 scic_sds_port_setup_transports( 964 scic_sds_port_setup_transports(
965 this_rnc->device->owning_port, 965 sci_rnc->device->owning_port,
966 this_rnc->remote_node_index 966 sci_rnc->remote_node_index
967 ); 967 );
968 } 968 }
969 } 969 }
@@ -971,24 +971,24 @@ static void scic_sds_remote_node_context_validate_context_buffer(
971 971
972/** 972/**
973 * 973 *
974 * @this_rnc: The remote node context object that is to be invalidated. 974 * @sci_rnc: The remote node context object that is to be invalidated.
975 * 975 *
976 * This method will update the RNC buffer and post the invalidate request. none 976 * This method will update the RNC buffer and post the invalidate request. none
977 */ 977 */
978static void scic_sds_remote_node_context_invalidate_context_buffer( 978static void scic_sds_remote_node_context_invalidate_context_buffer(
979 struct scic_sds_remote_node_context *this_rnc) 979 struct scic_sds_remote_node_context *sci_rnc)
980{ 980{
981 union scu_remote_node_context *rnc_buffer; 981 union scu_remote_node_context *rnc_buffer;
982 982
983 rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( 983 rnc_buffer = scic_sds_controller_get_remote_node_context_buffer(
984 scic_sds_remote_device_get_controller(this_rnc->device), 984 scic_sds_remote_device_get_controller(sci_rnc->device),
985 this_rnc->remote_node_index 985 sci_rnc->remote_node_index
986 ); 986 );
987 987
988 rnc_buffer->ssp.is_valid = false; 988 rnc_buffer->ssp.is_valid = false;
989 989
990 scic_sds_remote_device_post_request( 990 scic_sds_remote_device_post_request(
991 this_rnc->device, 991 sci_rnc->device,
992 SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE 992 SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE
993 ); 993 );
994} 994}
@@ -1037,17 +1037,17 @@ static void scic_sds_remote_node_context_initial_state_enter(
1037static void scic_sds_remote_node_context_posting_state_enter( 1037static void scic_sds_remote_node_context_posting_state_enter(
1038 struct sci_base_object *object) 1038 struct sci_base_object *object)
1039{ 1039{
1040 struct scic_sds_remote_node_context *this_rnc; 1040 struct scic_sds_remote_node_context *sci_rnc;
1041 1041
1042 this_rnc = (struct scic_sds_remote_node_context *)object; 1042 sci_rnc = (struct scic_sds_remote_node_context *)object;
1043 1043
1044 SET_STATE_HANDLER( 1044 SET_STATE_HANDLER(
1045 this_rnc, 1045 sci_rnc,
1046 scic_sds_remote_node_context_state_handler_table, 1046 scic_sds_remote_node_context_state_handler_table,
1047 SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE 1047 SCIC_SDS_REMOTE_NODE_CONTEXT_POSTING_STATE
1048 ); 1048 );
1049 1049
1050 scic_sds_remote_node_context_validate_context_buffer(this_rnc); 1050 scic_sds_remote_node_context_validate_context_buffer(sci_rnc);
1051} 1051}
1052 1052
1053/** 1053/**
diff --git a/drivers/scsi/isci/core/scic_sds_remote_node_context.h b/drivers/scsi/isci/core/scic_sds_remote_node_context.h
index e21abe2c6523..a103f155bcc4 100644
--- a/drivers/scsi/isci/core/scic_sds_remote_node_context.h
+++ b/drivers/scsi/isci/core/scic_sds_remote_node_context.h
@@ -86,25 +86,25 @@ struct scic_sds_remote_node_context;
86typedef void (*scics_sds_remote_node_context_callback)(void *); 86typedef void (*scics_sds_remote_node_context_callback)(void *);
87 87
88typedef enum sci_status (*scic_sds_remote_node_context_operation)( 88typedef enum sci_status (*scic_sds_remote_node_context_operation)(
89 struct scic_sds_remote_node_context *this_rnc, 89 struct scic_sds_remote_node_context *sci_rnc,
90 scics_sds_remote_node_context_callback the_callback, 90 scics_sds_remote_node_context_callback callback,
91 void *callback_parameter 91 void *callback_parameter
92 ); 92 );
93 93
94typedef enum sci_status (*scic_sds_remote_node_context_suspend_operation)( 94typedef enum sci_status (*scic_sds_remote_node_context_suspend_operation)(
95 struct scic_sds_remote_node_context *this_rnc, 95 struct scic_sds_remote_node_context *sci_rnc,
96 u32 suspension_type, 96 u32 suspension_type,
97 scics_sds_remote_node_context_callback the_callback, 97 scics_sds_remote_node_context_callback callback,
98 void *callback_parameter 98 void *callback_parameter
99 ); 99 );
100 100
101typedef enum sci_status (*scic_sds_remote_node_context_io_request)( 101typedef enum sci_status (*scic_sds_remote_node_context_io_request)(
102 struct scic_sds_remote_node_context *this_rnc, 102 struct scic_sds_remote_node_context *sci_rnc,
103 struct scic_sds_request *the_request 103 struct scic_sds_request *sci_req
104 ); 104 );
105 105
106typedef enum sci_status (*scic_sds_remote_node_context_event_handler)( 106typedef enum sci_status (*scic_sds_remote_node_context_event_handler)(
107 struct scic_sds_remote_node_context *this_rnc, 107 struct scic_sds_remote_node_context *sci_rnc,
108 u32 event_code 108 u32 event_code
109 ); 109 );
110 110
@@ -286,7 +286,7 @@ void scic_sds_remote_node_context_construct(
286 286
287 287
288bool scic_sds_remote_node_context_is_ready( 288bool scic_sds_remote_node_context_is_ready(
289 struct scic_sds_remote_node_context *this_rnc); 289 struct scic_sds_remote_node_context *sci_rnc);
290 290
291#define scic_sds_remote_node_context_get_remote_node_index(rcn) \ 291#define scic_sds_remote_node_context_get_remote_node_index(rcn) \
292 ((rnc)->remote_node_index) 292 ((rnc)->remote_node_index)
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c
index a6ee155c6825..8a608f01ceda 100644
--- a/drivers/scsi/isci/core/scic_sds_request.c
+++ b/drivers/scsi/isci/core/scic_sds_request.c
@@ -226,7 +226,7 @@ static u32 scic_sds_ssp_request_get_object_size(void)
226 226
227/** 227/**
228 * This method returns the sgl element pair for the specificed sgl_pair index. 228 * This method returns the sgl element pair for the specificed sgl_pair index.
229 * @this_request: This parameter specifies the IO request for which to retrieve 229 * @sci_req: This parameter specifies the IO request for which to retrieve
230 * the Scatter-Gather List element pair. 230 * the Scatter-Gather List element pair.
231 * @sgl_pair_index: This parameter specifies the index into the SGL element 231 * @sgl_pair_index: This parameter specifies the index into the SGL element
232 * pair to be retrieved. 232 * pair to be retrieved.
@@ -234,12 +234,12 @@ static u32 scic_sds_ssp_request_get_object_size(void)
234 * This method returns a pointer to an struct scu_sgl_element_pair. 234 * This method returns a pointer to an struct scu_sgl_element_pair.
235 */ 235 */
236static struct scu_sgl_element_pair *scic_sds_request_get_sgl_element_pair( 236static struct scu_sgl_element_pair *scic_sds_request_get_sgl_element_pair(
237 struct scic_sds_request *this_request, 237 struct scic_sds_request *sci_req,
238 u32 sgl_pair_index 238 u32 sgl_pair_index
239 ) { 239 ) {
240 struct scu_task_context *task_context; 240 struct scu_task_context *task_context;
241 241
242 task_context = (struct scu_task_context *)this_request->task_context_buffer; 242 task_context = (struct scu_task_context *)sci_req->task_context_buffer;
243 243
244 if (sgl_pair_index == 0) { 244 if (sgl_pair_index == 0) {
245 return &task_context->sgl_pair_ab; 245 return &task_context->sgl_pair_ab;
@@ -247,12 +247,12 @@ static struct scu_sgl_element_pair *scic_sds_request_get_sgl_element_pair(
247 return &task_context->sgl_pair_cd; 247 return &task_context->sgl_pair_cd;
248 } 248 }
249 249
250 return &this_request->sgl_element_pair_buffer[sgl_pair_index - 2]; 250 return &sci_req->sgl_element_pair_buffer[sgl_pair_index - 2];
251} 251}
252 252
253/** 253/**
254 * This function will build the SGL list for an IO request. 254 * This function will build the SGL list for an IO request.
255 * @this_request: This parameter specifies the IO request for which to build 255 * @sci_req: This parameter specifies the IO request for which to build
256 * the Scatter-Gather List. 256 * the Scatter-Gather List.
257 * 257 *
258 */ 258 */
@@ -325,36 +325,36 @@ void scic_sds_request_build_sgl(struct scic_sds_request *sds_request)
325 325
326/** 326/**
327 * This method build the remainder of the IO request object. 327 * This method build the remainder of the IO request object.
328 * @this_request: This parameter specifies the request object being constructed. 328 * @sci_req: This parameter specifies the request object being constructed.
329 * 329 *
330 * The scic_sds_general_request_construct() must be called before this call is 330 * The scic_sds_general_request_construct() must be called before this call is
331 * valid. none 331 * valid. none
332 */ 332 */
333static void scic_sds_ssp_io_request_assign_buffers( 333static void scic_sds_ssp_io_request_assign_buffers(
334 struct scic_sds_request *this_request) 334 struct scic_sds_request *sci_req)
335{ 335{
336 this_request->command_buffer = 336 sci_req->command_buffer =
337 scic_sds_ssp_request_get_command_buffer(this_request); 337 scic_sds_ssp_request_get_command_buffer(sci_req);
338 this_request->response_buffer = 338 sci_req->response_buffer =
339 scic_sds_ssp_request_get_response_buffer(this_request); 339 scic_sds_ssp_request_get_response_buffer(sci_req);
340 this_request->sgl_element_pair_buffer = 340 sci_req->sgl_element_pair_buffer =
341 scic_sds_ssp_request_get_sgl_element_buffer(this_request); 341 scic_sds_ssp_request_get_sgl_element_buffer(sci_req);
342 this_request->sgl_element_pair_buffer = 342 sci_req->sgl_element_pair_buffer =
343 PTR_ALIGN(this_request->sgl_element_pair_buffer, 343 PTR_ALIGN(sci_req->sgl_element_pair_buffer,
344 sizeof(struct scu_sgl_element_pair)); 344 sizeof(struct scu_sgl_element_pair));
345 345
346 if (this_request->was_tag_assigned_by_user == false) { 346 if (sci_req->was_tag_assigned_by_user == false) {
347 this_request->task_context_buffer = 347 sci_req->task_context_buffer =
348 scic_sds_ssp_request_get_task_context_buffer(this_request); 348 scic_sds_ssp_request_get_task_context_buffer(sci_req);
349 this_request->task_context_buffer = 349 sci_req->task_context_buffer =
350 PTR_ALIGN(this_request->task_context_buffer, 350 PTR_ALIGN(sci_req->task_context_buffer,
351 SMP_CACHE_BYTES); 351 SMP_CACHE_BYTES);
352 } 352 }
353} 353}
354 354
355/** 355/**
356 * This method constructs the SSP Command IU data for this io request object. 356 * This method constructs the SSP Command IU data for this io request object.
357 * @this_request: This parameter specifies the request object for which the SSP 357 * @sci_req: This parameter specifies the request object for which the SSP
358 * command information unit is being built. 358 * command information unit is being built.
359 * 359 *
360 */ 360 */
@@ -401,7 +401,7 @@ static void scic_sds_io_request_build_ssp_command_iu(
401 401
402/** 402/**
403 * This method constructs the SSP Task IU data for this io request object. 403 * This method constructs the SSP Task IU data for this io request object.
404 * @this_request: 404 * @sci_req:
405 * 405 *
406 */ 406 */
407static void scic_sds_task_request_build_ssp_task_iu( 407static void scic_sds_task_request_build_ssp_task_iu(
@@ -430,7 +430,7 @@ static void scic_sds_task_request_build_ssp_task_iu(
430 430
431/** 431/**
432 * This method is will fill in the SCU Task Context for any type of SSP request. 432 * This method is will fill in the SCU Task Context for any type of SSP request.
433 * @this_request: 433 * @sci_req:
434 * @task_context: 434 * @task_context:
435 * 435 *
436 */ 436 */
@@ -474,7 +474,7 @@ static void scu_ssp_reqeust_construct_task_context(
474 474
475 task_context->address_modifier = 0; 475 task_context->address_modifier = 0;
476 476
477 /* task_context->type.ssp.tag = this_request->io_tag; */ 477 /* task_context->type.ssp.tag = sci_req->io_tag; */
478 task_context->task_phase = 0x01; 478 task_context->task_phase = 0x01;
479 479
480 if (sds_request->was_tag_assigned_by_user) { 480 if (sds_request->was_tag_assigned_by_user) {
@@ -530,7 +530,7 @@ static void scu_ssp_reqeust_construct_task_context(
530 530
531/** 531/**
532 * This method is will fill in the SCU Task Context for a SSP IO request. 532 * This method is will fill in the SCU Task Context for a SSP IO request.
533 * @this_request: 533 * @sci_req:
534 * 534 *
535 */ 535 */
536static void scu_ssp_io_request_construct_task_context( 536static void scu_ssp_io_request_construct_task_context(
@@ -568,24 +568,24 @@ static void scu_ssp_io_request_construct_task_context(
568/** 568/**
569 * This method will fill in the remainder of the io request object for SSP Task 569 * This method will fill in the remainder of the io request object for SSP Task
570 * requests. 570 * requests.
571 * @this_request: 571 * @sci_req:
572 * 572 *
573 */ 573 */
574static void scic_sds_ssp_task_request_assign_buffers( 574static void scic_sds_ssp_task_request_assign_buffers(
575 struct scic_sds_request *this_request) 575 struct scic_sds_request *sci_req)
576{ 576{
577 /* Assign all of the buffer pointers */ 577 /* Assign all of the buffer pointers */
578 this_request->command_buffer = 578 sci_req->command_buffer =
579 scic_sds_ssp_task_request_get_command_buffer(this_request); 579 scic_sds_ssp_task_request_get_command_buffer(sci_req);
580 this_request->response_buffer = 580 sci_req->response_buffer =
581 scic_sds_ssp_task_request_get_response_buffer(this_request); 581 scic_sds_ssp_task_request_get_response_buffer(sci_req);
582 this_request->sgl_element_pair_buffer = NULL; 582 sci_req->sgl_element_pair_buffer = NULL;
583 583
584 if (this_request->was_tag_assigned_by_user == false) { 584 if (sci_req->was_tag_assigned_by_user == false) {
585 this_request->task_context_buffer = 585 sci_req->task_context_buffer =
586 scic_sds_ssp_task_request_get_task_context_buffer(this_request); 586 scic_sds_ssp_task_request_get_task_context_buffer(sci_req);
587 this_request->task_context_buffer = 587 sci_req->task_context_buffer =
588 PTR_ALIGN(this_request->task_context_buffer, SMP_CACHE_BYTES); 588 PTR_ALIGN(sci_req->task_context_buffer, SMP_CACHE_BYTES);
589 } 589 }
590} 590}
591 591
@@ -598,18 +598,18 @@ static void scic_sds_ssp_task_request_assign_buffers(
598 * (i.e. non-raw frame) is being utilized to perform task management. -# 598 * (i.e. non-raw frame) is being utilized to perform task management. -#
599 * control_frame == 1. This ensures that the proper endianess is set so 599 * control_frame == 1. This ensures that the proper endianess is set so
600 * that the bytes are transmitted in the right order for a task frame. 600 * that the bytes are transmitted in the right order for a task frame.
601 * @this_request: This parameter specifies the task request object being 601 * @sci_req: This parameter specifies the task request object being
602 * constructed. 602 * constructed.
603 * 603 *
604 */ 604 */
605static void scu_ssp_task_request_construct_task_context( 605static void scu_ssp_task_request_construct_task_context(
606 struct scic_sds_request *this_request) 606 struct scic_sds_request *sci_req)
607{ 607{
608 struct scu_task_context *task_context; 608 struct scu_task_context *task_context;
609 609
610 task_context = scic_sds_request_get_task_context(this_request); 610 task_context = scic_sds_request_get_task_context(sci_req);
611 611
612 scu_ssp_reqeust_construct_task_context(this_request, task_context); 612 scu_ssp_reqeust_construct_task_context(sci_req, task_context);
613 613
614 task_context->control_frame = 1; 614 task_context->control_frame = 1;
615 task_context->priority = SCU_TASK_PRIORITY_HIGH; 615 task_context->priority = SCU_TASK_PRIORITY_HIGH;
@@ -623,7 +623,7 @@ static void scu_ssp_task_request_construct_task_context(
623/** 623/**
624 * This method constructs the SSP Command IU data for this ssp passthrough 624 * This method constructs the SSP Command IU data for this ssp passthrough
625 * comand request object. 625 * comand request object.
626 * @this_request: This parameter specifies the request object for which the SSP 626 * @sci_req: This parameter specifies the request object for which the SSP
627 * command information unit is being built. 627 * command information unit is being built.
628 * 628 *
629 * enum sci_status, returns invalid parameter is cdb > 16 629 * enum sci_status, returns invalid parameter is cdb > 16
@@ -632,7 +632,7 @@ static void scu_ssp_task_request_construct_task_context(
632 632
633/** 633/**
634 * This method constructs the SATA request object. 634 * This method constructs the SATA request object.
635 * @this_request: 635 * @sci_req:
636 * @sat_protocol: 636 * @sat_protocol:
637 * @transfer_length: 637 * @transfer_length:
638 * @data_direction: 638 * @data_direction:
@@ -964,7 +964,7 @@ scic_sds_io_request_tc_completion(struct scic_sds_request *request, u32 completi
964 964
965/** 965/**
966 * 966 *
967 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start 967 * @sci_req: The SCIC_SDS_IO_REQUEST_T object for which the start
968 * operation is to be executed. 968 * operation is to be executed.
969 * @frame_index: The frame index returned by the hardware for the reqeust 969 * @frame_index: The frame index returned by the hardware for the reqeust
970 * object. 970 * object.
@@ -992,7 +992,7 @@ enum sci_status scic_sds_io_request_frame_handler(
992 992
993/** 993/**
994 * 994 *
995 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the task start 995 * @sci_req: The SCIC_SDS_IO_REQUEST_T object for which the task start
996 * operation is to be executed. 996 * operation is to be executed.
997 * 997 *
998 * This method invokes the core state task complete handler for the 998 * This method invokes the core state task complete handler for the
@@ -1007,7 +1007,7 @@ enum sci_status scic_sds_io_request_frame_handler(
1007/** 1007/**
1008 * This method copies response data for requests returning response data 1008 * This method copies response data for requests returning response data
1009 * instead of sense data. 1009 * instead of sense data.
1010 * @this_request: This parameter specifies the request object for which to copy 1010 * @sci_req: This parameter specifies the request object for which to copy
1011 * the response data. 1011 * the response data.
1012 * 1012 *
1013 */ 1013 */
@@ -1161,14 +1161,14 @@ enum sci_status scic_sds_request_started_state_abort_handler(
1161 * TC (task context) completions for normal IO request (i.e. Task/Abort 1161 * TC (task context) completions for normal IO request (i.e. Task/Abort
1162 * Completions of type 0). This method will update the 1162 * Completions of type 0). This method will update the
1163 * SCIC_SDS_IO_REQUEST_T::status field. 1163 * SCIC_SDS_IO_REQUEST_T::status field.
1164 * @this_request: This parameter specifies the request for which a completion 1164 * @sci_req: This parameter specifies the request for which a completion
1165 * occurred. 1165 * occurred.
1166 * @completion_code: This parameter specifies the completion code received from 1166 * @completion_code: This parameter specifies the completion code received from
1167 * the SCU. 1167 * the SCU.
1168 * 1168 *
1169 */ 1169 */
1170enum sci_status scic_sds_request_started_state_tc_completion_handler( 1170enum sci_status scic_sds_request_started_state_tc_completion_handler(
1171 struct scic_sds_request *this_request, 1171 struct scic_sds_request *sci_req,
1172 u32 completion_code) 1172 u32 completion_code)
1173{ 1173{
1174 u8 data_present; 1174 u8 data_present;
@@ -1181,7 +1181,7 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1181 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1181 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1182 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1182 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
1183 scic_sds_request_set_status( 1183 scic_sds_request_set_status(
1184 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 1184 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1185 ); 1185 );
1186 break; 1186 break;
1187 1187
@@ -1194,20 +1194,20 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1194 * response stats to see if this is truly a failed request or a good 1194 * response stats to see if this is truly a failed request or a good
1195 * request that just got completed early. */ 1195 * request that just got completed early. */
1196 struct sci_ssp_response_iu *response = (struct sci_ssp_response_iu *) 1196 struct sci_ssp_response_iu *response = (struct sci_ssp_response_iu *)
1197 this_request->response_buffer; 1197 sci_req->response_buffer;
1198 scic_word_copy_with_swap( 1198 scic_word_copy_with_swap(
1199 this_request->response_buffer, 1199 sci_req->response_buffer,
1200 this_request->response_buffer, 1200 sci_req->response_buffer,
1201 sizeof(struct sci_ssp_response_iu) / sizeof(u32) 1201 sizeof(struct sci_ssp_response_iu) / sizeof(u32)
1202 ); 1202 );
1203 1203
1204 if (response->status == 0) { 1204 if (response->status == 0) {
1205 scic_sds_request_set_status( 1205 scic_sds_request_set_status(
1206 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS_IO_DONE_EARLY 1206 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS_IO_DONE_EARLY
1207 ); 1207 );
1208 } else { 1208 } else {
1209 scic_sds_request_set_status( 1209 scic_sds_request_set_status(
1210 this_request, 1210 sci_req,
1211 SCU_TASK_DONE_CHECK_RESPONSE, 1211 SCU_TASK_DONE_CHECK_RESPONSE,
1212 SCI_FAILURE_IO_RESPONSE_VALID 1212 SCI_FAILURE_IO_RESPONSE_VALID
1213 ); 1213 );
@@ -1217,13 +1217,13 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1217 1217
1218 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CHECK_RESPONSE): 1218 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CHECK_RESPONSE):
1219 scic_word_copy_with_swap( 1219 scic_word_copy_with_swap(
1220 this_request->response_buffer, 1220 sci_req->response_buffer,
1221 this_request->response_buffer, 1221 sci_req->response_buffer,
1222 sizeof(struct sci_ssp_response_iu) / sizeof(u32) 1222 sizeof(struct sci_ssp_response_iu) / sizeof(u32)
1223 ); 1223 );
1224 1224
1225 scic_sds_request_set_status( 1225 scic_sds_request_set_status(
1226 this_request, 1226 sci_req,
1227 SCU_TASK_DONE_CHECK_RESPONSE, 1227 SCU_TASK_DONE_CHECK_RESPONSE,
1228 SCI_FAILURE_IO_RESPONSE_VALID 1228 SCI_FAILURE_IO_RESPONSE_VALID
1229 ); 1229 );
@@ -1234,19 +1234,19 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1234 * / @todo With TASK_DONE_RESP_LEN_ERR is the response frame guaranteed 1234 * / @todo With TASK_DONE_RESP_LEN_ERR is the response frame guaranteed
1235 * / to be received before this completion status is posted? */ 1235 * / to be received before this completion status is posted? */
1236 response_buffer = 1236 response_buffer =
1237 (struct sci_ssp_response_iu *)this_request->response_buffer; 1237 (struct sci_ssp_response_iu *)sci_req->response_buffer;
1238 data_present = 1238 data_present =
1239 response_buffer->data_present & SCI_SSP_RESPONSE_IU_DATA_PRESENT_MASK; 1239 response_buffer->data_present & SCI_SSP_RESPONSE_IU_DATA_PRESENT_MASK;
1240 1240
1241 if ((data_present == 0x01) || (data_present == 0x02)) { 1241 if ((data_present == 0x01) || (data_present == 0x02)) {
1242 scic_sds_request_set_status( 1242 scic_sds_request_set_status(
1243 this_request, 1243 sci_req,
1244 SCU_TASK_DONE_CHECK_RESPONSE, 1244 SCU_TASK_DONE_CHECK_RESPONSE,
1245 SCI_FAILURE_IO_RESPONSE_VALID 1245 SCI_FAILURE_IO_RESPONSE_VALID
1246 ); 1246 );
1247 } else { 1247 } else {
1248 scic_sds_request_set_status( 1248 scic_sds_request_set_status(
1249 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 1249 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1250 ); 1250 );
1251 } 1251 }
1252 break; 1252 break;
@@ -1263,15 +1263,15 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1263 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS): 1263 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_UNEXP_SDBFIS):
1264 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR): 1264 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_REG_ERR):
1265 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR): 1265 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_SDB_ERR):
1266 if (this_request->protocol == SCIC_STP_PROTOCOL) { 1266 if (sci_req->protocol == SCIC_STP_PROTOCOL) {
1267 scic_sds_request_set_status( 1267 scic_sds_request_set_status(
1268 this_request, 1268 sci_req,
1269 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT, 1269 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1270 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED 1270 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED
1271 ); 1271 );
1272 } else { 1272 } else {
1273 scic_sds_request_set_status( 1273 scic_sds_request_set_status(
1274 this_request, 1274 sci_req,
1275 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT, 1275 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1276 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1276 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1277 ); 1277 );
@@ -1290,7 +1290,7 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1290 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED): 1290 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_PROTOCOL_NOT_SUPPORTED):
1291 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_CONNECTION_RATE_NOT_SUPPORTED): 1291 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_OPEN_REJECT_CONNECTION_RATE_NOT_SUPPORTED):
1292 scic_sds_request_set_status( 1292 scic_sds_request_set_status(
1293 this_request, 1293 sci_req,
1294 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT, 1294 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1295 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED 1295 SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED
1296 ); 1296 );
@@ -1314,7 +1314,7 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1314 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_RNCNV_OUTBOUND): 1314 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_RNCNV_OUTBOUND):
1315 default: 1315 default:
1316 scic_sds_request_set_status( 1316 scic_sds_request_set_status(
1317 this_request, 1317 sci_req,
1318 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT, 1318 SCU_GET_COMPLETION_TL_STATUS(completion_code) >> SCU_COMPLETION_TL_STATUS_SHIFT,
1319 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1319 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1320 ); 1320 );
@@ -1326,7 +1326,7 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1326 */ 1326 */
1327 1327
1328 /* In all cases we will treat this as the completion of the IO request. */ 1328 /* In all cases we will treat this as the completion of the IO request. */
1329 sci_base_state_machine_change_state(&this_request->state_machine, 1329 sci_base_state_machine_change_state(&sci_req->state_machine,
1330 SCI_BASE_REQUEST_STATE_COMPLETED); 1330 SCI_BASE_REQUEST_STATE_COMPLETED);
1331 return SCI_SUCCESS; 1331 return SCI_SUCCESS;
1332} 1332}
@@ -1340,7 +1340,7 @@ enum sci_status scic_sds_request_started_state_tc_completion_handler(
1340 * logged. enum sci_status SCI_SUCCESS SCI_FAILURE_INVALID_PARAMETER_VALUE 1340 * logged. enum sci_status SCI_SUCCESS SCI_FAILURE_INVALID_PARAMETER_VALUE
1341 */ 1341 */
1342static enum sci_status scic_sds_request_started_state_frame_handler( 1342static enum sci_status scic_sds_request_started_state_frame_handler(
1343 struct scic_sds_request *this_request, 1343 struct scic_sds_request *sci_req,
1344 u32 frame_index) 1344 u32 frame_index)
1345{ 1345{
1346 enum sci_status status; 1346 enum sci_status status;
@@ -1348,7 +1348,7 @@ static enum sci_status scic_sds_request_started_state_frame_handler(
1348 1348
1349 /* / @todo If this is a response frame we must record that we received it */ 1349 /* / @todo If this is a response frame we must record that we received it */
1350 status = scic_sds_unsolicited_frame_control_get_header( 1350 status = scic_sds_unsolicited_frame_control_get_header(
1351 &(scic_sds_request_get_controller(this_request)->uf_control), 1351 &(scic_sds_request_get_controller(sci_req)->uf_control),
1352 frame_index, 1352 frame_index,
1353 (void **)&frame_header 1353 (void **)&frame_header
1354 ); 1354 );
@@ -1357,37 +1357,37 @@ static enum sci_status scic_sds_request_started_state_frame_handler(
1357 struct sci_ssp_response_iu *response_buffer; 1357 struct sci_ssp_response_iu *response_buffer;
1358 1358
1359 status = scic_sds_unsolicited_frame_control_get_buffer( 1359 status = scic_sds_unsolicited_frame_control_get_buffer(
1360 &(scic_sds_request_get_controller(this_request)->uf_control), 1360 &(scic_sds_request_get_controller(sci_req)->uf_control),
1361 frame_index, 1361 frame_index,
1362 (void **)&response_buffer 1362 (void **)&response_buffer
1363 ); 1363 );
1364 1364
1365 scic_word_copy_with_swap( 1365 scic_word_copy_with_swap(
1366 this_request->response_buffer, 1366 sci_req->response_buffer,
1367 (u32 *)response_buffer, 1367 (u32 *)response_buffer,
1368 sizeof(struct sci_ssp_response_iu) 1368 sizeof(struct sci_ssp_response_iu)
1369 ); 1369 );
1370 1370
1371 response_buffer = (struct sci_ssp_response_iu *)this_request->response_buffer; 1371 response_buffer = (struct sci_ssp_response_iu *)sci_req->response_buffer;
1372 1372
1373 if ((response_buffer->data_present == 0x01) || 1373 if ((response_buffer->data_present == 0x01) ||
1374 (response_buffer->data_present == 0x02)) { 1374 (response_buffer->data_present == 0x02)) {
1375 scic_sds_request_set_status( 1375 scic_sds_request_set_status(
1376 this_request, 1376 sci_req,
1377 SCU_TASK_DONE_CHECK_RESPONSE, 1377 SCU_TASK_DONE_CHECK_RESPONSE,
1378 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1378 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1379 ); 1379 );
1380 } else 1380 } else
1381 scic_sds_request_set_status( 1381 scic_sds_request_set_status(
1382 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 1382 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1383 ); 1383 );
1384 } else 1384 } else
1385 /* This was not a response frame why did it get forwarded? */ 1385 /* This was not a response frame why did it get forwarded? */
1386 dev_err(scic_to_dev(this_request->owning_controller), 1386 dev_err(scic_to_dev(sci_req->owning_controller),
1387 "%s: SCIC IO Request 0x%p received unexpected " 1387 "%s: SCIC IO Request 0x%p received unexpected "
1388 "frame %d type 0x%02x\n", 1388 "frame %d type 0x%02x\n",
1389 __func__, 1389 __func__,
1390 this_request, 1390 sci_req,
1391 frame_index, 1391 frame_index,
1392 frame_header->frame_type); 1392 frame_header->frame_type);
1393 1393
@@ -1395,7 +1395,7 @@ static enum sci_status scic_sds_request_started_state_frame_handler(
1395 * In any case we are done with this frame buffer return it to the 1395 * In any case we are done with this frame buffer return it to the
1396 * controller */ 1396 * controller */
1397 scic_sds_controller_release_frame( 1397 scic_sds_controller_release_frame(
1398 this_request->owning_controller, frame_index 1398 sci_req->owning_controller, frame_index
1399 ); 1399 );
1400 1400
1401 return SCI_SUCCESS; 1401 return SCI_SUCCESS;
@@ -1460,17 +1460,17 @@ static enum sci_status scic_sds_request_aborting_state_abort_handler(
1460 * transitions to the completed state. enum sci_status SCI_SUCCESS 1460 * transitions to the completed state. enum sci_status SCI_SUCCESS
1461 */ 1461 */
1462static enum sci_status scic_sds_request_aborting_state_tc_completion_handler( 1462static enum sci_status scic_sds_request_aborting_state_tc_completion_handler(
1463 struct scic_sds_request *this_request, 1463 struct scic_sds_request *sci_req,
1464 u32 completion_code) 1464 u32 completion_code)
1465{ 1465{
1466 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1466 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1467 case (SCU_TASK_DONE_GOOD << SCU_COMPLETION_TL_STATUS_SHIFT): 1467 case (SCU_TASK_DONE_GOOD << SCU_COMPLETION_TL_STATUS_SHIFT):
1468 case (SCU_TASK_DONE_TASK_ABORT << SCU_COMPLETION_TL_STATUS_SHIFT): 1468 case (SCU_TASK_DONE_TASK_ABORT << SCU_COMPLETION_TL_STATUS_SHIFT):
1469 scic_sds_request_set_status( 1469 scic_sds_request_set_status(
1470 this_request, SCU_TASK_DONE_TASK_ABORT, SCI_FAILURE_IO_TERMINATED 1470 sci_req, SCU_TASK_DONE_TASK_ABORT, SCI_FAILURE_IO_TERMINATED
1471 ); 1471 );
1472 1472
1473 sci_base_state_machine_change_state(&this_request->state_machine, 1473 sci_base_state_machine_change_state(&sci_req->state_machine,
1474 SCI_BASE_REQUEST_STATE_COMPLETED); 1474 SCI_BASE_REQUEST_STATE_COMPLETED);
1475 break; 1475 break;
1476 1476
@@ -1491,13 +1491,13 @@ static enum sci_status scic_sds_request_aborting_state_tc_completion_handler(
1491 * completion. enum sci_status SCI_SUCCESS 1491 * completion. enum sci_status SCI_SUCCESS
1492 */ 1492 */
1493static enum sci_status scic_sds_request_aborting_state_frame_handler( 1493static enum sci_status scic_sds_request_aborting_state_frame_handler(
1494 struct scic_sds_request *this_request, 1494 struct scic_sds_request *sci_req,
1495 u32 frame_index) 1495 u32 frame_index)
1496{ 1496{
1497 /* TODO: Is it even possible to get an unsolicited frame in the aborting state? */ 1497 /* TODO: Is it even possible to get an unsolicited frame in the aborting state? */
1498 1498
1499 scic_sds_controller_release_frame( 1499 scic_sds_controller_release_frame(
1500 this_request->owning_controller, frame_index); 1500 sci_req->owning_controller, frame_index);
1501 1501
1502 return SCI_SUCCESS; 1502 return SCI_SUCCESS;
1503} 1503}
@@ -1539,10 +1539,10 @@ static const struct scic_sds_io_request_state_handler scic_sds_request_state_han
1539static void scic_sds_request_initial_state_enter( 1539static void scic_sds_request_initial_state_enter(
1540 struct sci_base_object *object) 1540 struct sci_base_object *object)
1541{ 1541{
1542 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1542 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1543 1543
1544 SET_STATE_HANDLER( 1544 SET_STATE_HANDLER(
1545 this_request, 1545 sci_req,
1546 scic_sds_request_state_handler_table, 1546 scic_sds_request_state_handler_table,
1547 SCI_BASE_REQUEST_STATE_INITIAL 1547 SCI_BASE_REQUEST_STATE_INITIAL
1548 ); 1548 );
@@ -1559,10 +1559,10 @@ static void scic_sds_request_initial_state_enter(
1559static void scic_sds_request_constructed_state_enter( 1559static void scic_sds_request_constructed_state_enter(
1560 struct sci_base_object *object) 1560 struct sci_base_object *object)
1561{ 1561{
1562 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1562 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1563 1563
1564 SET_STATE_HANDLER( 1564 SET_STATE_HANDLER(
1565 this_request, 1565 sci_req,
1566 scic_sds_request_state_handler_table, 1566 scic_sds_request_state_handler_table,
1567 SCI_BASE_REQUEST_STATE_CONSTRUCTED 1567 SCI_BASE_REQUEST_STATE_CONSTRUCTED
1568 ); 1568 );
@@ -1580,10 +1580,10 @@ static void scic_sds_request_constructed_state_enter(
1580static void scic_sds_request_started_state_enter( 1580static void scic_sds_request_started_state_enter(
1581 struct sci_base_object *object) 1581 struct sci_base_object *object)
1582{ 1582{
1583 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1583 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1584 1584
1585 SET_STATE_HANDLER( 1585 SET_STATE_HANDLER(
1586 this_request, 1586 sci_req,
1587 scic_sds_request_state_handler_table, 1587 scic_sds_request_state_handler_table,
1588 SCI_BASE_REQUEST_STATE_STARTED 1588 SCI_BASE_REQUEST_STATE_STARTED
1589 ); 1589 );
@@ -1591,8 +1591,8 @@ static void scic_sds_request_started_state_enter(
1591 /* 1591 /*
1592 * Most of the request state machines have a started substate machine so 1592 * Most of the request state machines have a started substate machine so
1593 * start its execution on the entry to the started state. */ 1593 * start its execution on the entry to the started state. */
1594 if (this_request->has_started_substate_machine == true) 1594 if (sci_req->has_started_substate_machine == true)
1595 sci_base_state_machine_start(&this_request->started_substate_machine); 1595 sci_base_state_machine_start(&sci_req->started_substate_machine);
1596} 1596}
1597 1597
1598/** 1598/**
@@ -1608,10 +1608,10 @@ static void scic_sds_request_started_state_enter(
1608static void scic_sds_request_started_state_exit( 1608static void scic_sds_request_started_state_exit(
1609 struct sci_base_object *object) 1609 struct sci_base_object *object)
1610{ 1610{
1611 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1611 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1612 1612
1613 if (this_request->has_started_substate_machine == true) 1613 if (sci_req->has_started_substate_machine == true)
1614 sci_base_state_machine_stop(&this_request->started_substate_machine); 1614 sci_base_state_machine_stop(&sci_req->started_substate_machine);
1615} 1615}
1616 1616
1617/** 1617/**
@@ -1660,13 +1660,13 @@ static void scic_sds_request_completed_state_enter(
1660static void scic_sds_request_aborting_state_enter( 1660static void scic_sds_request_aborting_state_enter(
1661 struct sci_base_object *object) 1661 struct sci_base_object *object)
1662{ 1662{
1663 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1663 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1664 1664
1665 /* Setting the abort bit in the Task Context is required by the silicon. */ 1665 /* Setting the abort bit in the Task Context is required by the silicon. */
1666 this_request->task_context_buffer->abort = 1; 1666 sci_req->task_context_buffer->abort = 1;
1667 1667
1668 SET_STATE_HANDLER( 1668 SET_STATE_HANDLER(
1669 this_request, 1669 sci_req,
1670 scic_sds_request_state_handler_table, 1670 scic_sds_request_state_handler_table,
1671 SCI_BASE_REQUEST_STATE_ABORTING 1671 SCI_BASE_REQUEST_STATE_ABORTING
1672 ); 1672 );
@@ -1684,10 +1684,10 @@ static void scic_sds_request_aborting_state_enter(
1684static void scic_sds_request_final_state_enter( 1684static void scic_sds_request_final_state_enter(
1685 struct sci_base_object *object) 1685 struct sci_base_object *object)
1686{ 1686{
1687 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1687 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1688 1688
1689 SET_STATE_HANDLER( 1689 SET_STATE_HANDLER(
1690 this_request, 1690 sci_req,
1691 scic_sds_request_state_handler_table, 1691 scic_sds_request_state_handler_table,
1692 SCI_BASE_REQUEST_STATE_FINAL 1692 SCI_BASE_REQUEST_STATE_FINAL
1693 ); 1693 );
diff --git a/drivers/scsi/isci/core/scic_sds_request.h b/drivers/scsi/isci/core/scic_sds_request.h
index 423567a62901..0bb1da81ce85 100644
--- a/drivers/scsi/isci/core/scic_sds_request.h
+++ b/drivers/scsi/isci/core/scic_sds_request.h
@@ -336,32 +336,32 @@ extern const struct sci_base_state scic_sds_io_request_started_task_mgmt_substat
336 * 336 *
337 * This macro will return the controller for this io request object 337 * This macro will return the controller for this io request object
338 */ 338 */
339#define scic_sds_request_get_controller(this_request) \ 339#define scic_sds_request_get_controller(sci_req) \
340 ((this_request)->owning_controller) 340 ((sci_req)->owning_controller)
341 341
342/** 342/**
343 * scic_sds_request_get_device() - 343 * scic_sds_request_get_device() -
344 * 344 *
345 * This macro will return the device for this io request object 345 * This macro will return the device for this io request object
346 */ 346 */
347#define scic_sds_request_get_device(this_request) \ 347#define scic_sds_request_get_device(sci_req) \
348 ((this_request)->target_device) 348 ((sci_req)->target_device)
349 349
350/** 350/**
351 * scic_sds_request_get_port() - 351 * scic_sds_request_get_port() -
352 * 352 *
353 * This macro will return the port for this io request object 353 * This macro will return the port for this io request object
354 */ 354 */
355#define scic_sds_request_get_port(this_request) \ 355#define scic_sds_request_get_port(sci_req) \
356 scic_sds_remote_device_get_port(scic_sds_request_get_device(this_request)) 356 scic_sds_remote_device_get_port(scic_sds_request_get_device(sci_req))
357 357
358/** 358/**
359 * scic_sds_request_get_post_context() - 359 * scic_sds_request_get_post_context() -
360 * 360 *
361 * This macro returns the constructed post context result for the io request. 361 * This macro returns the constructed post context result for the io request.
362 */ 362 */
363#define scic_sds_request_get_post_context(this_request) \ 363#define scic_sds_request_get_post_context(sci_req) \
364 ((this_request)->post_context) 364 ((sci_req)->post_context)
365 365
366/** 366/**
367 * scic_sds_request_get_task_context() - 367 * scic_sds_request_get_task_context() -
@@ -433,41 +433,41 @@ scic_sds_io_request_tc_completion(struct scic_sds_request *request, u32 completi
433 * ***************************************************************************** */ 433 * ***************************************************************************** */
434 434
435void scic_sds_request_build_sgl( 435void scic_sds_request_build_sgl(
436 struct scic_sds_request *this_request); 436 struct scic_sds_request *sci_req);
437 437
438 438
439 439
440void scic_sds_stp_request_assign_buffers( 440void scic_sds_stp_request_assign_buffers(
441 struct scic_sds_request *this_request); 441 struct scic_sds_request *sci_req);
442 442
443void scic_sds_smp_request_assign_buffers( 443void scic_sds_smp_request_assign_buffers(
444 struct scic_sds_request *this_request); 444 struct scic_sds_request *sci_req);
445 445
446/* --------------------------------------------------------------------------- */ 446/* --------------------------------------------------------------------------- */
447 447
448enum sci_status scic_sds_request_start( 448enum sci_status scic_sds_request_start(
449 struct scic_sds_request *this_request); 449 struct scic_sds_request *sci_req);
450 450
451enum sci_status scic_sds_io_request_terminate( 451enum sci_status scic_sds_io_request_terminate(
452 struct scic_sds_request *this_request); 452 struct scic_sds_request *sci_req);
453 453
454enum sci_status scic_sds_io_request_complete( 454enum sci_status scic_sds_io_request_complete(
455 struct scic_sds_request *this_request); 455 struct scic_sds_request *sci_req);
456 456
457void scic_sds_io_request_copy_response( 457void scic_sds_io_request_copy_response(
458 struct scic_sds_request *this_request); 458 struct scic_sds_request *sci_req);
459 459
460enum sci_status scic_sds_io_request_event_handler( 460enum sci_status scic_sds_io_request_event_handler(
461 struct scic_sds_request *this_request, 461 struct scic_sds_request *sci_req,
462 u32 event_code); 462 u32 event_code);
463 463
464enum sci_status scic_sds_io_request_frame_handler( 464enum sci_status scic_sds_io_request_frame_handler(
465 struct scic_sds_request *this_request, 465 struct scic_sds_request *sci_req,
466 u32 frame_index); 466 u32 frame_index);
467 467
468 468
469enum sci_status scic_sds_task_request_terminate( 469enum sci_status scic_sds_task_request_terminate(
470 struct scic_sds_request *this_request); 470 struct scic_sds_request *sci_req);
471 471
472/* 472/*
473 * ***************************************************************************** 473 * *****************************************************************************
@@ -475,10 +475,10 @@ enum sci_status scic_sds_task_request_terminate(
475 * ***************************************************************************** */ 475 * ***************************************************************************** */
476 476
477enum sci_status scic_sds_request_started_state_abort_handler( 477enum sci_status scic_sds_request_started_state_abort_handler(
478 struct scic_sds_request *request); 478 struct scic_sds_request *sci_req);
479 479
480enum sci_status scic_sds_request_started_state_tc_completion_handler( 480enum sci_status scic_sds_request_started_state_tc_completion_handler(
481 struct scic_sds_request *this_request, 481 struct scic_sds_request *sci_req,
482 u32 completion_code); 482 u32 completion_code);
483 483
484#endif /* _SCIC_SDS_IO_REQUEST_H_ */ 484#endif /* _SCIC_SDS_IO_REQUEST_H_ */
diff --git a/drivers/scsi/isci/core/scic_sds_smp_remote_device.c b/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
index 88c359548c1b..471cb7d1142d 100644
--- a/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
+++ b/drivers/scsi/isci/core/scic_sds_smp_remote_device.c
@@ -142,15 +142,15 @@ scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(
142 struct scic_sds_request *request) 142 struct scic_sds_request *request)
143{ 143{
144 enum sci_status status; 144 enum sci_status status;
145 struct scic_sds_request *the_request; 145 struct scic_sds_request *sci_req;
146 146
147 the_request = (struct scic_sds_request *)request; 147 sci_req = (struct scic_sds_request *)request;
148 148
149 status = scic_sds_io_request_complete(the_request); 149 status = scic_sds_io_request_complete(sci_req);
150 150
151 if (status == SCI_SUCCESS) { 151 if (status == SCI_SUCCESS) {
152 status = scic_sds_port_complete_io( 152 status = scic_sds_port_complete_io(
153 device->owning_port, device, the_request); 153 device->owning_port, device, sci_req);
154 154
155 if (status == SCI_SUCCESS) { 155 if (status == SCI_SUCCESS) {
156 scic_sds_remote_device_decrement_request_count(device); 156 scic_sds_remote_device_decrement_request_count(device);
@@ -165,7 +165,7 @@ scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(
165 "failed with status %d.\n", 165 "failed with status %d.\n",
166 __func__, 166 __func__,
167 device, 167 device,
168 the_request, 168 sci_req,
169 device->owning_port, 169 device->owning_port,
170 status); 170 status);
171 } 171 }
@@ -175,13 +175,13 @@ scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(
175 175
176/** 176/**
177 * This is frame handler for smp device ready cmd substate. 177 * This is frame handler for smp device ready cmd substate.
178 * @this_device: This is the device object that is receiving the frame. 178 * @sci_dev: This is the device object that is receiving the frame.
179 * @frame_index: The index for the frame received. 179 * @frame_index: The index for the frame received.
180 * 180 *
181 * enum sci_status 181 * enum sci_status
182 */ 182 */
183static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handler( 183static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handler(
184 struct scic_sds_remote_device *this_device, 184 struct scic_sds_remote_device *sci_dev,
185 u32 frame_index) 185 u32 frame_index)
186{ 186{
187 enum sci_status status; 187 enum sci_status status;
@@ -191,7 +191,7 @@ static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handl
191 * / in this state. All unsolicited frames are forwarded to the io request 191 * / in this state. All unsolicited frames are forwarded to the io request
192 * / object. */ 192 * / object. */
193 status = scic_sds_io_request_frame_handler( 193 status = scic_sds_io_request_frame_handler(
194 this_device->working_request, 194 sci_dev->working_request,
195 frame_index 195 frame_index
196 ); 196 );
197 197
diff --git a/drivers/scsi/isci/core/scic_sds_smp_request.c b/drivers/scsi/isci/core/scic_sds_smp_request.c
index 70bc8d2cf048..f53f21b8b9c0 100644
--- a/drivers/scsi/isci/core/scic_sds_smp_request.c
+++ b/drivers/scsi/isci/core/scic_sds_smp_request.c
@@ -67,7 +67,7 @@
67#include "scu_task_context.h" 67#include "scu_task_context.h"
68 68
69static void scu_smp_request_construct_task_context( 69static void scu_smp_request_construct_task_context(
70 struct scic_sds_request *this_request, 70 struct scic_sds_request *sci_req,
71 struct smp_request *smp_request); 71 struct smp_request *smp_request);
72 72
73/** 73/**
@@ -118,27 +118,27 @@ u32 scic_sds_smp_request_get_object_size(void)
118 118
119/** 119/**
120 * This method build the remainder of the IO request object. 120 * This method build the remainder of the IO request object.
121 * @this_request: This parameter specifies the request object being constructed. 121 * @sci_req: This parameter specifies the request object being constructed.
122 * 122 *
123 * The scic_sds_general_request_construct() must be called before this call is 123 * The scic_sds_general_request_construct() must be called before this call is
124 * valid. none 124 * valid. none
125 */ 125 */
126 126
127void scic_sds_smp_request_assign_buffers( 127void scic_sds_smp_request_assign_buffers(
128 struct scic_sds_request *this_request) 128 struct scic_sds_request *sci_req)
129{ 129{
130 /* Assign all of the buffer pointers */ 130 /* Assign all of the buffer pointers */
131 this_request->command_buffer = 131 sci_req->command_buffer =
132 scic_sds_smp_request_get_command_buffer(this_request); 132 scic_sds_smp_request_get_command_buffer(sci_req);
133 this_request->response_buffer = 133 sci_req->response_buffer =
134 scic_sds_smp_request_get_response_buffer(this_request); 134 scic_sds_smp_request_get_response_buffer(sci_req);
135 this_request->sgl_element_pair_buffer = NULL; 135 sci_req->sgl_element_pair_buffer = NULL;
136 136
137 if (this_request->was_tag_assigned_by_user == false) { 137 if (sci_req->was_tag_assigned_by_user == false) {
138 this_request->task_context_buffer = 138 sci_req->task_context_buffer =
139 scic_sds_smp_request_get_task_context_buffer(this_request); 139 scic_sds_smp_request_get_task_context_buffer(sci_req);
140 this_request->task_context_buffer = 140 sci_req->task_context_buffer =
141 PTR_ALIGN(this_request->task_context_buffer, SMP_CACHE_BYTES); 141 PTR_ALIGN(sci_req->task_context_buffer, SMP_CACHE_BYTES);
142 } 142 }
143 143
144} 144}
@@ -163,7 +163,7 @@ void scic_sds_smp_request_assign_buffers(
163 * (i.e. non-raw frame) is being utilized to perform task management. -# 163 * (i.e. non-raw frame) is being utilized to perform task management. -#
164 * control_frame == 1. This ensures that the proper endianess is set so 164 * control_frame == 1. This ensures that the proper endianess is set so
165 * that the bytes are transmitted in the right order for a smp request frame. 165 * that the bytes are transmitted in the right order for a smp request frame.
166 * @this_request: This parameter specifies the smp request object being 166 * @sci_req: This parameter specifies the smp request object being
167 * constructed. 167 * constructed.
168 * 168 *
169 */ 169 */
@@ -295,7 +295,7 @@ static void scu_smp_request_construct_task_context(
295 * for a response frame. It will copy the response data, release the 295 * for a response frame. It will copy the response data, release the
296 * unsolicited frame, and transition the request to the 296 * unsolicited frame, and transition the request to the
297 * SCI_BASE_REQUEST_STATE_COMPLETED state. 297 * SCI_BASE_REQUEST_STATE_COMPLETED state.
298 * @this_request: This parameter specifies the request for which the 298 * @sci_req: This parameter specifies the request for which the
299 * unsolicited frame was received. 299 * unsolicited frame was received.
300 * @frame_index: This parameter indicates the unsolicited frame index that 300 * @frame_index: This parameter indicates the unsolicited frame index that
301 * should contain the response. 301 * should contain the response.
@@ -305,16 +305,16 @@ static void scu_smp_request_construct_task_context(
305 * indicates successful processing of the TC response. 305 * indicates successful processing of the TC response.
306 */ 306 */
307static enum sci_status scic_sds_smp_request_await_response_frame_handler( 307static enum sci_status scic_sds_smp_request_await_response_frame_handler(
308 struct scic_sds_request *this_request, 308 struct scic_sds_request *sci_req,
309 u32 frame_index) 309 u32 frame_index)
310{ 310{
311 enum sci_status status; 311 enum sci_status status;
312 void *frame_header; 312 void *frame_header;
313 struct smp_response_header *this_frame_header; 313 struct smp_response_header *rsp_hdr;
314 u8 *user_smp_buffer = this_request->response_buffer; 314 u8 *user_smp_buffer = sci_req->response_buffer;
315 315
316 status = scic_sds_unsolicited_frame_control_get_header( 316 status = scic_sds_unsolicited_frame_control_get_header(
317 &(scic_sds_request_get_controller(this_request)->uf_control), 317 &(scic_sds_request_get_controller(sci_req)->uf_control),
318 frame_index, 318 frame_index,
319 &frame_header 319 &frame_header
320 ); 320 );
@@ -325,13 +325,13 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
325 frame_header, 325 frame_header,
326 sizeof(struct smp_response_header) / sizeof(u32) 326 sizeof(struct smp_response_header) / sizeof(u32)
327 ); 327 );
328 this_frame_header = (struct smp_response_header *)user_smp_buffer; 328 rsp_hdr = (struct smp_response_header *)user_smp_buffer;
329 329
330 if (this_frame_header->smp_frame_type == SMP_FRAME_TYPE_RESPONSE) { 330 if (rsp_hdr->smp_frame_type == SMP_FRAME_TYPE_RESPONSE) {
331 void *smp_response_buffer; 331 void *smp_response_buffer;
332 332
333 status = scic_sds_unsolicited_frame_control_get_buffer( 333 status = scic_sds_unsolicited_frame_control_get_buffer(
334 &(scic_sds_request_get_controller(this_request)->uf_control), 334 &(scic_sds_request_get_controller(sci_req)->uf_control),
335 frame_index, 335 frame_index,
336 &smp_response_buffer 336 &smp_response_buffer
337 ); 337 );
@@ -341,23 +341,23 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
341 smp_response_buffer, 341 smp_response_buffer,
342 sizeof(union smp_response_body) / sizeof(u32) 342 sizeof(union smp_response_body) / sizeof(u32)
343 ); 343 );
344 if (this_frame_header->function == SMP_FUNCTION_DISCOVER) { 344 if (rsp_hdr->function == SMP_FUNCTION_DISCOVER) {
345 struct smp_response *this_smp_response; 345 struct smp_response *smp_resp;
346 346
347 this_smp_response = (struct smp_response *)user_smp_buffer; 347 smp_resp = (struct smp_response *)user_smp_buffer;
348 348
349 /* 349 /*
350 * Some expanders only report an attached SATA device, and 350 * Some expanders only report an attached SATA device, and
351 * not an STP target. Since the core depends on the STP 351 * not an STP target. Since the core depends on the STP
352 * target attribute to correctly build I/O, set the bit now 352 * target attribute to correctly build I/O, set the bit now
353 * if necessary. */ 353 * if necessary. */
354 if (this_smp_response->response.discover.protocols.u.bits.attached_sata_device 354 if (smp_resp->response.discover.protocols.u.bits.attached_sata_device
355 && !this_smp_response->response.discover.protocols.u.bits.attached_stp_target) { 355 && !smp_resp->response.discover.protocols.u.bits.attached_stp_target) {
356 this_smp_response->response.discover.protocols.u.bits.attached_stp_target = 1; 356 smp_resp->response.discover.protocols.u.bits.attached_stp_target = 1;
357 357
358 dev_dbg(scic_to_dev(this_request->owning_controller), 358 dev_dbg(scic_to_dev(sci_req->owning_controller),
359 "%s: scic_sds_smp_request_await_response_frame_handler(0x%p) Found SATA dev, setting STP bit.\n", 359 "%s: scic_sds_smp_request_await_response_frame_handler(0x%p) Found SATA dev, setting STP bit.\n",
360 __func__, this_request); 360 __func__, sci_req);
361 } 361 }
362 } 362 }
363 363
@@ -367,40 +367,40 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
367 367
368 /* 368 /*
369 * copy the smp response to framework smp request's response buffer. 369 * copy the smp response to framework smp request's response buffer.
370 * scic_sds_smp_request_copy_response(this_request); */ 370 * scic_sds_smp_request_copy_response(sci_req); */
371 371
372 scic_sds_request_set_status( 372 scic_sds_request_set_status(
373 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 373 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
374 ); 374 );
375 375
376 sci_base_state_machine_change_state( 376 sci_base_state_machine_change_state(
377 &this_request->started_substate_machine, 377 &sci_req->started_substate_machine,
378 SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION 378 SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION
379 ); 379 );
380 } else { 380 } else {
381 /* This was not a response frame why did it get forwarded? */ 381 /* This was not a response frame why did it get forwarded? */
382 dev_err(scic_to_dev(this_request->owning_controller), 382 dev_err(scic_to_dev(sci_req->owning_controller),
383 "%s: SCIC SMP Request 0x%p received unexpected frame " 383 "%s: SCIC SMP Request 0x%p received unexpected frame "
384 "%d type 0x%02x\n", 384 "%d type 0x%02x\n",
385 __func__, 385 __func__,
386 this_request, 386 sci_req,
387 frame_index, 387 frame_index,
388 this_frame_header->smp_frame_type); 388 rsp_hdr->smp_frame_type);
389 389
390 scic_sds_request_set_status( 390 scic_sds_request_set_status(
391 this_request, 391 sci_req,
392 SCU_TASK_DONE_SMP_FRM_TYPE_ERR, 392 SCU_TASK_DONE_SMP_FRM_TYPE_ERR,
393 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 393 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
394 ); 394 );
395 395
396 sci_base_state_machine_change_state( 396 sci_base_state_machine_change_state(
397 &this_request->state_machine, 397 &sci_req->state_machine,
398 SCI_BASE_REQUEST_STATE_COMPLETED 398 SCI_BASE_REQUEST_STATE_COMPLETED
399 ); 399 );
400 } 400 }
401 401
402 scic_sds_controller_release_frame( 402 scic_sds_controller_release_frame(
403 this_request->owning_controller, frame_index 403 sci_req->owning_controller, frame_index
404 ); 404 );
405 405
406 return SCI_SUCCESS; 406 return SCI_SUCCESS;
@@ -411,7 +411,7 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
411 * This method processes an abnormal TC completion while the SMP request is 411 * This method processes an abnormal TC completion while the SMP request is
412 * waiting for a response frame. It decides what happened to the IO based 412 * waiting for a response frame. It decides what happened to the IO based
413 * on TC completion status. 413 * on TC completion status.
414 * @this_request: This parameter specifies the request for which the TC 414 * @sci_req: This parameter specifies the request for which the TC
415 * completion was received. 415 * completion was received.
416 * @completion_code: This parameter indicates the completion status information 416 * @completion_code: This parameter indicates the completion status information
417 * for the TC. 417 * for the TC.
@@ -420,7 +420,7 @@ static enum sci_status scic_sds_smp_request_await_response_frame_handler(
420 * this method always returns success. 420 * this method always returns success.
421 */ 421 */
422static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler( 422static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler(
423 struct scic_sds_request *this_request, 423 struct scic_sds_request *sci_req,
424 u32 completion_code) 424 u32 completion_code)
425{ 425{
426 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 426 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
@@ -429,11 +429,11 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
429 * In the AWAIT RESPONSE state, any TC completion is unexpected. 429 * In the AWAIT RESPONSE state, any TC completion is unexpected.
430 * but if the TC has success status, we complete the IO anyway. */ 430 * but if the TC has success status, we complete the IO anyway. */
431 scic_sds_request_set_status( 431 scic_sds_request_set_status(
432 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 432 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
433 ); 433 );
434 434
435 sci_base_state_machine_change_state( 435 sci_base_state_machine_change_state(
436 &this_request->state_machine, 436 &sci_req->state_machine,
437 SCI_BASE_REQUEST_STATE_COMPLETED); 437 SCI_BASE_REQUEST_STATE_COMPLETED);
438 break; 438 break;
439 439
@@ -447,11 +447,11 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
447 * break the connection and set TC completion with one of these SMP_XXX_XX_ERR 447 * break the connection and set TC completion with one of these SMP_XXX_XX_ERR
448 * status. For these type of error, we ask scic user to retry the request. */ 448 * status. For these type of error, we ask scic user to retry the request. */
449 scic_sds_request_set_status( 449 scic_sds_request_set_status(
450 this_request, SCU_TASK_DONE_SMP_RESP_TO_ERR, SCI_FAILURE_RETRY_REQUIRED 450 sci_req, SCU_TASK_DONE_SMP_RESP_TO_ERR, SCI_FAILURE_RETRY_REQUIRED
451 ); 451 );
452 452
453 sci_base_state_machine_change_state( 453 sci_base_state_machine_change_state(
454 &this_request->state_machine, 454 &sci_req->state_machine,
455 SCI_BASE_REQUEST_STATE_COMPLETED); 455 SCI_BASE_REQUEST_STATE_COMPLETED);
456 break; 456 break;
457 457
@@ -460,13 +460,13 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
460 * All other completion status cause the IO to be complete. If a NAK 460 * All other completion status cause the IO to be complete. If a NAK
461 * was received, then it is up to the user to retry the request. */ 461 * was received, then it is up to the user to retry the request. */
462 scic_sds_request_set_status( 462 scic_sds_request_set_status(
463 this_request, 463 sci_req,
464 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 464 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
465 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 465 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
466 ); 466 );
467 467
468 sci_base_state_machine_change_state( 468 sci_base_state_machine_change_state(
469 &this_request->state_machine, 469 &sci_req->state_machine,
470 SCI_BASE_REQUEST_STATE_COMPLETED); 470 SCI_BASE_REQUEST_STATE_COMPLETED);
471 break; 471 break;
472 } 472 }
@@ -480,7 +480,7 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
480 * determine if the SMP request was sent successfully. If the SMP request 480 * determine if the SMP request was sent successfully. If the SMP request
481 * was sent successfully, then the state for the SMP request transits to 481 * was sent successfully, then the state for the SMP request transits to
482 * waiting for a response frame. 482 * waiting for a response frame.
483 * @this_request: This parameter specifies the request for which the TC 483 * @sci_req: This parameter specifies the request for which the TC
484 * completion was received. 484 * completion was received.
485 * @completion_code: This parameter indicates the completion status information 485 * @completion_code: This parameter indicates the completion status information
486 * for the TC. 486 * for the TC.
@@ -489,17 +489,17 @@ static enum sci_status scic_sds_smp_request_await_response_tc_completion_handler
489 * this method always returns success. 489 * this method always returns success.
490 */ 490 */
491static enum sci_status scic_sds_smp_request_await_tc_completion_tc_completion_handler( 491static enum sci_status scic_sds_smp_request_await_tc_completion_tc_completion_handler(
492 struct scic_sds_request *this_request, 492 struct scic_sds_request *sci_req,
493 u32 completion_code) 493 u32 completion_code)
494{ 494{
495 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 495 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
496 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 496 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
497 scic_sds_request_set_status( 497 scic_sds_request_set_status(
498 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 498 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
499 ); 499 );
500 500
501 sci_base_state_machine_change_state( 501 sci_base_state_machine_change_state(
502 &this_request->state_machine, 502 &sci_req->state_machine,
503 SCI_BASE_REQUEST_STATE_COMPLETED); 503 SCI_BASE_REQUEST_STATE_COMPLETED);
504 break; 504 break;
505 505
@@ -508,13 +508,13 @@ static enum sci_status scic_sds_smp_request_await_tc_completion_tc_completion_ha
508 * All other completion status cause the IO to be complete. If a NAK 508 * All other completion status cause the IO to be complete. If a NAK
509 * was received, then it is up to the user to retry the request. */ 509 * was received, then it is up to the user to retry the request. */
510 scic_sds_request_set_status( 510 scic_sds_request_set_status(
511 this_request, 511 sci_req,
512 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 512 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
513 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 513 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
514 ); 514 );
515 515
516 sci_base_state_machine_change_state( 516 sci_base_state_machine_change_state(
517 &this_request->state_machine, 517 &sci_req->state_machine,
518 SCI_BASE_REQUEST_STATE_COMPLETED); 518 SCI_BASE_REQUEST_STATE_COMPLETED);
519 break; 519 break;
520 } 520 }
@@ -547,10 +547,10 @@ static const struct scic_sds_io_request_state_handler scic_sds_smp_request_start
547static void scic_sds_smp_request_started_await_response_substate_enter( 547static void scic_sds_smp_request_started_await_response_substate_enter(
548 struct sci_base_object *object) 548 struct sci_base_object *object)
549{ 549{
550 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 550 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
551 551
552 SET_STATE_HANDLER( 552 SET_STATE_HANDLER(
553 this_request, 553 sci_req,
554 scic_sds_smp_request_started_substate_handler_table, 554 scic_sds_smp_request_started_substate_handler_table,
555 SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_RESPONSE 555 SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_RESPONSE
556 ); 556 );
@@ -568,10 +568,10 @@ static void scic_sds_smp_request_started_await_response_substate_enter(
568static void scic_sds_smp_request_started_await_tc_completion_substate_enter( 568static void scic_sds_smp_request_started_await_tc_completion_substate_enter(
569 struct sci_base_object *object) 569 struct sci_base_object *object)
570{ 570{
571 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 571 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
572 572
573 SET_STATE_HANDLER( 573 SET_STATE_HANDLER(
574 this_request, 574 sci_req,
575 scic_sds_smp_request_started_substate_handler_table, 575 scic_sds_smp_request_started_substate_handler_table,
576 SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION 576 SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION
577 ); 577 );
diff --git a/drivers/scsi/isci/core/scic_sds_smp_request.h b/drivers/scsi/isci/core/scic_sds_smp_request.h
index bcad282ce753..8f34ffe2c236 100644
--- a/drivers/scsi/isci/core/scic_sds_smp_request.h
+++ b/drivers/scsi/isci/core/scic_sds_smp_request.h
@@ -62,8 +62,7 @@
62u32 scic_sds_smp_request_get_object_size(void); 62u32 scic_sds_smp_request_get_object_size(void);
63 63
64 64
65void scic_sds_smp_request_copy_response( 65void scic_sds_smp_request_copy_response(struct scic_sds_request *sci_req);
66 struct scic_sds_request *this_request);
67 66
68#endif /* _SCIC_SDS_SMP_REQUEST_T_ */ 67#endif /* _SCIC_SDS_SMP_REQUEST_T_ */
69 68
diff --git a/drivers/scsi/isci/core/scic_sds_ssp_request.c b/drivers/scsi/isci/core/scic_sds_ssp_request.c
index 4d3a21b6ac03..03676682e6ef 100644
--- a/drivers/scsi/isci/core/scic_sds_ssp_request.c
+++ b/drivers/scsi/isci/core/scic_sds_ssp_request.c
@@ -67,7 +67,7 @@
67 * determine if the RAW task management frame was sent successfully. If the 67 * determine if the RAW task management frame was sent successfully. If the
68 * raw frame was sent successfully, then the state for the task request 68 * raw frame was sent successfully, then the state for the task request
69 * transitions to waiting for a response frame. 69 * transitions to waiting for a response frame.
70 * @this_request: This parameter specifies the request for which the TC 70 * @sci_req: This parameter specifies the request for which the TC
71 * completion was received. 71 * completion was received.
72 * @completion_code: This parameter indicates the completion status information 72 * @completion_code: This parameter indicates the completion status information
73 * for the TC. 73 * for the TC.
@@ -76,17 +76,17 @@
76 * this method always returns success. 76 * this method always returns success.
77 */ 77 */
78static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler( 78static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler(
79 struct scic_sds_request *this_request, 79 struct scic_sds_request *sci_req,
80 u32 completion_code) 80 u32 completion_code)
81{ 81{
82 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 82 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
83 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 83 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
84 scic_sds_request_set_status( 84 scic_sds_request_set_status(
85 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 85 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
86 ); 86 );
87 87
88 sci_base_state_machine_change_state( 88 sci_base_state_machine_change_state(
89 &this_request->started_substate_machine, 89 &sci_req->started_substate_machine,
90 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE 90 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
91 ); 91 );
92 break; 92 break;
@@ -97,15 +97,15 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completi
97 * timeout if the task IU wasn't received successfully. 97 * timeout if the task IU wasn't received successfully.
98 * There is a potential for receiving multiple task responses if we 98 * There is a potential for receiving multiple task responses if we
99 * decide to send the task IU again. */ 99 * decide to send the task IU again. */
100 dev_warn(scic_to_dev(this_request->owning_controller), 100 dev_warn(scic_to_dev(sci_req->owning_controller),
101 "%s: TaskRequest:0x%p CompletionCode:%x - " 101 "%s: TaskRequest:0x%p CompletionCode:%x - "
102 "ACK/NAK timeout\n", 102 "ACK/NAK timeout\n",
103 __func__, 103 __func__,
104 this_request, 104 sci_req,
105 completion_code); 105 completion_code);
106 106
107 sci_base_state_machine_change_state( 107 sci_base_state_machine_change_state(
108 &this_request->started_substate_machine, 108 &sci_req->started_substate_machine,
109 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE 109 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
110 ); 110 );
111 break; 111 break;
@@ -115,12 +115,12 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completi
115 * All other completion status cause the IO to be complete. If a NAK 115 * All other completion status cause the IO to be complete. If a NAK
116 * was received, then it is up to the user to retry the request. */ 116 * was received, then it is up to the user to retry the request. */
117 scic_sds_request_set_status( 117 scic_sds_request_set_status(
118 this_request, 118 sci_req,
119 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 119 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
120 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 120 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
121 ); 121 );
122 122
123 sci_base_state_machine_change_state(&this_request->state_machine, 123 sci_base_state_machine_change_state(&sci_req->state_machine,
124 SCI_BASE_REQUEST_STATE_COMPLETED); 124 SCI_BASE_REQUEST_STATE_COMPLETED);
125 break; 125 break;
126 } 126 }
@@ -132,7 +132,7 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_completion_tc_completi
132 * This method is responsible for processing a terminate/abort request for this 132 * This method is responsible for processing a terminate/abort request for this
133 * TC while the request is waiting for the task management response 133 * TC while the request is waiting for the task management response
134 * unsolicited frame. 134 * unsolicited frame.
135 * @this_request: This parameter specifies the request for which the 135 * @sci_req: This parameter specifies the request for which the
136 * termination was requested. 136 * termination was requested.
137 * 137 *
138 * This method returns an indication as to whether the abort request was 138 * This method returns an indication as to whether the abort request was
@@ -155,7 +155,7 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_response_abort_handler
155 * waiting for a response frame. It will copy the response data, release 155 * waiting for a response frame. It will copy the response data, release
156 * the unsolicited frame, and transition the request to the 156 * the unsolicited frame, and transition the request to the
157 * SCI_BASE_REQUEST_STATE_COMPLETED state. 157 * SCI_BASE_REQUEST_STATE_COMPLETED state.
158 * @this_request: This parameter specifies the request for which the 158 * @sci_req: This parameter specifies the request for which the
159 * unsolicited frame was received. 159 * unsolicited frame was received.
160 * @frame_index: This parameter indicates the unsolicited frame index that 160 * @frame_index: This parameter indicates the unsolicited frame index that
161 * should contain the response. 161 * should contain the response.
@@ -202,10 +202,10 @@ static const struct scic_sds_io_request_state_handler scic_sds_ssp_task_request_
202static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_enter( 202static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_enter(
203 struct sci_base_object *object) 203 struct sci_base_object *object)
204{ 204{
205 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 205 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
206 206
207 SET_STATE_HANDLER( 207 SET_STATE_HANDLER(
208 this_request, 208 sci_req,
209 scic_sds_ssp_task_request_started_substate_handler_table, 209 scic_sds_ssp_task_request_started_substate_handler_table,
210 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION 210 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION
211 ); 211 );
@@ -223,10 +223,10 @@ static void scic_sds_io_request_started_task_mgmt_await_tc_completion_substate_e
223static void scic_sds_io_request_started_task_mgmt_await_task_response_substate_enter( 223static void scic_sds_io_request_started_task_mgmt_await_task_response_substate_enter(
224 struct sci_base_object *object) 224 struct sci_base_object *object)
225{ 225{
226 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 226 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
227 227
228 SET_STATE_HANDLER( 228 SET_STATE_HANDLER(
229 this_request, 229 sci_req,
230 scic_sds_ssp_task_request_started_substate_handler_table, 230 scic_sds_ssp_task_request_started_substate_handler_table,
231 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE 231 SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE
232 ); 232 );
diff --git a/drivers/scsi/isci/core/scic_sds_stp_packet_request.c b/drivers/scsi/isci/core/scic_sds_stp_packet_request.c
index 25c68cef298e..e4d2bf56f491 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_packet_request.c
+++ b/drivers/scsi/isci/core/scic_sds_stp_packet_request.c
@@ -75,16 +75,16 @@
75/** 75/**
76 * This method will fill in the SCU Task Context for a PACKET fis. And 76 * This method will fill in the SCU Task Context for a PACKET fis. And
77 * construct the request STARTED sub-state machine for Packet Protocol IO. 77 * construct the request STARTED sub-state machine for Packet Protocol IO.
78 * @this_request: This parameter specifies the stp packet request object being 78 * @sci_req: This parameter specifies the stp packet request object being
79 * constructed. 79 * constructed.
80 * 80 *
81 */ 81 */
82enum sci_status scic_sds_stp_packet_request_construct( 82enum sci_status scic_sds_stp_packet_request_construct(
83 struct scic_sds_request *this_request) 83 struct scic_sds_request *sci_req)
84{ 84{
85 struct sata_fis_reg_h2d *h2d_fis = 85 struct sata_fis_reg_h2d *h2d_fis =
86 scic_stp_io_request_get_h2d_reg_address( 86 scic_stp_io_request_get_h2d_reg_address(
87 this_request 87 sci_req
88 ); 88 );
89 89
90 /* 90 /*
@@ -92,17 +92,17 @@ enum sci_status scic_sds_stp_packet_request_construct(
92 * need to make change to Packet Fis features field. */ 92 * need to make change to Packet Fis features field. */
93 h2d_fis->features = h2d_fis->features | ATA_PACKET_FEATURE_DMA; 93 h2d_fis->features = h2d_fis->features | ATA_PACKET_FEATURE_DMA;
94 94
95 scic_sds_stp_non_ncq_request_construct(this_request); 95 scic_sds_stp_non_ncq_request_construct(sci_req);
96 96
97 /* Build the Packet Fis task context structure */ 97 /* Build the Packet Fis task context structure */
98 scu_stp_raw_request_construct_task_context( 98 scu_stp_raw_request_construct_task_context(
99 (struct scic_sds_stp_request *)this_request, 99 (struct scic_sds_stp_request *)sci_req,
100 this_request->task_context_buffer 100 sci_req->task_context_buffer
101 ); 101 );
102 102
103 sci_base_state_machine_construct( 103 sci_base_state_machine_construct(
104 &this_request->started_substate_machine, 104 &sci_req->started_substate_machine,
105 &this_request->parent.parent, 105 &sci_req->parent.parent,
106 scic_sds_stp_packet_request_started_substate_table, 106 scic_sds_stp_packet_request_started_substate_table,
107 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_TC_COMPLETION_SUBSTATE 107 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_TC_COMPLETION_SUBSTATE
108 ); 108 );
@@ -119,24 +119,24 @@ enum sci_status scic_sds_stp_packet_request_construct(
119 * utilized to perform task management. -# control_frame == 1. This ensures 119 * utilized to perform task management. -# control_frame == 1. This ensures
120 * that the proper endianess is set so that the bytes are transmitted in the 120 * that the proper endianess is set so that the bytes are transmitted in the
121 * right order for a smp request frame. 121 * right order for a smp request frame.
122 * @this_request: This parameter specifies the smp request object being 122 * @sci_req: This parameter specifies the smp request object being
123 * constructed. 123 * constructed.
124 * @task_context: The task_context to be reconstruct for packet request command 124 * @task_context: The task_context to be reconstruct for packet request command
125 * phase. 125 * phase.
126 * 126 *
127 */ 127 */
128void scu_stp_packet_request_command_phase_construct_task_context( 128void scu_stp_packet_request_command_phase_construct_task_context(
129 struct scic_sds_request *this_request, 129 struct scic_sds_request *sci_req,
130 struct scu_task_context *task_context) 130 struct scu_task_context *task_context)
131{ 131{
132 void *atapi_cdb; 132 void *atapi_cdb;
133 u32 atapi_cdb_length; 133 u32 atapi_cdb_length;
134 struct scic_sds_stp_request *stp_request = (struct scic_sds_stp_request *)this_request; 134 struct scic_sds_stp_request *stp_request = (struct scic_sds_stp_request *)sci_req;
135 135
136 /* 136 /*
137 * reference: SSTL 1.13.4.2 137 * reference: SSTL 1.13.4.2
138 * task_type, sata_direction */ 138 * task_type, sata_direction */
139 if (scic_cb_io_request_get_data_direction(this_request->user_request) 139 if (scic_cb_io_request_get_data_direction(sci_req->user_request)
140 == SCI_IO_REQUEST_DATA_OUT) { 140 == SCI_IO_REQUEST_DATA_OUT) {
141 task_context->task_type = SCU_TASK_TYPE_PACKET_DMA_OUT; 141 task_context->task_type = SCU_TASK_TYPE_PACKET_DMA_OUT;
142 task_context->sata_direction = 0; 142 task_context->sata_direction = 0;
@@ -152,15 +152,15 @@ void scu_stp_packet_request_command_phase_construct_task_context(
152 /* 152 /*
153 * Copy in the command IU with CDB so that the commandIU address doesn't 153 * Copy in the command IU with CDB so that the commandIU address doesn't
154 * change. */ 154 * change. */
155 memset(this_request->command_buffer, 0, sizeof(struct sata_fis_reg_h2d)); 155 memset(sci_req->command_buffer, 0, sizeof(struct sata_fis_reg_h2d));
156 156
157 atapi_cdb = 157 atapi_cdb =
158 scic_cb_stp_packet_io_request_get_cdb_address(this_request->user_request); 158 scic_cb_stp_packet_io_request_get_cdb_address(sci_req->user_request);
159 159
160 atapi_cdb_length = 160 atapi_cdb_length =
161 scic_cb_stp_packet_io_request_get_cdb_length(this_request->user_request); 161 scic_cb_stp_packet_io_request_get_cdb_length(sci_req->user_request);
162 162
163 memcpy(((u8 *)this_request->command_buffer + sizeof(u32)), atapi_cdb, atapi_cdb_length); 163 memcpy(((u8 *)sci_req->command_buffer + sizeof(u32)), atapi_cdb, atapi_cdb_length);
164 164
165 atapi_cdb_length = 165 atapi_cdb_length =
166 max(atapi_cdb_length, stp_request->type.packet.device_preferred_cdb_length); 166 max(atapi_cdb_length, stp_request->type.packet.device_preferred_cdb_length);
@@ -175,18 +175,18 @@ void scu_stp_packet_request_command_phase_construct_task_context(
175 /* retry counter */ 175 /* retry counter */
176 task_context->stp_retry_count = 0; 176 task_context->stp_retry_count = 0;
177 177
178 if (scic_cb_request_is_initial_construction(this_request->user_request)) { 178 if (scic_cb_request_is_initial_construction(sci_req->user_request)) {
179 /* data transfer size. */ 179 /* data transfer size. */
180 task_context->transfer_length_bytes = 180 task_context->transfer_length_bytes =
181 scic_cb_io_request_get_transfer_length(this_request->user_request); 181 scic_cb_io_request_get_transfer_length(sci_req->user_request);
182 182
183 /* setup sgl */ 183 /* setup sgl */
184 scic_sds_request_build_sgl(this_request); 184 scic_sds_request_build_sgl(sci_req);
185 } else { 185 } else {
186 /* data transfer size, need to be 4 bytes aligned. */ 186 /* data transfer size, need to be 4 bytes aligned. */
187 task_context->transfer_length_bytes = (SCSI_FIXED_SENSE_DATA_BASE_LENGTH + 2); 187 task_context->transfer_length_bytes = (SCSI_FIXED_SENSE_DATA_BASE_LENGTH + 2);
188 188
189 scic_sds_stp_packet_internal_request_sense_build_sgl(this_request); 189 scic_sds_stp_packet_internal_request_sense_build_sgl(sci_req);
190 } 190 }
191} 191}
192 192
@@ -194,24 +194,24 @@ void scu_stp_packet_request_command_phase_construct_task_context(
194 * This method will fill in the SCU Task Context for a DATA fis containing CDB 194 * This method will fill in the SCU Task Context for a DATA fis containing CDB
195 * in Raw Frame type. The TC for previous Packet fis was already there, we 195 * in Raw Frame type. The TC for previous Packet fis was already there, we
196 * only need to change the H2D fis content. 196 * only need to change the H2D fis content.
197 * @this_request: This parameter specifies the smp request object being 197 * @sci_req: This parameter specifies the smp request object being
198 * constructed. 198 * constructed.
199 * @task_context: The task_context to be reconstruct for packet request command 199 * @task_context: The task_context to be reconstruct for packet request command
200 * phase. 200 * phase.
201 * 201 *
202 */ 202 */
203void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context( 203void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
204 struct scic_sds_request *this_request, 204 struct scic_sds_request *sci_req,
205 struct scu_task_context *task_context) 205 struct scu_task_context *task_context)
206{ 206{
207 void *atapi_cdb = 207 void *atapi_cdb =
208 scic_cb_stp_packet_io_request_get_cdb_address(this_request->user_request); 208 scic_cb_stp_packet_io_request_get_cdb_address(sci_req->user_request);
209 209
210 u32 atapi_cdb_length = 210 u32 atapi_cdb_length =
211 scic_cb_stp_packet_io_request_get_cdb_length(this_request->user_request); 211 scic_cb_stp_packet_io_request_get_cdb_length(sci_req->user_request);
212 212
213 memset(this_request->command_buffer, 0, sizeof(struct sata_fis_reg_h2d)); 213 memset(sci_req->command_buffer, 0, sizeof(struct sata_fis_reg_h2d));
214 memcpy(((u8 *)this_request->command_buffer + sizeof(u32)), atapi_cdb, atapi_cdb_length); 214 memcpy(((u8 *)sci_req->command_buffer + sizeof(u32)), atapi_cdb, atapi_cdb_length);
215 215
216 memset(&(task_context->type.stp), 0, sizeof(struct stp_task_context)); 216 memset(&(task_context->type.stp), 0, sizeof(struct stp_task_context));
217 task_context->type.stp.fis_type = SATA_FIS_TYPE_DATA; 217 task_context->type.stp.fis_type = SATA_FIS_TYPE_DATA;
@@ -227,12 +227,12 @@ void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
227 * *@brief This methods decode the D2H status FIS and retrieve the sense data, 227 * *@brief This methods decode the D2H status FIS and retrieve the sense data,
228 * then pass the sense data to user request. 228 * then pass the sense data to user request.
229 * 229 *
230 ***@param[in] this_request The request receive D2H status FIS. 230 ***@param[in] sci_req The request receive D2H status FIS.
231 ***@param[in] status_fis The D2H status fis to be processed. 231 ***@param[in] status_fis The D2H status fis to be processed.
232 * 232 *
233 */ 233 */
234enum sci_status scic_sds_stp_packet_request_process_status_fis( 234enum sci_status scic_sds_stp_packet_request_process_status_fis(
235 struct scic_sds_request *this_request, 235 struct scic_sds_request *sci_req,
236 struct sata_fis_reg_d2h *status_fis) 236 struct sata_fis_reg_d2h *status_fis)
237{ 237{
238 enum sci_status status = SCI_SUCCESS; 238 enum sci_status status = SCI_SUCCESS;
@@ -249,7 +249,7 @@ enum sci_status scic_sds_stp_packet_request_process_status_fis(
249 * command using this request response buffer, only one sge is 249 * command using this request response buffer, only one sge is
250 * needed. 250 * needed.
251 * 251 *
252 ***@param[in] this_request The request receive request sense data. 252 ***@param[in] sci_req The request receive request sense data.
253 * 253 *
254 */ 254 */
255void scic_sds_stp_packet_internal_request_sense_build_sgl( 255void scic_sds_stp_packet_internal_request_sense_build_sgl(
@@ -284,7 +284,7 @@ void scic_sds_stp_packet_internal_request_sense_build_sgl(
284 * determine if the Packet FIS was sent successfully. If the Packet FIS was 284 * determine if the Packet FIS was sent successfully. If the Packet FIS was
285 * sent successfully, then the state for the Packet request transits to 285 * sent successfully, then the state for the Packet request transits to
286 * waiting for a PIO SETUP frame. 286 * waiting for a PIO SETUP frame.
287 * @this_request: This parameter specifies the request for which the TC 287 * @sci_req: This parameter specifies the request for which the TC
288 * completion was received. 288 * completion was received.
289 * @completion_code: This parameter indicates the completion status information 289 * @completion_code: This parameter indicates the completion status information
290 * for the TC. 290 * for the TC.
@@ -293,7 +293,7 @@ void scic_sds_stp_packet_internal_request_sense_build_sgl(
293 * this method always returns success. 293 * this method always returns success.
294 */ 294 */
295enum sci_status scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_completion_handler( 295enum sci_status scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_completion_handler(
296 struct scic_sds_request *this_request, 296 struct scic_sds_request *sci_req,
297 u32 completion_code) 297 u32 completion_code)
298{ 298{
299 enum sci_status status = SCI_SUCCESS; 299 enum sci_status status = SCI_SUCCESS;
@@ -301,11 +301,11 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_
301 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 301 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
302 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 302 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
303 scic_sds_request_set_status( 303 scic_sds_request_set_status(
304 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 304 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
305 ); 305 );
306 306
307 sci_base_state_machine_change_state( 307 sci_base_state_machine_change_state(
308 &this_request->started_substate_machine, 308 &sci_req->started_substate_machine,
309 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_PIO_SETUP_SUBSTATE 309 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_PIO_SETUP_SUBSTATE
310 ); 310 );
311 break; 311 break;
@@ -315,13 +315,13 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_
315 * All other completion status cause the IO to be complete. If a NAK 315 * All other completion status cause the IO to be complete. If a NAK
316 * was received, then it is up to the user to retry the request. */ 316 * was received, then it is up to the user to retry the request. */
317 scic_sds_request_set_status( 317 scic_sds_request_set_status(
318 this_request, 318 sci_req,
319 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 319 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
320 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 320 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
321 ); 321 );
322 322
323 sci_base_state_machine_change_state( 323 sci_base_state_machine_change_state(
324 &this_request->parent.state_machine, 324 &sci_req->parent.state_machine,
325 SCI_BASE_REQUEST_STATE_COMPLETED 325 SCI_BASE_REQUEST_STATE_COMPLETED
326 ); 326 );
327 break; 327 break;
@@ -336,7 +336,7 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_
336 * waiting for a PIO SETUP FIS. It will release the unsolicited frame, and 336 * waiting for a PIO SETUP FIS. It will release the unsolicited frame, and
337 * transition the request to the COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE 337 * transition the request to the COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE
338 * state. 338 * state.
339 * @this_request: This parameter specifies the request for which the 339 * @sci_req: This parameter specifies the request for which the
340 * unsolicited frame was received. 340 * unsolicited frame was received.
341 * @frame_index: This parameter indicates the unsolicited frame index that 341 * @frame_index: This parameter indicates the unsolicited frame index that
342 * should contain the response. 342 * should contain the response.
@@ -352,12 +352,12 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_h
352 enum sci_status status; 352 enum sci_status status;
353 struct sata_fis_header *frame_header; 353 struct sata_fis_header *frame_header;
354 u32 *frame_buffer; 354 u32 *frame_buffer;
355 struct scic_sds_stp_request *this_request; 355 struct scic_sds_stp_request *sci_req;
356 356
357 this_request = (struct scic_sds_stp_request *)request; 357 sci_req = (struct scic_sds_stp_request *)request;
358 358
359 status = scic_sds_unsolicited_frame_control_get_header( 359 status = scic_sds_unsolicited_frame_control_get_header(
360 &(this_request->parent.owning_controller->uf_control), 360 &(sci_req->parent.owning_controller->uf_control),
361 frame_index, 361 frame_index,
362 (void **)&frame_header 362 (void **)&frame_header
363 ); 363 );
@@ -369,7 +369,7 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_h
369 * Get from the frame buffer the PIO Setup Data, although we don't need 369 * Get from the frame buffer the PIO Setup Data, although we don't need
370 * any info from this pio setup fis. */ 370 * any info from this pio setup fis. */
371 scic_sds_unsolicited_frame_control_get_buffer( 371 scic_sds_unsolicited_frame_control_get_buffer(
372 &(this_request->parent.owning_controller->uf_control), 372 &(sci_req->parent.owning_controller->uf_control),
373 frame_index, 373 frame_index,
374 (void **)&frame_buffer 374 (void **)&frame_buffer
375 ); 375 );
@@ -378,23 +378,23 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_h
378 * Get the data from the PIO Setup 378 * Get the data from the PIO Setup
379 * The SCU Hardware returns first word in the frame_header and the rest 379 * The SCU Hardware returns first word in the frame_header and the rest
380 * of the data is in the frame buffer so we need to back up one dword */ 380 * of the data is in the frame buffer so we need to back up one dword */
381 this_request->type.packet.device_preferred_cdb_length = 381 sci_req->type.packet.device_preferred_cdb_length =
382 (u16)((struct sata_fis_pio_setup *)(&frame_buffer[-1]))->transfter_count; 382 (u16)((struct sata_fis_pio_setup *)(&frame_buffer[-1]))->transfter_count;
383 383
384 /* Frame has been decoded return it to the controller */ 384 /* Frame has been decoded return it to the controller */
385 scic_sds_controller_release_frame( 385 scic_sds_controller_release_frame(
386 this_request->parent.owning_controller, frame_index 386 sci_req->parent.owning_controller, frame_index
387 ); 387 );
388 388
389 sci_base_state_machine_change_state( 389 sci_base_state_machine_change_state(
390 &this_request->parent.started_substate_machine, 390 &sci_req->parent.started_substate_machine,
391 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE 391 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE
392 ); 392 );
393 } else 393 } else
394 dev_err(scic_to_dev(request->owning_controller), 394 dev_err(scic_to_dev(request->owning_controller),
395 "%s: SCIC IO Request 0x%p could not get frame header " 395 "%s: SCIC IO Request 0x%p could not get frame header "
396 "for frame index %d, status %x\n", 396 "for frame index %d, status %x\n",
397 __func__, this_request, frame_index, status); 397 __func__, sci_req, frame_index, status);
398 398
399 return status; 399 return status;
400} 400}
@@ -406,7 +406,7 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_h
406 * successfully, then the state for the packet request transits to COMPLETE 406 * successfully, then the state for the packet request transits to COMPLETE
407 * state. If not successfuly, the request transits to 407 * state. If not successfuly, the request transits to
408 * COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE. 408 * COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE.
409 * @this_request: This parameter specifies the request for which the TC 409 * @sci_req: This parameter specifies the request for which the TC
410 * completion was received. 410 * completion was received.
411 * @completion_code: This parameter indicates the completion status information 411 * @completion_code: This parameter indicates the completion status information
412 * for the TC. 412 * for the TC.
@@ -415,64 +415,64 @@ enum sci_status scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_h
415 * this method always returns success. 415 * this method always returns success.
416 */ 416 */
417enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_tc_completion_handler( 417enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_tc_completion_handler(
418 struct scic_sds_request *this_request, 418 struct scic_sds_request *sci_req,
419 u32 completion_code) 419 u32 completion_code)
420{ 420{
421 enum sci_status status = SCI_SUCCESS; 421 enum sci_status status = SCI_SUCCESS;
422 u8 sat_packet_protocol = 422 u8 sat_packet_protocol =
423 scic_cb_request_get_sat_protocol(this_request->user_request); 423 scic_cb_request_get_sat_protocol(sci_req->user_request);
424 424
425 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 425 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
426 case (SCU_TASK_DONE_GOOD << SCU_COMPLETION_TL_STATUS_SHIFT): 426 case (SCU_TASK_DONE_GOOD << SCU_COMPLETION_TL_STATUS_SHIFT):
427 scic_sds_request_set_status( 427 scic_sds_request_set_status(
428 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 428 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
429 ); 429 );
430 430
431 if (sat_packet_protocol == SAT_PROTOCOL_PACKET_DMA_DATA_IN 431 if (sat_packet_protocol == SAT_PROTOCOL_PACKET_DMA_DATA_IN
432 || sat_packet_protocol == SAT_PROTOCOL_PACKET_DMA_DATA_OUT 432 || sat_packet_protocol == SAT_PROTOCOL_PACKET_DMA_DATA_OUT
433 ) 433 )
434 sci_base_state_machine_change_state( 434 sci_base_state_machine_change_state(
435 &this_request->parent.state_machine, 435 &sci_req->parent.state_machine,
436 SCI_BASE_REQUEST_STATE_COMPLETED 436 SCI_BASE_REQUEST_STATE_COMPLETED
437 ); 437 );
438 else 438 else
439 sci_base_state_machine_change_state( 439 sci_base_state_machine_change_state(
440 &this_request->started_substate_machine, 440 &sci_req->started_substate_machine,
441 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE 441 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE
442 ); 442 );
443 break; 443 break;
444 444
445 case (SCU_TASK_DONE_UNEXP_FIS << SCU_COMPLETION_TL_STATUS_SHIFT): 445 case (SCU_TASK_DONE_UNEXP_FIS << SCU_COMPLETION_TL_STATUS_SHIFT):
446 if (scic_io_request_get_number_of_bytes_transferred(this_request) < 446 if (scic_io_request_get_number_of_bytes_transferred(sci_req) <
447 scic_cb_io_request_get_transfer_length(this_request->user_request)) { 447 scic_cb_io_request_get_transfer_length(sci_req->user_request)) {
448 scic_sds_request_set_status( 448 scic_sds_request_set_status(
449 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS_IO_DONE_EARLY 449 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS_IO_DONE_EARLY
450 ); 450 );
451 451
452 sci_base_state_machine_change_state( 452 sci_base_state_machine_change_state(
453 &this_request->parent.state_machine, 453 &sci_req->parent.state_machine,
454 SCI_BASE_REQUEST_STATE_COMPLETED 454 SCI_BASE_REQUEST_STATE_COMPLETED
455 ); 455 );
456 456
457 status = this_request->sci_status; 457 status = sci_req->sci_status;
458 } 458 }
459 break; 459 break;
460 460
461 case (SCU_TASK_DONE_EXCESS_DATA << SCU_COMPLETION_TL_STATUS_SHIFT): 461 case (SCU_TASK_DONE_EXCESS_DATA << SCU_COMPLETION_TL_STATUS_SHIFT):
462 /* In this case, there is no UF coming after. compelte the IO now. */ 462 /* In this case, there is no UF coming after. compelte the IO now. */
463 scic_sds_request_set_status( 463 scic_sds_request_set_status(
464 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 464 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
465 ); 465 );
466 466
467 sci_base_state_machine_change_state( 467 sci_base_state_machine_change_state(
468 &this_request->parent.state_machine, 468 &sci_req->parent.state_machine,
469 SCI_BASE_REQUEST_STATE_COMPLETED 469 SCI_BASE_REQUEST_STATE_COMPLETED
470 ); 470 );
471 471
472 break; 472 break;
473 473
474 default: 474 default:
475 if (this_request->sci_status != SCI_SUCCESS) { /* The io status was set already. This means an UF for the status 475 if (sci_req->sci_status != SCI_SUCCESS) { /* The io status was set already. This means an UF for the status
476 * fis was received already. 476 * fis was received already.
477 */ 477 */
478 478
@@ -480,28 +480,28 @@ enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_tc
480 * A device suspension event is expected, we need to have the device 480 * A device suspension event is expected, we need to have the device
481 * coming out of suspension, then complete the IO. */ 481 * coming out of suspension, then complete the IO. */
482 sci_base_state_machine_change_state( 482 sci_base_state_machine_change_state(
483 &this_request->started_substate_machine, 483 &sci_req->started_substate_machine,
484 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMPLETION_DELAY_SUBSTATE 484 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMPLETION_DELAY_SUBSTATE
485 ); 485 );
486 486
487 /* change the device state to ATAPI_ERROR. */ 487 /* change the device state to ATAPI_ERROR. */
488 sci_base_state_machine_change_state( 488 sci_base_state_machine_change_state(
489 &this_request->target_device->ready_substate_machine, 489 &sci_req->target_device->ready_substate_machine,
490 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR 490 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR
491 ); 491 );
492 492
493 status = this_request->sci_status; 493 status = sci_req->sci_status;
494 } else { /* If receiving any non-sucess TC status, no UF received yet, then an UF for 494 } else { /* If receiving any non-sucess TC status, no UF received yet, then an UF for
495 * the status fis is coming after. 495 * the status fis is coming after.
496 */ 496 */
497 scic_sds_request_set_status( 497 scic_sds_request_set_status(
498 this_request, 498 sci_req,
499 SCU_TASK_DONE_CHECK_RESPONSE, 499 SCU_TASK_DONE_CHECK_RESPONSE,
500 SCI_FAILURE_IO_RESPONSE_VALID 500 SCI_FAILURE_IO_RESPONSE_VALID
501 ); 501 );
502 502
503 sci_base_state_machine_change_state( 503 sci_base_state_machine_change_state(
504 &this_request->started_substate_machine, 504 &sci_req->started_substate_machine,
505 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE 505 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE
506 ); 506 );
507 } 507 }
@@ -514,7 +514,7 @@ enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_tc
514 514
515/** 515/**
516 * This method processes an unsolicited frame. 516 * This method processes an unsolicited frame.
517 * @this_request: This parameter specifies the request for which the 517 * @sci_req: This parameter specifies the request for which the
518 * unsolicited frame was received. 518 * unsolicited frame was received.
519 * @frame_index: This parameter indicates the unsolicited frame index that 519 * @frame_index: This parameter indicates the unsolicited frame index that
520 * should contain the response. 520 * should contain the response.
@@ -530,12 +530,12 @@ enum sci_status scic_sds_stp_packet_request_command_phase_common_frame_handler(
530 enum sci_status status; 530 enum sci_status status;
531 struct sata_fis_header *frame_header; 531 struct sata_fis_header *frame_header;
532 u32 *frame_buffer; 532 u32 *frame_buffer;
533 struct scic_sds_stp_request *this_request; 533 struct scic_sds_stp_request *sci_req;
534 534
535 this_request = (struct scic_sds_stp_request *)request; 535 sci_req = (struct scic_sds_stp_request *)request;
536 536
537 status = scic_sds_unsolicited_frame_control_get_header( 537 status = scic_sds_unsolicited_frame_control_get_header(
538 &(this_request->parent.owning_controller->uf_control), 538 &(sci_req->parent.owning_controller->uf_control),
539 frame_index, 539 frame_index,
540 (void **)&frame_header 540 (void **)&frame_header
541 ); 541 );
@@ -547,18 +547,18 @@ enum sci_status scic_sds_stp_packet_request_command_phase_common_frame_handler(
547 * Get from the frame buffer the PIO Setup Data, although we don't need 547 * Get from the frame buffer the PIO Setup Data, although we don't need
548 * any info from this pio setup fis. */ 548 * any info from this pio setup fis. */
549 scic_sds_unsolicited_frame_control_get_buffer( 549 scic_sds_unsolicited_frame_control_get_buffer(
550 &(this_request->parent.owning_controller->uf_control), 550 &(sci_req->parent.owning_controller->uf_control),
551 frame_index, 551 frame_index,
552 (void **)&frame_buffer 552 (void **)&frame_buffer
553 ); 553 );
554 554
555 scic_sds_controller_copy_sata_response( 555 scic_sds_controller_copy_sata_response(
556 &this_request->d2h_reg_fis, (u32 *)frame_header, frame_buffer 556 &sci_req->d2h_reg_fis, (u32 *)frame_header, frame_buffer
557 ); 557 );
558 558
559 /* Frame has been decoded return it to the controller */ 559 /* Frame has been decoded return it to the controller */
560 scic_sds_controller_release_frame( 560 scic_sds_controller_release_frame(
561 this_request->parent.owning_controller, frame_index 561 sci_req->parent.owning_controller, frame_index
562 ); 562 );
563 } 563 }
564 564
@@ -568,7 +568,7 @@ enum sci_status scic_sds_stp_packet_request_command_phase_common_frame_handler(
568/** 568/**
569 * This method processes an unsolicited frame while the packet request is 569 * This method processes an unsolicited frame while the packet request is
570 * expecting TC completion. It will process the FIS and construct sense data. 570 * expecting TC completion. It will process the FIS and construct sense data.
571 * @this_request: This parameter specifies the request for which the 571 * @sci_req: This parameter specifies the request for which the
572 * unsolicited frame was received. 572 * unsolicited frame was received.
573 * @frame_index: This parameter indicates the unsolicited frame index that 573 * @frame_index: This parameter indicates the unsolicited frame index that
574 * should contain the response. 574 * should contain the response.
@@ -581,7 +581,7 @@ enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_fr
581 struct scic_sds_request *request, 581 struct scic_sds_request *request,
582 u32 frame_index) 582 u32 frame_index)
583{ 583{
584 struct scic_sds_stp_request *this_request = (struct scic_sds_stp_request *)request; 584 struct scic_sds_stp_request *sci_req = (struct scic_sds_stp_request *)request;
585 585
586 enum sci_status status = 586 enum sci_status status =
587 scic_sds_stp_packet_request_command_phase_common_frame_handler( 587 scic_sds_stp_packet_request_command_phase_common_frame_handler(
@@ -590,17 +590,17 @@ enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_fr
590 if (status == SCI_SUCCESS) { 590 if (status == SCI_SUCCESS) {
591 /* The command has completed with error status from target device. */ 591 /* The command has completed with error status from target device. */
592 status = scic_sds_stp_packet_request_process_status_fis( 592 status = scic_sds_stp_packet_request_process_status_fis(
593 request, &this_request->d2h_reg_fis); 593 request, &sci_req->d2h_reg_fis);
594 594
595 if (status != SCI_SUCCESS) { 595 if (status != SCI_SUCCESS) {
596 scic_sds_request_set_status( 596 scic_sds_request_set_status(
597 &this_request->parent, 597 &sci_req->parent,
598 SCU_TASK_DONE_CHECK_RESPONSE, 598 SCU_TASK_DONE_CHECK_RESPONSE,
599 status 599 status
600 ); 600 );
601 } else 601 } else
602 scic_sds_request_set_status( 602 scic_sds_request_set_status(
603 &this_request->parent, SCU_TASK_DONE_GOOD, SCI_SUCCESS 603 &sci_req->parent, SCU_TASK_DONE_GOOD, SCI_SUCCESS
604 ); 604 );
605 } 605 }
606 606
@@ -611,7 +611,7 @@ enum sci_status scic_sds_stp_packet_request_command_phase_await_tc_completion_fr
611/** 611/**
612 * This method processes an unsolicited frame while the packet request is 612 * This method processes an unsolicited frame while the packet request is
613 * expecting TC completion. It will process the FIS and construct sense data. 613 * expecting TC completion. It will process the FIS and construct sense data.
614 * @this_request: This parameter specifies the request for which the 614 * @sci_req: This parameter specifies the request for which the
615 * unsolicited frame was received. 615 * unsolicited frame was received.
616 * @frame_index: This parameter indicates the unsolicited frame index that 616 * @frame_index: This parameter indicates the unsolicited frame index that
617 * should contain the response. 617 * should contain the response.
@@ -628,12 +628,12 @@ enum sci_status scic_sds_stp_packet_request_command_phase_await_d2h_fis_frame_ha
628 scic_sds_stp_packet_request_command_phase_common_frame_handler( 628 scic_sds_stp_packet_request_command_phase_common_frame_handler(
629 request, frame_index); 629 request, frame_index);
630 630
631 struct scic_sds_stp_request *this_request = (struct scic_sds_stp_request *)request; 631 struct scic_sds_stp_request *sci_req = (struct scic_sds_stp_request *)request;
632 632
633 if (status == SCI_SUCCESS) { 633 if (status == SCI_SUCCESS) {
634 /* The command has completed with error status from target device. */ 634 /* The command has completed with error status from target device. */
635 status = scic_sds_stp_packet_request_process_status_fis( 635 status = scic_sds_stp_packet_request_process_status_fis(
636 request, &this_request->d2h_reg_fis); 636 request, &sci_req->d2h_reg_fis);
637 637
638 if (status != SCI_SUCCESS) { 638 if (status != SCI_SUCCESS) {
639 scic_sds_request_set_status( 639 scic_sds_request_set_status(
@@ -696,26 +696,26 @@ const struct scic_sds_io_request_state_handler scic_sds_stp_packet_request_start
696void scic_sds_stp_packet_request_started_packet_phase_await_tc_completion_enter( 696void scic_sds_stp_packet_request_started_packet_phase_await_tc_completion_enter(
697 struct sci_base_object *object) 697 struct sci_base_object *object)
698{ 698{
699 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 699 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
700 700
701 SET_STATE_HANDLER( 701 SET_STATE_HANDLER(
702 this_request, 702 sci_req,
703 scic_sds_stp_packet_request_started_substate_handler_table, 703 scic_sds_stp_packet_request_started_substate_handler_table,
704 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_TC_COMPLETION_SUBSTATE 704 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_TC_COMPLETION_SUBSTATE
705 ); 705 );
706 706
707 scic_sds_remote_device_set_working_request( 707 scic_sds_remote_device_set_working_request(
708 this_request->target_device, this_request 708 sci_req->target_device, sci_req
709 ); 709 );
710} 710}
711 711
712void scic_sds_stp_packet_request_started_packet_phase_await_pio_setup_enter( 712void scic_sds_stp_packet_request_started_packet_phase_await_pio_setup_enter(
713 struct sci_base_object *object) 713 struct sci_base_object *object)
714{ 714{
715 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 715 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
716 716
717 SET_STATE_HANDLER( 717 SET_STATE_HANDLER(
718 this_request, 718 sci_req,
719 scic_sds_stp_packet_request_started_substate_handler_table, 719 scic_sds_stp_packet_request_started_substate_handler_table,
720 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_PIO_SETUP_SUBSTATE 720 SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_PIO_SETUP_SUBSTATE
721 ); 721 );
@@ -724,9 +724,9 @@ void scic_sds_stp_packet_request_started_packet_phase_await_pio_setup_enter(
724void scic_sds_stp_packet_request_started_command_phase_await_tc_completion_enter( 724void scic_sds_stp_packet_request_started_command_phase_await_tc_completion_enter(
725 struct sci_base_object *object) 725 struct sci_base_object *object)
726{ 726{
727 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 727 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
728 u8 sat_packet_protocol = 728 u8 sat_packet_protocol =
729 scic_cb_request_get_sat_protocol(this_request->user_request); 729 scic_cb_request_get_sat_protocol(sci_req->user_request);
730 730
731 struct scu_task_context *task_context; 731 struct scu_task_context *task_context;
732 enum sci_status status; 732 enum sci_status status;
@@ -735,25 +735,25 @@ void scic_sds_stp_packet_request_started_command_phase_await_tc_completion_enter
735 * Recycle the TC and reconstruct it for sending out data fis containing 735 * Recycle the TC and reconstruct it for sending out data fis containing
736 * CDB. */ 736 * CDB. */
737 task_context = scic_sds_controller_get_task_context_buffer( 737 task_context = scic_sds_controller_get_task_context_buffer(
738 this_request->owning_controller, this_request->io_tag); 738 sci_req->owning_controller, sci_req->io_tag);
739 739
740 if (sat_packet_protocol == SAT_PROTOCOL_PACKET_NON_DATA) 740 if (sat_packet_protocol == SAT_PROTOCOL_PACKET_NON_DATA)
741 scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context( 741 scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
742 this_request, task_context); 742 sci_req, task_context);
743 else 743 else
744 scu_stp_packet_request_command_phase_construct_task_context( 744 scu_stp_packet_request_command_phase_construct_task_context(
745 this_request, task_context); 745 sci_req, task_context);
746 746
747 /* send the new TC out. */ 747 /* send the new TC out. */
748 status = this_request->owning_controller->state_handlers->parent.continue_io_handler( 748 status = sci_req->owning_controller->state_handlers->parent.continue_io_handler(
749 &this_request->owning_controller->parent, 749 &sci_req->owning_controller->parent,
750 &this_request->target_device->parent, 750 &sci_req->target_device->parent,
751 &this_request->parent 751 &sci_req->parent
752 ); 752 );
753 753
754 if (status == SCI_SUCCESS) 754 if (status == SCI_SUCCESS)
755 SET_STATE_HANDLER( 755 SET_STATE_HANDLER(
756 this_request, 756 sci_req,
757 scic_sds_stp_packet_request_started_substate_handler_table, 757 scic_sds_stp_packet_request_started_substate_handler_table,
758 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE 758 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE
759 ); 759 );
@@ -762,10 +762,10 @@ void scic_sds_stp_packet_request_started_command_phase_await_tc_completion_enter
762void scic_sds_stp_packet_request_started_command_phase_await_d2h_fis_enter( 762void scic_sds_stp_packet_request_started_command_phase_await_d2h_fis_enter(
763 struct sci_base_object *object) 763 struct sci_base_object *object)
764{ 764{
765 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 765 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
766 766
767 SET_STATE_HANDLER( 767 SET_STATE_HANDLER(
768 this_request, 768 sci_req,
769 scic_sds_stp_packet_request_started_substate_handler_table, 769 scic_sds_stp_packet_request_started_substate_handler_table,
770 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE 770 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE
771 ); 771 );
@@ -774,10 +774,10 @@ void scic_sds_stp_packet_request_started_command_phase_await_d2h_fis_enter(
774void scic_sds_stp_packet_request_started_completion_delay_enter( 774void scic_sds_stp_packet_request_started_completion_delay_enter(
775 struct sci_base_object *object) 775 struct sci_base_object *object)
776{ 776{
777 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 777 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
778 778
779 SET_STATE_HANDLER( 779 SET_STATE_HANDLER(
780 this_request, 780 sci_req,
781 scic_sds_stp_packet_request_started_substate_handler_table, 781 scic_sds_stp_packet_request_started_substate_handler_table,
782 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMPLETION_DELAY_SUBSTATE 782 SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMPLETION_DELAY_SUBSTATE
783 ); 783 );
diff --git a/drivers/scsi/isci/core/scic_sds_stp_packet_request.h b/drivers/scsi/isci/core/scic_sds_stp_packet_request.h
index eebfff32216b..f6ff5a6f6645 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_packet_request.h
+++ b/drivers/scsi/isci/core/scic_sds_stp_packet_request.h
@@ -113,14 +113,14 @@ extern const struct scic_sds_io_request_state_handler scic_sds_stp_packet_reques
113 113
114#if !defined(DISABLE_ATAPI) 114#if !defined(DISABLE_ATAPI)
115enum sci_status scic_sds_stp_packet_request_construct( 115enum sci_status scic_sds_stp_packet_request_construct(
116 struct scic_sds_request *this_request); 116 struct scic_sds_request *sci_req);
117#else /* !defined(DISABLE_ATAPI) */ 117#else /* !defined(DISABLE_ATAPI) */
118#define scic_sds_stp_packet_request_construct(request) SCI_FAILURE 118#define scic_sds_stp_packet_request_construct(request) SCI_FAILURE
119#endif /* !defined(DISABLE_ATAPI) */ 119#endif /* !defined(DISABLE_ATAPI) */
120 120
121#if !defined(DISABLE_ATAPI) 121#if !defined(DISABLE_ATAPI)
122void scu_stp_packet_request_command_phase_construct_task_context( 122void scu_stp_packet_request_command_phase_construct_task_context(
123 struct scic_sds_request *this_request, 123 struct scic_sds_request *sci_req,
124 struct scu_task_context *task_context); 124 struct scu_task_context *task_context);
125#else /* !defined(DISABLE_ATAPI) */ 125#else /* !defined(DISABLE_ATAPI) */
126#define scu_stp_packet_request_command_phase_construct_task_context(reqeust, tc) 126#define scu_stp_packet_request_command_phase_construct_task_context(reqeust, tc)
@@ -128,7 +128,7 @@ void scu_stp_packet_request_command_phase_construct_task_context(
128 128
129#if !defined(DISABLE_ATAPI) 129#if !defined(DISABLE_ATAPI)
130void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context( 130void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
131 struct scic_sds_request *this_request, 131 struct scic_sds_request *sci_req,
132 struct scu_task_context *task_context); 132 struct scu_task_context *task_context);
133#else /* !defined(DISABLE_ATAPI) */ 133#else /* !defined(DISABLE_ATAPI) */
134#define scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(reqeust, tc) 134#define scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(reqeust, tc)
@@ -136,7 +136,7 @@ void scu_stp_packet_request_command_phase_reconstruct_raw_frame_task_context(
136 136
137#if !defined(DISABLE_ATAPI) 137#if !defined(DISABLE_ATAPI)
138enum sci_status scic_sds_stp_packet_request_process_status_fis( 138enum sci_status scic_sds_stp_packet_request_process_status_fis(
139 struct scic_sds_request *this_request, 139 struct scic_sds_request *sci_req,
140 struct sata_fis_reg_d2h *status_fis); 140 struct sata_fis_reg_d2h *status_fis);
141#else /* !defined(DISABLE_ATAPI) */ 141#else /* !defined(DISABLE_ATAPI) */
142#define scic_sds_stp_packet_request_process_status_fis(reqeust, fis) SCI_FAILURE 142#define scic_sds_stp_packet_request_process_status_fis(reqeust, fis) SCI_FAILURE
@@ -144,7 +144,7 @@ enum sci_status scic_sds_stp_packet_request_process_status_fis(
144 144
145#if !defined(DISABLE_ATAPI) 145#if !defined(DISABLE_ATAPI)
146void scic_sds_stp_packet_internal_request_sense_build_sgl( 146void scic_sds_stp_packet_internal_request_sense_build_sgl(
147 struct scic_sds_request *this_request); 147 struct scic_sds_request *sci_req);
148#else /* !defined(DISABLE_ATAPI) */ 148#else /* !defined(DISABLE_ATAPI) */
149#define scic_sds_stp_packet_internal_request_sense_build_sgl(request) 149#define scic_sds_stp_packet_internal_request_sense_build_sgl(request)
150#endif /* !defined(DISABLE_ATAPI) */ 150#endif /* !defined(DISABLE_ATAPI) */
diff --git a/drivers/scsi/isci/core/scic_sds_stp_remote_device.c b/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
index a5b1fe3229ce..b15357b2ce08 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
+++ b/drivers/scsi/isci/core/scic_sds_stp_remote_device.c
@@ -252,18 +252,18 @@ out:
252 * resume the RNC right away. enum sci_status 252 * resume the RNC right away. enum sci_status
253 */ 253 */
254static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_handler( 254static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_handler(
255 struct scic_sds_remote_device *this_device, 255 struct scic_sds_remote_device *sci_dev,
256 u32 event_code) 256 u32 event_code)
257{ 257{
258 enum sci_status status; 258 enum sci_status status;
259 259
260 status = scic_sds_remote_device_general_event_handler(this_device, event_code); 260 status = scic_sds_remote_device_general_event_handler(sci_dev, event_code);
261 261
262 if (status == SCI_SUCCESS) { 262 if (status == SCI_SUCCESS) {
263 if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX 263 if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX
264 || scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) { 264 || scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) {
265 status = scic_sds_remote_node_context_resume( 265 status = scic_sds_remote_node_context_resume(
266 this_device->rnc, NULL, NULL); 266 sci_dev->rnc, NULL, NULL);
267 } 267 }
268 } 268 }
269 269
@@ -312,21 +312,21 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_start_io_ha
312/** 312/**
313 * This method will handle events received while the STP device is in the ready 313 * This method will handle events received while the STP device is in the ready
314 * command substate. 314 * command substate.
315 * @this_device: This is the device object that is receiving the event. 315 * @sci_dev: This is the device object that is receiving the event.
316 * @event_code: The event code to process. 316 * @event_code: The event code to process.
317 * 317 *
318 * enum sci_status 318 * enum sci_status
319 */ 319 */
320 320
321static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handler( 321static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handler(
322 struct scic_sds_remote_device *this_device, 322 struct scic_sds_remote_device *sci_dev,
323 u32 frame_index) 323 u32 frame_index)
324{ 324{
325 enum sci_status status; 325 enum sci_status status;
326 struct sata_fis_header *frame_header; 326 struct sata_fis_header *frame_header;
327 327
328 status = scic_sds_unsolicited_frame_control_get_header( 328 status = scic_sds_unsolicited_frame_control_get_header(
329 &(scic_sds_remote_device_get_controller(this_device)->uf_control), 329 &(scic_sds_remote_device_get_controller(sci_dev)->uf_control),
330 frame_index, 330 frame_index,
331 (void **)&frame_header 331 (void **)&frame_header
332 ); 332 );
@@ -334,7 +334,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
334 if (status == SCI_SUCCESS) { 334 if (status == SCI_SUCCESS) {
335 if (frame_header->fis_type == SATA_FIS_TYPE_SETDEVBITS && 335 if (frame_header->fis_type == SATA_FIS_TYPE_SETDEVBITS &&
336 (frame_header->status & ATA_STATUS_REG_ERROR_BIT)) { 336 (frame_header->status & ATA_STATUS_REG_ERROR_BIT)) {
337 this_device->not_ready_reason = 337 sci_dev->not_ready_reason =
338 SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED; 338 SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
339 339
340 /* 340 /*
@@ -343,7 +343,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
343 */ 343 */
344 344
345 sci_base_state_machine_change_state( 345 sci_base_state_machine_change_state(
346 &this_device->ready_substate_machine, 346 &sci_dev->ready_substate_machine,
347 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR 347 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
348 ); 348 );
349 } else if (frame_header->fis_type == SATA_FIS_TYPE_REGD2H && 349 } else if (frame_header->fis_type == SATA_FIS_TYPE_REGD2H &&
@@ -353,11 +353,11 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
353 * Some devices return D2H FIS when an NCQ error is detected. 353 * Some devices return D2H FIS when an NCQ error is detected.
354 * Treat this like an SDB error FIS ready reason. 354 * Treat this like an SDB error FIS ready reason.
355 */ 355 */
356 this_device->not_ready_reason = 356 sci_dev->not_ready_reason =
357 SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED; 357 SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED;
358 358
359 sci_base_state_machine_change_state( 359 sci_base_state_machine_change_state(
360 &this_device->ready_substate_machine, 360 &sci_dev->ready_substate_machine,
361 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR 361 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR
362 ); 362 );
363 } else { 363 } else {
@@ -365,7 +365,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl
365 } 365 }
366 366
367 scic_sds_controller_release_frame( 367 scic_sds_controller_release_frame(
368 scic_sds_remote_device_get_controller(this_device), frame_index 368 scic_sds_remote_device_get_controller(sci_dev), frame_index
369 ); 369 );
370 } 370 }
371 371
@@ -393,20 +393,20 @@ static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_start_io_ha
393} 393}
394 394
395static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler( 395static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler(
396 struct scic_sds_remote_device *this_device, 396 struct scic_sds_remote_device *sci_dev,
397 u32 suspend_type) 397 u32 suspend_type)
398{ 398{
399 enum sci_status status; 399 enum sci_status status;
400 400
401 status = scic_sds_remote_node_context_suspend( 401 status = scic_sds_remote_node_context_suspend(
402 this_device->rnc, suspend_type, NULL, NULL 402 sci_dev->rnc, suspend_type, NULL, NULL
403 ); 403 );
404 404
405 return status; 405 return status;
406} 406}
407 407
408static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_frame_handler( 408static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_frame_handler(
409 struct scic_sds_remote_device *this_device, 409 struct scic_sds_remote_device *sci_dev,
410 u32 frame_index) 410 u32 frame_index)
411{ 411{
412 enum sci_status status; 412 enum sci_status status;
@@ -416,7 +416,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_frame_handl
416 * / in this state. All unsolicited frames are forwarded to the io request 416 * / in this state. All unsolicited frames are forwarded to the io request
417 * / object. */ 417 * / object. */
418 status = scic_sds_io_request_frame_handler( 418 status = scic_sds_io_request_frame_handler(
419 this_device->working_request, 419 sci_dev->working_request,
420 frame_index 420 frame_index
421 ); 421 );
422 422
@@ -461,14 +461,14 @@ static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_com
461 struct scic_sds_remote_device *device, 461 struct scic_sds_remote_device *device,
462 struct scic_sds_request *request) 462 struct scic_sds_request *request)
463{ 463{
464 struct scic_sds_request *the_request = (struct scic_sds_request *)request; 464 struct scic_sds_request *sci_req = (struct scic_sds_request *)request;
465 enum sci_status status; 465 enum sci_status status;
466 466
467 status = scic_sds_io_request_complete(the_request); 467 status = scic_sds_io_request_complete(sci_req);
468 468
469 if (status == SCI_SUCCESS) { 469 if (status == SCI_SUCCESS) {
470 status = scic_sds_port_complete_io( 470 status = scic_sds_port_complete_io(
471 device->owning_port, device, the_request 471 device->owning_port, device, sci_req
472 ); 472 );
473 473
474 if (status == SCI_SUCCESS) 474 if (status == SCI_SUCCESS)
@@ -482,7 +482,7 @@ static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_com
482 __func__, 482 __func__,
483 device->owning_port, 483 device->owning_port,
484 device, 484 device,
485 the_request, 485 sci_req,
486 status); 486 status);
487 487
488 return status; 488 return status;
@@ -505,20 +505,20 @@ static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_com
505 * this device. enum sci_status 505 * this device. enum sci_status
506 */ 506 */
507enum sci_status scic_sds_stp_remote_device_ready_atapi_error_substate_event_handler( 507enum sci_status scic_sds_stp_remote_device_ready_atapi_error_substate_event_handler(
508 struct scic_sds_remote_device *this_device, 508 struct scic_sds_remote_device *sci_dev,
509 u32 event_code) 509 u32 event_code)
510{ 510{
511 enum sci_status status; 511 enum sci_status status;
512 512
513 status = scic_sds_remote_device_general_event_handler(this_device, event_code); 513 status = scic_sds_remote_device_general_event_handler(sci_dev, event_code);
514 514
515 if (status == SCI_SUCCESS) { 515 if (status == SCI_SUCCESS) {
516 if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX 516 if (scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX
517 || scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) { 517 || scu_get_event_type(event_code) == SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX) {
518 status = scic_sds_remote_node_context_resume( 518 status = scic_sds_remote_node_context_resume(
519 this_device->rnc, 519 sci_dev->rnc,
520 this_device->working_request->state_handlers->parent.complete_handler, 520 sci_dev->working_request->state_handlers->parent.complete_handler,
521 (void *)this_device->working_request 521 (void *)sci_dev->working_request
522 ); 522 );
523 } 523 }
524 } 524 }
@@ -673,30 +673,30 @@ scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *use
673static void scic_sds_stp_remote_device_ready_idle_substate_enter( 673static void scic_sds_stp_remote_device_ready_idle_substate_enter(
674 struct sci_base_object *device) 674 struct sci_base_object *device)
675{ 675{
676 struct scic_sds_remote_device *this_device; 676 struct scic_sds_remote_device *sci_dev;
677 677
678 this_device = (struct scic_sds_remote_device *)device; 678 sci_dev = (struct scic_sds_remote_device *)device;
679 679
680 SET_STATE_HANDLER( 680 SET_STATE_HANDLER(
681 this_device, 681 sci_dev,
682 scic_sds_stp_remote_device_ready_substate_handler_table, 682 scic_sds_stp_remote_device_ready_substate_handler_table,
683 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE 683 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE
684 ); 684 );
685 685
686 this_device->working_request = NULL; 686 sci_dev->working_request = NULL;
687 687
688 if (scic_sds_remote_node_context_is_ready(this_device->rnc)) { 688 if (scic_sds_remote_node_context_is_ready(sci_dev->rnc)) {
689 /* 689 /*
690 * Since the RNC is ready, it's alright to finish completion 690 * Since the RNC is ready, it's alright to finish completion
691 * processing (e.g. signal the remote device is ready). */ 691 * processing (e.g. signal the remote device is ready). */
692 scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler( 692 scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(
693 this_device 693 sci_dev
694 ); 694 );
695 } else { 695 } else {
696 scic_sds_remote_node_context_resume( 696 scic_sds_remote_node_context_resume(
697 this_device->rnc, 697 sci_dev->rnc,
698 scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler, 698 scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler,
699 this_device 699 sci_dev
700 ); 700 );
701 } 701 }
702} 702}
@@ -759,12 +759,12 @@ static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(struct sci
759static void scic_sds_stp_remote_device_ready_await_reset_substate_enter( 759static void scic_sds_stp_remote_device_ready_await_reset_substate_enter(
760 struct sci_base_object *device) 760 struct sci_base_object *device)
761{ 761{
762 struct scic_sds_remote_device *this_device; 762 struct scic_sds_remote_device *sci_dev;
763 763
764 this_device = (struct scic_sds_remote_device *)device; 764 sci_dev = (struct scic_sds_remote_device *)device;
765 765
766 SET_STATE_HANDLER( 766 SET_STATE_HANDLER(
767 this_device, 767 sci_dev,
768 scic_sds_stp_remote_device_ready_substate_handler_table, 768 scic_sds_stp_remote_device_ready_substate_handler_table,
769 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET 769 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET
770 ); 770 );
@@ -785,12 +785,12 @@ static void scic_sds_stp_remote_device_ready_await_reset_substate_enter(
785void scic_sds_stp_remote_device_ready_atapi_error_substate_enter( 785void scic_sds_stp_remote_device_ready_atapi_error_substate_enter(
786 struct sci_base_object *device) 786 struct sci_base_object *device)
787{ 787{
788 struct scic_sds_remote_device *this_device; 788 struct scic_sds_remote_device *sci_dev;
789 789
790 this_device = (struct scic_sds_remote_device *)device; 790 sci_dev = (struct scic_sds_remote_device *)device;
791 791
792 SET_STATE_HANDLER( 792 SET_STATE_HANDLER(
793 this_device, 793 sci_dev,
794 scic_sds_stp_remote_device_ready_substate_handler_table, 794 scic_sds_stp_remote_device_ready_substate_handler_table,
795 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR 795 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_ATAPI_ERROR
796 ); 796 );
diff --git a/drivers/scsi/isci/core/scic_sds_stp_request.c b/drivers/scsi/isci/core/scic_sds_stp_request.c
index e4ca4e40ae87..ab01f8d5506b 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_request.c
+++ b/drivers/scsi/isci/core/scic_sds_stp_request.c
@@ -156,7 +156,7 @@ void scic_sds_stp_request_assign_buffers(struct scic_sds_request *sci_req)
156/** 156/**
157 * This method is will fill in the SCU Task Context for any type of SATA 157 * This method is will fill in the SCU Task Context for any type of SATA
158 * request. This is called from the various SATA constructors. 158 * request. This is called from the various SATA constructors.
159 * @this_request: The general IO request object which is to be used in 159 * @sci_req: The general IO request object which is to be used in
160 * constructing the SCU task context. 160 * constructing the SCU task context.
161 * @task_context: The buffer pointer for the SCU task context which is being 161 * @task_context: The buffer pointer for the SCU task context which is being
162 * constructed. 162 * constructed.
@@ -262,15 +262,15 @@ static void scu_sata_reqeust_construct_task_context(
262 262
263/** 263/**
264 * 264 *
265 * @this_request: 265 * @sci_req:
266 * 266 *
267 * This method will perform any general sata request construction. What part of 267 * This method will perform any general sata request construction. What part of
268 * SATA IO request construction is general? none 268 * SATA IO request construction is general? none
269 */ 269 */
270static void scic_sds_stp_non_ncq_request_construct( 270static void scic_sds_stp_non_ncq_request_construct(
271 struct scic_sds_request *this_request) 271 struct scic_sds_request *sci_req)
272{ 272{
273 this_request->has_started_substate_machine = true; 273 sci_req->has_started_substate_machine = true;
274} 274}
275 275
276/** 276/**
@@ -338,7 +338,7 @@ enum sci_status scic_sds_stp_ncq_request_construct(struct scic_sds_request *sci_
338 338
339/** 339/**
340 * scu_stp_raw_request_construct_task_context - 340 * scu_stp_raw_request_construct_task_context -
341 * @this_request: This parameter specifies the STP request object for which to 341 * @sci_req: This parameter specifies the STP request object for which to
342 * construct a RAW command frame task context. 342 * construct a RAW command frame task context.
343 * @task_context: This parameter specifies the SCU specific task context buffer 343 * @task_context: This parameter specifies the SCU specific task context buffer
344 * to construct. 344 * to construct.
@@ -347,10 +347,10 @@ enum sci_status scic_sds_stp_ncq_request_construct(struct scic_sds_request *sci_
347 * utilizing the raw frame method. none 347 * utilizing the raw frame method. none
348 */ 348 */
349static void scu_stp_raw_request_construct_task_context( 349static void scu_stp_raw_request_construct_task_context(
350 struct scic_sds_stp_request *this_request, 350 struct scic_sds_stp_request *sci_req,
351 struct scu_task_context *task_context) 351 struct scu_task_context *task_context)
352{ 352{
353 scu_sata_reqeust_construct_task_context(&this_request->parent, task_context); 353 scu_sata_reqeust_construct_task_context(&sci_req->parent, task_context);
354 354
355 task_context->control_frame = 0; 355 task_context->control_frame = 0;
356 task_context->priority = SCU_TASK_PRIORITY_NORMAL; 356 task_context->priority = SCU_TASK_PRIORITY_NORMAL;
@@ -386,7 +386,7 @@ void *scic_stp_io_request_get_d2h_reg_address(
386 386
387/** 387/**
388 * 388 *
389 * @this_request: 389 * @sci_req:
390 * 390 *
391 * Get the next SGL element from the request. - Check on which SGL element pair 391 * Get the next SGL element from the request. - Check on which SGL element pair
392 * we are working - if working on SLG pair element A - advance to element B - 392 * we are working - if working on SLG pair element A - advance to element B -
@@ -430,7 +430,7 @@ static struct scu_sgl_element *scic_sds_stp_request_pio_get_next_sgl(struct scic
430 430
431/** 431/**
432 * 432 *
433 * @this_request: 433 * @sci_req:
434 * @completion_code: 434 * @completion_code:
435 * 435 *
436 * This method processes a TC completion. The expected TC completion is for 436 * This method processes a TC completion. The expected TC completion is for
@@ -439,17 +439,17 @@ static struct scu_sgl_element *scic_sds_stp_request_pio_get_next_sgl(struct scic
439 * SCI_SUCCESS This value is always returned. 439 * SCI_SUCCESS This value is always returned.
440 */ 440 */
441static enum sci_status scic_sds_stp_request_non_data_await_h2d_tc_completion_handler( 441static enum sci_status scic_sds_stp_request_non_data_await_h2d_tc_completion_handler(
442 struct scic_sds_request *this_request, 442 struct scic_sds_request *sci_req,
443 u32 completion_code) 443 u32 completion_code)
444{ 444{
445 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 445 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
446 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 446 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
447 scic_sds_request_set_status( 447 scic_sds_request_set_status(
448 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 448 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
449 ); 449 );
450 450
451 sci_base_state_machine_change_state( 451 sci_base_state_machine_change_state(
452 &this_request->started_substate_machine, 452 &sci_req->started_substate_machine,
453 SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_D2H_SUBSTATE 453 SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_D2H_SUBSTATE
454 ); 454 );
455 break; 455 break;
@@ -459,13 +459,13 @@ static enum sci_status scic_sds_stp_request_non_data_await_h2d_tc_completion_han
459 * All other completion status cause the IO to be complete. If a NAK 459 * All other completion status cause the IO to be complete. If a NAK
460 * was received, then it is up to the user to retry the request. */ 460 * was received, then it is up to the user to retry the request. */
461 scic_sds_request_set_status( 461 scic_sds_request_set_status(
462 this_request, 462 sci_req,
463 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 463 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
464 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 464 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
465 ); 465 );
466 466
467 sci_base_state_machine_change_state( 467 sci_base_state_machine_change_state(
468 &this_request->state_machine, SCI_BASE_REQUEST_STATE_COMPLETED); 468 &sci_req->state_machine, SCI_BASE_REQUEST_STATE_COMPLETED);
469 break; 469 break;
470 } 470 }
471 471
@@ -491,10 +491,10 @@ static enum sci_status scic_sds_stp_request_non_data_await_d2h_frame_handler(
491 enum sci_status status; 491 enum sci_status status;
492 struct sata_fis_header *frame_header; 492 struct sata_fis_header *frame_header;
493 u32 *frame_buffer; 493 u32 *frame_buffer;
494 struct scic_sds_stp_request *this_request = (struct scic_sds_stp_request *)request; 494 struct scic_sds_stp_request *sci_req = (struct scic_sds_stp_request *)request;
495 495
496 status = scic_sds_unsolicited_frame_control_get_header( 496 status = scic_sds_unsolicited_frame_control_get_header(
497 &this_request->parent.owning_controller->uf_control, 497 &sci_req->parent.owning_controller->uf_control,
498 frame_index, 498 frame_index,
499 (void **)&frame_header 499 (void **)&frame_header
500 ); 500 );
@@ -503,18 +503,18 @@ static enum sci_status scic_sds_stp_request_non_data_await_d2h_frame_handler(
503 switch (frame_header->fis_type) { 503 switch (frame_header->fis_type) {
504 case SATA_FIS_TYPE_REGD2H: 504 case SATA_FIS_TYPE_REGD2H:
505 scic_sds_unsolicited_frame_control_get_buffer( 505 scic_sds_unsolicited_frame_control_get_buffer(
506 &this_request->parent.owning_controller->uf_control, 506 &sci_req->parent.owning_controller->uf_control,
507 frame_index, 507 frame_index,
508 (void **)&frame_buffer 508 (void **)&frame_buffer
509 ); 509 );
510 510
511 scic_sds_controller_copy_sata_response( 511 scic_sds_controller_copy_sata_response(
512 &this_request->d2h_reg_fis, (u32 *)frame_header, frame_buffer 512 &sci_req->d2h_reg_fis, (u32 *)frame_header, frame_buffer
513 ); 513 );
514 514
515 /* The command has completed with error */ 515 /* The command has completed with error */
516 scic_sds_request_set_status( 516 scic_sds_request_set_status(
517 &this_request->parent, 517 &sci_req->parent,
518 SCU_TASK_DONE_CHECK_RESPONSE, 518 SCU_TASK_DONE_CHECK_RESPONSE,
519 SCI_FAILURE_IO_RESPONSE_VALID 519 SCI_FAILURE_IO_RESPONSE_VALID
520 ); 520 );
@@ -524,10 +524,10 @@ static enum sci_status scic_sds_stp_request_non_data_await_d2h_frame_handler(
524 dev_warn(scic_to_dev(request->owning_controller), 524 dev_warn(scic_to_dev(request->owning_controller),
525 "%s: IO Request:0x%p Frame Id:%d protocol " 525 "%s: IO Request:0x%p Frame Id:%d protocol "
526 "violation occurred\n", 526 "violation occurred\n",
527 __func__, this_request, frame_index); 527 __func__, sci_req, frame_index);
528 528
529 scic_sds_request_set_status( 529 scic_sds_request_set_status(
530 &this_request->parent, 530 &sci_req->parent,
531 SCU_TASK_DONE_UNEXP_FIS, 531 SCU_TASK_DONE_UNEXP_FIS,
532 SCI_FAILURE_PROTOCOL_VIOLATION 532 SCI_FAILURE_PROTOCOL_VIOLATION
533 ); 533 );
@@ -535,18 +535,18 @@ static enum sci_status scic_sds_stp_request_non_data_await_d2h_frame_handler(
535 } 535 }
536 536
537 sci_base_state_machine_change_state( 537 sci_base_state_machine_change_state(
538 &this_request->parent.state_machine, 538 &sci_req->parent.state_machine,
539 SCI_BASE_REQUEST_STATE_COMPLETED 539 SCI_BASE_REQUEST_STATE_COMPLETED
540 ); 540 );
541 541
542 /* Frame has been decoded return it to the controller */ 542 /* Frame has been decoded return it to the controller */
543 scic_sds_controller_release_frame( 543 scic_sds_controller_release_frame(
544 this_request->parent.owning_controller, frame_index); 544 sci_req->parent.owning_controller, frame_index);
545 } else 545 } else
546 dev_err(scic_to_dev(request->owning_controller), 546 dev_err(scic_to_dev(request->owning_controller),
547 "%s: SCIC IO Request 0x%p could not get frame header " 547 "%s: SCIC IO Request 0x%p could not get frame header "
548 "for frame index %d, status %x\n", 548 "for frame index %d, status %x\n",
549 __func__, this_request, frame_index, status); 549 __func__, sci_req, frame_index, status);
550 550
551 return status; 551 return status;
552} 552}
@@ -567,26 +567,26 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
567static void scic_sds_stp_request_started_non_data_await_h2d_completion_enter( 567static void scic_sds_stp_request_started_non_data_await_h2d_completion_enter(
568 struct sci_base_object *object) 568 struct sci_base_object *object)
569{ 569{
570 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 570 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
571 571
572 SET_STATE_HANDLER( 572 SET_STATE_HANDLER(
573 this_request, 573 sci_req,
574 scic_sds_stp_request_started_non_data_substate_handler_table, 574 scic_sds_stp_request_started_non_data_substate_handler_table,
575 SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_H2D_COMPLETION_SUBSTATE 575 SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_H2D_COMPLETION_SUBSTATE
576 ); 576 );
577 577
578 scic_sds_remote_device_set_working_request( 578 scic_sds_remote_device_set_working_request(
579 this_request->target_device, this_request 579 sci_req->target_device, sci_req
580 ); 580 );
581} 581}
582 582
583static void scic_sds_stp_request_started_non_data_await_d2h_enter( 583static void scic_sds_stp_request_started_non_data_await_d2h_enter(
584 struct sci_base_object *object) 584 struct sci_base_object *object)
585{ 585{
586 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 586 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
587 587
588 SET_STATE_HANDLER( 588 SET_STATE_HANDLER(
589 this_request, 589 sci_req,
590 scic_sds_stp_request_started_non_data_substate_handler_table, 590 scic_sds_stp_request_started_non_data_substate_handler_table,
591 SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_D2H_SUBSTATE 591 SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_D2H_SUBSTATE
592 ); 592 );
@@ -624,7 +624,7 @@ enum sci_status scic_sds_stp_non_data_request_construct(struct scic_sds_request
624 624
625/** 625/**
626 * 626 *
627 * @this_request: 627 * @sci_req:
628 * @length: 628 * @length:
629 * 629 *
630 * This function will transmit DATA_FIS from (current sgl + offset) for input 630 * This function will transmit DATA_FIS from (current sgl + offset) for input
@@ -633,24 +633,24 @@ enum sci_status scic_sds_stp_non_data_request_construct(struct scic_sds_request
633 */ 633 */
634 634
635static enum sci_status scic_sds_stp_request_pio_data_out_trasmit_data_frame( 635static enum sci_status scic_sds_stp_request_pio_data_out_trasmit_data_frame(
636 struct scic_sds_request *this_request, 636 struct scic_sds_request *sci_req,
637 u32 length) 637 u32 length)
638{ 638{
639 struct scic_sds_stp_request *this_sds_stp_request = (struct scic_sds_stp_request *)this_request; 639 struct scic_sds_stp_request *stp_req = (struct scic_sds_stp_request *)sci_req;
640 struct scu_sgl_element *current_sgl; 640 struct scu_sgl_element *current_sgl;
641 641
642 /* 642 /*
643 * Recycle the TC and reconstruct it for sending out DATA FIS containing 643 * Recycle the TC and reconstruct it for sending out DATA FIS containing
644 * for the data from current_sgl+offset for the input length */ 644 * for the data from current_sgl+offset for the input length */
645 struct scu_task_context *task_context = scic_sds_controller_get_task_context_buffer( 645 struct scu_task_context *task_context = scic_sds_controller_get_task_context_buffer(
646 this_request->owning_controller, 646 sci_req->owning_controller,
647 this_request->io_tag 647 sci_req->io_tag
648 ); 648 );
649 649
650 if (this_sds_stp_request->type.pio.request_current.sgl_set == SCU_SGL_ELEMENT_PAIR_A) 650 if (stp_req->type.pio.request_current.sgl_set == SCU_SGL_ELEMENT_PAIR_A)
651 current_sgl = &(this_sds_stp_request->type.pio.request_current.sgl_pair->A); 651 current_sgl = &(stp_req->type.pio.request_current.sgl_pair->A);
652 else 652 else
653 current_sgl = &(this_sds_stp_request->type.pio.request_current.sgl_pair->B); 653 current_sgl = &(stp_req->type.pio.request_current.sgl_pair->B);
654 654
655 /* update the TC */ 655 /* update the TC */
656 task_context->command_iu_upper = current_sgl->address_upper; 656 task_context->command_iu_upper = current_sgl->address_upper;
@@ -659,17 +659,17 @@ static enum sci_status scic_sds_stp_request_pio_data_out_trasmit_data_frame(
659 task_context->type.stp.fis_type = SATA_FIS_TYPE_DATA; 659 task_context->type.stp.fis_type = SATA_FIS_TYPE_DATA;
660 660
661 /* send the new TC out. */ 661 /* send the new TC out. */
662 return scic_controller_continue_io(this_request); 662 return scic_controller_continue_io(sci_req);
663} 663}
664 664
665/** 665/**
666 * 666 *
667 * @this_request: 667 * @sci_req:
668 * 668 *
669 * enum sci_status 669 * enum sci_status
670 */ 670 */
671static enum sci_status scic_sds_stp_request_pio_data_out_transmit_data( 671static enum sci_status scic_sds_stp_request_pio_data_out_transmit_data(
672 struct scic_sds_request *this_sds_request) 672 struct scic_sds_request *sci_req)
673{ 673{
674 674
675 struct scu_sgl_element *current_sgl; 675 struct scu_sgl_element *current_sgl;
@@ -677,45 +677,45 @@ static enum sci_status scic_sds_stp_request_pio_data_out_transmit_data(
677 u32 remaining_bytes_in_current_sgl = 0; 677 u32 remaining_bytes_in_current_sgl = 0;
678 enum sci_status status = SCI_SUCCESS; 678 enum sci_status status = SCI_SUCCESS;
679 679
680 struct scic_sds_stp_request *this_sds_stp_request = (struct scic_sds_stp_request *)this_sds_request; 680 struct scic_sds_stp_request *stp_req = (struct scic_sds_stp_request *)sci_req;
681 681
682 sgl_offset = this_sds_stp_request->type.pio.request_current.sgl_offset; 682 sgl_offset = stp_req->type.pio.request_current.sgl_offset;
683 683
684 if (this_sds_stp_request->type.pio.request_current.sgl_set == SCU_SGL_ELEMENT_PAIR_A) { 684 if (stp_req->type.pio.request_current.sgl_set == SCU_SGL_ELEMENT_PAIR_A) {
685 current_sgl = &(this_sds_stp_request->type.pio.request_current.sgl_pair->A); 685 current_sgl = &(stp_req->type.pio.request_current.sgl_pair->A);
686 remaining_bytes_in_current_sgl = this_sds_stp_request->type.pio.request_current.sgl_pair->A.length - sgl_offset; 686 remaining_bytes_in_current_sgl = stp_req->type.pio.request_current.sgl_pair->A.length - sgl_offset;
687 } else { 687 } else {
688 current_sgl = &(this_sds_stp_request->type.pio.request_current.sgl_pair->B); 688 current_sgl = &(stp_req->type.pio.request_current.sgl_pair->B);
689 remaining_bytes_in_current_sgl = this_sds_stp_request->type.pio.request_current.sgl_pair->B.length - sgl_offset; 689 remaining_bytes_in_current_sgl = stp_req->type.pio.request_current.sgl_pair->B.length - sgl_offset;
690 } 690 }
691 691
692 692
693 if (this_sds_stp_request->type.pio.pio_transfer_bytes > 0) { 693 if (stp_req->type.pio.pio_transfer_bytes > 0) {
694 if (this_sds_stp_request->type.pio.pio_transfer_bytes >= remaining_bytes_in_current_sgl) { 694 if (stp_req->type.pio.pio_transfer_bytes >= remaining_bytes_in_current_sgl) {
695 /* recycle the TC and send the H2D Data FIS from (current sgl + sgl_offset) and length = remaining_bytes_in_current_sgl */ 695 /* recycle the TC and send the H2D Data FIS from (current sgl + sgl_offset) and length = remaining_bytes_in_current_sgl */
696 status = scic_sds_stp_request_pio_data_out_trasmit_data_frame(this_sds_request, remaining_bytes_in_current_sgl); 696 status = scic_sds_stp_request_pio_data_out_trasmit_data_frame(sci_req, remaining_bytes_in_current_sgl);
697 if (status == SCI_SUCCESS) { 697 if (status == SCI_SUCCESS) {
698 this_sds_stp_request->type.pio.pio_transfer_bytes -= remaining_bytes_in_current_sgl; 698 stp_req->type.pio.pio_transfer_bytes -= remaining_bytes_in_current_sgl;
699 699
700 /* update the current sgl, sgl_offset and save for future */ 700 /* update the current sgl, sgl_offset and save for future */
701 current_sgl = scic_sds_stp_request_pio_get_next_sgl(this_sds_stp_request); 701 current_sgl = scic_sds_stp_request_pio_get_next_sgl(stp_req);
702 sgl_offset = 0; 702 sgl_offset = 0;
703 } 703 }
704 } else if (this_sds_stp_request->type.pio.pio_transfer_bytes < remaining_bytes_in_current_sgl) { 704 } else if (stp_req->type.pio.pio_transfer_bytes < remaining_bytes_in_current_sgl) {
705 /* recycle the TC and send the H2D Data FIS from (current sgl + sgl_offset) and length = type.pio.pio_transfer_bytes */ 705 /* recycle the TC and send the H2D Data FIS from (current sgl + sgl_offset) and length = type.pio.pio_transfer_bytes */
706 scic_sds_stp_request_pio_data_out_trasmit_data_frame(this_sds_request, this_sds_stp_request->type.pio.pio_transfer_bytes); 706 scic_sds_stp_request_pio_data_out_trasmit_data_frame(sci_req, stp_req->type.pio.pio_transfer_bytes);
707 707
708 if (status == SCI_SUCCESS) { 708 if (status == SCI_SUCCESS) {
709 /* Sgl offset will be adjusted and saved for future */ 709 /* Sgl offset will be adjusted and saved for future */
710 sgl_offset += this_sds_stp_request->type.pio.pio_transfer_bytes; 710 sgl_offset += stp_req->type.pio.pio_transfer_bytes;
711 current_sgl->address_lower += this_sds_stp_request->type.pio.pio_transfer_bytes; 711 current_sgl->address_lower += stp_req->type.pio.pio_transfer_bytes;
712 this_sds_stp_request->type.pio.pio_transfer_bytes = 0; 712 stp_req->type.pio.pio_transfer_bytes = 0;
713 } 713 }
714 } 714 }
715 } 715 }
716 716
717 if (status == SCI_SUCCESS) { 717 if (status == SCI_SUCCESS) {
718 this_sds_stp_request->type.pio.request_current.sgl_offset = sgl_offset; 718 stp_req->type.pio.request_current.sgl_offset = sgl_offset;
719 } 719 }
720 720
721 return status; 721 return status;
@@ -772,13 +772,13 @@ scic_sds_stp_request_pio_data_in_copy_data_buffer(struct scic_sds_stp_request *s
772 772
773/** 773/**
774 * 774 *
775 * @this_request: The PIO DATA IN request that is to receive the data. 775 * @sci_req: The PIO DATA IN request that is to receive the data.
776 * @data_buffer: The buffer to copy from. 776 * @data_buffer: The buffer to copy from.
777 * 777 *
778 * Copy the data buffer to the io request data region. enum sci_status 778 * Copy the data buffer to the io request data region. enum sci_status
779 */ 779 */
780static enum sci_status scic_sds_stp_request_pio_data_in_copy_data( 780static enum sci_status scic_sds_stp_request_pio_data_in_copy_data(
781 struct scic_sds_stp_request *this_request, 781 struct scic_sds_stp_request *sci_req,
782 u8 *data_buffer) 782 u8 *data_buffer)
783{ 783{
784 enum sci_status status; 784 enum sci_status status;
@@ -786,19 +786,19 @@ static enum sci_status scic_sds_stp_request_pio_data_in_copy_data(
786 /* 786 /*
787 * If there is less than 1K remaining in the transfer request 787 * If there is less than 1K remaining in the transfer request
788 * copy just the data for the transfer */ 788 * copy just the data for the transfer */
789 if (this_request->type.pio.pio_transfer_bytes < SCU_MAX_FRAME_BUFFER_SIZE) { 789 if (sci_req->type.pio.pio_transfer_bytes < SCU_MAX_FRAME_BUFFER_SIZE) {
790 status = scic_sds_stp_request_pio_data_in_copy_data_buffer( 790 status = scic_sds_stp_request_pio_data_in_copy_data_buffer(
791 this_request, data_buffer, this_request->type.pio.pio_transfer_bytes); 791 sci_req, data_buffer, sci_req->type.pio.pio_transfer_bytes);
792 792
793 if (status == SCI_SUCCESS) 793 if (status == SCI_SUCCESS)
794 this_request->type.pio.pio_transfer_bytes = 0; 794 sci_req->type.pio.pio_transfer_bytes = 0;
795 } else { 795 } else {
796 /* We are transfering the whole frame so copy */ 796 /* We are transfering the whole frame so copy */
797 status = scic_sds_stp_request_pio_data_in_copy_data_buffer( 797 status = scic_sds_stp_request_pio_data_in_copy_data_buffer(
798 this_request, data_buffer, SCU_MAX_FRAME_BUFFER_SIZE); 798 sci_req, data_buffer, SCU_MAX_FRAME_BUFFER_SIZE);
799 799
800 if (status == SCI_SUCCESS) 800 if (status == SCI_SUCCESS)
801 this_request->type.pio.pio_transfer_bytes -= SCU_MAX_FRAME_BUFFER_SIZE; 801 sci_req->type.pio.pio_transfer_bytes -= SCU_MAX_FRAME_BUFFER_SIZE;
802 } 802 }
803 803
804 return status; 804 return status;
@@ -806,13 +806,13 @@ static enum sci_status scic_sds_stp_request_pio_data_in_copy_data(
806 806
807/** 807/**
808 * 808 *
809 * @this_request: 809 * @sci_req:
810 * @completion_code: 810 * @completion_code:
811 * 811 *
812 * enum sci_status 812 * enum sci_status
813 */ 813 */
814static enum sci_status scic_sds_stp_request_pio_await_h2d_completion_tc_completion_handler( 814static enum sci_status scic_sds_stp_request_pio_await_h2d_completion_tc_completion_handler(
815 struct scic_sds_request *this_request, 815 struct scic_sds_request *sci_req,
816 u32 completion_code) 816 u32 completion_code)
817{ 817{
818 enum sci_status status = SCI_SUCCESS; 818 enum sci_status status = SCI_SUCCESS;
@@ -820,11 +820,11 @@ static enum sci_status scic_sds_stp_request_pio_await_h2d_completion_tc_completi
820 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 820 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
821 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 821 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
822 scic_sds_request_set_status( 822 scic_sds_request_set_status(
823 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 823 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
824 ); 824 );
825 825
826 sci_base_state_machine_change_state( 826 sci_base_state_machine_change_state(
827 &this_request->started_substate_machine, 827 &sci_req->started_substate_machine,
828 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE 828 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE
829 ); 829 );
830 break; 830 break;
@@ -834,13 +834,13 @@ static enum sci_status scic_sds_stp_request_pio_await_h2d_completion_tc_completi
834 * All other completion status cause the IO to be complete. If a NAK 834 * All other completion status cause the IO to be complete. If a NAK
835 * was received, then it is up to the user to retry the request. */ 835 * was received, then it is up to the user to retry the request. */
836 scic_sds_request_set_status( 836 scic_sds_request_set_status(
837 this_request, 837 sci_req,
838 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 838 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
839 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 839 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
840 ); 840 );
841 841
842 sci_base_state_machine_change_state( 842 sci_base_state_machine_change_state(
843 &this_request->state_machine, 843 &sci_req->state_machine,
844 SCI_BASE_REQUEST_STATE_COMPLETED 844 SCI_BASE_REQUEST_STATE_COMPLETED
845 ); 845 );
846 break; 846 break;
@@ -851,7 +851,7 @@ static enum sci_status scic_sds_stp_request_pio_await_h2d_completion_tc_completi
851 851
852/** 852/**
853 * 853 *
854 * @this_request: 854 * @sci_req:
855 * @frame_index: 855 * @frame_index:
856 * 856 *
857 * enum sci_status 857 * enum sci_status
@@ -863,12 +863,12 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
863 enum sci_status status; 863 enum sci_status status;
864 struct sata_fis_header *frame_header; 864 struct sata_fis_header *frame_header;
865 u32 *frame_buffer; 865 u32 *frame_buffer;
866 struct scic_sds_stp_request *this_request; 866 struct scic_sds_stp_request *sci_req;
867 867
868 this_request = (struct scic_sds_stp_request *)request; 868 sci_req = (struct scic_sds_stp_request *)request;
869 869
870 status = scic_sds_unsolicited_frame_control_get_header( 870 status = scic_sds_unsolicited_frame_control_get_header(
871 &(this_request->parent.owning_controller->uf_control), 871 &(sci_req->parent.owning_controller->uf_control),
872 frame_index, 872 frame_index,
873 (void **)&frame_header 873 (void **)&frame_header
874 ); 874 );
@@ -878,7 +878,7 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
878 case SATA_FIS_TYPE_PIO_SETUP: 878 case SATA_FIS_TYPE_PIO_SETUP:
879 /* Get from the frame buffer the PIO Setup Data */ 879 /* Get from the frame buffer the PIO Setup Data */
880 scic_sds_unsolicited_frame_control_get_buffer( 880 scic_sds_unsolicited_frame_control_get_buffer(
881 &(this_request->parent.owning_controller->uf_control), 881 &(sci_req->parent.owning_controller->uf_control),
882 frame_index, 882 frame_index,
883 (void **)&frame_buffer 883 (void **)&frame_buffer
884 ); 884 );
@@ -887,30 +887,30 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
887 * Get the data from the PIO Setup 887 * Get the data from the PIO Setup
888 * The SCU Hardware returns first word in the frame_header and the rest 888 * The SCU Hardware returns first word in the frame_header and the rest
889 * of the data is in the frame buffer so we need to back up one dword */ 889 * of the data is in the frame buffer so we need to back up one dword */
890 this_request->type.pio.pio_transfer_bytes = 890 sci_req->type.pio.pio_transfer_bytes =
891 (u16)((struct sata_fis_pio_setup *)(&frame_buffer[-1]))->transfter_count; 891 (u16)((struct sata_fis_pio_setup *)(&frame_buffer[-1]))->transfter_count;
892 this_request->type.pio.ending_status = 892 sci_req->type.pio.ending_status =
893 (u8)((struct sata_fis_pio_setup *)(&frame_buffer[-1]))->ending_status; 893 (u8)((struct sata_fis_pio_setup *)(&frame_buffer[-1]))->ending_status;
894 894
895 scic_sds_controller_copy_sata_response( 895 scic_sds_controller_copy_sata_response(
896 &this_request->d2h_reg_fis, (u32 *)frame_header, frame_buffer 896 &sci_req->d2h_reg_fis, (u32 *)frame_header, frame_buffer
897 ); 897 );
898 898
899 this_request->d2h_reg_fis.status = 899 sci_req->d2h_reg_fis.status =
900 this_request->type.pio.ending_status; 900 sci_req->type.pio.ending_status;
901 901
902 /* The next state is dependent on whether the request was PIO Data-in or Data out */ 902 /* The next state is dependent on whether the request was PIO Data-in or Data out */
903 if (this_request->type.pio.sat_protocol == SAT_PROTOCOL_PIO_DATA_IN) { 903 if (sci_req->type.pio.sat_protocol == SAT_PROTOCOL_PIO_DATA_IN) {
904 sci_base_state_machine_change_state( 904 sci_base_state_machine_change_state(
905 &this_request->parent.started_substate_machine, 905 &sci_req->parent.started_substate_machine,
906 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_DATA_SUBSTATE 906 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_DATA_SUBSTATE
907 ); 907 );
908 } else if (this_request->type.pio.sat_protocol == SAT_PROTOCOL_PIO_DATA_OUT) { 908 } else if (sci_req->type.pio.sat_protocol == SAT_PROTOCOL_PIO_DATA_OUT) {
909 /* Transmit data */ 909 /* Transmit data */
910 status = scic_sds_stp_request_pio_data_out_transmit_data(request); 910 status = scic_sds_stp_request_pio_data_out_transmit_data(request);
911 if (status == SCI_SUCCESS) { 911 if (status == SCI_SUCCESS) {
912 sci_base_state_machine_change_state( 912 sci_base_state_machine_change_state(
913 &this_request->parent.started_substate_machine, 913 &sci_req->parent.started_substate_machine,
914 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_OUT_TRANSMIT_DATA_SUBSTATE 914 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_OUT_TRANSMIT_DATA_SUBSTATE
915 ); 915 );
916 } 916 }
@@ -919,7 +919,7 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
919 919
920 case SATA_FIS_TYPE_SETDEVBITS: 920 case SATA_FIS_TYPE_SETDEVBITS:
921 sci_base_state_machine_change_state( 921 sci_base_state_machine_change_state(
922 &this_request->parent.started_substate_machine, 922 &sci_req->parent.started_substate_machine,
923 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE 923 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE
924 ); 924 );
925 break; 925 break;
@@ -927,22 +927,22 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
927 case SATA_FIS_TYPE_REGD2H: 927 case SATA_FIS_TYPE_REGD2H:
928 if ((frame_header->status & ATA_STATUS_REG_BSY_BIT) == 0) { 928 if ((frame_header->status & ATA_STATUS_REG_BSY_BIT) == 0) {
929 scic_sds_unsolicited_frame_control_get_buffer( 929 scic_sds_unsolicited_frame_control_get_buffer(
930 &(this_request->parent.owning_controller->uf_control), 930 &(sci_req->parent.owning_controller->uf_control),
931 frame_index, 931 frame_index,
932 (void **)&frame_buffer 932 (void **)&frame_buffer
933 ); 933 );
934 934
935 scic_sds_controller_copy_sata_response( 935 scic_sds_controller_copy_sata_response(
936 &this_request->d2h_reg_fis, (u32 *)frame_header, frame_buffer); 936 &sci_req->d2h_reg_fis, (u32 *)frame_header, frame_buffer);
937 937
938 scic_sds_request_set_status( 938 scic_sds_request_set_status(
939 &this_request->parent, 939 &sci_req->parent,
940 SCU_TASK_DONE_CHECK_RESPONSE, 940 SCU_TASK_DONE_CHECK_RESPONSE,
941 SCI_FAILURE_IO_RESPONSE_VALID 941 SCI_FAILURE_IO_RESPONSE_VALID
942 ); 942 );
943 943
944 sci_base_state_machine_change_state( 944 sci_base_state_machine_change_state(
945 &this_request->parent.state_machine, 945 &sci_req->parent.state_machine,
946 SCI_BASE_REQUEST_STATE_COMPLETED 946 SCI_BASE_REQUEST_STATE_COMPLETED
947 ); 947 );
948 } else { 948 } else {
@@ -954,7 +954,7 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
954 "D2H Register FIS with BSY status " 954 "D2H Register FIS with BSY status "
955 "0x%x\n", 955 "0x%x\n",
956 __func__, 956 __func__,
957 this_request, 957 sci_req,
958 frame_header->status); 958 frame_header->status);
959 } 959 }
960 break; 960 break;
@@ -965,21 +965,21 @@ static enum sci_status scic_sds_stp_request_pio_await_frame_frame_handler(
965 965
966 /* Frame is decoded return it to the controller */ 966 /* Frame is decoded return it to the controller */
967 scic_sds_controller_release_frame( 967 scic_sds_controller_release_frame(
968 this_request->parent.owning_controller, 968 sci_req->parent.owning_controller,
969 frame_index 969 frame_index
970 ); 970 );
971 } else 971 } else
972 dev_err(scic_to_dev(request->owning_controller), 972 dev_err(scic_to_dev(request->owning_controller),
973 "%s: SCIC IO Request 0x%p could not get frame header " 973 "%s: SCIC IO Request 0x%p could not get frame header "
974 "for frame index %d, status %x\n", 974 "for frame index %d, status %x\n",
975 __func__, this_request, frame_index, status); 975 __func__, sci_req, frame_index, status);
976 976
977 return status; 977 return status;
978} 978}
979 979
980/** 980/**
981 * 981 *
982 * @this_request: 982 * @sci_req:
983 * @frame_index: 983 * @frame_index:
984 * 984 *
985 * enum sci_status 985 * enum sci_status
@@ -991,33 +991,33 @@ static enum sci_status scic_sds_stp_request_pio_data_in_await_data_frame_handler
991 enum sci_status status; 991 enum sci_status status;
992 struct sata_fis_header *frame_header; 992 struct sata_fis_header *frame_header;
993 struct sata_fis_data *frame_buffer; 993 struct sata_fis_data *frame_buffer;
994 struct scic_sds_stp_request *this_request; 994 struct scic_sds_stp_request *sci_req;
995 995
996 this_request = (struct scic_sds_stp_request *)request; 996 sci_req = (struct scic_sds_stp_request *)request;
997 997
998 status = scic_sds_unsolicited_frame_control_get_header( 998 status = scic_sds_unsolicited_frame_control_get_header(
999 &(this_request->parent.owning_controller->uf_control), 999 &(sci_req->parent.owning_controller->uf_control),
1000 frame_index, 1000 frame_index,
1001 (void **)&frame_header 1001 (void **)&frame_header
1002 ); 1002 );
1003 1003
1004 if (status == SCI_SUCCESS) { 1004 if (status == SCI_SUCCESS) {
1005 if (frame_header->fis_type == SATA_FIS_TYPE_DATA) { 1005 if (frame_header->fis_type == SATA_FIS_TYPE_DATA) {
1006 if (this_request->type.pio.request_current.sgl_pair == NULL) { 1006 if (sci_req->type.pio.request_current.sgl_pair == NULL) {
1007 this_request->parent.saved_rx_frame_index = frame_index; 1007 sci_req->parent.saved_rx_frame_index = frame_index;
1008 this_request->type.pio.pio_transfer_bytes = 0; 1008 sci_req->type.pio.pio_transfer_bytes = 0;
1009 } else { 1009 } else {
1010 status = scic_sds_unsolicited_frame_control_get_buffer( 1010 status = scic_sds_unsolicited_frame_control_get_buffer(
1011 &(this_request->parent.owning_controller->uf_control), 1011 &(sci_req->parent.owning_controller->uf_control),
1012 frame_index, 1012 frame_index,
1013 (void **)&frame_buffer 1013 (void **)&frame_buffer
1014 ); 1014 );
1015 1015
1016 status = scic_sds_stp_request_pio_data_in_copy_data(this_request, (u8 *)frame_buffer); 1016 status = scic_sds_stp_request_pio_data_in_copy_data(sci_req, (u8 *)frame_buffer);
1017 1017
1018 /* Frame is decoded return it to the controller */ 1018 /* Frame is decoded return it to the controller */
1019 scic_sds_controller_release_frame( 1019 scic_sds_controller_release_frame(
1020 this_request->parent.owning_controller, 1020 sci_req->parent.owning_controller,
1021 frame_index 1021 frame_index
1022 ); 1022 );
1023 } 1023 }
@@ -1027,17 +1027,17 @@ static enum sci_status scic_sds_stp_request_pio_data_in_await_data_frame_handler
1027 * for this data transfer */ 1027 * for this data transfer */
1028 if ( 1028 if (
1029 (status == SCI_SUCCESS) 1029 (status == SCI_SUCCESS)
1030 && (this_request->type.pio.pio_transfer_bytes == 0) 1030 && (sci_req->type.pio.pio_transfer_bytes == 0)
1031 ) { 1031 ) {
1032 if ((this_request->type.pio.ending_status & ATA_STATUS_REG_BSY_BIT) == 0) { 1032 if ((sci_req->type.pio.ending_status & ATA_STATUS_REG_BSY_BIT) == 0) {
1033 scic_sds_request_set_status( 1033 scic_sds_request_set_status(
1034 &this_request->parent, 1034 &sci_req->parent,
1035 SCU_TASK_DONE_CHECK_RESPONSE, 1035 SCU_TASK_DONE_CHECK_RESPONSE,
1036 SCI_FAILURE_IO_RESPONSE_VALID 1036 SCI_FAILURE_IO_RESPONSE_VALID
1037 ); 1037 );
1038 1038
1039 sci_base_state_machine_change_state( 1039 sci_base_state_machine_change_state(
1040 &this_request->parent.state_machine, 1040 &sci_req->parent.state_machine,
1041 SCI_BASE_REQUEST_STATE_COMPLETED 1041 SCI_BASE_REQUEST_STATE_COMPLETED
1042 ); 1042 );
1043 } else { 1043 } else {
@@ -1053,24 +1053,24 @@ static enum sci_status scic_sds_stp_request_pio_data_in_await_data_frame_handler
1053 "with fis type 0x%02x when expecting a data " 1053 "with fis type 0x%02x when expecting a data "
1054 "fis.\n", 1054 "fis.\n",
1055 __func__, 1055 __func__,
1056 this_request, 1056 sci_req,
1057 frame_index, 1057 frame_index,
1058 frame_header->fis_type); 1058 frame_header->fis_type);
1059 1059
1060 scic_sds_request_set_status( 1060 scic_sds_request_set_status(
1061 &this_request->parent, 1061 &sci_req->parent,
1062 SCU_TASK_DONE_GOOD, 1062 SCU_TASK_DONE_GOOD,
1063 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT 1063 SCI_FAILURE_IO_REQUIRES_SCSI_ABORT
1064 ); 1064 );
1065 1065
1066 sci_base_state_machine_change_state( 1066 sci_base_state_machine_change_state(
1067 &this_request->parent.state_machine, 1067 &sci_req->parent.state_machine,
1068 SCI_BASE_REQUEST_STATE_COMPLETED 1068 SCI_BASE_REQUEST_STATE_COMPLETED
1069 ); 1069 );
1070 1070
1071 /* Frame is decoded return it to the controller */ 1071 /* Frame is decoded return it to the controller */
1072 scic_sds_controller_release_frame( 1072 scic_sds_controller_release_frame(
1073 this_request->parent.owning_controller, 1073 sci_req->parent.owning_controller,
1074 frame_index 1074 frame_index
1075 ); 1075 );
1076 } 1076 }
@@ -1078,7 +1078,7 @@ static enum sci_status scic_sds_stp_request_pio_data_in_await_data_frame_handler
1078 dev_err(scic_to_dev(request->owning_controller), 1078 dev_err(scic_to_dev(request->owning_controller),
1079 "%s: SCIC IO Request 0x%p could not get frame header " 1079 "%s: SCIC IO Request 0x%p could not get frame header "
1080 "for frame index %d, status %x\n", 1080 "for frame index %d, status %x\n",
1081 __func__, this_request, frame_index, status); 1081 __func__, sci_req, frame_index, status);
1082 1082
1083 return status; 1083 return status;
1084} 1084}
@@ -1086,31 +1086,31 @@ static enum sci_status scic_sds_stp_request_pio_data_in_await_data_frame_handler
1086 1086
1087/** 1087/**
1088 * 1088 *
1089 * @this_request: 1089 * @sci_req:
1090 * @completion_code: 1090 * @completion_code:
1091 * 1091 *
1092 * enum sci_status 1092 * enum sci_status
1093 */ 1093 */
1094static enum sci_status scic_sds_stp_request_pio_data_out_await_data_transmit_completion_tc_completion_handler( 1094static enum sci_status scic_sds_stp_request_pio_data_out_await_data_transmit_completion_tc_completion_handler(
1095 1095
1096 struct scic_sds_request *this_request, 1096 struct scic_sds_request *sci_req,
1097 u32 completion_code) 1097 u32 completion_code)
1098{ 1098{
1099 enum sci_status status = SCI_SUCCESS; 1099 enum sci_status status = SCI_SUCCESS;
1100 bool all_frames_transferred = false; 1100 bool all_frames_transferred = false;
1101 1101
1102 struct scic_sds_stp_request *this_scic_sds_stp_request = (struct scic_sds_stp_request *)this_request; 1102 struct scic_sds_stp_request *stp_req = (struct scic_sds_stp_request *)sci_req;
1103 1103
1104 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1104 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1105 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1105 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
1106 /* Transmit data */ 1106 /* Transmit data */
1107 if (this_scic_sds_stp_request->type.pio.pio_transfer_bytes != 0) { 1107 if (stp_req->type.pio.pio_transfer_bytes != 0) {
1108 status = scic_sds_stp_request_pio_data_out_transmit_data(this_request); 1108 status = scic_sds_stp_request_pio_data_out_transmit_data(sci_req);
1109 if (status == SCI_SUCCESS) { 1109 if (status == SCI_SUCCESS) {
1110 if (this_scic_sds_stp_request->type.pio.pio_transfer_bytes == 0) 1110 if (stp_req->type.pio.pio_transfer_bytes == 0)
1111 all_frames_transferred = true; 1111 all_frames_transferred = true;
1112 } 1112 }
1113 } else if (this_scic_sds_stp_request->type.pio.pio_transfer_bytes == 0) { 1113 } else if (stp_req->type.pio.pio_transfer_bytes == 0) {
1114 /* 1114 /*
1115 * this will happen if the all data is written at the 1115 * this will happen if the all data is written at the
1116 * first time after the pio setup fis is received 1116 * first time after the pio setup fis is received
@@ -1124,7 +1124,7 @@ static enum sci_status scic_sds_stp_request_pio_data_out_await_data_transmit_com
1124 * Change the state to SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_FRAME_SUBSTATE 1124 * Change the state to SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_FRAME_SUBSTATE
1125 * and wait for PIO_SETUP fis / or D2H REg fis. */ 1125 * and wait for PIO_SETUP fis / or D2H REg fis. */
1126 sci_base_state_machine_change_state( 1126 sci_base_state_machine_change_state(
1127 &this_request->started_substate_machine, 1127 &sci_req->started_substate_machine,
1128 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE 1128 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE
1129 ); 1129 );
1130 } 1130 }
@@ -1135,13 +1135,13 @@ static enum sci_status scic_sds_stp_request_pio_data_out_await_data_transmit_com
1135 * All other completion status cause the IO to be complete. If a NAK 1135 * All other completion status cause the IO to be complete. If a NAK
1136 * was received, then it is up to the user to retry the request. */ 1136 * was received, then it is up to the user to retry the request. */
1137 scic_sds_request_set_status( 1137 scic_sds_request_set_status(
1138 this_request, 1138 sci_req,
1139 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1139 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
1140 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1140 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1141 ); 1141 );
1142 1142
1143 sci_base_state_machine_change_state( 1143 sci_base_state_machine_change_state(
1144 &this_request->state_machine, 1144 &sci_req->state_machine,
1145 SCI_BASE_REQUEST_STATE_COMPLETED 1145 SCI_BASE_REQUEST_STATE_COMPLETED
1146 ); 1146 );
1147 break; 1147 break;
@@ -1217,25 +1217,25 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
1217static void scic_sds_stp_request_started_pio_await_h2d_completion_enter( 1217static void scic_sds_stp_request_started_pio_await_h2d_completion_enter(
1218 struct sci_base_object *object) 1218 struct sci_base_object *object)
1219{ 1219{
1220 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1220 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1221 1221
1222 SET_STATE_HANDLER( 1222 SET_STATE_HANDLER(
1223 this_request, 1223 sci_req,
1224 scic_sds_stp_request_started_pio_substate_handler_table, 1224 scic_sds_stp_request_started_pio_substate_handler_table,
1225 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_H2D_COMPLETION_SUBSTATE 1225 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_H2D_COMPLETION_SUBSTATE
1226 ); 1226 );
1227 1227
1228 scic_sds_remote_device_set_working_request( 1228 scic_sds_remote_device_set_working_request(
1229 this_request->target_device, this_request); 1229 sci_req->target_device, sci_req);
1230} 1230}
1231 1231
1232static void scic_sds_stp_request_started_pio_await_frame_enter( 1232static void scic_sds_stp_request_started_pio_await_frame_enter(
1233 struct sci_base_object *object) 1233 struct sci_base_object *object)
1234{ 1234{
1235 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1235 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1236 1236
1237 SET_STATE_HANDLER( 1237 SET_STATE_HANDLER(
1238 this_request, 1238 sci_req,
1239 scic_sds_stp_request_started_pio_substate_handler_table, 1239 scic_sds_stp_request_started_pio_substate_handler_table,
1240 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE 1240 SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE
1241 ); 1241 );
@@ -1244,10 +1244,10 @@ static void scic_sds_stp_request_started_pio_await_frame_enter(
1244static void scic_sds_stp_request_started_pio_data_in_await_data_enter( 1244static void scic_sds_stp_request_started_pio_data_in_await_data_enter(
1245 struct sci_base_object *object) 1245 struct sci_base_object *object)
1246{ 1246{
1247 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1247 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1248 1248
1249 SET_STATE_HANDLER( 1249 SET_STATE_HANDLER(
1250 this_request, 1250 sci_req,
1251 scic_sds_stp_request_started_pio_substate_handler_table, 1251 scic_sds_stp_request_started_pio_substate_handler_table,
1252 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_DATA_SUBSTATE 1252 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_DATA_SUBSTATE
1253 ); 1253 );
@@ -1256,10 +1256,10 @@ static void scic_sds_stp_request_started_pio_data_in_await_data_enter(
1256static void scic_sds_stp_request_started_pio_data_out_transmit_data_enter( 1256static void scic_sds_stp_request_started_pio_data_out_transmit_data_enter(
1257 struct sci_base_object *object) 1257 struct sci_base_object *object)
1258{ 1258{
1259 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1259 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1260 1260
1261 SET_STATE_HANDLER( 1261 SET_STATE_HANDLER(
1262 this_request, 1262 sci_req,
1263 scic_sds_stp_request_started_pio_substate_handler_table, 1263 scic_sds_stp_request_started_pio_substate_handler_table,
1264 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_OUT_TRANSMIT_DATA_SUBSTATE 1264 SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_OUT_TRANSMIT_DATA_SUBSTATE
1265 ); 1265 );
@@ -1333,13 +1333,13 @@ static void scic_sds_stp_request_udma_complete_request(
1333 1333
1334/** 1334/**
1335 * 1335 *
1336 * @this_request: 1336 * @sci_req:
1337 * @frame_index: 1337 * @frame_index:
1338 * 1338 *
1339 * enum sci_status 1339 * enum sci_status
1340 */ 1340 */
1341static enum sci_status scic_sds_stp_request_udma_general_frame_handler( 1341static enum sci_status scic_sds_stp_request_udma_general_frame_handler(
1342 struct scic_sds_request *this_request, 1342 struct scic_sds_request *sci_req,
1343 u32 frame_index) 1343 u32 frame_index)
1344{ 1344{
1345 enum sci_status status; 1345 enum sci_status status;
@@ -1347,7 +1347,7 @@ static enum sci_status scic_sds_stp_request_udma_general_frame_handler(
1347 u32 *frame_buffer; 1347 u32 *frame_buffer;
1348 1348
1349 status = scic_sds_unsolicited_frame_control_get_header( 1349 status = scic_sds_unsolicited_frame_control_get_header(
1350 &this_request->owning_controller->uf_control, 1350 &sci_req->owning_controller->uf_control,
1351 frame_index, 1351 frame_index,
1352 (void **)&frame_header 1352 (void **)&frame_header
1353 ); 1353 );
@@ -1357,20 +1357,20 @@ static enum sci_status scic_sds_stp_request_udma_general_frame_handler(
1357 && (frame_header->fis_type == SATA_FIS_TYPE_REGD2H) 1357 && (frame_header->fis_type == SATA_FIS_TYPE_REGD2H)
1358 ) { 1358 ) {
1359 scic_sds_unsolicited_frame_control_get_buffer( 1359 scic_sds_unsolicited_frame_control_get_buffer(
1360 &this_request->owning_controller->uf_control, 1360 &sci_req->owning_controller->uf_control,
1361 frame_index, 1361 frame_index,
1362 (void **)&frame_buffer 1362 (void **)&frame_buffer
1363 ); 1363 );
1364 1364
1365 scic_sds_controller_copy_sata_response( 1365 scic_sds_controller_copy_sata_response(
1366 &((struct scic_sds_stp_request *)this_request)->d2h_reg_fis, 1366 &((struct scic_sds_stp_request *)sci_req)->d2h_reg_fis,
1367 (u32 *)frame_header, 1367 (u32 *)frame_header,
1368 frame_buffer 1368 frame_buffer
1369 ); 1369 );
1370 } 1370 }
1371 1371
1372 scic_sds_controller_release_frame( 1372 scic_sds_controller_release_frame(
1373 this_request->owning_controller, frame_index); 1373 sci_req->owning_controller, frame_index);
1374 1374
1375 return status; 1375 return status;
1376} 1376}
@@ -1378,7 +1378,7 @@ static enum sci_status scic_sds_stp_request_udma_general_frame_handler(
1378/** 1378/**
1379 * This method process TC completions while in the state where we are waiting 1379 * This method process TC completions while in the state where we are waiting
1380 * for TC completions. 1380 * for TC completions.
1381 * @this_request: 1381 * @sci_req:
1382 * @completion_code: 1382 * @completion_code:
1383 * 1383 *
1384 * enum sci_status 1384 * enum sci_status
@@ -1388,12 +1388,12 @@ static enum sci_status scic_sds_stp_request_udma_await_tc_completion_tc_completi
1388 u32 completion_code) 1388 u32 completion_code)
1389{ 1389{
1390 enum sci_status status = SCI_SUCCESS; 1390 enum sci_status status = SCI_SUCCESS;
1391 struct scic_sds_stp_request *this_request = (struct scic_sds_stp_request *)request; 1391 struct scic_sds_stp_request *sci_req = (struct scic_sds_stp_request *)request;
1392 1392
1393 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1393 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1394 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1394 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
1395 scic_sds_stp_request_udma_complete_request( 1395 scic_sds_stp_request_udma_complete_request(
1396 &this_request->parent, SCU_TASK_DONE_GOOD, SCI_SUCCESS 1396 &sci_req->parent, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1397 ); 1397 );
1398 break; 1398 break;
1399 1399
@@ -1402,14 +1402,14 @@ static enum sci_status scic_sds_stp_request_udma_await_tc_completion_tc_completi
1402 /* 1402 /*
1403 * We must check ther response buffer to see if the D2H Register FIS was 1403 * We must check ther response buffer to see if the D2H Register FIS was
1404 * received before we got the TC completion. */ 1404 * received before we got the TC completion. */
1405 if (this_request->d2h_reg_fis.fis_type == SATA_FIS_TYPE_REGD2H) { 1405 if (sci_req->d2h_reg_fis.fis_type == SATA_FIS_TYPE_REGD2H) {
1406 scic_sds_remote_device_suspend( 1406 scic_sds_remote_device_suspend(
1407 this_request->parent.target_device, 1407 sci_req->parent.target_device,
1408 SCU_EVENT_SPECIFIC(SCU_NORMALIZE_COMPLETION_STATUS(completion_code)) 1408 SCU_EVENT_SPECIFIC(SCU_NORMALIZE_COMPLETION_STATUS(completion_code))
1409 ); 1409 );
1410 1410
1411 scic_sds_stp_request_udma_complete_request( 1411 scic_sds_stp_request_udma_complete_request(
1412 &this_request->parent, 1412 &sci_req->parent,
1413 SCU_TASK_DONE_CHECK_RESPONSE, 1413 SCU_TASK_DONE_CHECK_RESPONSE,
1414 SCI_FAILURE_IO_RESPONSE_VALID 1414 SCI_FAILURE_IO_RESPONSE_VALID
1415 ); 1415 );
@@ -1418,7 +1418,7 @@ static enum sci_status scic_sds_stp_request_udma_await_tc_completion_tc_completi
1418 * If we have an error completion status for the TC then we can expect a 1418 * If we have an error completion status for the TC then we can expect a
1419 * D2H register FIS from the device so we must change state to wait for it */ 1419 * D2H register FIS from the device so we must change state to wait for it */
1420 sci_base_state_machine_change_state( 1420 sci_base_state_machine_change_state(
1421 &this_request->parent.started_substate_machine, 1421 &sci_req->parent.started_substate_machine,
1422 SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_D2H_REG_FIS_SUBSTATE 1422 SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_D2H_REG_FIS_SUBSTATE
1423 ); 1423 );
1424 } 1424 }
@@ -1434,14 +1434,14 @@ static enum sci_status scic_sds_stp_request_udma_await_tc_completion_tc_completi
1434 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CMD_LL_R_ERR): 1434 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CMD_LL_R_ERR):
1435 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CRC_ERR): 1435 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_CRC_ERR):
1436 scic_sds_remote_device_suspend( 1436 scic_sds_remote_device_suspend(
1437 this_request->parent.target_device, 1437 sci_req->parent.target_device,
1438 SCU_EVENT_SPECIFIC(SCU_NORMALIZE_COMPLETION_STATUS(completion_code)) 1438 SCU_EVENT_SPECIFIC(SCU_NORMALIZE_COMPLETION_STATUS(completion_code))
1439 ); 1439 );
1440 /* Fall through to the default case */ 1440 /* Fall through to the default case */
1441 default: 1441 default:
1442 /* All other completion status cause the IO to be complete. */ 1442 /* All other completion status cause the IO to be complete. */
1443 scic_sds_stp_request_udma_complete_request( 1443 scic_sds_stp_request_udma_complete_request(
1444 &this_request->parent, 1444 &sci_req->parent,
1445 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1445 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
1446 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1446 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1447 ); 1447 );
@@ -1452,17 +1452,17 @@ static enum sci_status scic_sds_stp_request_udma_await_tc_completion_tc_completi
1452} 1452}
1453 1453
1454static enum sci_status scic_sds_stp_request_udma_await_d2h_reg_fis_frame_handler( 1454static enum sci_status scic_sds_stp_request_udma_await_d2h_reg_fis_frame_handler(
1455 struct scic_sds_request *this_request, 1455 struct scic_sds_request *sci_req,
1456 u32 frame_index) 1456 u32 frame_index)
1457{ 1457{
1458 enum sci_status status; 1458 enum sci_status status;
1459 1459
1460 /* Use the general frame handler to copy the resposne data */ 1460 /* Use the general frame handler to copy the resposne data */
1461 status = scic_sds_stp_request_udma_general_frame_handler(this_request, frame_index); 1461 status = scic_sds_stp_request_udma_general_frame_handler(sci_req, frame_index);
1462 1462
1463 if (status == SCI_SUCCESS) { 1463 if (status == SCI_SUCCESS) {
1464 scic_sds_stp_request_udma_complete_request( 1464 scic_sds_stp_request_udma_complete_request(
1465 this_request, 1465 sci_req,
1466 SCU_TASK_DONE_CHECK_RESPONSE, 1466 SCU_TASK_DONE_CHECK_RESPONSE,
1467 SCI_FAILURE_IO_RESPONSE_VALID 1467 SCI_FAILURE_IO_RESPONSE_VALID
1468 ); 1468 );
@@ -1488,10 +1488,10 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
1488static void scic_sds_stp_request_started_udma_await_tc_completion_enter( 1488static void scic_sds_stp_request_started_udma_await_tc_completion_enter(
1489 struct sci_base_object *object) 1489 struct sci_base_object *object)
1490{ 1490{
1491 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1491 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1492 1492
1493 SET_STATE_HANDLER( 1493 SET_STATE_HANDLER(
1494 this_request, 1494 sci_req,
1495 scic_sds_stp_request_started_udma_substate_handler_table, 1495 scic_sds_stp_request_started_udma_substate_handler_table,
1496 SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_TC_COMPLETION_SUBSTATE 1496 SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_TC_COMPLETION_SUBSTATE
1497 ); 1497 );
@@ -1507,10 +1507,10 @@ static void scic_sds_stp_request_started_udma_await_tc_completion_enter(
1507static void scic_sds_stp_request_started_udma_await_d2h_reg_fis_enter( 1507static void scic_sds_stp_request_started_udma_await_d2h_reg_fis_enter(
1508 struct sci_base_object *object) 1508 struct sci_base_object *object)
1509{ 1509{
1510 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1510 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1511 1511
1512 SET_STATE_HANDLER( 1512 SET_STATE_HANDLER(
1513 this_request, 1513 sci_req,
1514 scic_sds_stp_request_started_udma_substate_handler_table, 1514 scic_sds_stp_request_started_udma_substate_handler_table,
1515 SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_D2H_REG_FIS_SUBSTATE 1515 SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_D2H_REG_FIS_SUBSTATE
1516 ); 1516 );
@@ -1548,7 +1548,7 @@ enum sci_status scic_sds_stp_udma_request_construct(struct scic_sds_request *sci
1548 1548
1549/** 1549/**
1550 * 1550 *
1551 * @this_request: 1551 * @sci_req:
1552 * @completion_code: 1552 * @completion_code:
1553 * 1553 *
1554 * This method processes a TC completion. The expected TC completion is for 1554 * This method processes a TC completion. The expected TC completion is for
@@ -1557,17 +1557,17 @@ enum sci_status scic_sds_stp_udma_request_construct(struct scic_sds_request *sci
1557 * SCI_SUCCESS This value is always returned. 1557 * SCI_SUCCESS This value is always returned.
1558 */ 1558 */
1559static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_completion_handler( 1559static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_completion_handler(
1560 struct scic_sds_request *this_request, 1560 struct scic_sds_request *sci_req,
1561 u32 completion_code) 1561 u32 completion_code)
1562{ 1562{
1563 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1563 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1564 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1564 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
1565 scic_sds_request_set_status( 1565 scic_sds_request_set_status(
1566 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 1566 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1567 ); 1567 );
1568 1568
1569 sci_base_state_machine_change_state( 1569 sci_base_state_machine_change_state(
1570 &this_request->started_substate_machine, 1570 &sci_req->started_substate_machine,
1571 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_DIAGNOSTIC_COMPLETION_SUBSTATE 1571 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_DIAGNOSTIC_COMPLETION_SUBSTATE
1572 ); 1572 );
1573 break; 1573 break;
@@ -1577,13 +1577,13 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_com
1577 * All other completion status cause the IO to be complete. If a NAK 1577 * All other completion status cause the IO to be complete. If a NAK
1578 * was received, then it is up to the user to retry the request. */ 1578 * was received, then it is up to the user to retry the request. */
1579 scic_sds_request_set_status( 1579 scic_sds_request_set_status(
1580 this_request, 1580 sci_req,
1581 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1581 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
1582 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1582 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1583 ); 1583 );
1584 1584
1585 sci_base_state_machine_change_state( 1585 sci_base_state_machine_change_state(
1586 &this_request->state_machine, SCI_BASE_REQUEST_STATE_COMPLETED); 1586 &sci_req->state_machine, SCI_BASE_REQUEST_STATE_COMPLETED);
1587 break; 1587 break;
1588 } 1588 }
1589 1589
@@ -1592,7 +1592,7 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_com
1592 1592
1593/** 1593/**
1594 * 1594 *
1595 * @this_request: 1595 * @sci_req:
1596 * @completion_code: 1596 * @completion_code:
1597 * 1597 *
1598 * This method processes a TC completion. The expected TC completion is for 1598 * This method processes a TC completion. The expected TC completion is for
@@ -1601,17 +1601,17 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_com
1601 * SCI_SUCCESS This value is always returned. 1601 * SCI_SUCCESS This value is always returned.
1602 */ 1602 */
1603static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_diagnostic_tc_completion_handler( 1603static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_diagnostic_tc_completion_handler(
1604 struct scic_sds_request *this_request, 1604 struct scic_sds_request *sci_req,
1605 u32 completion_code) 1605 u32 completion_code)
1606{ 1606{
1607 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) { 1607 switch (SCU_GET_COMPLETION_TL_STATUS(completion_code)) {
1608 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD): 1608 case SCU_MAKE_COMPLETION_STATUS(SCU_TASK_DONE_GOOD):
1609 scic_sds_request_set_status( 1609 scic_sds_request_set_status(
1610 this_request, SCU_TASK_DONE_GOOD, SCI_SUCCESS 1610 sci_req, SCU_TASK_DONE_GOOD, SCI_SUCCESS
1611 ); 1611 );
1612 1612
1613 sci_base_state_machine_change_state( 1613 sci_base_state_machine_change_state(
1614 &this_request->started_substate_machine, 1614 &sci_req->started_substate_machine,
1615 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_D2H_RESPONSE_FRAME_SUBSTATE 1615 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_D2H_RESPONSE_FRAME_SUBSTATE
1616 ); 1616 );
1617 break; 1617 break;
@@ -1621,12 +1621,12 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_h2d_diagnostic_tc_c
1621 * All other completion status cause the IO to be complete. If a NAK 1621 * All other completion status cause the IO to be complete. If a NAK
1622 * was received, then it is up to the user to retry the request. */ 1622 * was received, then it is up to the user to retry the request. */
1623 scic_sds_request_set_status( 1623 scic_sds_request_set_status(
1624 this_request, 1624 sci_req,
1625 SCU_NORMALIZE_COMPLETION_STATUS(completion_code), 1625 SCU_NORMALIZE_COMPLETION_STATUS(completion_code),
1626 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR 1626 SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR
1627 ); 1627 );
1628 1628
1629 sci_base_state_machine_change_state(&this_request->state_machine, 1629 sci_base_state_machine_change_state(&sci_req->state_machine,
1630 SCI_BASE_REQUEST_STATE_COMPLETED); 1630 SCI_BASE_REQUEST_STATE_COMPLETED);
1631 break; 1631 break;
1632 } 1632 }
@@ -1653,10 +1653,10 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_d2h_frame_handler(
1653 enum sci_status status; 1653 enum sci_status status;
1654 struct sata_fis_header *frame_header; 1654 struct sata_fis_header *frame_header;
1655 u32 *frame_buffer; 1655 u32 *frame_buffer;
1656 struct scic_sds_stp_request *this_request = (struct scic_sds_stp_request *)request; 1656 struct scic_sds_stp_request *sci_req = (struct scic_sds_stp_request *)request;
1657 1657
1658 status = scic_sds_unsolicited_frame_control_get_header( 1658 status = scic_sds_unsolicited_frame_control_get_header(
1659 &(this_request->parent.owning_controller->uf_control), 1659 &(sci_req->parent.owning_controller->uf_control),
1660 frame_index, 1660 frame_index,
1661 (void **)&frame_header 1661 (void **)&frame_header
1662 ); 1662 );
@@ -1665,18 +1665,18 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_d2h_frame_handler(
1665 switch (frame_header->fis_type) { 1665 switch (frame_header->fis_type) {
1666 case SATA_FIS_TYPE_REGD2H: 1666 case SATA_FIS_TYPE_REGD2H:
1667 scic_sds_unsolicited_frame_control_get_buffer( 1667 scic_sds_unsolicited_frame_control_get_buffer(
1668 &(this_request->parent.owning_controller->uf_control), 1668 &(sci_req->parent.owning_controller->uf_control),
1669 frame_index, 1669 frame_index,
1670 (void **)&frame_buffer 1670 (void **)&frame_buffer
1671 ); 1671 );
1672 1672
1673 scic_sds_controller_copy_sata_response( 1673 scic_sds_controller_copy_sata_response(
1674 &this_request->d2h_reg_fis, (u32 *)frame_header, frame_buffer 1674 &sci_req->d2h_reg_fis, (u32 *)frame_header, frame_buffer
1675 ); 1675 );
1676 1676
1677 /* The command has completed with error */ 1677 /* The command has completed with error */
1678 scic_sds_request_set_status( 1678 scic_sds_request_set_status(
1679 &this_request->parent, 1679 &sci_req->parent,
1680 SCU_TASK_DONE_CHECK_RESPONSE, 1680 SCU_TASK_DONE_CHECK_RESPONSE,
1681 SCI_FAILURE_IO_RESPONSE_VALID 1681 SCI_FAILURE_IO_RESPONSE_VALID
1682 ); 1682 );
@@ -1687,11 +1687,11 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_d2h_frame_handler(
1687 "%s: IO Request:0x%p Frame Id:%d protocol " 1687 "%s: IO Request:0x%p Frame Id:%d protocol "
1688 "violation occurred\n", 1688 "violation occurred\n",
1689 __func__, 1689 __func__,
1690 this_request, 1690 sci_req,
1691 frame_index); 1691 frame_index);
1692 1692
1693 scic_sds_request_set_status( 1693 scic_sds_request_set_status(
1694 &this_request->parent, 1694 &sci_req->parent,
1695 SCU_TASK_DONE_UNEXP_FIS, 1695 SCU_TASK_DONE_UNEXP_FIS,
1696 SCI_FAILURE_PROTOCOL_VIOLATION 1696 SCI_FAILURE_PROTOCOL_VIOLATION
1697 ); 1697 );
@@ -1699,18 +1699,18 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_d2h_frame_handler(
1699 } 1699 }
1700 1700
1701 sci_base_state_machine_change_state( 1701 sci_base_state_machine_change_state(
1702 &this_request->parent.state_machine, 1702 &sci_req->parent.state_machine,
1703 SCI_BASE_REQUEST_STATE_COMPLETED); 1703 SCI_BASE_REQUEST_STATE_COMPLETED);
1704 1704
1705 /* Frame has been decoded return it to the controller */ 1705 /* Frame has been decoded return it to the controller */
1706 scic_sds_controller_release_frame( 1706 scic_sds_controller_release_frame(
1707 this_request->parent.owning_controller, frame_index 1707 sci_req->parent.owning_controller, frame_index
1708 ); 1708 );
1709 } else 1709 } else
1710 dev_err(scic_to_dev(request->owning_controller), 1710 dev_err(scic_to_dev(request->owning_controller),
1711 "%s: SCIC IO Request 0x%p could not get frame header " 1711 "%s: SCIC IO Request 0x%p could not get frame header "
1712 "for frame index %d, status %x\n", 1712 "for frame index %d, status %x\n",
1713 __func__, this_request, frame_index, status); 1713 __func__, sci_req, frame_index, status);
1714 1714
1715 return status; 1715 return status;
1716} 1716}
@@ -1735,40 +1735,40 @@ static const struct scic_sds_io_request_state_handler scic_sds_stp_request_start
1735static void scic_sds_stp_request_started_soft_reset_await_h2d_asserted_completion_enter( 1735static void scic_sds_stp_request_started_soft_reset_await_h2d_asserted_completion_enter(
1736 struct sci_base_object *object) 1736 struct sci_base_object *object)
1737{ 1737{
1738 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1738 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1739 1739
1740 SET_STATE_HANDLER( 1740 SET_STATE_HANDLER(
1741 this_request, 1741 sci_req,
1742 scic_sds_stp_request_started_soft_reset_substate_handler_table, 1742 scic_sds_stp_request_started_soft_reset_substate_handler_table,
1743 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_ASSERTED_COMPLETION_SUBSTATE 1743 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_ASSERTED_COMPLETION_SUBSTATE
1744 ); 1744 );
1745 1745
1746 scic_sds_remote_device_set_working_request( 1746 scic_sds_remote_device_set_working_request(
1747 this_request->target_device, this_request 1747 sci_req->target_device, sci_req
1748 ); 1748 );
1749} 1749}
1750 1750
1751static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter( 1751static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_completion_enter(
1752 struct sci_base_object *object) 1752 struct sci_base_object *object)
1753{ 1753{
1754 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1754 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1755 struct scu_task_context *task_context; 1755 struct scu_task_context *task_context;
1756 struct sata_fis_reg_h2d *h2d_fis; 1756 struct sata_fis_reg_h2d *h2d_fis;
1757 enum sci_status status; 1757 enum sci_status status;
1758 1758
1759 /* Clear the SRST bit */ 1759 /* Clear the SRST bit */
1760 h2d_fis = scic_stp_io_request_get_h2d_reg_address(this_request); 1760 h2d_fis = scic_stp_io_request_get_h2d_reg_address(sci_req);
1761 h2d_fis->control = 0; 1761 h2d_fis->control = 0;
1762 1762
1763 /* Clear the TC control bit */ 1763 /* Clear the TC control bit */
1764 task_context = scic_sds_controller_get_task_context_buffer( 1764 task_context = scic_sds_controller_get_task_context_buffer(
1765 this_request->owning_controller, this_request->io_tag); 1765 sci_req->owning_controller, sci_req->io_tag);
1766 task_context->control_frame = 0; 1766 task_context->control_frame = 0;
1767 1767
1768 status = scic_controller_continue_io(this_request); 1768 status = scic_controller_continue_io(sci_req);
1769 if (status == SCI_SUCCESS) { 1769 if (status == SCI_SUCCESS) {
1770 SET_STATE_HANDLER( 1770 SET_STATE_HANDLER(
1771 this_request, 1771 sci_req,
1772 scic_sds_stp_request_started_soft_reset_substate_handler_table, 1772 scic_sds_stp_request_started_soft_reset_substate_handler_table,
1773 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_DIAGNOSTIC_COMPLETION_SUBSTATE 1773 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_DIAGNOSTIC_COMPLETION_SUBSTATE
1774 ); 1774 );
@@ -1778,10 +1778,10 @@ static void scic_sds_stp_request_started_soft_reset_await_h2d_diagnostic_complet
1778static void scic_sds_stp_request_started_soft_reset_await_d2h_response_enter( 1778static void scic_sds_stp_request_started_soft_reset_await_d2h_response_enter(
1779 struct sci_base_object *object) 1779 struct sci_base_object *object)
1780{ 1780{
1781 struct scic_sds_request *this_request = (struct scic_sds_request *)object; 1781 struct scic_sds_request *sci_req = (struct scic_sds_request *)object;
1782 1782
1783 SET_STATE_HANDLER( 1783 SET_STATE_HANDLER(
1784 this_request, 1784 sci_req,
1785 scic_sds_stp_request_started_soft_reset_substate_handler_table, 1785 scic_sds_stp_request_started_soft_reset_substate_handler_table,
1786 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_D2H_RESPONSE_FRAME_SUBSTATE 1786 SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_D2H_RESPONSE_FRAME_SUBSTATE
1787 ); 1787 );
diff --git a/drivers/scsi/isci/core/scic_sds_stp_request.h b/drivers/scsi/isci/core/scic_sds_stp_request.h
index a6c02d3cba50..6724c1d759df 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_request.h
+++ b/drivers/scsi/isci/core/scic_sds_stp_request.h
@@ -177,18 +177,18 @@ enum sci_status scic_sds_stp_pio_request_construct(
177 bool copy_rx_frame); 177 bool copy_rx_frame);
178 178
179enum sci_status scic_sds_stp_udma_request_construct( 179enum sci_status scic_sds_stp_udma_request_construct(
180 struct scic_sds_request *this_request, 180 struct scic_sds_request *sci_req,
181 u32 transfer_length, 181 u32 transfer_length,
182 enum dma_data_direction dir); 182 enum dma_data_direction dir);
183 183
184enum sci_status scic_sds_stp_non_data_request_construct( 184enum sci_status scic_sds_stp_non_data_request_construct(
185 struct scic_sds_request *this_request); 185 struct scic_sds_request *sci_req);
186 186
187enum sci_status scic_sds_stp_soft_reset_request_construct( 187enum sci_status scic_sds_stp_soft_reset_request_construct(
188 struct scic_sds_request *this_request); 188 struct scic_sds_request *sci_req);
189 189
190enum sci_status scic_sds_stp_ncq_request_construct( 190enum sci_status scic_sds_stp_ncq_request_construct(
191 struct scic_sds_request *this_request, 191 struct scic_sds_request *sci_req,
192 u32 transfer_length, 192 u32 transfer_length,
193 enum dma_data_direction dir); 193 enum dma_data_direction dir);
194 194