aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-03-31 11:06:16 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:00:37 -0400
commit524b5f723be8a1d966c1285d69810bc461f181c2 (patch)
treefe9843f60e832d326f7b72bbe64aaf0c94424b3a /drivers/scsi/isci
parent78141676784ed190ce2546f97a7d6368f21e450b (diff)
isci: simplify request state handlers
Instead of filling up tables with default handlers call the default handler in the only caller. IMHO the whole state handlers concept is not very suitable for the isci request. For example there is a single real instance of the start handler, and we'd be much better off just having a check for the right state in the only caller, than all this mess. It's quite similar for the abort handler as well. Even the actual state machine has a lot of states that are rather pointless. The initial and constructed states are not needed at all as the request is not reachable for calls before it's fully set up and started. And the abort state should be replaced with an abort actions and a state transition to the completed state. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.c287
-rw-r--r--drivers/scsi/isci/core/scic_sds_request.h54
-rw-r--r--drivers/scsi/isci/core/scic_sds_smp_request.c9
-rw-r--r--drivers/scsi/isci/core/scic_sds_ssp_request.c10
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_packet_request.c24
-rw-r--r--drivers/scsi/isci/core/scic_sds_stp_request.c53
6 files changed, 80 insertions, 357 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c
index 7c21de0cc3a6..191b5d0f1a53 100644
--- a/drivers/scsi/isci/core/scic_sds_request.c
+++ b/drivers/scsi/isci/core/scic_sds_request.c
@@ -874,67 +874,93 @@ u32 scic_io_request_get_number_of_bytes_transferred(
874 * * SCIC SDS Interface Implementation 874 * * SCIC SDS Interface Implementation
875 * **************************************************************************** */ 875 * **************************************************************************** */
876 876
877/**
878 *
879 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
880 * operation is to be executed.
881 *
882 * This method invokes the base state start request handler for the
883 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
884 */
885enum sci_status 877enum sci_status
886scic_sds_request_start(struct scic_sds_request *request) 878scic_sds_request_start(struct scic_sds_request *request)
887{ 879{
888 if (request->device_sequence == 880 if (request->device_sequence !=
889 scic_sds_remote_device_get_sequence(request->target_device)) 881 scic_sds_remote_device_get_sequence(request->target_device))
882 return SCI_FAILURE;
883
884 if (request->state_handlers->start_handler)
890 return request->state_handlers->start_handler(request); 885 return request->state_handlers->start_handler(request);
891 return SCI_FAILURE; 886
887 dev_warn(scic_to_dev(request->owning_controller),
888 "%s: SCIC IO Request requested to start while in wrong "
889 "state %d\n",
890 __func__,
891 sci_base_state_machine_get_state(&request->state_machine));
892
893 return SCI_FAILURE_INVALID_STATE;
892} 894}
893 895
894/**
895 *
896 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
897 * operation is to be executed.
898 *
899 * This method invokes the base state terminate request handber for the
900 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
901 */
902enum sci_status 896enum sci_status
903scic_sds_io_request_terminate(struct scic_sds_request *request) 897scic_sds_io_request_terminate(struct scic_sds_request *request)
904{ 898{
905 return request->state_handlers->abort_handler(request); 899 if (request->state_handlers->abort_handler)
900 return request->state_handlers->abort_handler(request);
901
902 dev_warn(scic_to_dev(request->owning_controller),
903 "%s: SCIC IO Request requested to abort while in wrong "
904 "state %d\n",
905 __func__,
906 sci_base_state_machine_get_state(&request->state_machine));
907
908 return SCI_FAILURE_INVALID_STATE;
906} 909}
907 910
908/**
909 *
910 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
911 * operation is to be executed.
912 *
913 * This method invokes the base state request completion handler for the
914 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
915 */
916enum sci_status 911enum sci_status
917scic_sds_io_request_complete(struct scic_sds_request *request) 912scic_sds_io_request_complete(struct scic_sds_request *request)
918{ 913{
919 return request->state_handlers->complete_handler(request); 914 if (request->state_handlers->complete_handler)
915 return request->state_handlers->complete_handler(request);
916
917 dev_warn(scic_to_dev(request->owning_controller),
918 "%s: SCIC IO Request requested to complete while in wrong "
919 "state %d\n",
920 __func__,
921 sci_base_state_machine_get_state(&request->state_machine));
922
923 return SCI_FAILURE_INVALID_STATE;
920} 924}
921 925
922/**
923 *
924 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
925 * operation is to be executed.
926 * @event_code: The event code returned by the hardware for the task reqeust.
927 *
928 * This method invokes the core state handler for the SCIC_SDS_IO_REQUEST_T
929 * object. enum sci_status
930 */
931enum sci_status scic_sds_io_request_event_handler( 926enum sci_status scic_sds_io_request_event_handler(
932 struct scic_sds_request *this_request, 927 struct scic_sds_request *request,
933 u32 event_code) 928 u32 event_code)
934{ 929{
935 return this_request->state_handlers->event_handler(this_request, event_code); 930 if (request->state_handlers->event_handler)
931 return request->state_handlers->event_handler(request, event_code);
932
933 dev_warn(scic_to_dev(request->owning_controller),
934 "%s: SCIC IO Request given event code notification %x while "
935 "in wrong state %d\n",
936 __func__,
937 event_code,
938 sci_base_state_machine_get_state(&request->state_machine));
939
940 return SCI_FAILURE_INVALID_STATE;
936} 941}
937 942
943enum sci_status
944scic_sds_io_request_tc_completion(struct scic_sds_request *request, u32 completion_code)
945{
946 if (request->state_machine.current_state_id == SCI_BASE_REQUEST_STATE_STARTED &&
947 request->has_started_substate_machine == false)
948 return scic_sds_request_started_state_tc_completion_handler(request, completion_code);
949 else if (request->state_handlers->tc_completion_handler)
950 return request->state_handlers->tc_completion_handler(request, completion_code);
951
952 dev_warn(scic_to_dev(request->owning_controller),
953 "%s: SCIC IO Request given task completion notification %x "
954 "while in wrong state %d\n",
955 __func__,
956 completion_code,
957 sci_base_state_machine_get_state(&request->state_machine));
958
959 return SCI_FAILURE_INVALID_STATE;
960
961}
962
963
938/** 964/**
939 * 965 *
940 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start 966 * @this_request: The SCIC_SDS_IO_REQUEST_T object for which the start
@@ -946,10 +972,21 @@ enum sci_status scic_sds_io_request_event_handler(
946 * SCIC_SDS_IO_REQUEST_T object. enum sci_status 972 * SCIC_SDS_IO_REQUEST_T object. enum sci_status
947 */ 973 */
948enum sci_status scic_sds_io_request_frame_handler( 974enum sci_status scic_sds_io_request_frame_handler(
949 struct scic_sds_request *this_request, 975 struct scic_sds_request *request,
950 u32 frame_index) 976 u32 frame_index)
951{ 977{
952 return this_request->state_handlers->frame_handler(this_request, frame_index); 978 if (request->state_handlers->frame_handler)
979 return request->state_handlers->frame_handler(request, frame_index);
980
981 dev_warn(scic_to_dev(request->owning_controller),
982 "%s: SCIC IO Request given unexpected frame %x while in "
983 "state %d\n",
984 __func__,
985 frame_index,
986 sci_base_state_machine_get_state(&request->state_machine));
987
988 scic_sds_controller_release_frame(request->owning_controller, frame_index);
989 return SCI_FAILURE_INVALID_STATE;
953} 990}
954 991
955/** 992/**
@@ -1003,141 +1040,6 @@ void scic_sds_io_request_copy_response(struct scic_sds_request *sds_request)
1003 1040
1004/* 1041/*
1005 * ***************************************************************************** 1042 * *****************************************************************************
1006 * * DEFAULT STATE HANDLERS
1007 * ***************************************************************************** */
1008
1009/*
1010 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1011 * object receives a scic_sds_request_start() request. The default action is
1012 * to log a warning and return a failure status. enum sci_status
1013 * SCI_FAILURE_INVALID_STATE
1014 */
1015enum sci_status scic_sds_request_default_start_handler(
1016 struct scic_sds_request *request)
1017{
1018 dev_warn(scic_to_dev(request->owning_controller),
1019 "%s: SCIC IO Request requested to start while in wrong "
1020 "state %d\n",
1021 __func__,
1022 sci_base_state_machine_get_state(&request->state_machine));
1023
1024 return SCI_FAILURE_INVALID_STATE;
1025}
1026
1027static enum sci_status scic_sds_request_default_abort_handler(
1028 struct scic_sds_request *request)
1029{
1030 dev_warn(scic_to_dev(request->owning_controller),
1031 "%s: SCIC IO Request requested to abort while in wrong "
1032 "state %d\n",
1033 __func__,
1034 sci_base_state_machine_get_state(&request->state_machine));
1035
1036 return SCI_FAILURE_INVALID_STATE;
1037}
1038
1039/*
1040 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1041 * object receives a scic_sds_request_complete() request. The default action
1042 * is to log a warning and return a failure status. enum sci_status
1043 * SCI_FAILURE_INVALID_STATE
1044 */
1045enum sci_status scic_sds_request_default_complete_handler(
1046 struct scic_sds_request *request)
1047{
1048 dev_warn(scic_to_dev(request->owning_controller),
1049 "%s: SCIC IO Request requested to complete while in wrong "
1050 "state %d\n",
1051 __func__,
1052 sci_base_state_machine_get_state(&request->state_machine));
1053
1054 return SCI_FAILURE_INVALID_STATE;
1055}
1056
1057/*
1058 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1059 * object receives a scic_sds_request_complete() request. The default action
1060 * is to log a warning and return a failure status. enum sci_status
1061 * SCI_FAILURE_INVALID_STATE
1062 */
1063enum sci_status scic_sds_request_default_destruct_handler(
1064 struct scic_sds_request *request)
1065{
1066 dev_warn(scic_to_dev(request->owning_controller),
1067 "%s: SCIC IO Request requested to destroy while in wrong "
1068 "state %d\n",
1069 __func__,
1070 sci_base_state_machine_get_state(&request->state_machine));
1071
1072 return SCI_FAILURE_INVALID_STATE;
1073}
1074
1075/**
1076 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1077 * object receives a scic_sds_task_request_complete() request. The default
1078 * action is to log a warning and return a failure status. enum sci_status
1079 * SCI_FAILURE_INVALID_STATE
1080 */
1081enum sci_status scic_sds_request_default_tc_completion_handler(
1082 struct scic_sds_request *request,
1083 u32 completion_code)
1084{
1085 dev_warn(scic_to_dev(request->owning_controller),
1086 "%s: SCIC IO Request given task completion notification %x "
1087 "while in wrong state %d\n",
1088 __func__,
1089 completion_code,
1090 sci_base_state_machine_get_state(&request->state_machine));
1091
1092 return SCI_FAILURE_INVALID_STATE;
1093
1094}
1095
1096/*
1097 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1098 * object receives a scic_sds_request_event_handler() request. The default
1099 * action is to log a warning and return a failure status. enum sci_status
1100 * SCI_FAILURE_INVALID_STATE
1101 */
1102enum sci_status scic_sds_request_default_event_handler(
1103 struct scic_sds_request *request,
1104 u32 event_code)
1105{
1106 dev_warn(scic_to_dev(request->owning_controller),
1107 "%s: SCIC IO Request given event code notification %x while "
1108 "in wrong state %d\n",
1109 __func__,
1110 event_code,
1111 sci_base_state_machine_get_state(&request->state_machine));
1112
1113 return SCI_FAILURE_INVALID_STATE;
1114}
1115
1116/*
1117 * This method is the default action to take when an SCIC_SDS_IO_REQUEST_T
1118 * object receives a scic_sds_request_event_handler() request. The default
1119 * action is to log a warning and return a failure status. enum sci_status
1120 * SCI_FAILURE_INVALID_STATE
1121 */
1122enum sci_status scic_sds_request_default_frame_handler(
1123 struct scic_sds_request *request,
1124 u32 frame_index)
1125{
1126 dev_warn(scic_to_dev(request->owning_controller),
1127 "%s: SCIC IO Request given unexpected frame %x while in "
1128 "state %d\n",
1129 __func__,
1130 frame_index,
1131 sci_base_state_machine_get_state(&request->state_machine));
1132
1133 scic_sds_controller_release_frame(
1134 request->owning_controller, frame_index);
1135
1136 return SCI_FAILURE_INVALID_STATE;
1137}
1138
1139/*
1140 * *****************************************************************************
1141 * * CONSTRUCTED STATE HANDLERS 1043 * * CONSTRUCTED STATE HANDLERS
1142 * ***************************************************************************** */ 1044 * ***************************************************************************** */
1143 1045
@@ -1601,58 +1503,25 @@ static enum sci_status scic_sds_request_aborting_state_frame_handler(
1601 1503
1602static const struct scic_sds_io_request_state_handler scic_sds_request_state_handler_table[] = { 1504static const struct scic_sds_io_request_state_handler scic_sds_request_state_handler_table[] = {
1603 [SCI_BASE_REQUEST_STATE_INITIAL] = { 1505 [SCI_BASE_REQUEST_STATE_INITIAL] = {
1604 .start_handler = scic_sds_request_default_start_handler,
1605 .abort_handler = scic_sds_request_default_abort_handler,
1606 .complete_handler = scic_sds_request_default_complete_handler,
1607 .destruct_handler = scic_sds_request_default_destruct_handler,
1608 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1609 .event_handler = scic_sds_request_default_event_handler,
1610 .frame_handler = scic_sds_request_default_frame_handler,
1611 }, 1506 },
1612 [SCI_BASE_REQUEST_STATE_CONSTRUCTED] = { 1507 [SCI_BASE_REQUEST_STATE_CONSTRUCTED] = {
1613 .start_handler = scic_sds_request_constructed_state_start_handler, 1508 .start_handler = scic_sds_request_constructed_state_start_handler,
1614 .abort_handler = scic_sds_request_constructed_state_abort_handler, 1509 .abort_handler = scic_sds_request_constructed_state_abort_handler,
1615 .complete_handler = scic_sds_request_default_complete_handler,
1616 .destruct_handler = scic_sds_request_default_destruct_handler,
1617 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1618 .event_handler = scic_sds_request_default_event_handler,
1619 .frame_handler = scic_sds_request_default_frame_handler,
1620 }, 1510 },
1621 [SCI_BASE_REQUEST_STATE_STARTED] = { 1511 [SCI_BASE_REQUEST_STATE_STARTED] = {
1622 .start_handler = scic_sds_request_default_start_handler,
1623 .abort_handler = scic_sds_request_started_state_abort_handler, 1512 .abort_handler = scic_sds_request_started_state_abort_handler,
1624 .complete_handler = scic_sds_request_default_complete_handler,
1625 .destruct_handler = scic_sds_request_default_destruct_handler,
1626 .tc_completion_handler = scic_sds_request_started_state_tc_completion_handler, 1513 .tc_completion_handler = scic_sds_request_started_state_tc_completion_handler,
1627 .event_handler = scic_sds_request_default_event_handler,
1628 .frame_handler = scic_sds_request_started_state_frame_handler, 1514 .frame_handler = scic_sds_request_started_state_frame_handler,
1629 }, 1515 },
1630 [SCI_BASE_REQUEST_STATE_COMPLETED] = { 1516 [SCI_BASE_REQUEST_STATE_COMPLETED] = {
1631 .start_handler = scic_sds_request_default_start_handler,
1632 .abort_handler = scic_sds_request_default_abort_handler,
1633 .complete_handler = scic_sds_request_completed_state_complete_handler, 1517 .complete_handler = scic_sds_request_completed_state_complete_handler,
1634 .destruct_handler = scic_sds_request_default_destruct_handler,
1635 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1636 .event_handler = scic_sds_request_default_event_handler,
1637 .frame_handler = scic_sds_request_default_frame_handler,
1638 }, 1518 },
1639 [SCI_BASE_REQUEST_STATE_ABORTING] = { 1519 [SCI_BASE_REQUEST_STATE_ABORTING] = {
1640 .start_handler = scic_sds_request_default_start_handler,
1641 .abort_handler = scic_sds_request_aborting_state_abort_handler, 1520 .abort_handler = scic_sds_request_aborting_state_abort_handler,
1642 .complete_handler = scic_sds_request_default_complete_handler,
1643 .destruct_handler = scic_sds_request_default_destruct_handler,
1644 .tc_completion_handler = scic_sds_request_aborting_state_tc_completion_handler, 1521 .tc_completion_handler = scic_sds_request_aborting_state_tc_completion_handler,
1645 .event_handler = scic_sds_request_default_event_handler,
1646 .frame_handler = scic_sds_request_aborting_state_frame_handler, 1522 .frame_handler = scic_sds_request_aborting_state_frame_handler,
1647 }, 1523 },
1648 [SCI_BASE_REQUEST_STATE_FINAL] = { 1524 [SCI_BASE_REQUEST_STATE_FINAL] = {
1649 .start_handler = scic_sds_request_default_start_handler,
1650 .abort_handler = scic_sds_request_default_abort_handler,
1651 .complete_handler = scic_sds_request_default_complete_handler,
1652 .destruct_handler = scic_sds_request_default_destruct_handler,
1653 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1654 .event_handler = scic_sds_request_default_event_handler,
1655 .frame_handler = scic_sds_request_default_frame_handler,
1656 }, 1525 },
1657}; 1526};
1658 1527
diff --git a/drivers/scsi/isci/core/scic_sds_request.h b/drivers/scsi/isci/core/scic_sds_request.h
index 5b0f88596370..423567a62901 100644
--- a/drivers/scsi/isci/core/scic_sds_request.h
+++ b/drivers/scsi/isci/core/scic_sds_request.h
@@ -315,13 +315,6 @@ struct scic_sds_io_request_state_handler {
315 */ 315 */
316 scic_sds_io_request_handler_t complete_handler; 316 scic_sds_io_request_handler_t complete_handler;
317 317
318 /**
319 * The destruct_handler specifies the method invoked when a user attempts to
320 * destruct a request.
321 */
322 scic_sds_io_request_handler_t destruct_handler;
323
324
325 scic_sds_io_request_task_completion_handler_t tc_completion_handler; 318 scic_sds_io_request_task_completion_handler_t tc_completion_handler;
326 scic_sds_io_request_event_handler_t event_handler; 319 scic_sds_io_request_event_handler_t event_handler;
327 scic_sds_io_request_frame_handler_t frame_handler; 320 scic_sds_io_request_frame_handler_t frame_handler;
@@ -394,24 +387,8 @@ extern const struct sci_base_state scic_sds_io_request_started_task_mgmt_substat
394 ((a_request)->state_handlers->complete_handler(a_request)) 387 ((a_request)->state_handlers->complete_handler(a_request))
395 388
396 389
397 390extern enum sci_status
398 391scic_sds_io_request_tc_completion(struct scic_sds_request *request, u32 completion_code);
399/**
400 * scic_sds_io_request_tc_completion() -
401 *
402 * This macro invokes the core state task completion handler for the
403 * struct scic_sds_io_request object.
404 */
405#define scic_sds_io_request_tc_completion(this_request, completion_code) \
406{ \
407 if (this_request->state_machine.current_state_id \
408 == SCI_BASE_REQUEST_STATE_STARTED \
409 && this_request->has_started_substate_machine \
410 == false) \
411 scic_sds_request_started_state_tc_completion_handler(this_request, completion_code); \
412 else \
413 this_request->state_handlers->tc_completion_handler(this_request, completion_code); \
414}
415 392
416/** 393/**
417 * SCU_SGL_ZERO() - 394 * SCU_SGL_ZERO() -
@@ -494,33 +471,6 @@ enum sci_status scic_sds_task_request_terminate(
494 471
495/* 472/*
496 * ***************************************************************************** 473 * *****************************************************************************
497 * * DEFAULT STATE HANDLERS
498 * ***************************************************************************** */
499
500enum sci_status scic_sds_request_default_start_handler(
501 struct scic_sds_request *request);
502
503
504enum sci_status scic_sds_request_default_complete_handler(
505 struct scic_sds_request *request);
506
507enum sci_status scic_sds_request_default_destruct_handler(
508 struct scic_sds_request *request);
509
510enum sci_status scic_sds_request_default_tc_completion_handler(
511 struct scic_sds_request *this_request,
512 u32 completion_code);
513
514enum sci_status scic_sds_request_default_event_handler(
515 struct scic_sds_request *this_request,
516 u32 event_code);
517
518enum sci_status scic_sds_request_default_frame_handler(
519 struct scic_sds_request *this_request,
520 u32 frame_index);
521
522/*
523 * *****************************************************************************
524 * * STARTED STATE HANDLERS 474 * * STARTED STATE HANDLERS
525 * ***************************************************************************** */ 475 * ***************************************************************************** */
526 476
diff --git a/drivers/scsi/isci/core/scic_sds_smp_request.c b/drivers/scsi/isci/core/scic_sds_smp_request.c
index 9293c2d5fc91..70bc8d2cf048 100644
--- a/drivers/scsi/isci/core/scic_sds_smp_request.c
+++ b/drivers/scsi/isci/core/scic_sds_smp_request.c
@@ -525,22 +525,13 @@ static enum sci_status scic_sds_smp_request_await_tc_completion_tc_completion_ha
525 525
526static const struct scic_sds_io_request_state_handler scic_sds_smp_request_started_substate_handler_table[] = { 526static const struct scic_sds_io_request_state_handler scic_sds_smp_request_started_substate_handler_table[] = {
527 [SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_RESPONSE] = { 527 [SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_RESPONSE] = {
528 .start_handler = scic_sds_request_default_start_handler,
529 .abort_handler = scic_sds_request_started_state_abort_handler, 528 .abort_handler = scic_sds_request_started_state_abort_handler,
530 .complete_handler = scic_sds_request_default_complete_handler,
531 .destruct_handler = scic_sds_request_default_destruct_handler,
532 .tc_completion_handler = scic_sds_smp_request_await_response_tc_completion_handler, 529 .tc_completion_handler = scic_sds_smp_request_await_response_tc_completion_handler,
533 .event_handler = scic_sds_request_default_event_handler,
534 .frame_handler = scic_sds_smp_request_await_response_frame_handler, 530 .frame_handler = scic_sds_smp_request_await_response_frame_handler,
535 }, 531 },
536 [SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION] = { 532 [SCIC_SDS_SMP_REQUEST_STARTED_SUBSTATE_AWAIT_TC_COMPLETION] = {
537 .start_handler = scic_sds_request_default_start_handler,
538 .abort_handler = scic_sds_request_started_state_abort_handler, 533 .abort_handler = scic_sds_request_started_state_abort_handler,
539 .complete_handler = scic_sds_request_default_complete_handler,
540 .destruct_handler = scic_sds_request_default_destruct_handler,
541 .tc_completion_handler = scic_sds_smp_request_await_tc_completion_tc_completion_handler, 534 .tc_completion_handler = scic_sds_smp_request_await_tc_completion_tc_completion_handler,
542 .event_handler = scic_sds_request_default_event_handler,
543 .frame_handler = scic_sds_request_default_frame_handler,
544 } 535 }
545}; 536};
546 537
diff --git a/drivers/scsi/isci/core/scic_sds_ssp_request.c b/drivers/scsi/isci/core/scic_sds_ssp_request.c
index 1eecb19c3ad6..4d3a21b6ac03 100644
--- a/drivers/scsi/isci/core/scic_sds_ssp_request.c
+++ b/drivers/scsi/isci/core/scic_sds_ssp_request.c
@@ -180,21 +180,11 @@ static enum sci_status scic_sds_ssp_task_request_await_tc_response_frame_handler
180 180
181static const struct scic_sds_io_request_state_handler scic_sds_ssp_task_request_started_substate_handler_table[] = { 181static const struct scic_sds_io_request_state_handler scic_sds_ssp_task_request_started_substate_handler_table[] = {
182 [SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION] = { 182 [SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_COMPLETION] = {
183 .start_handler = scic_sds_request_default_start_handler,
184 .abort_handler = scic_sds_request_started_state_abort_handler, 183 .abort_handler = scic_sds_request_started_state_abort_handler,
185 .complete_handler = scic_sds_request_default_complete_handler,
186 .destruct_handler = scic_sds_request_default_destruct_handler,
187 .tc_completion_handler = scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler, 184 .tc_completion_handler = scic_sds_ssp_task_request_await_tc_completion_tc_completion_handler,
188 .event_handler = scic_sds_request_default_event_handler,
189 .frame_handler = scic_sds_request_default_frame_handler,
190 }, 185 },
191 [SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE] = { 186 [SCIC_SDS_IO_REQUEST_STARTED_TASK_MGMT_SUBSTATE_AWAIT_TC_RESPONSE] = {
192 .start_handler = scic_sds_request_default_start_handler,
193 .abort_handler = scic_sds_ssp_task_request_await_tc_response_abort_handler, 187 .abort_handler = scic_sds_ssp_task_request_await_tc_response_abort_handler,
194 .complete_handler = scic_sds_request_default_complete_handler,
195 .destruct_handler = scic_sds_request_default_destruct_handler,
196 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
197 .event_handler = scic_sds_request_default_event_handler,
198 .frame_handler = scic_sds_ssp_task_request_await_tc_response_frame_handler, 188 .frame_handler = scic_sds_ssp_task_request_await_tc_response_frame_handler,
199 } 189 }
200}; 190};
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 2d551ad3a46c..25c68cef298e 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_packet_request.c
+++ b/drivers/scsi/isci/core/scic_sds_stp_packet_request.c
@@ -671,49 +671,25 @@ enum sci_status scic_sds_stp_packet_request_started_completion_delay_complete_ha
671 671
672const struct scic_sds_io_request_state_handler scic_sds_stp_packet_request_started_substate_handler_table[] = { 672const struct scic_sds_io_request_state_handler scic_sds_stp_packet_request_started_substate_handler_table[] = {
673 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_TC_COMPLETION_SUBSTATE] = { 673 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_TC_COMPLETION_SUBSTATE] = {
674 .parent.start_handler = scic_sds_request_default_start_handler,
675 .parent.abort_handler = scic_sds_request_started_state_abort_handler, 674 .parent.abort_handler = scic_sds_request_started_state_abort_handler,
676 .parent.complete_handler = scic_sds_request_default_complete_handler,
677 .parent.destruct_handler = scic_sds_request_default_destruct_handler
678 .tc_completion_handler = scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_completion_handler, 675 .tc_completion_handler = scic_sds_stp_packet_request_packet_phase_await_tc_completion_tc_completion_handler,
679 .event_handler = scic_sds_request_default_event_handler,
680 .frame_handler = scic_sds_request_default_frame_handler
681 }, 676 },
682 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_PIO_SETUP_SUBSTATE] = { 677 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_PACKET_PHASE_AWAIT_PIO_SETUP_SUBSTATE] = {
683 .parent.start_handler = scic_sds_request_default_start_handler,
684 .parent.abort_handler = scic_sds_request_started_state_abort_handler, 678 .parent.abort_handler = scic_sds_request_started_state_abort_handler,
685 .parent.complete_handler = scic_sds_request_default_complete_handler,
686 .parent.destruct_handler = scic_sds_request_default_destruct_handler
687 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
688 .event_handler = scic_sds_request_default_event_handler,
689 .frame_handler = scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_handler 679 .frame_handler = scic_sds_stp_packet_request_packet_phase_await_pio_setup_frame_handler
690 }, 680 },
691 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE] = { 681 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_TC_COMPLETION_SUBSTATE] = {
692 .parent.start_handler = scic_sds_request_default_start_handler,
693 .parent.abort_handler = scic_sds_request_started_state_abort_handler, 682 .parent.abort_handler = scic_sds_request_started_state_abort_handler,
694 .parent.complete_handler = scic_sds_request_default_complete_handler,
695 .parent.destruct_handler = scic_sds_request_default_destruct_handler
696 .tc_completion_handler = scic_sds_stp_packet_request_command_phase_await_tc_completion_tc_completion_handler, 683 .tc_completion_handler = scic_sds_stp_packet_request_command_phase_await_tc_completion_tc_completion_handler,
697 .event_handler = scic_sds_request_default_event_handler,
698 .frame_handler = scic_sds_stp_packet_request_command_phase_await_tc_completion_frame_handler 684 .frame_handler = scic_sds_stp_packet_request_command_phase_await_tc_completion_frame_handler
699 }, 685 },
700 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE] = { 686 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMMAND_PHASE_AWAIT_D2H_FIS_SUBSTATE] = {
701 .parent.start_handler = scic_sds_request_default_start_handler,
702 .parent.abort_handler = scic_sds_request_started_state_abort_handler, 687 .parent.abort_handler = scic_sds_request_started_state_abort_handler,
703 .parent.complete_handler = scic_sds_request_default_complete_handler,
704 .parent.destruct_handler = scic_sds_request_default_destruct_handler
705 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
706 .event_handler = scic_sds_request_default_event_handler,
707 .frame_handler = scic_sds_stp_packet_request_command_phase_await_d2h_fis_frame_handler 688 .frame_handler = scic_sds_stp_packet_request_command_phase_await_d2h_fis_frame_handler
708 }, 689 },
709 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMPLETION_DELAY_SUBSTATE] = { 690 [SCIC_SDS_STP_PACKET_REQUEST_STARTED_COMPLETION_DELAY_SUBSTATE] = {
710 .parent.start_handler = scic_sds_request_default_start_handler,
711 .parent.abort_handler = scic_sds_request_started_state_abort_handler, 691 .parent.abort_handler = scic_sds_request_started_state_abort_handler,
712 .parent.complete_handler = scic_sds_stp_packet_request_started_completion_delay_complete_handler, 692 .parent.complete_handler = scic_sds_stp_packet_request_started_completion_delay_complete_handler,
713 .parent.destruct_handler = scic_sds_request_default_destruct_handler
714 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
715 .event_handler = scic_sds_request_default_event_handler,
716 .frame_handler = scic_sds_request_default_frame_handler
717 }, 693 },
718}; 694};
719 695
diff --git a/drivers/scsi/isci/core/scic_sds_stp_request.c b/drivers/scsi/isci/core/scic_sds_stp_request.c
index 6d0a17866aac..0b3bc65b8a2b 100644
--- a/drivers/scsi/isci/core/scic_sds_stp_request.c
+++ b/drivers/scsi/isci/core/scic_sds_stp_request.c
@@ -555,21 +555,11 @@ static enum sci_status scic_sds_stp_request_non_data_await_d2h_frame_handler(
555 555
556static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_non_data_substate_handler_table[] = { 556static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_non_data_substate_handler_table[] = {
557 [SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_H2D_COMPLETION_SUBSTATE] = { 557 [SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_H2D_COMPLETION_SUBSTATE] = {
558 .start_handler = scic_sds_request_default_start_handler,
559 .abort_handler = scic_sds_request_started_state_abort_handler, 558 .abort_handler = scic_sds_request_started_state_abort_handler,
560 .complete_handler = scic_sds_request_default_complete_handler,
561 .destruct_handler = scic_sds_request_default_destruct_handler,
562 .tc_completion_handler = scic_sds_stp_request_non_data_await_h2d_tc_completion_handler, 559 .tc_completion_handler = scic_sds_stp_request_non_data_await_h2d_tc_completion_handler,
563 .event_handler = scic_sds_request_default_event_handler,
564 .frame_handler = scic_sds_request_default_frame_handler,
565 }, 560 },
566 [SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_D2H_SUBSTATE] = { 561 [SCIC_SDS_STP_REQUEST_STARTED_NON_DATA_AWAIT_D2H_SUBSTATE] = {
567 .start_handler = scic_sds_request_default_start_handler,
568 .abort_handler = scic_sds_request_started_state_abort_handler, 562 .abort_handler = scic_sds_request_started_state_abort_handler,
569 .complete_handler = scic_sds_request_default_complete_handler,
570 .destruct_handler = scic_sds_request_default_destruct_handler,
571 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
572 .event_handler = scic_sds_request_default_event_handler,
573 .frame_handler = scic_sds_stp_request_non_data_await_d2h_frame_handler, 563 .frame_handler = scic_sds_stp_request_non_data_await_d2h_frame_handler,
574 } 564 }
575}; 565};
@@ -1212,40 +1202,21 @@ static enum sci_status scic_sds_stp_request_pio_data_in_await_data_event_handler
1212 1202
1213static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_pio_substate_handler_table[] = { 1203static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_pio_substate_handler_table[] = {
1214 [SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_H2D_COMPLETION_SUBSTATE] = { 1204 [SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_H2D_COMPLETION_SUBSTATE] = {
1215 .start_handler = scic_sds_request_default_start_handler,
1216 .abort_handler = scic_sds_request_started_state_abort_handler, 1205 .abort_handler = scic_sds_request_started_state_abort_handler,
1217 .complete_handler = scic_sds_request_default_complete_handler,
1218 .destruct_handler = scic_sds_request_default_destruct_handler,
1219 .tc_completion_handler = scic_sds_stp_request_pio_await_h2d_completion_tc_completion_handler, 1206 .tc_completion_handler = scic_sds_stp_request_pio_await_h2d_completion_tc_completion_handler,
1220 .event_handler = scic_sds_request_default_event_handler,
1221 .frame_handler = scic_sds_request_default_frame_handler
1222 }, 1207 },
1223 [SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE] = { 1208 [SCIC_SDS_STP_REQUEST_STARTED_PIO_AWAIT_FRAME_SUBSTATE] = {
1224 .start_handler = scic_sds_request_default_start_handler,
1225 .abort_handler = scic_sds_request_started_state_abort_handler, 1209 .abort_handler = scic_sds_request_started_state_abort_handler,
1226 .complete_handler = scic_sds_request_default_complete_handler,
1227 .destruct_handler = scic_sds_request_default_destruct_handler,
1228 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1229 .event_handler = scic_sds_request_default_event_handler,
1230 .frame_handler = scic_sds_stp_request_pio_await_frame_frame_handler 1210 .frame_handler = scic_sds_stp_request_pio_await_frame_frame_handler
1231 }, 1211 },
1232 [SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_DATA_SUBSTATE] = { 1212 [SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_IN_AWAIT_DATA_SUBSTATE] = {
1233 .start_handler = scic_sds_request_default_start_handler,
1234 .abort_handler = scic_sds_request_started_state_abort_handler, 1213 .abort_handler = scic_sds_request_started_state_abort_handler,
1235 .complete_handler = scic_sds_request_default_complete_handler,
1236 .destruct_handler = scic_sds_request_default_destruct_handler,
1237 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1238 .event_handler = scic_sds_stp_request_pio_data_in_await_data_event_handler, 1214 .event_handler = scic_sds_stp_request_pio_data_in_await_data_event_handler,
1239 .frame_handler = scic_sds_stp_request_pio_data_in_await_data_frame_handler 1215 .frame_handler = scic_sds_stp_request_pio_data_in_await_data_frame_handler
1240 }, 1216 },
1241 [SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_OUT_TRANSMIT_DATA_SUBSTATE] = { 1217 [SCIC_SDS_STP_REQUEST_STARTED_PIO_DATA_OUT_TRANSMIT_DATA_SUBSTATE] = {
1242 .start_handler = scic_sds_request_default_start_handler,
1243 .abort_handler = scic_sds_request_started_state_abort_handler, 1218 .abort_handler = scic_sds_request_started_state_abort_handler,
1244 .complete_handler = scic_sds_request_default_complete_handler,
1245 .destruct_handler = scic_sds_request_default_destruct_handler,
1246 .tc_completion_handler = scic_sds_stp_request_pio_data_out_await_data_transmit_completion_tc_completion_handler, 1219 .tc_completion_handler = scic_sds_stp_request_pio_data_out_await_data_transmit_completion_tc_completion_handler,
1247 .event_handler = scic_sds_request_default_event_handler,
1248 .frame_handler = scic_sds_request_default_frame_handler,
1249 } 1220 }
1250}; 1221};
1251 1222
@@ -1510,21 +1481,12 @@ static enum sci_status scic_sds_stp_request_udma_await_d2h_reg_fis_frame_handler
1510 1481
1511static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_udma_substate_handler_table[] = { 1482static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_udma_substate_handler_table[] = {
1512 [SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_TC_COMPLETION_SUBSTATE] = { 1483 [SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_TC_COMPLETION_SUBSTATE] = {
1513 .start_handler = scic_sds_request_default_start_handler,
1514 .abort_handler = scic_sds_request_started_state_abort_handler, 1484 .abort_handler = scic_sds_request_started_state_abort_handler,
1515 .complete_handler = scic_sds_request_default_complete_handler,
1516 .destruct_handler = scic_sds_request_default_destruct_handler,
1517 .tc_completion_handler = scic_sds_stp_request_udma_await_tc_completion_tc_completion_handler, 1485 .tc_completion_handler = scic_sds_stp_request_udma_await_tc_completion_tc_completion_handler,
1518 .event_handler = scic_sds_request_default_event_handler,
1519 .frame_handler = scic_sds_stp_request_udma_general_frame_handler, 1486 .frame_handler = scic_sds_stp_request_udma_general_frame_handler,
1520 }, 1487 },
1521 [SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_D2H_REG_FIS_SUBSTATE] = { 1488 [SCIC_SDS_STP_REQUEST_STARTED_UDMA_AWAIT_D2H_REG_FIS_SUBSTATE] = {
1522 .start_handler = scic_sds_request_default_start_handler,
1523 .abort_handler = scic_sds_request_started_state_abort_handler, 1489 .abort_handler = scic_sds_request_started_state_abort_handler,
1524 .complete_handler = scic_sds_request_default_complete_handler,
1525 .destruct_handler = scic_sds_request_default_destruct_handler,
1526 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1527 .event_handler = scic_sds_request_default_event_handler,
1528 .frame_handler = scic_sds_stp_request_udma_await_d2h_reg_fis_frame_handler, 1490 .frame_handler = scic_sds_stp_request_udma_await_d2h_reg_fis_frame_handler,
1529 }, 1491 },
1530}; 1492};
@@ -1763,30 +1725,15 @@ static enum sci_status scic_sds_stp_request_soft_reset_await_d2h_frame_handler(
1763 1725
1764static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_soft_reset_substate_handler_table[] = { 1726static const struct scic_sds_io_request_state_handler scic_sds_stp_request_started_soft_reset_substate_handler_table[] = {
1765 [SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_ASSERTED_COMPLETION_SUBSTATE] = { 1727 [SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_ASSERTED_COMPLETION_SUBSTATE] = {
1766 .start_handler = scic_sds_request_default_start_handler,
1767 .abort_handler = scic_sds_request_started_state_abort_handler, 1728 .abort_handler = scic_sds_request_started_state_abort_handler,
1768 .complete_handler = scic_sds_request_default_complete_handler,
1769 .destruct_handler = scic_sds_request_default_destruct_handler,
1770 .tc_completion_handler = scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_completion_handler, 1729 .tc_completion_handler = scic_sds_stp_request_soft_reset_await_h2d_asserted_tc_completion_handler,
1771 .event_handler = scic_sds_request_default_event_handler,
1772 .frame_handler = scic_sds_request_default_frame_handler,
1773 }, 1730 },
1774 [SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_DIAGNOSTIC_COMPLETION_SUBSTATE] = { 1731 [SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_H2D_DIAGNOSTIC_COMPLETION_SUBSTATE] = {
1775 .start_handler = scic_sds_request_default_start_handler,
1776 .abort_handler = scic_sds_request_started_state_abort_handler, 1732 .abort_handler = scic_sds_request_started_state_abort_handler,
1777 .complete_handler = scic_sds_request_default_complete_handler,
1778 .destruct_handler = scic_sds_request_default_destruct_handler,
1779 .tc_completion_handler = scic_sds_stp_request_soft_reset_await_h2d_diagnostic_tc_completion_handler, 1733 .tc_completion_handler = scic_sds_stp_request_soft_reset_await_h2d_diagnostic_tc_completion_handler,
1780 .event_handler = scic_sds_request_default_event_handler,
1781 .frame_handler = scic_sds_request_default_frame_handler,
1782 }, 1734 },
1783 [SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_D2H_RESPONSE_FRAME_SUBSTATE] = { 1735 [SCIC_SDS_STP_REQUEST_STARTED_SOFT_RESET_AWAIT_D2H_RESPONSE_FRAME_SUBSTATE] = {
1784 .start_handler = scic_sds_request_default_start_handler,
1785 .abort_handler = scic_sds_request_started_state_abort_handler, 1736 .abort_handler = scic_sds_request_started_state_abort_handler,
1786 .complete_handler = scic_sds_request_default_complete_handler,
1787 .destruct_handler = scic_sds_request_default_destruct_handler,
1788 .tc_completion_handler = scic_sds_request_default_tc_completion_handler,
1789 .event_handler = scic_sds_request_default_event_handler,
1790 .frame_handler = scic_sds_stp_request_soft_reset_await_d2h_frame_handler, 1737 .frame_handler = scic_sds_stp_request_soft_reset_await_d2h_frame_handler,
1791 }, 1738 },
1792}; 1739};