diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-05-01 17:57:11 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:04:45 -0400 |
commit | 1860655706ee5a7e3f3adeebd4927fed98860462 (patch) | |
tree | 57e35266b23a841b2a586f545c8c1ebc41561472 | |
parent | 815151826553f875846ebba9696777a424ee62e5 (diff) |
isci: unify remote_device start_io_handlers
Implement all states in scic_sds_remote_device_start_io() and delete the
state handler.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 334 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_device.h | 6 |
2 files changed, 125 insertions, 215 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index 658781dd65e6..f4ba5be00c03 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c | |||
@@ -305,22 +305,132 @@ enum sci_status scic_sds_remote_device_event_handler( | |||
305 | return sci_dev->state_handlers->event_handler(sci_dev, event_code); | 305 | return sci_dev->state_handlers->event_handler(sci_dev, event_code); |
306 | } | 306 | } |
307 | 307 | ||
308 | /** | 308 | static void scic_sds_remote_device_start_request(struct scic_sds_remote_device *sci_dev, |
309 | * | 309 | struct scic_sds_request *sci_req, |
310 | * @controller: The controller that is starting the io request. | 310 | enum sci_status status) |
311 | * @sci_dev: The remote device for which the start io handling is being | ||
312 | * requested. | ||
313 | * @io_request: The io request that is being started. | ||
314 | * | ||
315 | * This method invokes the remote device start io handler. enum sci_status | ||
316 | */ | ||
317 | enum sci_status scic_sds_remote_device_start_io( | ||
318 | struct scic_sds_controller *controller, | ||
319 | struct scic_sds_remote_device *sci_dev, | ||
320 | struct scic_sds_request *io_request) | ||
321 | { | 311 | { |
322 | return sci_dev->state_handlers->start_io_handler( | 312 | struct scic_sds_port *sci_port = sci_dev->owning_port; |
323 | sci_dev, io_request); | 313 | |
314 | /* cleanup requests that failed after starting on the port */ | ||
315 | if (status != SCI_SUCCESS) | ||
316 | scic_sds_port_complete_io(sci_port, sci_dev, sci_req); | ||
317 | else | ||
318 | scic_sds_remote_device_increment_request_count(sci_dev); | ||
319 | } | ||
320 | |||
321 | enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic, | ||
322 | struct scic_sds_remote_device *sci_dev, | ||
323 | struct scic_sds_request *sci_req) | ||
324 | { | ||
325 | struct sci_base_state_machine *sm = &sci_dev->state_machine; | ||
326 | enum scic_sds_remote_device_states state = sm->current_state_id; | ||
327 | struct scic_sds_port *sci_port = sci_dev->owning_port; | ||
328 | enum sci_status status; | ||
329 | |||
330 | switch (state) { | ||
331 | case SCI_BASE_REMOTE_DEVICE_STATE_INITIAL: | ||
332 | case SCI_BASE_REMOTE_DEVICE_STATE_STOPPED: | ||
333 | case SCI_BASE_REMOTE_DEVICE_STATE_STARTING: | ||
334 | case SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR: | ||
335 | case SCI_BASE_REMOTE_DEVICE_STATE_STOPPING: | ||
336 | case SCI_BASE_REMOTE_DEVICE_STATE_FAILED: | ||
337 | case SCI_BASE_REMOTE_DEVICE_STATE_RESETTING: | ||
338 | case SCI_BASE_REMOTE_DEVICE_STATE_FINAL: | ||
339 | default: | ||
340 | dev_warn(scirdev_to_dev(sci_dev), "%s: in wrong state: %d\n", | ||
341 | __func__, state); | ||
342 | return SCI_FAILURE_INVALID_STATE; | ||
343 | case SCI_BASE_REMOTE_DEVICE_STATE_READY: | ||
344 | /* attempt to start an io request for this device object. The remote | ||
345 | * device object will issue the start request for the io and if | ||
346 | * successful it will start the request for the port object then | ||
347 | * increment its own request count. | ||
348 | */ | ||
349 | status = scic_sds_port_start_io(sci_port, sci_dev, sci_req); | ||
350 | if (status != SCI_SUCCESS) | ||
351 | return status; | ||
352 | |||
353 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, sci_req); | ||
354 | if (status != SCI_SUCCESS) | ||
355 | break; | ||
356 | |||
357 | status = scic_sds_request_start(sci_req); | ||
358 | break; | ||
359 | case SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE: { | ||
360 | /* handle the start io operation for a sata device that is in | ||
361 | * the command idle state. - Evalute the type of IO request to | ||
362 | * be started - If its an NCQ request change to NCQ substate - | ||
363 | * If its any other command change to the CMD substate | ||
364 | * | ||
365 | * If this is a softreset we may want to have a different | ||
366 | * substate. | ||
367 | */ | ||
368 | enum scic_sds_remote_device_states new_state; | ||
369 | |||
370 | status = scic_sds_port_start_io(sci_port, sci_dev, sci_req); | ||
371 | if (status != SCI_SUCCESS) | ||
372 | return status; | ||
373 | |||
374 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, sci_req); | ||
375 | if (status != SCI_SUCCESS) | ||
376 | break; | ||
377 | |||
378 | status = sci_req->state_handlers->start_handler(sci_req); | ||
379 | if (status != SCI_SUCCESS) | ||
380 | break; | ||
381 | |||
382 | if (isci_sata_get_sat_protocol(sci_req->ireq) == SAT_PROTOCOL_FPDMA) | ||
383 | new_state = SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ; | ||
384 | else { | ||
385 | sci_dev->working_request = sci_req; | ||
386 | new_state = SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD; | ||
387 | } | ||
388 | sci_base_state_machine_change_state(sm, new_state); | ||
389 | break; | ||
390 | } | ||
391 | case SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ: | ||
392 | if (isci_sata_get_sat_protocol(sci_req->ireq) == SAT_PROTOCOL_FPDMA) { | ||
393 | status = scic_sds_port_start_io(sci_port, sci_dev, sci_req); | ||
394 | if (status != SCI_SUCCESS) | ||
395 | return status; | ||
396 | |||
397 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, sci_req); | ||
398 | if (status != SCI_SUCCESS) | ||
399 | break; | ||
400 | |||
401 | status = sci_req->state_handlers->start_handler(sci_req); | ||
402 | } else | ||
403 | return SCI_FAILURE_INVALID_STATE; | ||
404 | break; | ||
405 | case SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET: | ||
406 | return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; | ||
407 | case SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE: | ||
408 | status = scic_sds_port_start_io(sci_port, sci_dev, sci_req); | ||
409 | if (status != SCI_SUCCESS) | ||
410 | return status; | ||
411 | |||
412 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, sci_req); | ||
413 | if (status != SCI_SUCCESS) | ||
414 | break; | ||
415 | |||
416 | status = scic_sds_request_start(sci_req); | ||
417 | if (status != SCI_SUCCESS) | ||
418 | break; | ||
419 | |||
420 | sci_dev->working_request = sci_req; | ||
421 | sci_base_state_machine_change_state(&sci_dev->state_machine, | ||
422 | SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD); | ||
423 | break; | ||
424 | case SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD: | ||
425 | case SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD: | ||
426 | /* device is already handling a command it can not accept new commands | ||
427 | * until this one is complete. | ||
428 | */ | ||
429 | return SCI_FAILURE_INVALID_STATE; | ||
430 | } | ||
431 | |||
432 | scic_sds_remote_device_start_request(sci_dev, sci_req, status); | ||
433 | return status; | ||
324 | } | 434 | } |
325 | 435 | ||
326 | /** | 436 | /** |
@@ -411,32 +521,6 @@ static void remote_device_resume_done(void *_dev) | |||
411 | 521 | ||
412 | /** | 522 | /** |
413 | * | 523 | * |
414 | * @device: This parameter specifies the device for which the request is being | ||
415 | * started. | ||
416 | * @request: This parameter specifies the request being started. | ||
417 | * @status: This parameter specifies the current start operation status. | ||
418 | * | ||
419 | * This method will perform the STP request start processing common to IO | ||
420 | * requests and task requests of all types. none | ||
421 | */ | ||
422 | static void scic_sds_remote_device_start_request( | ||
423 | struct scic_sds_remote_device *sci_dev, | ||
424 | struct scic_sds_request *sci_req, | ||
425 | enum sci_status status) | ||
426 | { | ||
427 | /* We still have a fault in starting the io complete it on the port */ | ||
428 | if (status == SCI_SUCCESS) | ||
429 | scic_sds_remote_device_increment_request_count(sci_dev); | ||
430 | else{ | ||
431 | sci_dev->owning_port->state_handlers->complete_io_handler( | ||
432 | sci_dev->owning_port, sci_dev, sci_req | ||
433 | ); | ||
434 | } | ||
435 | } | ||
436 | |||
437 | |||
438 | /** | ||
439 | * | ||
440 | * @request: This parameter specifies the request being continued. | 524 | * @request: This parameter specifies the request being continued. |
441 | * | 525 | * |
442 | * This method will continue to post tc for a STP request. This method usually | 526 | * This method will continue to post tc for a STP request. This method usually |
@@ -700,35 +784,6 @@ static enum sci_status scic_sds_remote_device_ready_state_start_task_handler( | |||
700 | } | 784 | } |
701 | 785 | ||
702 | /* | 786 | /* |
703 | * This method will attempt to start an io request for this device object. The | ||
704 | * remote device object will issue the start request for the io and if | ||
705 | * successful it will start the request for the port object then increment its | ||
706 | * own requet count. enum sci_status SCI_SUCCESS if the io request is started for | ||
707 | * this device object. SCI_FAILURE_INSUFFICIENT_RESOURCES if the io request | ||
708 | * object could not get the resources to start. | ||
709 | */ | ||
710 | static enum sci_status scic_sds_remote_device_ready_state_start_io_handler( | ||
711 | struct scic_sds_remote_device *sci_dev, | ||
712 | struct scic_sds_request *request) | ||
713 | { | ||
714 | enum sci_status result; | ||
715 | |||
716 | /* See if the port is in a state where we can start the IO request */ | ||
717 | result = scic_sds_port_start_io( | ||
718 | scic_sds_remote_device_get_port(sci_dev), sci_dev, request); | ||
719 | |||
720 | if (result == SCI_SUCCESS) { | ||
721 | result = scic_sds_remote_node_context_start_io(&sci_dev->rnc, request); | ||
722 | if (result == SCI_SUCCESS) | ||
723 | result = scic_sds_request_start(request); | ||
724 | |||
725 | scic_sds_remote_device_start_request(sci_dev, request, result); | ||
726 | } | ||
727 | |||
728 | return result; | ||
729 | } | ||
730 | |||
731 | /* | ||
732 | * This method will complete the request for the remote device object. The | 787 | * This method will complete the request for the remote device object. The |
733 | * method will call the completion handler for the request object and if | 788 | * method will call the completion handler for the request object and if |
734 | * successful it will complete the request on the port object then decrement | 789 | * successful it will complete the request on the port object then decrement |
@@ -920,48 +975,6 @@ out: | |||
920 | return SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS; | 975 | return SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS; |
921 | } | 976 | } |
922 | 977 | ||
923 | /* handle the start io operation for a sata device that is in the command idle | ||
924 | * state. - Evalute the type of IO request to be started - If its an NCQ | ||
925 | * request change to NCQ substate - If its any other command change to the CMD | ||
926 | * substate | ||
927 | * | ||
928 | * If this is a softreset we may want to have a different substate. | ||
929 | */ | ||
930 | static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_start_io_handler( | ||
931 | struct scic_sds_remote_device *sci_dev, | ||
932 | struct scic_sds_request *request) | ||
933 | { | ||
934 | enum sci_status status; | ||
935 | struct isci_request *isci_request = request->ireq; | ||
936 | enum scic_sds_remote_device_states new_state; | ||
937 | |||
938 | /* Will the port allow the io request to start? */ | ||
939 | status = sci_dev->owning_port->state_handlers->start_io_handler( | ||
940 | sci_dev->owning_port, sci_dev, request); | ||
941 | if (status != SCI_SUCCESS) | ||
942 | return status; | ||
943 | |||
944 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, request); | ||
945 | if (status != SCI_SUCCESS) | ||
946 | goto out; | ||
947 | |||
948 | status = request->state_handlers->start_handler(request); | ||
949 | if (status != SCI_SUCCESS) | ||
950 | goto out; | ||
951 | |||
952 | if (isci_sata_get_sat_protocol(isci_request) == SAT_PROTOCOL_FPDMA) | ||
953 | new_state = SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ; | ||
954 | else { | ||
955 | sci_dev->working_request = request; | ||
956 | new_state = SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD; | ||
957 | } | ||
958 | sci_base_state_machine_change_state(&sci_dev->state_machine, new_state); | ||
959 | out: | ||
960 | scic_sds_remote_device_start_request(sci_dev, request, status); | ||
961 | return status; | ||
962 | } | ||
963 | |||
964 | |||
965 | static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_handler( | 978 | static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_handler( |
966 | struct scic_sds_remote_device *sci_dev, | 979 | struct scic_sds_remote_device *sci_dev, |
967 | u32 event_code) | 980 | u32 event_code) |
@@ -982,31 +995,6 @@ static enum sci_status scic_sds_stp_remote_device_ready_idle_substate_event_hand | |||
982 | return status; | 995 | return status; |
983 | } | 996 | } |
984 | 997 | ||
985 | static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_start_io_handler( | ||
986 | struct scic_sds_remote_device *sci_dev, | ||
987 | struct scic_sds_request *request) | ||
988 | { | ||
989 | enum sci_status status; | ||
990 | struct isci_request *isci_request = request->ireq; | ||
991 | scic_sds_port_io_request_handler_t start_io; | ||
992 | |||
993 | if (isci_sata_get_sat_protocol(isci_request) == SAT_PROTOCOL_FPDMA) { | ||
994 | start_io = sci_dev->owning_port->state_handlers->start_io_handler; | ||
995 | status = start_io(sci_dev->owning_port, sci_dev, request); | ||
996 | if (status != SCI_SUCCESS) | ||
997 | return status; | ||
998 | |||
999 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, request); | ||
1000 | if (status == SCI_SUCCESS) | ||
1001 | status = request->state_handlers->start_handler(request); | ||
1002 | |||
1003 | scic_sds_remote_device_start_request(sci_dev, request, status); | ||
1004 | } else | ||
1005 | status = SCI_FAILURE_INVALID_STATE; | ||
1006 | |||
1007 | return status; | ||
1008 | } | ||
1009 | |||
1010 | static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handler(struct scic_sds_remote_device *sci_dev, | 998 | static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handler(struct scic_sds_remote_device *sci_dev, |
1011 | u32 frame_index) | 999 | u32 frame_index) |
1012 | { | 1000 | { |
@@ -1046,16 +1034,6 @@ static enum sci_status scic_sds_stp_remote_device_ready_ncq_substate_frame_handl | |||
1046 | return status; | 1034 | return status; |
1047 | } | 1035 | } |
1048 | 1036 | ||
1049 | static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_start_io_handler( | ||
1050 | struct scic_sds_remote_device *device, | ||
1051 | struct scic_sds_request *request) | ||
1052 | { | ||
1053 | /* device is already handling a command it can not accept new commands | ||
1054 | * until this one is complete. | ||
1055 | */ | ||
1056 | return SCI_FAILURE_INVALID_STATE; | ||
1057 | } | ||
1058 | |||
1059 | static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler( | 1037 | static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_suspend_handler( |
1060 | struct scic_sds_remote_device *sci_dev, | 1038 | struct scic_sds_remote_device *sci_dev, |
1061 | u32 suspend_type) | 1039 | u32 suspend_type) |
@@ -1080,13 +1058,6 @@ static enum sci_status scic_sds_stp_remote_device_ready_cmd_substate_frame_handl | |||
1080 | frame_index); | 1058 | frame_index); |
1081 | } | 1059 | } |
1082 | 1060 | ||
1083 | static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_start_io_handler( | ||
1084 | struct scic_sds_remote_device *device, | ||
1085 | struct scic_sds_request *request) | ||
1086 | { | ||
1087 | return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED; | ||
1088 | } | ||
1089 | |||
1090 | static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_complete_request_handler( | 1061 | static enum sci_status scic_sds_stp_remote_device_ready_await_reset_substate_complete_request_handler( |
1091 | struct scic_sds_remote_device *device, | 1062 | struct scic_sds_remote_device *device, |
1092 | struct scic_sds_request *request) | 1063 | struct scic_sds_request *request) |
@@ -1126,46 +1097,6 @@ static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handl | |||
1126 | isci_remote_device_ready(scic->ihost, idev); | 1097 | isci_remote_device_ready(scic->ihost, idev); |
1127 | } | 1098 | } |
1128 | 1099 | ||
1129 | static enum sci_status scic_sds_smp_remote_device_ready_idle_substate_start_io_handler( | ||
1130 | struct scic_sds_remote_device *sci_dev, | ||
1131 | struct scic_sds_request *sci_req) | ||
1132 | { | ||
1133 | enum sci_status status; | ||
1134 | |||
1135 | /* Will the port allow the io request to start? */ | ||
1136 | status = sci_dev->owning_port->state_handlers->start_io_handler( | ||
1137 | sci_dev->owning_port, sci_dev, sci_req); | ||
1138 | if (status != SCI_SUCCESS) | ||
1139 | return status; | ||
1140 | |||
1141 | status = scic_sds_remote_node_context_start_io(&sci_dev->rnc, sci_req); | ||
1142 | if (status != SCI_SUCCESS) | ||
1143 | goto out; | ||
1144 | |||
1145 | status = scic_sds_request_start(sci_req); | ||
1146 | if (status != SCI_SUCCESS) | ||
1147 | goto out; | ||
1148 | |||
1149 | sci_dev->working_request = sci_req; | ||
1150 | sci_base_state_machine_change_state(&sci_dev->state_machine, | ||
1151 | SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD); | ||
1152 | |||
1153 | out: | ||
1154 | scic_sds_remote_device_start_request(sci_dev, sci_req, status); | ||
1155 | |||
1156 | return status; | ||
1157 | } | ||
1158 | |||
1159 | static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_start_io_handler( | ||
1160 | struct scic_sds_remote_device *device, | ||
1161 | struct scic_sds_request *request) | ||
1162 | { | ||
1163 | /* device is already handling a command it can not accept new commands | ||
1164 | * until this one is complete. | ||
1165 | */ | ||
1166 | return SCI_FAILURE_INVALID_STATE; | ||
1167 | } | ||
1168 | |||
1169 | static enum sci_status | 1100 | static enum sci_status |
1170 | scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(struct scic_sds_remote_device *sci_dev, | 1101 | scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler(struct scic_sds_remote_device *sci_dev, |
1171 | struct scic_sds_request *sci_req) | 1102 | struct scic_sds_request *sci_req) |
@@ -1213,7 +1144,6 @@ static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handl | |||
1213 | 1144 | ||
1214 | static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_state_handler_table[] = { | 1145 | static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_state_handler_table[] = { |
1215 | [SCI_BASE_REMOTE_DEVICE_STATE_INITIAL] = { | 1146 | [SCI_BASE_REMOTE_DEVICE_STATE_INITIAL] = { |
1216 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1217 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1147 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1218 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1148 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1219 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1149 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1224,7 +1154,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1224 | .frame_handler = scic_sds_remote_device_default_frame_handler | 1154 | .frame_handler = scic_sds_remote_device_default_frame_handler |
1225 | }, | 1155 | }, |
1226 | [SCI_BASE_REMOTE_DEVICE_STATE_STOPPED] = { | 1156 | [SCI_BASE_REMOTE_DEVICE_STATE_STOPPED] = { |
1227 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1228 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1157 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1229 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1158 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1230 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1159 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1235,7 +1164,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1235 | .frame_handler = scic_sds_remote_device_default_frame_handler | 1164 | .frame_handler = scic_sds_remote_device_default_frame_handler |
1236 | }, | 1165 | }, |
1237 | [SCI_BASE_REMOTE_DEVICE_STATE_STARTING] = { | 1166 | [SCI_BASE_REMOTE_DEVICE_STATE_STARTING] = { |
1238 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1239 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1167 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1240 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1168 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1241 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1169 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1246,7 +1174,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1246 | .frame_handler = scic_sds_remote_device_default_frame_handler | 1174 | .frame_handler = scic_sds_remote_device_default_frame_handler |
1247 | }, | 1175 | }, |
1248 | [SCI_BASE_REMOTE_DEVICE_STATE_READY] = { | 1176 | [SCI_BASE_REMOTE_DEVICE_STATE_READY] = { |
1249 | .start_io_handler = scic_sds_remote_device_ready_state_start_io_handler, | ||
1250 | .complete_io_handler = scic_sds_remote_device_ready_state_complete_request_handler, | 1177 | .complete_io_handler = scic_sds_remote_device_ready_state_complete_request_handler, |
1251 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1178 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1252 | .start_task_handler = scic_sds_remote_device_ready_state_start_task_handler, | 1179 | .start_task_handler = scic_sds_remote_device_ready_state_start_task_handler, |
@@ -1257,7 +1184,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1257 | .frame_handler = scic_sds_remote_device_general_frame_handler, | 1184 | .frame_handler = scic_sds_remote_device_general_frame_handler, |
1258 | }, | 1185 | }, |
1259 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = { | 1186 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = { |
1260 | .start_io_handler = scic_sds_stp_remote_device_ready_idle_substate_start_io_handler, | ||
1261 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1187 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1262 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1188 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1263 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, | 1189 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, |
@@ -1268,7 +1194,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1268 | .frame_handler = scic_sds_remote_device_default_frame_handler | 1194 | .frame_handler = scic_sds_remote_device_default_frame_handler |
1269 | }, | 1195 | }, |
1270 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = { | 1196 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = { |
1271 | .start_io_handler = scic_sds_stp_remote_device_ready_cmd_substate_start_io_handler, | ||
1272 | .complete_io_handler = scic_sds_stp_remote_device_complete_request, | 1197 | .complete_io_handler = scic_sds_stp_remote_device_complete_request, |
1273 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1198 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1274 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, | 1199 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, |
@@ -1279,7 +1204,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1279 | .frame_handler = scic_sds_stp_remote_device_ready_cmd_substate_frame_handler | 1204 | .frame_handler = scic_sds_stp_remote_device_ready_cmd_substate_frame_handler |
1280 | }, | 1205 | }, |
1281 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ] = { | 1206 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ] = { |
1282 | .start_io_handler = scic_sds_stp_remote_device_ready_ncq_substate_start_io_handler, | ||
1283 | .complete_io_handler = scic_sds_stp_remote_device_complete_request, | 1207 | .complete_io_handler = scic_sds_stp_remote_device_complete_request, |
1284 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1208 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1285 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, | 1209 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, |
@@ -1290,7 +1214,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1290 | .frame_handler = scic_sds_stp_remote_device_ready_ncq_substate_frame_handler | 1214 | .frame_handler = scic_sds_stp_remote_device_ready_ncq_substate_frame_handler |
1291 | }, | 1215 | }, |
1292 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR] = { | 1216 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR] = { |
1293 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1294 | .complete_io_handler = scic_sds_stp_remote_device_complete_request, | 1217 | .complete_io_handler = scic_sds_stp_remote_device_complete_request, |
1295 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1218 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1296 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, | 1219 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, |
@@ -1301,7 +1224,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1301 | .frame_handler = scic_sds_remote_device_general_frame_handler | 1224 | .frame_handler = scic_sds_remote_device_general_frame_handler |
1302 | }, | 1225 | }, |
1303 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET] = { | 1226 | [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET] = { |
1304 | .start_io_handler = scic_sds_stp_remote_device_ready_await_reset_substate_start_io_handler, | ||
1305 | .complete_io_handler = scic_sds_stp_remote_device_ready_await_reset_substate_complete_request_handler, | 1227 | .complete_io_handler = scic_sds_stp_remote_device_ready_await_reset_substate_complete_request_handler, |
1306 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1228 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1307 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, | 1229 | .start_task_handler = scic_sds_stp_remote_device_ready_substate_start_request_handler, |
@@ -1312,7 +1234,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1312 | .frame_handler = scic_sds_remote_device_general_frame_handler | 1234 | .frame_handler = scic_sds_remote_device_general_frame_handler |
1313 | }, | 1235 | }, |
1314 | [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = { | 1236 | [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = { |
1315 | .start_io_handler = scic_sds_smp_remote_device_ready_idle_substate_start_io_handler, | ||
1316 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1237 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1317 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1238 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1318 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1239 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1323,7 +1244,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1323 | .frame_handler = scic_sds_remote_device_default_frame_handler | 1244 | .frame_handler = scic_sds_remote_device_default_frame_handler |
1324 | }, | 1245 | }, |
1325 | [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = { | 1246 | [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = { |
1326 | .start_io_handler = scic_sds_smp_remote_device_ready_cmd_substate_start_io_handler, | ||
1327 | .complete_io_handler = scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler, | 1247 | .complete_io_handler = scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler, |
1328 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1248 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1329 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1249 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1334,7 +1254,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1334 | .frame_handler = scic_sds_smp_remote_device_ready_cmd_substate_frame_handler | 1254 | .frame_handler = scic_sds_smp_remote_device_ready_cmd_substate_frame_handler |
1335 | }, | 1255 | }, |
1336 | [SCI_BASE_REMOTE_DEVICE_STATE_STOPPING] = { | 1256 | [SCI_BASE_REMOTE_DEVICE_STATE_STOPPING] = { |
1337 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1338 | .complete_io_handler = scic_sds_remote_device_stopping_state_complete_request_handler, | 1257 | .complete_io_handler = scic_sds_remote_device_stopping_state_complete_request_handler, |
1339 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1258 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1340 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1259 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1345,7 +1264,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1345 | .frame_handler = scic_sds_remote_device_general_frame_handler | 1264 | .frame_handler = scic_sds_remote_device_general_frame_handler |
1346 | }, | 1265 | }, |
1347 | [SCI_BASE_REMOTE_DEVICE_STATE_FAILED] = { | 1266 | [SCI_BASE_REMOTE_DEVICE_STATE_FAILED] = { |
1348 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1349 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1267 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1350 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1268 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1351 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1269 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1356,7 +1274,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1356 | .frame_handler = scic_sds_remote_device_general_frame_handler | 1274 | .frame_handler = scic_sds_remote_device_general_frame_handler |
1357 | }, | 1275 | }, |
1358 | [SCI_BASE_REMOTE_DEVICE_STATE_RESETTING] = { | 1276 | [SCI_BASE_REMOTE_DEVICE_STATE_RESETTING] = { |
1359 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1360 | .complete_io_handler = scic_sds_remote_device_resetting_state_complete_request_handler, | 1277 | .complete_io_handler = scic_sds_remote_device_resetting_state_complete_request_handler, |
1361 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1278 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1362 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1279 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
@@ -1367,7 +1284,6 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1367 | .frame_handler = scic_sds_remote_device_general_frame_handler | 1284 | .frame_handler = scic_sds_remote_device_general_frame_handler |
1368 | }, | 1285 | }, |
1369 | [SCI_BASE_REMOTE_DEVICE_STATE_FINAL] = { | 1286 | [SCI_BASE_REMOTE_DEVICE_STATE_FINAL] = { |
1370 | .start_io_handler = scic_sds_remote_device_default_start_request_handler, | ||
1371 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, | 1287 | .complete_io_handler = scic_sds_remote_device_default_complete_request_handler, |
1372 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, | 1288 | .continue_io_handler = scic_sds_remote_device_default_continue_request_handler, |
1373 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, | 1289 | .start_task_handler = scic_sds_remote_device_default_start_request_handler, |
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h index 51094352d952..58ce41af9e66 100644 --- a/drivers/scsi/isci/remote_device.h +++ b/drivers/scsi/isci/remote_device.h | |||
@@ -387,12 +387,6 @@ typedef void (*scic_sds_remote_device_ready_not_ready_handler_t)( | |||
387 | */ | 387 | */ |
388 | struct scic_sds_remote_device_state_handler { | 388 | struct scic_sds_remote_device_state_handler { |
389 | /** | 389 | /** |
390 | * The start_io_handler specifies the method invoked when a user | ||
391 | * attempts to start an IO request for a remote device. | ||
392 | */ | ||
393 | scic_sds_remote_device_request_handler_t start_io_handler; | ||
394 | |||
395 | /** | ||
396 | * The complete_io_handler specifies the method invoked when a user | 390 | * The complete_io_handler specifies the method invoked when a user |
397 | * attempts to complete an IO request for a remote device. | 391 | * attempts to complete an IO request for a remote device. |
398 | */ | 392 | */ |