diff options
author | Piotr Sawicki <piotr.sawicki@intel.com> | 2011-05-11 19:52:16 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:04:48 -0400 |
commit | c777c26ca2a06164e1b8c8ccf4cd76cd645a9bbb (patch) | |
tree | a55a4d14a746592be6d2361b8bbd09736894791e | |
parent | 4f20ef4f57aa52fd3356c143a8f3d2bd18dc61fc (diff) |
isci: c99 port state handlers
Name the table fields for consistancy and clarity.
Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | drivers/scsi/isci/port.c | 227 |
1 files changed, 106 insertions, 121 deletions
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index 6d2633051adc..e386066825b2 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c | |||
@@ -1567,56 +1567,48 @@ static enum sci_status scic_sds_port_default_complete_io_handler(struct scic_sds | |||
1567 | return default_port_handler(sci_port, __func__); | 1567 | return default_port_handler(sci_port, __func__); |
1568 | } | 1568 | } |
1569 | 1569 | ||
1570 | 1570 | static struct scic_sds_port_state_handler scic_sds_port_ready_substate_handler_table[] = { | |
1571 | 1571 | [SCIC_SDS_PORT_READY_SUBSTATE_WAITING] = { | |
1572 | static struct scic_sds_port_state_handler | 1572 | .start_handler = scic_sds_port_default_start_handler, |
1573 | scic_sds_port_ready_substate_handler_table[SCIC_SDS_PORT_READY_MAX_SUBSTATES] = { | 1573 | .stop_handler = scic_sds_port_ready_substate_stop_handler, |
1574 | { | 1574 | .destruct_handler = scic_sds_port_default_destruct_handler, |
1575 | /* SCIC_SDS_PORT_READY_SUBSTATE_WAITING */ | 1575 | .reset_handler = scic_sds_port_default_reset_handler, |
1576 | scic_sds_port_default_start_handler, | 1576 | .add_phy_handler = scic_sds_port_ready_substate_add_phy_handler, |
1577 | scic_sds_port_ready_substate_stop_handler, | 1577 | .remove_phy_handler = scic_sds_port_default_remove_phy_handler, |
1578 | scic_sds_port_default_destruct_handler, | 1578 | .frame_handler = scic_sds_port_default_frame_handler, |
1579 | scic_sds_port_default_reset_handler, | 1579 | .event_handler = scic_sds_port_default_event_handler, |
1580 | scic_sds_port_ready_substate_add_phy_handler, | 1580 | .link_up_handler = scic_sds_port_ready_waiting_substate_link_up_handler, |
1581 | scic_sds_port_default_remove_phy_handler, | 1581 | .link_down_handler = scic_sds_port_default_link_down_handler, |
1582 | scic_sds_port_default_frame_handler, | 1582 | .start_io_handler = scic_sds_port_ready_waiting_substate_start_io_handler, |
1583 | scic_sds_port_default_event_handler, | 1583 | .complete_io_handler = scic_sds_port_ready_substate_complete_io_handler, |
1584 | scic_sds_port_ready_waiting_substate_link_up_handler, | ||
1585 | scic_sds_port_default_link_down_handler, | ||
1586 | scic_sds_port_ready_waiting_substate_start_io_handler, | ||
1587 | scic_sds_port_ready_substate_complete_io_handler, | ||
1588 | }, | 1584 | }, |
1589 | 1585 | [SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL] = { | |
1590 | { | 1586 | .start_handler = scic_sds_port_default_start_handler, |
1591 | /* SCIC_SDS_PORT_READY_SUBSTATE_OPERATIONAL */ | 1587 | .stop_handler = scic_sds_port_ready_substate_stop_handler, |
1592 | scic_sds_port_default_start_handler, | 1588 | .destruct_handler = scic_sds_port_default_destruct_handler, |
1593 | scic_sds_port_ready_substate_stop_handler, | 1589 | .reset_handler = scic_sds_port_ready_operational_substate_reset_handler, |
1594 | scic_sds_port_default_destruct_handler, | 1590 | .add_phy_handler = scic_sds_port_ready_substate_add_phy_handler, |
1595 | scic_sds_port_ready_operational_substate_reset_handler, | 1591 | .remove_phy_handler = scic_sds_port_ready_substate_remove_phy_handler, |
1596 | scic_sds_port_ready_substate_add_phy_handler, | 1592 | .frame_handler = scic_sds_port_default_frame_handler, |
1597 | scic_sds_port_ready_substate_remove_phy_handler, | 1593 | .event_handler = scic_sds_port_default_event_handler, |
1598 | scic_sds_port_default_frame_handler, | 1594 | .link_up_handler = scic_sds_port_ready_operational_substate_link_up_handler, |
1599 | scic_sds_port_default_event_handler, | 1595 | .link_down_handler = scic_sds_port_ready_operational_substate_link_down_handler, |
1600 | scic_sds_port_ready_operational_substate_link_up_handler, | 1596 | .start_io_handler = scic_sds_port_ready_operational_substate_start_io_handler, |
1601 | scic_sds_port_ready_operational_substate_link_down_handler, | 1597 | .complete_io_handler = scic_sds_port_ready_substate_complete_io_handler, |
1602 | scic_sds_port_ready_operational_substate_start_io_handler, | ||
1603 | scic_sds_port_ready_substate_complete_io_handler, | ||
1604 | }, | 1598 | }, |
1605 | 1599 | [SCIC_SDS_PORT_READY_SUBSTATE_CONFIGURING] = { | |
1606 | { | 1600 | .start_handler = scic_sds_port_default_start_handler, |
1607 | /* SCIC_SDS_PORT_READY_SUBSTATE_CONFIGURING */ | 1601 | .stop_handler = scic_sds_port_ready_substate_stop_handler, |
1608 | scic_sds_port_default_start_handler, | 1602 | .destruct_handler = scic_sds_port_default_destruct_handler, |
1609 | scic_sds_port_ready_substate_stop_handler, | 1603 | .reset_handler = scic_sds_port_default_reset_handler, |
1610 | scic_sds_port_default_destruct_handler, | 1604 | .add_phy_handler = scic_sds_port_ready_configuring_substate_add_phy_handler, |
1611 | scic_sds_port_default_reset_handler, | 1605 | .remove_phy_handler = scic_sds_port_ready_configuring_substate_remove_phy_handler, |
1612 | scic_sds_port_ready_configuring_substate_add_phy_handler, | 1606 | .frame_handler = scic_sds_port_default_frame_handler, |
1613 | scic_sds_port_ready_configuring_substate_remove_phy_handler, | 1607 | .event_handler = scic_sds_port_default_event_handler, |
1614 | scic_sds_port_default_frame_handler, | 1608 | .link_up_handler = scic_sds_port_default_link_up_handler, |
1615 | scic_sds_port_default_event_handler, | 1609 | .link_down_handler = scic_sds_port_default_link_down_handler, |
1616 | scic_sds_port_default_link_up_handler, | 1610 | .start_io_handler = scic_sds_port_default_start_io_handler, |
1617 | scic_sds_port_default_link_down_handler, | 1611 | .complete_io_handler = scic_sds_port_ready_configuring_substate_complete_io_handler |
1618 | scic_sds_port_default_start_io_handler, | ||
1619 | scic_sds_port_ready_configuring_substate_complete_io_handler | ||
1620 | } | 1612 | } |
1621 | }; | 1613 | }; |
1622 | 1614 | ||
@@ -2166,83 +2158,76 @@ static void scic_sds_port_reset_state_link_down_handler( | |||
2166 | scic_sds_port_deactivate_phy(port, phy, false); | 2158 | scic_sds_port_deactivate_phy(port, phy, false); |
2167 | } | 2159 | } |
2168 | 2160 | ||
2169 | static struct scic_sds_port_state_handler | 2161 | static struct scic_sds_port_state_handler scic_sds_port_state_handler_table[] = { |
2170 | scic_sds_port_state_handler_table[SCI_BASE_PORT_MAX_STATES] = | 2162 | [SCI_BASE_PORT_STATE_STOPPED] = { |
2171 | { | 2163 | .start_handler = scic_sds_port_stopped_state_start_handler, |
2172 | /* SCI_BASE_PORT_STATE_STOPPED */ | 2164 | .stop_handler = scic_sds_port_stopped_state_stop_handler, |
2173 | { | 2165 | .destruct_handler = scic_sds_port_stopped_state_destruct_handler, |
2174 | scic_sds_port_stopped_state_start_handler, | 2166 | .reset_handler = scic_sds_port_default_reset_handler, |
2175 | scic_sds_port_stopped_state_stop_handler, | 2167 | .add_phy_handler = scic_sds_port_stopped_state_add_phy_handler, |
2176 | scic_sds_port_stopped_state_destruct_handler, | 2168 | .remove_phy_handler = scic_sds_port_stopped_state_remove_phy_handler, |
2177 | scic_sds_port_default_reset_handler, | 2169 | .frame_handler = scic_sds_port_default_frame_handler, |
2178 | scic_sds_port_stopped_state_add_phy_handler, | 2170 | .event_handler = scic_sds_port_default_event_handler, |
2179 | scic_sds_port_stopped_state_remove_phy_handler, | 2171 | .link_up_handler = scic_sds_port_default_link_up_handler, |
2180 | scic_sds_port_default_frame_handler, | 2172 | .link_down_handler = scic_sds_port_default_link_down_handler, |
2181 | scic_sds_port_default_event_handler, | 2173 | .start_io_handler = scic_sds_port_default_start_io_handler, |
2182 | scic_sds_port_default_link_up_handler, | 2174 | .complete_io_handler = scic_sds_port_default_complete_io_handler |
2183 | scic_sds_port_default_link_down_handler, | ||
2184 | scic_sds_port_default_start_io_handler, | ||
2185 | scic_sds_port_default_complete_io_handler | ||
2186 | }, | 2175 | }, |
2187 | /* SCI_BASE_PORT_STATE_STOPPING */ | 2176 | [SCI_BASE_PORT_STATE_STOPPING] = { |
2188 | { | 2177 | .start_handler = scic_sds_port_default_start_handler, |
2189 | scic_sds_port_default_start_handler, | 2178 | .stop_handler = scic_sds_port_default_stop_handler, |
2190 | scic_sds_port_default_stop_handler, | 2179 | .destruct_handler = scic_sds_port_default_destruct_handler, |
2191 | scic_sds_port_default_destruct_handler, | 2180 | .reset_handler = scic_sds_port_default_reset_handler, |
2192 | scic_sds_port_default_reset_handler, | 2181 | .add_phy_handler = scic_sds_port_default_add_phy_handler, |
2193 | scic_sds_port_default_add_phy_handler, | 2182 | .remove_phy_handler = scic_sds_port_default_remove_phy_handler, |
2194 | scic_sds_port_default_remove_phy_handler, | 2183 | .frame_handler = scic_sds_port_default_frame_handler, |
2195 | scic_sds_port_default_frame_handler, | 2184 | .event_handler = scic_sds_port_default_event_handler, |
2196 | scic_sds_port_default_event_handler, | 2185 | .link_up_handler = scic_sds_port_default_link_up_handler, |
2197 | scic_sds_port_default_link_up_handler, | 2186 | .link_down_handler = scic_sds_port_default_link_down_handler, |
2198 | scic_sds_port_default_link_down_handler, | 2187 | .start_io_handler = scic_sds_port_default_start_io_handler, |
2199 | scic_sds_port_default_start_io_handler, | 2188 | .complete_io_handler = scic_sds_port_stopping_state_complete_io_handler |
2200 | scic_sds_port_stopping_state_complete_io_handler | ||
2201 | }, | 2189 | }, |
2202 | /* SCI_BASE_PORT_STATE_READY */ | 2190 | [SCI_BASE_PORT_STATE_READY] = { |
2203 | { | 2191 | .start_handler = scic_sds_port_default_start_handler, |
2204 | scic_sds_port_default_start_handler, | 2192 | .stop_handler = scic_sds_port_default_stop_handler, |
2205 | scic_sds_port_default_stop_handler, | 2193 | .destruct_handler = scic_sds_port_default_destruct_handler, |
2206 | scic_sds_port_default_destruct_handler, | 2194 | .reset_handler = scic_sds_port_default_reset_handler, |
2207 | scic_sds_port_default_reset_handler, | 2195 | .add_phy_handler = scic_sds_port_default_add_phy_handler, |
2208 | scic_sds_port_default_add_phy_handler, | 2196 | .remove_phy_handler = scic_sds_port_default_remove_phy_handler, |
2209 | scic_sds_port_default_remove_phy_handler, | 2197 | .frame_handler = scic_sds_port_default_frame_handler, |
2210 | scic_sds_port_default_frame_handler, | 2198 | .event_handler = scic_sds_port_default_event_handler, |
2211 | scic_sds_port_default_event_handler, | 2199 | .link_up_handler = scic_sds_port_default_link_up_handler, |
2212 | scic_sds_port_default_link_up_handler, | 2200 | .link_down_handler = scic_sds_port_default_link_down_handler, |
2213 | scic_sds_port_default_link_down_handler, | 2201 | .start_io_handler = scic_sds_port_default_start_io_handler, |
2214 | scic_sds_port_default_start_io_handler, | 2202 | .complete_io_handler = scic_sds_port_general_complete_io_handler |
2215 | scic_sds_port_general_complete_io_handler | ||
2216 | }, | 2203 | }, |
2217 | /* SCI_BASE_PORT_STATE_RESETTING */ | 2204 | [SCI_BASE_PORT_STATE_RESETTING] = { |
2218 | { | 2205 | .start_handler = scic_sds_port_default_start_handler, |
2219 | scic_sds_port_default_start_handler, | 2206 | .stop_handler = scic_sds_port_reset_state_stop_handler, |
2220 | scic_sds_port_reset_state_stop_handler, | 2207 | .destruct_handler = scic_sds_port_default_destruct_handler, |
2221 | scic_sds_port_default_destruct_handler, | 2208 | .reset_handler = scic_sds_port_default_reset_handler, |
2222 | scic_sds_port_default_reset_handler, | 2209 | .add_phy_handler = scic_sds_port_default_add_phy_handler, |
2223 | scic_sds_port_default_add_phy_handler, | 2210 | .remove_phy_handler = scic_sds_port_default_remove_phy_handler, |
2224 | scic_sds_port_default_remove_phy_handler, | 2211 | .frame_handler = scic_sds_port_default_frame_handler, |
2225 | scic_sds_port_default_frame_handler, | 2212 | .event_handler = scic_sds_port_default_event_handler, |
2226 | scic_sds_port_default_event_handler, | 2213 | .link_up_handler = scic_sds_port_reset_state_link_up_handler, |
2227 | scic_sds_port_reset_state_link_up_handler, | 2214 | .link_down_handler = scic_sds_port_reset_state_link_down_handler, |
2228 | scic_sds_port_reset_state_link_down_handler, | 2215 | .start_io_handler = scic_sds_port_default_start_io_handler, |
2229 | scic_sds_port_default_start_io_handler, | 2216 | .complete_io_handler = scic_sds_port_general_complete_io_handler |
2230 | scic_sds_port_general_complete_io_handler | ||
2231 | }, | 2217 | }, |
2232 | /* SCI_BASE_PORT_STATE_FAILED */ | 2218 | [SCI_BASE_PORT_STATE_FAILED] = { |
2233 | { | 2219 | .start_handler = scic_sds_port_default_start_handler, |
2234 | scic_sds_port_default_start_handler, | 2220 | .stop_handler = scic_sds_port_default_stop_handler, |
2235 | scic_sds_port_default_stop_handler, | 2221 | .destruct_handler = scic_sds_port_default_destruct_handler, |
2236 | scic_sds_port_default_destruct_handler, | 2222 | .reset_handler = scic_sds_port_default_reset_handler, |
2237 | scic_sds_port_default_reset_handler, | 2223 | .add_phy_handler = scic_sds_port_default_add_phy_handler, |
2238 | scic_sds_port_default_add_phy_handler, | 2224 | .remove_phy_handler = scic_sds_port_default_remove_phy_handler, |
2239 | scic_sds_port_default_remove_phy_handler, | 2225 | .frame_handler = scic_sds_port_default_frame_handler, |
2240 | scic_sds_port_default_frame_handler, | 2226 | .event_handler = scic_sds_port_default_event_handler, |
2241 | scic_sds_port_default_event_handler, | 2227 | .link_up_handler = scic_sds_port_default_link_up_handler, |
2242 | scic_sds_port_default_link_up_handler, | 2228 | .link_down_handler = scic_sds_port_default_link_down_handler, |
2243 | scic_sds_port_default_link_down_handler, | 2229 | .start_io_handler = scic_sds_port_default_start_io_handler, |
2244 | scic_sds_port_default_start_io_handler, | 2230 | .complete_io_handler = scic_sds_port_general_complete_io_handler |
2245 | scic_sds_port_general_complete_io_handler | ||
2246 | } | 2231 | } |
2247 | }; | 2232 | }; |
2248 | 2233 | ||