aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-05-01 19:58:46 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:04:45 -0400
commit971cc2ff90875a4ca28b7da5b91a408cc8151fdc (patch)
tree19219586d7ea8ed142c9931a01cbc2d7c61db429
parent01bec7788db9d1bb2c594d1f1916096ce6299f38 (diff)
isci: kill scic_sds_remote_device.state_handlers
Remove the now unused state_handler infrastructure for remote_devices. 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.c136
-rw-r--r--drivers/scsi/isci/remote_device.h56
2 files changed, 5 insertions, 187 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index 0295349b40e5..a23ebe85773e 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -809,46 +809,10 @@ static void scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handl
809 isci_remote_device_ready(scic->ihost, idev); 809 isci_remote_device_ready(scic->ihost, idev);
810} 810}
811 811
812static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_state_handler_table[] = {
813 [SCI_BASE_REMOTE_DEVICE_STATE_INITIAL] = {
814 },
815 [SCI_BASE_REMOTE_DEVICE_STATE_STOPPED] = {
816 },
817 [SCI_BASE_REMOTE_DEVICE_STATE_STARTING] = {
818 },
819 [SCI_BASE_REMOTE_DEVICE_STATE_READY] = {
820 },
821 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = {
822 },
823 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = {
824 },
825 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ] = {
826 },
827 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR] = {
828 },
829 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET] = {
830 },
831 [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = {
832 },
833 [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = {
834 },
835 [SCI_BASE_REMOTE_DEVICE_STATE_STOPPING] = {
836 },
837 [SCI_BASE_REMOTE_DEVICE_STATE_FAILED] = {
838 },
839 [SCI_BASE_REMOTE_DEVICE_STATE_RESETTING] = {
840 },
841 [SCI_BASE_REMOTE_DEVICE_STATE_FINAL] = {
842 }
843};
844
845static void scic_sds_remote_device_initial_state_enter(void *object) 812static void scic_sds_remote_device_initial_state_enter(void *object)
846{ 813{
847 struct scic_sds_remote_device *sci_dev = object; 814 struct scic_sds_remote_device *sci_dev = object;
848 815
849 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
850 SCI_BASE_REMOTE_DEVICE_STATE_INITIAL);
851
852 /* Initial state is a transitional state to the stopped state */ 816 /* Initial state is a transitional state to the stopped state */
853 sci_base_state_machine_change_state(&sci_dev->state_machine, 817 sci_base_state_machine_change_state(&sci_dev->state_machine,
854 SCI_BASE_REMOTE_DEVICE_STATE_STOPPED); 818 SCI_BASE_REMOTE_DEVICE_STATE_STOPPED);
@@ -953,9 +917,6 @@ static void scic_sds_remote_device_stopped_state_enter(void *object)
953 ihost = scic->ihost; 917 ihost = scic->ihost;
954 idev = sci_dev_to_idev(sci_dev); 918 idev = sci_dev_to_idev(sci_dev);
955 919
956 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
957 SCI_BASE_REMOTE_DEVICE_STATE_STOPPED);
958
959 /* If we are entering from the stopping state let the SCI User know that 920 /* If we are entering from the stopping state let the SCI User know that
960 * the stop operation has completed. 921 * the stop operation has completed.
961 */ 922 */
@@ -973,9 +934,6 @@ static void scic_sds_remote_device_starting_state_enter(void *object)
973 struct isci_host *ihost = scic->ihost; 934 struct isci_host *ihost = scic->ihost;
974 struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); 935 struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
975 936
976 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
977 SCI_BASE_REMOTE_DEVICE_STATE_STARTING);
978
979 isci_remote_device_not_ready(ihost, idev, 937 isci_remote_device_not_ready(ihost, idev,
980 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED); 938 SCIC_REMOTE_DEVICE_NOT_READY_START_REQUESTED);
981} 939}
@@ -986,10 +944,6 @@ static void scic_sds_remote_device_ready_state_enter(void *object)
986 struct scic_sds_controller *scic = sci_dev->owning_port->owning_controller; 944 struct scic_sds_controller *scic = sci_dev->owning_port->owning_controller;
987 struct domain_device *dev = sci_dev_to_domain(sci_dev); 945 struct domain_device *dev = sci_dev_to_domain(sci_dev);
988 946
989 SET_STATE_HANDLER(sci_dev,
990 scic_sds_remote_device_state_handler_table,
991 SCI_BASE_REMOTE_DEVICE_STATE_READY);
992
993 scic->remote_device_sequence[sci_dev->rnc.remote_node_index]++; 947 scic->remote_device_sequence[sci_dev->rnc.remote_node_index]++;
994 948
995 if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_SATA)) { 949 if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_SATA)) {
@@ -1016,38 +970,10 @@ static void scic_sds_remote_device_ready_state_exit(void *object)
1016 } 970 }
1017} 971}
1018 972
1019static void scic_sds_remote_device_stopping_state_enter(void *object)
1020{
1021 struct scic_sds_remote_device *sci_dev = object;
1022
1023 SET_STATE_HANDLER(
1024 sci_dev,
1025 scic_sds_remote_device_state_handler_table,
1026 SCI_BASE_REMOTE_DEVICE_STATE_STOPPING
1027 );
1028}
1029
1030static void scic_sds_remote_device_failed_state_enter(void *object)
1031{
1032 struct scic_sds_remote_device *sci_dev = object;
1033
1034 SET_STATE_HANDLER(
1035 sci_dev,
1036 scic_sds_remote_device_state_handler_table,
1037 SCI_BASE_REMOTE_DEVICE_STATE_FAILED
1038 );
1039}
1040
1041static void scic_sds_remote_device_resetting_state_enter(void *object) 973static void scic_sds_remote_device_resetting_state_enter(void *object)
1042{ 974{
1043 struct scic_sds_remote_device *sci_dev = object; 975 struct scic_sds_remote_device *sci_dev = object;
1044 976
1045 SET_STATE_HANDLER(
1046 sci_dev,
1047 scic_sds_remote_device_state_handler_table,
1048 SCI_BASE_REMOTE_DEVICE_STATE_RESETTING
1049 );
1050
1051 scic_sds_remote_node_context_suspend( 977 scic_sds_remote_node_context_suspend(
1052 &sci_dev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL); 978 &sci_dev->rnc, SCI_SOFTWARE_SUSPENSION, NULL, NULL);
1053} 979}
@@ -1059,24 +985,10 @@ static void scic_sds_remote_device_resetting_state_exit(void *object)
1059 scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL); 985 scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL);
1060} 986}
1061 987
1062static void scic_sds_remote_device_final_state_enter(void *object)
1063{
1064 struct scic_sds_remote_device *sci_dev = object;
1065
1066 SET_STATE_HANDLER(
1067 sci_dev,
1068 scic_sds_remote_device_state_handler_table,
1069 SCI_BASE_REMOTE_DEVICE_STATE_FINAL
1070 );
1071}
1072
1073static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *object) 988static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *object)
1074{ 989{
1075 struct scic_sds_remote_device *sci_dev = object; 990 struct scic_sds_remote_device *sci_dev = object;
1076 991
1077 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1078 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
1079
1080 sci_dev->working_request = NULL; 992 sci_dev->working_request = NULL;
1081 if (scic_sds_remote_node_context_is_ready(&sci_dev->rnc)) { 993 if (scic_sds_remote_node_context_is_ready(&sci_dev->rnc)) {
1082 /* 994 /*
@@ -1097,51 +1009,26 @@ static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object)
1097 1009
1098 BUG_ON(sci_dev->working_request == NULL); 1010 BUG_ON(sci_dev->working_request == NULL);
1099 1011
1100 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1101 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
1102
1103 isci_remote_device_not_ready(scic->ihost, sci_dev_to_idev(sci_dev), 1012 isci_remote_device_not_ready(scic->ihost, sci_dev_to_idev(sci_dev),
1104 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED); 1013 SCIC_REMOTE_DEVICE_NOT_READY_SATA_REQUEST_STARTED);
1105} 1014}
1106 1015
1107static void scic_sds_stp_remote_device_ready_ncq_substate_enter(void *object)
1108{
1109 struct scic_sds_remote_device *sci_dev = object;
1110
1111 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1112 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ);
1113}
1114
1115static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(void *object) 1016static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter(void *object)
1116{ 1017{
1117 struct scic_sds_remote_device *sci_dev = object; 1018 struct scic_sds_remote_device *sci_dev = object;
1118 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 1019 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
1119 struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); 1020 struct isci_remote_device *idev = sci_dev_to_idev(sci_dev);
1120 1021
1121 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1122 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR);
1123
1124 if (sci_dev->not_ready_reason == SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED) 1022 if (sci_dev->not_ready_reason == SCIC_REMOTE_DEVICE_NOT_READY_SATA_SDB_ERROR_FIS_RECEIVED)
1125 isci_remote_device_not_ready(scic->ihost, idev, 1023 isci_remote_device_not_ready(scic->ihost, idev,
1126 sci_dev->not_ready_reason); 1024 sci_dev->not_ready_reason);
1127} 1025}
1128 1026
1129static void scic_sds_stp_remote_device_ready_await_reset_substate_enter(void *object)
1130{
1131 struct scic_sds_remote_device *sci_dev = object;
1132
1133 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1134 SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET);
1135}
1136
1137static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object) 1027static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object)
1138{ 1028{
1139 struct scic_sds_remote_device *sci_dev = object; 1029 struct scic_sds_remote_device *sci_dev = object;
1140 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); 1030 struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev);
1141 1031
1142 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1143 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE);
1144
1145 isci_remote_device_ready(scic->ihost, sci_dev_to_idev(sci_dev)); 1032 isci_remote_device_ready(scic->ihost, sci_dev_to_idev(sci_dev));
1146} 1033}
1147 1034
@@ -1152,9 +1039,6 @@ static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object)
1152 1039
1153 BUG_ON(sci_dev->working_request == NULL); 1040 BUG_ON(sci_dev->working_request == NULL);
1154 1041
1155 SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table,
1156 SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD);
1157
1158 isci_remote_device_not_ready(scic->ihost, sci_dev_to_idev(sci_dev), 1042 isci_remote_device_not_ready(scic->ihost, sci_dev_to_idev(sci_dev),
1159 SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED); 1043 SCIC_REMOTE_DEVICE_NOT_READY_SMP_REQUEST_STARTED);
1160} 1044}
@@ -1186,15 +1070,11 @@ static const struct sci_base_state scic_sds_remote_device_state_table[] = {
1186 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = { 1070 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = {
1187 .enter_state = scic_sds_stp_remote_device_ready_cmd_substate_enter, 1071 .enter_state = scic_sds_stp_remote_device_ready_cmd_substate_enter,
1188 }, 1072 },
1189 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ] = { 1073 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ] = { },
1190 .enter_state = scic_sds_stp_remote_device_ready_ncq_substate_enter,
1191 },
1192 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR] = { 1074 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ_ERROR] = {
1193 .enter_state = scic_sds_stp_remote_device_ready_ncq_error_substate_enter, 1075 .enter_state = scic_sds_stp_remote_device_ready_ncq_error_substate_enter,
1194 }, 1076 },
1195 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET] = { 1077 [SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET] = { },
1196 .enter_state = scic_sds_stp_remote_device_ready_await_reset_substate_enter,
1197 },
1198 [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = { 1078 [SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = {
1199 .enter_state = scic_sds_smp_remote_device_ready_idle_substate_enter, 1079 .enter_state = scic_sds_smp_remote_device_ready_idle_substate_enter,
1200 }, 1080 },
@@ -1202,19 +1082,13 @@ static const struct sci_base_state scic_sds_remote_device_state_table[] = {
1202 .enter_state = scic_sds_smp_remote_device_ready_cmd_substate_enter, 1082 .enter_state = scic_sds_smp_remote_device_ready_cmd_substate_enter,
1203 .exit_state = scic_sds_smp_remote_device_ready_cmd_substate_exit, 1083 .exit_state = scic_sds_smp_remote_device_ready_cmd_substate_exit,
1204 }, 1084 },
1205 [SCI_BASE_REMOTE_DEVICE_STATE_STOPPING] = { 1085 [SCI_BASE_REMOTE_DEVICE_STATE_STOPPING] = { },
1206 .enter_state = scic_sds_remote_device_stopping_state_enter, 1086 [SCI_BASE_REMOTE_DEVICE_STATE_FAILED] = { },
1207 },
1208 [SCI_BASE_REMOTE_DEVICE_STATE_FAILED] = {
1209 .enter_state = scic_sds_remote_device_failed_state_enter,
1210 },
1211 [SCI_BASE_REMOTE_DEVICE_STATE_RESETTING] = { 1087 [SCI_BASE_REMOTE_DEVICE_STATE_RESETTING] = {
1212 .enter_state = scic_sds_remote_device_resetting_state_enter, 1088 .enter_state = scic_sds_remote_device_resetting_state_enter,
1213 .exit_state = scic_sds_remote_device_resetting_state_exit 1089 .exit_state = scic_sds_remote_device_resetting_state_exit
1214 }, 1090 },
1215 [SCI_BASE_REMOTE_DEVICE_STATE_FINAL] = { 1091 [SCI_BASE_REMOTE_DEVICE_STATE_FINAL] = { },
1216 .enter_state = scic_sds_remote_device_final_state_enter,
1217 },
1218}; 1092};
1219 1093
1220/** 1094/**
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h
index 1577b126aedc..18f7f9663661 100644
--- a/drivers/scsi/isci/remote_device.h
+++ b/drivers/scsi/isci/remote_device.h
@@ -128,12 +128,6 @@ struct scic_sds_remote_device {
128 * assigned in the state handlers and used in the state transition. 128 * assigned in the state handlers and used in the state transition.
129 */ 129 */
130 u32 not_ready_reason; 130 u32 not_ready_reason;
131
132 /**
133 * This field maintains the set of state handlers for the remote device
134 * object. These are changed each time the remote device enters a new state.
135 */
136 const struct scic_sds_remote_device_state_handler *state_handlers;
137}; 131};
138 132
139struct isci_remote_device { 133struct isci_remote_device {
@@ -347,47 +341,6 @@ static inline bool dev_is_expander(struct domain_device *dev)
347 return dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV; 341 return dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV;
348} 342}
349 343
350typedef enum sci_status (*scic_sds_remote_device_request_handler_t)(
351 struct scic_sds_remote_device *device,
352 struct scic_sds_request *request);
353
354typedef enum sci_status (*scic_sds_remote_device_high_priority_request_complete_handler_t)(
355 struct scic_sds_remote_device *device,
356 struct scic_sds_request *request,
357 void *,
358 enum sci_io_status);
359
360typedef enum sci_status (*scic_sds_remote_device_handler_t)(
361 struct scic_sds_remote_device *sci_dev);
362
363typedef enum sci_status (*scic_sds_remote_device_suspend_handler_t)(
364 struct scic_sds_remote_device *sci_dev,
365 u32 suspend_type);
366
367typedef enum sci_status (*scic_sds_remote_device_resume_handler_t)(
368 struct scic_sds_remote_device *sci_dev);
369
370typedef enum sci_status (*scic_sds_remote_device_frame_handler_t)(
371 struct scic_sds_remote_device *sci_dev,
372 u32 frame_index);
373
374typedef enum sci_status (*scic_sds_remote_device_event_handler_t)(
375 struct scic_sds_remote_device *sci_dev,
376 u32 event_code);
377
378typedef void (*scic_sds_remote_device_ready_not_ready_handler_t)(
379 struct scic_sds_remote_device *sci_dev);
380
381/**
382 * struct scic_sds_remote_device_state_handler - This structure conains the
383 * state handlers that are needed to process requests for the SCU remote
384 * device objects.
385 *
386 *
387 */
388struct scic_sds_remote_device_state_handler {
389};
390
391/** 344/**
392 * scic_sds_remote_device_increment_request_count() - 345 * scic_sds_remote_device_increment_request_count() -
393 * 346 *
@@ -431,15 +384,6 @@ struct scic_sds_remote_device_state_handler {
431 scic_sds_port_get_controller(scic_sds_remote_device_get_port(sci_dev)) 384 scic_sds_port_get_controller(scic_sds_remote_device_get_port(sci_dev))
432 385
433/** 386/**
434 * scic_sds_remote_device_set_state_handlers() -
435 *
436 * This macro sets the remote device state handlers pointer and is set on entry
437 * to each device state.
438 */
439#define scic_sds_remote_device_set_state_handlers(sci_dev, handlers) \
440 ((sci_dev)->state_handlers = (handlers))
441
442/**
443 * scic_sds_remote_device_get_port() - 387 * scic_sds_remote_device_get_port() -
444 * 388 *
445 * This macro returns the owning port of this device 389 * This macro returns the owning port of this device