diff options
Diffstat (limited to 'drivers/scsi/isci/remote_node_context.c')
-rw-r--r-- | drivers/scsi/isci/remote_node_context.c | 198 |
1 files changed, 90 insertions, 108 deletions
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c index 8a5203b6eb09..c2dfd5a72181 100644 --- a/drivers/scsi/isci/remote_node_context.c +++ b/drivers/scsi/isci/remote_node_context.c | |||
@@ -81,8 +81,8 @@ | |||
81 | * otherwise it will return false bool true if the remote node context is in | 81 | * otherwise it will return false bool true if the remote node context is in |
82 | * the ready state. false if the remote node context is not in the ready state. | 82 | * the ready state. false if the remote node context is not in the ready state. |
83 | */ | 83 | */ |
84 | bool scic_sds_remote_node_context_is_ready( | 84 | bool sci_remote_node_context_is_ready( |
85 | struct scic_sds_remote_node_context *sci_rnc) | 85 | struct sci_remote_node_context *sci_rnc) |
86 | { | 86 | { |
87 | u32 current_state = sci_rnc->sm.current_state_id; | 87 | u32 current_state = sci_rnc->sm.current_state_id; |
88 | 88 | ||
@@ -93,15 +93,16 @@ bool scic_sds_remote_node_context_is_ready( | |||
93 | return false; | 93 | return false; |
94 | } | 94 | } |
95 | 95 | ||
96 | /** | 96 | static union scu_remote_node_context *sci_rnc_by_id(struct isci_host *ihost, u16 id) |
97 | * | 97 | { |
98 | * @sci_dev: The remote device to use to construct the RNC buffer. | 98 | if (id < ihost->remote_node_entries && |
99 | * @rnc: The buffer into which the remote device data will be copied. | 99 | ihost->device_table[id]) |
100 | * | 100 | return &ihost->remote_node_context_table[id]; |
101 | * This method will construct the RNC buffer for this remote device object. none | 101 | |
102 | */ | 102 | return NULL; |
103 | static void scic_sds_remote_node_context_construct_buffer( | 103 | } |
104 | struct scic_sds_remote_node_context *sci_rnc) | 104 | |
105 | static void sci_remote_node_context_construct_buffer(struct sci_remote_node_context *sci_rnc) | ||
105 | { | 106 | { |
106 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); | 107 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); |
107 | struct domain_device *dev = idev->domain_dev; | 108 | struct domain_device *dev = idev->domain_dev; |
@@ -110,11 +111,11 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
110 | struct isci_host *ihost; | 111 | struct isci_host *ihost; |
111 | __le64 sas_addr; | 112 | __le64 sas_addr; |
112 | 113 | ||
113 | ihost = scic_sds_remote_device_get_controller(idev); | 114 | ihost = sci_remote_device_get_controller(idev); |
114 | rnc = scic_sds_controller_get_remote_node_context_buffer(ihost, rni); | 115 | rnc = sci_rnc_by_id(ihost, rni); |
115 | 116 | ||
116 | memset(rnc, 0, sizeof(union scu_remote_node_context) | 117 | memset(rnc, 0, sizeof(union scu_remote_node_context) |
117 | * scic_sds_remote_device_node_count(idev)); | 118 | * sci_remote_device_node_count(idev)); |
118 | 119 | ||
119 | rnc->ssp.remote_node_index = rni; | 120 | rnc->ssp.remote_node_index = rni; |
120 | rnc->ssp.remote_node_port_width = idev->device_port_width; | 121 | rnc->ssp.remote_node_port_width = idev->device_port_width; |
@@ -135,14 +136,14 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
135 | 136 | ||
136 | if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { | 137 | if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { |
137 | rnc->ssp.connection_occupancy_timeout = | 138 | rnc->ssp.connection_occupancy_timeout = |
138 | ihost->user_parameters.sds1.stp_max_occupancy_timeout; | 139 | ihost->user_parameters.stp_max_occupancy_timeout; |
139 | rnc->ssp.connection_inactivity_timeout = | 140 | rnc->ssp.connection_inactivity_timeout = |
140 | ihost->user_parameters.sds1.stp_inactivity_timeout; | 141 | ihost->user_parameters.stp_inactivity_timeout; |
141 | } else { | 142 | } else { |
142 | rnc->ssp.connection_occupancy_timeout = | 143 | rnc->ssp.connection_occupancy_timeout = |
143 | ihost->user_parameters.sds1.ssp_max_occupancy_timeout; | 144 | ihost->user_parameters.ssp_max_occupancy_timeout; |
144 | rnc->ssp.connection_inactivity_timeout = | 145 | rnc->ssp.connection_inactivity_timeout = |
145 | ihost->user_parameters.sds1.ssp_inactivity_timeout; | 146 | ihost->user_parameters.ssp_inactivity_timeout; |
146 | } | 147 | } |
147 | 148 | ||
148 | rnc->ssp.initial_arbitration_wait_time = 0; | 149 | rnc->ssp.initial_arbitration_wait_time = 0; |
@@ -164,8 +165,8 @@ static void scic_sds_remote_node_context_construct_buffer( | |||
164 | * to its ready state. If the remote node context is already setup to | 165 | * to its ready state. If the remote node context is already setup to |
165 | * transition to its final state then this function does nothing. none | 166 | * transition to its final state then this function does nothing. none |
166 | */ | 167 | */ |
167 | static void scic_sds_remote_node_context_setup_to_resume( | 168 | static void sci_remote_node_context_setup_to_resume( |
168 | struct scic_sds_remote_node_context *sci_rnc, | 169 | struct sci_remote_node_context *sci_rnc, |
169 | scics_sds_remote_node_context_callback callback, | 170 | scics_sds_remote_node_context_callback callback, |
170 | void *callback_parameter) | 171 | void *callback_parameter) |
171 | { | 172 | { |
@@ -176,8 +177,8 @@ static void scic_sds_remote_node_context_setup_to_resume( | |||
176 | } | 177 | } |
177 | } | 178 | } |
178 | 179 | ||
179 | static void scic_sds_remote_node_context_setup_to_destory( | 180 | static void sci_remote_node_context_setup_to_destory( |
180 | struct scic_sds_remote_node_context *sci_rnc, | 181 | struct sci_remote_node_context *sci_rnc, |
181 | scics_sds_remote_node_context_callback callback, | 182 | scics_sds_remote_node_context_callback callback, |
182 | void *callback_parameter) | 183 | void *callback_parameter) |
183 | { | 184 | { |
@@ -192,8 +193,8 @@ static void scic_sds_remote_node_context_setup_to_destory( | |||
192 | * This method just calls the user callback function and then resets the | 193 | * This method just calls the user callback function and then resets the |
193 | * callback. | 194 | * callback. |
194 | */ | 195 | */ |
195 | static void scic_sds_remote_node_context_notify_user( | 196 | static void sci_remote_node_context_notify_user( |
196 | struct scic_sds_remote_node_context *rnc) | 197 | struct sci_remote_node_context *rnc) |
197 | { | 198 | { |
198 | if (rnc->user_callback != NULL) { | 199 | if (rnc->user_callback != NULL) { |
199 | (*rnc->user_callback)(rnc->user_cookie); | 200 | (*rnc->user_callback)(rnc->user_cookie); |
@@ -203,99 +204,80 @@ static void scic_sds_remote_node_context_notify_user( | |||
203 | } | 204 | } |
204 | } | 205 | } |
205 | 206 | ||
206 | static void scic_sds_remote_node_context_continue_state_transitions(struct scic_sds_remote_node_context *rnc) | 207 | static void sci_remote_node_context_continue_state_transitions(struct sci_remote_node_context *rnc) |
207 | { | 208 | { |
208 | if (rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) | 209 | if (rnc->destination_state == SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_READY) |
209 | scic_sds_remote_node_context_resume(rnc, rnc->user_callback, | 210 | sci_remote_node_context_resume(rnc, rnc->user_callback, |
210 | rnc->user_cookie); | 211 | rnc->user_cookie); |
211 | } | 212 | } |
212 | 213 | ||
213 | /** | 214 | static void sci_remote_node_context_validate_context_buffer(struct sci_remote_node_context *sci_rnc) |
214 | * | ||
215 | * @sci_rnc: The remote node context object that is to be validated. | ||
216 | * | ||
217 | * This method will mark the rnc buffer as being valid and post the request to | ||
218 | * the hardware. none | ||
219 | */ | ||
220 | static void scic_sds_remote_node_context_validate_context_buffer( | ||
221 | struct scic_sds_remote_node_context *sci_rnc) | ||
222 | { | 215 | { |
216 | union scu_remote_node_context *rnc_buffer; | ||
223 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); | 217 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); |
224 | struct domain_device *dev = idev->domain_dev; | 218 | struct domain_device *dev = idev->domain_dev; |
225 | union scu_remote_node_context *rnc_buffer; | 219 | struct isci_host *ihost = idev->owning_port->owning_controller; |
226 | 220 | ||
227 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( | 221 | rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); |
228 | scic_sds_remote_device_get_controller(idev), | ||
229 | sci_rnc->remote_node_index | ||
230 | ); | ||
231 | 222 | ||
232 | rnc_buffer->ssp.is_valid = true; | 223 | rnc_buffer->ssp.is_valid = true; |
233 | 224 | ||
234 | if (!idev->is_direct_attached && | 225 | if (!idev->is_direct_attached && |
235 | (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP))) { | 226 | (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP))) { |
236 | scic_sds_remote_device_post_request(idev, | 227 | sci_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_96); |
237 | SCU_CONTEXT_COMMAND_POST_RNC_96); | ||
238 | } else { | 228 | } else { |
239 | scic_sds_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_32); | 229 | sci_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_32); |
240 | 230 | ||
241 | if (idev->is_direct_attached) { | 231 | if (idev->is_direct_attached) |
242 | scic_sds_port_setup_transports(idev->owning_port, | 232 | sci_port_setup_transports(idev->owning_port, |
243 | sci_rnc->remote_node_index); | 233 | sci_rnc->remote_node_index); |
244 | } | ||
245 | } | 234 | } |
246 | } | 235 | } |
247 | 236 | ||
248 | /** | 237 | static void sci_remote_node_context_invalidate_context_buffer(struct sci_remote_node_context *sci_rnc) |
249 | * | ||
250 | * @sci_rnc: The remote node context object that is to be invalidated. | ||
251 | * | ||
252 | * This method will update the RNC buffer and post the invalidate request. none | ||
253 | */ | ||
254 | static void scic_sds_remote_node_context_invalidate_context_buffer( | ||
255 | struct scic_sds_remote_node_context *sci_rnc) | ||
256 | { | 238 | { |
257 | union scu_remote_node_context *rnc_buffer; | 239 | union scu_remote_node_context *rnc_buffer; |
240 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); | ||
241 | struct isci_host *ihost = idev->owning_port->owning_controller; | ||
258 | 242 | ||
259 | rnc_buffer = scic_sds_controller_get_remote_node_context_buffer( | 243 | rnc_buffer = sci_rnc_by_id(ihost, sci_rnc->remote_node_index); |
260 | scic_sds_remote_device_get_controller(rnc_to_dev(sci_rnc)), | ||
261 | sci_rnc->remote_node_index); | ||
262 | 244 | ||
263 | rnc_buffer->ssp.is_valid = false; | 245 | rnc_buffer->ssp.is_valid = false; |
264 | 246 | ||
265 | scic_sds_remote_device_post_request(rnc_to_dev(sci_rnc), | 247 | sci_remote_device_post_request(rnc_to_dev(sci_rnc), |
266 | SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE); | 248 | SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE); |
267 | } | 249 | } |
268 | 250 | ||
269 | static void scic_sds_remote_node_context_initial_state_enter(struct sci_base_state_machine *sm) | 251 | static void sci_remote_node_context_initial_state_enter(struct sci_base_state_machine *sm) |
270 | { | 252 | { |
271 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 253 | struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
272 | 254 | ||
273 | /* Check to see if we have gotten back to the initial state because | 255 | /* Check to see if we have gotten back to the initial state because |
274 | * someone requested to destroy the remote node context object. | 256 | * someone requested to destroy the remote node context object. |
275 | */ | 257 | */ |
276 | if (sm->previous_state_id == SCI_RNC_INVALIDATING) { | 258 | if (sm->previous_state_id == SCI_RNC_INVALIDATING) { |
277 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; | 259 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; |
278 | scic_sds_remote_node_context_notify_user(rnc); | 260 | sci_remote_node_context_notify_user(rnc); |
279 | } | 261 | } |
280 | } | 262 | } |
281 | 263 | ||
282 | static void scic_sds_remote_node_context_posting_state_enter(struct sci_base_state_machine *sm) | 264 | static void sci_remote_node_context_posting_state_enter(struct sci_base_state_machine *sm) |
283 | { | 265 | { |
284 | struct scic_sds_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); | 266 | struct sci_remote_node_context *sci_rnc = container_of(sm, typeof(*sci_rnc), sm); |
285 | 267 | ||
286 | scic_sds_remote_node_context_validate_context_buffer(sci_rnc); | 268 | sci_remote_node_context_validate_context_buffer(sci_rnc); |
287 | } | 269 | } |
288 | 270 | ||
289 | static void scic_sds_remote_node_context_invalidating_state_enter(struct sci_base_state_machine *sm) | 271 | static void sci_remote_node_context_invalidating_state_enter(struct sci_base_state_machine *sm) |
290 | { | 272 | { |
291 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 273 | struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
292 | 274 | ||
293 | scic_sds_remote_node_context_invalidate_context_buffer(rnc); | 275 | sci_remote_node_context_invalidate_context_buffer(rnc); |
294 | } | 276 | } |
295 | 277 | ||
296 | static void scic_sds_remote_node_context_resuming_state_enter(struct sci_base_state_machine *sm) | 278 | static void sci_remote_node_context_resuming_state_enter(struct sci_base_state_machine *sm) |
297 | { | 279 | { |
298 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 280 | struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
299 | struct isci_remote_device *idev; | 281 | struct isci_remote_device *idev; |
300 | struct domain_device *dev; | 282 | struct domain_device *dev; |
301 | 283 | ||
@@ -310,73 +292,73 @@ static void scic_sds_remote_node_context_resuming_state_enter(struct sci_base_st | |||
310 | */ | 292 | */ |
311 | if ((dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) && | 293 | if ((dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) && |
312 | idev->is_direct_attached) | 294 | idev->is_direct_attached) |
313 | scic_sds_port_setup_transports(idev->owning_port, | 295 | sci_port_setup_transports(idev->owning_port, |
314 | rnc->remote_node_index); | 296 | rnc->remote_node_index); |
315 | 297 | ||
316 | scic_sds_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); | 298 | sci_remote_device_post_request(idev, SCU_CONTEXT_COMMAND_POST_RNC_RESUME); |
317 | } | 299 | } |
318 | 300 | ||
319 | static void scic_sds_remote_node_context_ready_state_enter(struct sci_base_state_machine *sm) | 301 | static void sci_remote_node_context_ready_state_enter(struct sci_base_state_machine *sm) |
320 | { | 302 | { |
321 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 303 | struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
322 | 304 | ||
323 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; | 305 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; |
324 | 306 | ||
325 | if (rnc->user_callback) | 307 | if (rnc->user_callback) |
326 | scic_sds_remote_node_context_notify_user(rnc); | 308 | sci_remote_node_context_notify_user(rnc); |
327 | } | 309 | } |
328 | 310 | ||
329 | static void scic_sds_remote_node_context_tx_suspended_state_enter(struct sci_base_state_machine *sm) | 311 | static void sci_remote_node_context_tx_suspended_state_enter(struct sci_base_state_machine *sm) |
330 | { | 312 | { |
331 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 313 | struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
332 | 314 | ||
333 | scic_sds_remote_node_context_continue_state_transitions(rnc); | 315 | sci_remote_node_context_continue_state_transitions(rnc); |
334 | } | 316 | } |
335 | 317 | ||
336 | static void scic_sds_remote_node_context_tx_rx_suspended_state_enter(struct sci_base_state_machine *sm) | 318 | static void sci_remote_node_context_tx_rx_suspended_state_enter(struct sci_base_state_machine *sm) |
337 | { | 319 | { |
338 | struct scic_sds_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); | 320 | struct sci_remote_node_context *rnc = container_of(sm, typeof(*rnc), sm); |
339 | 321 | ||
340 | scic_sds_remote_node_context_continue_state_transitions(rnc); | 322 | sci_remote_node_context_continue_state_transitions(rnc); |
341 | } | 323 | } |
342 | 324 | ||
343 | static const struct sci_base_state scic_sds_remote_node_context_state_table[] = { | 325 | static const struct sci_base_state sci_remote_node_context_state_table[] = { |
344 | [SCI_RNC_INITIAL] = { | 326 | [SCI_RNC_INITIAL] = { |
345 | .enter_state = scic_sds_remote_node_context_initial_state_enter, | 327 | .enter_state = sci_remote_node_context_initial_state_enter, |
346 | }, | 328 | }, |
347 | [SCI_RNC_POSTING] = { | 329 | [SCI_RNC_POSTING] = { |
348 | .enter_state = scic_sds_remote_node_context_posting_state_enter, | 330 | .enter_state = sci_remote_node_context_posting_state_enter, |
349 | }, | 331 | }, |
350 | [SCI_RNC_INVALIDATING] = { | 332 | [SCI_RNC_INVALIDATING] = { |
351 | .enter_state = scic_sds_remote_node_context_invalidating_state_enter, | 333 | .enter_state = sci_remote_node_context_invalidating_state_enter, |
352 | }, | 334 | }, |
353 | [SCI_RNC_RESUMING] = { | 335 | [SCI_RNC_RESUMING] = { |
354 | .enter_state = scic_sds_remote_node_context_resuming_state_enter, | 336 | .enter_state = sci_remote_node_context_resuming_state_enter, |
355 | }, | 337 | }, |
356 | [SCI_RNC_READY] = { | 338 | [SCI_RNC_READY] = { |
357 | .enter_state = scic_sds_remote_node_context_ready_state_enter, | 339 | .enter_state = sci_remote_node_context_ready_state_enter, |
358 | }, | 340 | }, |
359 | [SCI_RNC_TX_SUSPENDED] = { | 341 | [SCI_RNC_TX_SUSPENDED] = { |
360 | .enter_state = scic_sds_remote_node_context_tx_suspended_state_enter, | 342 | .enter_state = sci_remote_node_context_tx_suspended_state_enter, |
361 | }, | 343 | }, |
362 | [SCI_RNC_TX_RX_SUSPENDED] = { | 344 | [SCI_RNC_TX_RX_SUSPENDED] = { |
363 | .enter_state = scic_sds_remote_node_context_tx_rx_suspended_state_enter, | 345 | .enter_state = sci_remote_node_context_tx_rx_suspended_state_enter, |
364 | }, | 346 | }, |
365 | [SCI_RNC_AWAIT_SUSPENSION] = { }, | 347 | [SCI_RNC_AWAIT_SUSPENSION] = { }, |
366 | }; | 348 | }; |
367 | 349 | ||
368 | void scic_sds_remote_node_context_construct(struct scic_sds_remote_node_context *rnc, | 350 | void sci_remote_node_context_construct(struct sci_remote_node_context *rnc, |
369 | u16 remote_node_index) | 351 | u16 remote_node_index) |
370 | { | 352 | { |
371 | memset(rnc, 0, sizeof(struct scic_sds_remote_node_context)); | 353 | memset(rnc, 0, sizeof(struct sci_remote_node_context)); |
372 | 354 | ||
373 | rnc->remote_node_index = remote_node_index; | 355 | rnc->remote_node_index = remote_node_index; |
374 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; | 356 | rnc->destination_state = SCIC_SDS_REMOTE_NODE_DESTINATION_STATE_UNSPECIFIED; |
375 | 357 | ||
376 | sci_init_sm(&rnc->sm, scic_sds_remote_node_context_state_table, SCI_RNC_INITIAL); | 358 | sci_init_sm(&rnc->sm, sci_remote_node_context_state_table, SCI_RNC_INITIAL); |
377 | } | 359 | } |
378 | 360 | ||
379 | enum sci_status scic_sds_remote_node_context_event_handler(struct scic_sds_remote_node_context *sci_rnc, | 361 | enum sci_status sci_remote_node_context_event_handler(struct sci_remote_node_context *sci_rnc, |
380 | u32 event_code) | 362 | u32 event_code) |
381 | { | 363 | { |
382 | enum scis_sds_remote_node_context_states state; | 364 | enum scis_sds_remote_node_context_states state; |
@@ -476,7 +458,7 @@ enum sci_status scic_sds_remote_node_context_event_handler(struct scic_sds_remot | |||
476 | 458 | ||
477 | } | 459 | } |
478 | 460 | ||
479 | enum sci_status scic_sds_remote_node_context_destruct(struct scic_sds_remote_node_context *sci_rnc, | 461 | enum sci_status sci_remote_node_context_destruct(struct sci_remote_node_context *sci_rnc, |
480 | scics_sds_remote_node_context_callback cb_fn, | 462 | scics_sds_remote_node_context_callback cb_fn, |
481 | void *cb_p) | 463 | void *cb_p) |
482 | { | 464 | { |
@@ -485,7 +467,7 @@ enum sci_status scic_sds_remote_node_context_destruct(struct scic_sds_remote_nod | |||
485 | state = sci_rnc->sm.current_state_id; | 467 | state = sci_rnc->sm.current_state_id; |
486 | switch (state) { | 468 | switch (state) { |
487 | case SCI_RNC_INVALIDATING: | 469 | case SCI_RNC_INVALIDATING: |
488 | scic_sds_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); | 470 | sci_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); |
489 | return SCI_SUCCESS; | 471 | return SCI_SUCCESS; |
490 | case SCI_RNC_POSTING: | 472 | case SCI_RNC_POSTING: |
491 | case SCI_RNC_RESUMING: | 473 | case SCI_RNC_RESUMING: |
@@ -493,7 +475,7 @@ enum sci_status scic_sds_remote_node_context_destruct(struct scic_sds_remote_nod | |||
493 | case SCI_RNC_TX_SUSPENDED: | 475 | case SCI_RNC_TX_SUSPENDED: |
494 | case SCI_RNC_TX_RX_SUSPENDED: | 476 | case SCI_RNC_TX_RX_SUSPENDED: |
495 | case SCI_RNC_AWAIT_SUSPENSION: | 477 | case SCI_RNC_AWAIT_SUSPENSION: |
496 | scic_sds_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); | 478 | sci_remote_node_context_setup_to_destory(sci_rnc, cb_fn, cb_p); |
497 | sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); | 479 | sci_change_state(&sci_rnc->sm, SCI_RNC_INVALIDATING); |
498 | return SCI_SUCCESS; | 480 | return SCI_SUCCESS; |
499 | case SCI_RNC_INITIAL: | 481 | case SCI_RNC_INITIAL: |
@@ -511,7 +493,7 @@ enum sci_status scic_sds_remote_node_context_destruct(struct scic_sds_remote_nod | |||
511 | } | 493 | } |
512 | } | 494 | } |
513 | 495 | ||
514 | enum sci_status scic_sds_remote_node_context_suspend(struct scic_sds_remote_node_context *sci_rnc, | 496 | enum sci_status sci_remote_node_context_suspend(struct sci_remote_node_context *sci_rnc, |
515 | u32 suspend_type, | 497 | u32 suspend_type, |
516 | scics_sds_remote_node_context_callback cb_fn, | 498 | scics_sds_remote_node_context_callback cb_fn, |
517 | void *cb_p) | 499 | void *cb_p) |
@@ -530,7 +512,7 @@ enum sci_status scic_sds_remote_node_context_suspend(struct scic_sds_remote_node | |||
530 | sci_rnc->suspension_code = suspend_type; | 512 | sci_rnc->suspension_code = suspend_type; |
531 | 513 | ||
532 | if (suspend_type == SCI_SOFTWARE_SUSPENSION) { | 514 | if (suspend_type == SCI_SOFTWARE_SUSPENSION) { |
533 | scic_sds_remote_device_post_request(rnc_to_dev(sci_rnc), | 515 | sci_remote_device_post_request(rnc_to_dev(sci_rnc), |
534 | SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX); | 516 | SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX); |
535 | } | 517 | } |
536 | 518 | ||
@@ -538,7 +520,7 @@ enum sci_status scic_sds_remote_node_context_suspend(struct scic_sds_remote_node | |||
538 | return SCI_SUCCESS; | 520 | return SCI_SUCCESS; |
539 | } | 521 | } |
540 | 522 | ||
541 | enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_context *sci_rnc, | 523 | enum sci_status sci_remote_node_context_resume(struct sci_remote_node_context *sci_rnc, |
542 | scics_sds_remote_node_context_callback cb_fn, | 524 | scics_sds_remote_node_context_callback cb_fn, |
543 | void *cb_p) | 525 | void *cb_p) |
544 | { | 526 | { |
@@ -550,8 +532,8 @@ enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_ | |||
550 | if (sci_rnc->remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) | 532 | if (sci_rnc->remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) |
551 | return SCI_FAILURE_INVALID_STATE; | 533 | return SCI_FAILURE_INVALID_STATE; |
552 | 534 | ||
553 | scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); | 535 | sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); |
554 | scic_sds_remote_node_context_construct_buffer(sci_rnc); | 536 | sci_remote_node_context_construct_buffer(sci_rnc); |
555 | sci_change_state(&sci_rnc->sm, SCI_RNC_POSTING); | 537 | sci_change_state(&sci_rnc->sm, SCI_RNC_POSTING); |
556 | return SCI_SUCCESS; | 538 | return SCI_SUCCESS; |
557 | case SCI_RNC_POSTING: | 539 | case SCI_RNC_POSTING: |
@@ -567,7 +549,7 @@ enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_ | |||
567 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); | 549 | struct isci_remote_device *idev = rnc_to_dev(sci_rnc); |
568 | struct domain_device *dev = idev->domain_dev; | 550 | struct domain_device *dev = idev->domain_dev; |
569 | 551 | ||
570 | scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); | 552 | sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); |
571 | 553 | ||
572 | /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */ | 554 | /* TODO: consider adding a resume action of NONE, INVALIDATE, WRITE_TLCR */ |
573 | if (dev->dev_type == SAS_END_DEV || dev_is_expander(dev)) | 555 | if (dev->dev_type == SAS_END_DEV || dev_is_expander(dev)) |
@@ -584,11 +566,11 @@ enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_ | |||
584 | return SCI_SUCCESS; | 566 | return SCI_SUCCESS; |
585 | } | 567 | } |
586 | case SCI_RNC_TX_RX_SUSPENDED: | 568 | case SCI_RNC_TX_RX_SUSPENDED: |
587 | scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); | 569 | sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); |
588 | sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); | 570 | sci_change_state(&sci_rnc->sm, SCI_RNC_RESUMING); |
589 | return SCI_FAILURE_INVALID_STATE; | 571 | return SCI_FAILURE_INVALID_STATE; |
590 | case SCI_RNC_AWAIT_SUSPENSION: | 572 | case SCI_RNC_AWAIT_SUSPENSION: |
591 | scic_sds_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); | 573 | sci_remote_node_context_setup_to_resume(sci_rnc, cb_fn, cb_p); |
592 | return SCI_SUCCESS; | 574 | return SCI_SUCCESS; |
593 | default: | 575 | default: |
594 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), | 576 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |
@@ -597,7 +579,7 @@ enum sci_status scic_sds_remote_node_context_resume(struct scic_sds_remote_node_ | |||
597 | } | 579 | } |
598 | } | 580 | } |
599 | 581 | ||
600 | enum sci_status scic_sds_remote_node_context_start_io(struct scic_sds_remote_node_context *sci_rnc, | 582 | enum sci_status sci_remote_node_context_start_io(struct sci_remote_node_context *sci_rnc, |
601 | struct isci_request *ireq) | 583 | struct isci_request *ireq) |
602 | { | 584 | { |
603 | enum scis_sds_remote_node_context_states state; | 585 | enum scis_sds_remote_node_context_states state; |
@@ -622,7 +604,7 @@ enum sci_status scic_sds_remote_node_context_start_io(struct scic_sds_remote_nod | |||
622 | return SCI_FAILURE_INVALID_STATE; | 604 | return SCI_FAILURE_INVALID_STATE; |
623 | } | 605 | } |
624 | 606 | ||
625 | enum sci_status scic_sds_remote_node_context_start_task(struct scic_sds_remote_node_context *sci_rnc, | 607 | enum sci_status sci_remote_node_context_start_task(struct sci_remote_node_context *sci_rnc, |
626 | struct isci_request *ireq) | 608 | struct isci_request *ireq) |
627 | { | 609 | { |
628 | enum scis_sds_remote_node_context_states state; | 610 | enum scis_sds_remote_node_context_states state; |
@@ -635,7 +617,7 @@ enum sci_status scic_sds_remote_node_context_start_task(struct scic_sds_remote_n | |||
635 | return SCI_SUCCESS; | 617 | return SCI_SUCCESS; |
636 | case SCI_RNC_TX_SUSPENDED: | 618 | case SCI_RNC_TX_SUSPENDED: |
637 | case SCI_RNC_TX_RX_SUSPENDED: | 619 | case SCI_RNC_TX_RX_SUSPENDED: |
638 | scic_sds_remote_node_context_resume(sci_rnc, NULL, NULL); | 620 | sci_remote_node_context_resume(sci_rnc, NULL, NULL); |
639 | return SCI_SUCCESS; | 621 | return SCI_SUCCESS; |
640 | default: | 622 | default: |
641 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), | 623 | dev_warn(scirdev_to_dev(rnc_to_dev(sci_rnc)), |