diff options
author | Maciej Patelczyk <maciej.patelczyk@intel.com> | 2011-04-28 18:06:16 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:38 -0400 |
commit | 115bd1f9e8ee11744818e6eb5351d05ab6a8402e (patch) | |
tree | f22c291b6a80b5f47ae1f886cf27a19e51ec52c2 /drivers/scsi/isci | |
parent | e1e72a00dd9db0cd2b7d106916645626f53c0382 (diff) |
isci: Removed sci_base_object from scic_sds_port.
The 'struct sci_base_object' was removed from the struct
scic_sds_port and was replaced by a pointer to
struct isci_port.
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
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_port.c | 55 | ||||
-rw-r--r-- | drivers/scsi/isci/core/scic_sds_port.h | 8 | ||||
-rw-r--r-- | drivers/scsi/isci/port.c | 5 | ||||
-rw-r--r-- | drivers/scsi/isci/sci_environment.h | 5 |
4 files changed, 29 insertions, 44 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_port.c b/drivers/scsi/isci/core/scic_sds_port.c index d6339c41c392..3697211e7ca9 100644 --- a/drivers/scsi/isci/core/scic_sds_port.c +++ b/drivers/scsi/isci/core/scic_sds_port.c | |||
@@ -678,7 +678,7 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port, | |||
678 | bool do_notify_user) | 678 | bool do_notify_user) |
679 | { | 679 | { |
680 | struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port); | 680 | struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port); |
681 | struct isci_port *iport = sci_object_get_association(sci_port); | 681 | struct isci_port *iport = sci_port->iport; |
682 | struct isci_host *ihost = scic->ihost; | 682 | struct isci_host *ihost = scic->ihost; |
683 | struct isci_phy *iphy = sci_phy->iphy; | 683 | struct isci_phy *iphy = sci_phy->iphy; |
684 | 684 | ||
@@ -1632,7 +1632,7 @@ scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port) | |||
1632 | */ | 1632 | */ |
1633 | static void scic_sds_port_ready_substate_waiting_enter(void *object) | 1633 | static void scic_sds_port_ready_substate_waiting_enter(void *object) |
1634 | { | 1634 | { |
1635 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 1635 | struct scic_sds_port *sci_port = object; |
1636 | 1636 | ||
1637 | scic_sds_port_set_ready_state_handlers( | 1637 | scic_sds_port_set_ready_state_handlers( |
1638 | sci_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING | 1638 | sci_port, SCIC_SDS_PORT_READY_SUBSTATE_WAITING |
@@ -1663,11 +1663,11 @@ static void scic_sds_port_ready_substate_waiting_enter(void *object) | |||
1663 | static void scic_sds_port_ready_substate_operational_enter(void *object) | 1663 | static void scic_sds_port_ready_substate_operational_enter(void *object) |
1664 | { | 1664 | { |
1665 | u32 index; | 1665 | u32 index; |
1666 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 1666 | struct scic_sds_port *sci_port = object; |
1667 | struct scic_sds_controller *scic = | 1667 | struct scic_sds_controller *scic = |
1668 | scic_sds_port_get_controller(sci_port); | 1668 | scic_sds_port_get_controller(sci_port); |
1669 | struct isci_host *ihost = scic->ihost; | 1669 | struct isci_host *ihost = scic->ihost; |
1670 | struct isci_port *iport = sci_object_get_association(sci_port); | 1670 | struct isci_port *iport = sci_port->iport; |
1671 | 1671 | ||
1672 | scic_sds_port_set_ready_state_handlers( | 1672 | scic_sds_port_set_ready_state_handlers( |
1673 | sci_port, | 1673 | sci_port, |
@@ -1704,11 +1704,11 @@ static void scic_sds_port_ready_substate_operational_enter(void *object) | |||
1704 | */ | 1704 | */ |
1705 | static void scic_sds_port_ready_substate_operational_exit(void *object) | 1705 | static void scic_sds_port_ready_substate_operational_exit(void *object) |
1706 | { | 1706 | { |
1707 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 1707 | struct scic_sds_port *sci_port = object; |
1708 | struct scic_sds_controller *scic = | 1708 | struct scic_sds_controller *scic = |
1709 | scic_sds_port_get_controller(sci_port); | 1709 | scic_sds_port_get_controller(sci_port); |
1710 | struct isci_host *ihost = scic->ihost; | 1710 | struct isci_host *ihost = scic->ihost; |
1711 | struct isci_port *iport = sci_object_get_association(sci_port); | 1711 | struct isci_port *iport = sci_port->iport; |
1712 | 1712 | ||
1713 | /* | 1713 | /* |
1714 | * Kill the dummy task for this port if it has not yet posted | 1714 | * Kill the dummy task for this port if it has not yet posted |
@@ -1735,11 +1735,11 @@ static void scic_sds_port_ready_substate_operational_exit(void *object) | |||
1735 | */ | 1735 | */ |
1736 | static void scic_sds_port_ready_substate_configuring_enter(void *object) | 1736 | static void scic_sds_port_ready_substate_configuring_enter(void *object) |
1737 | { | 1737 | { |
1738 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 1738 | struct scic_sds_port *sci_port = object; |
1739 | struct scic_sds_controller *scic = | 1739 | struct scic_sds_controller *scic = |
1740 | scic_sds_port_get_controller(sci_port); | 1740 | scic_sds_port_get_controller(sci_port); |
1741 | struct isci_host *ihost = scic->ihost; | 1741 | struct isci_host *ihost = scic->ihost; |
1742 | struct isci_port *iport = sci_object_get_association(sci_port); | 1742 | struct isci_port *iport = sci_port->iport; |
1743 | 1743 | ||
1744 | scic_sds_port_set_ready_state_handlers( | 1744 | scic_sds_port_set_ready_state_handlers( |
1745 | sci_port, | 1745 | sci_port, |
@@ -1759,7 +1759,7 @@ static void scic_sds_port_ready_substate_configuring_enter(void *object) | |||
1759 | 1759 | ||
1760 | static void scic_sds_port_ready_substate_configuring_exit(void *object) | 1760 | static void scic_sds_port_ready_substate_configuring_exit(void *object) |
1761 | { | 1761 | { |
1762 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 1762 | struct scic_sds_port *sci_port = object; |
1763 | 1763 | ||
1764 | scic_sds_port_suspend_port_task_scheduler(sci_port); | 1764 | scic_sds_port_suspend_port_task_scheduler(sci_port); |
1765 | } | 1765 | } |
@@ -2255,9 +2255,7 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci | |||
2255 | */ | 2255 | */ |
2256 | static void scic_sds_port_stopped_state_enter(void *object) | 2256 | static void scic_sds_port_stopped_state_enter(void *object) |
2257 | { | 2257 | { |
2258 | struct scic_sds_port *sci_port; | 2258 | struct scic_sds_port *sci_port = object; |
2259 | |||
2260 | sci_port = (struct scic_sds_port *)object; | ||
2261 | 2259 | ||
2262 | scic_sds_port_set_base_state_handlers( | 2260 | scic_sds_port_set_base_state_handlers( |
2263 | sci_port, SCI_BASE_PORT_STATE_STOPPED | 2261 | sci_port, SCI_BASE_PORT_STATE_STOPPED |
@@ -2285,9 +2283,7 @@ static void scic_sds_port_stopped_state_enter(void *object) | |||
2285 | */ | 2283 | */ |
2286 | static void scic_sds_port_stopped_state_exit(void *object) | 2284 | static void scic_sds_port_stopped_state_exit(void *object) |
2287 | { | 2285 | { |
2288 | struct scic_sds_port *sci_port; | 2286 | struct scic_sds_port *sci_port = object; |
2289 | |||
2290 | sci_port = (struct scic_sds_port *)object; | ||
2291 | 2287 | ||
2292 | /* Enable and suspend the port task scheduler */ | 2288 | /* Enable and suspend the port task scheduler */ |
2293 | scic_sds_port_enable_port_task_scheduler(sci_port); | 2289 | scic_sds_port_enable_port_task_scheduler(sci_port); |
@@ -2305,15 +2301,14 @@ static void scic_sds_port_stopped_state_exit(void *object) | |||
2305 | static void scic_sds_port_ready_state_enter(void *object) | 2301 | static void scic_sds_port_ready_state_enter(void *object) |
2306 | { | 2302 | { |
2307 | struct scic_sds_controller *scic; | 2303 | struct scic_sds_controller *scic; |
2308 | struct scic_sds_port *sci_port; | 2304 | struct scic_sds_port *sci_port = object; |
2309 | struct isci_port *iport; | 2305 | struct isci_port *iport; |
2310 | struct isci_host *ihost; | 2306 | struct isci_host *ihost; |
2311 | u32 prev_state; | 2307 | u32 prev_state; |
2312 | 2308 | ||
2313 | sci_port = container_of(object, typeof(*sci_port), parent); | ||
2314 | scic = scic_sds_port_get_controller(sci_port); | 2309 | scic = scic_sds_port_get_controller(sci_port); |
2315 | ihost = scic->ihost; | 2310 | ihost = scic->ihost; |
2316 | iport = sci_object_get_association(sci_port); | 2311 | iport = sci_port->iport; |
2317 | 2312 | ||
2318 | /* Put the ready state handlers in place though they will not be there long */ | 2313 | /* Put the ready state handlers in place though they will not be there long */ |
2319 | scic_sds_port_set_base_state_handlers(sci_port, SCI_BASE_PORT_STATE_READY); | 2314 | scic_sds_port_set_base_state_handlers(sci_port, SCI_BASE_PORT_STATE_READY); |
@@ -2333,9 +2328,8 @@ static void scic_sds_port_ready_state_enter(void *object) | |||
2333 | 2328 | ||
2334 | static void scic_sds_port_ready_state_exit(void *object) | 2329 | static void scic_sds_port_ready_state_exit(void *object) |
2335 | { | 2330 | { |
2336 | struct scic_sds_port *sci_port; | 2331 | struct scic_sds_port *sci_port = object; |
2337 | 2332 | ||
2338 | sci_port = container_of(object, typeof(*sci_port), parent); | ||
2339 | sci_base_state_machine_stop(&sci_port->ready_substate_machine); | 2333 | sci_base_state_machine_stop(&sci_port->ready_substate_machine); |
2340 | scic_sds_port_invalidate_dummy_remote_node(sci_port); | 2334 | scic_sds_port_invalidate_dummy_remote_node(sci_port); |
2341 | } | 2335 | } |
@@ -2350,9 +2344,7 @@ static void scic_sds_port_ready_state_exit(void *object) | |||
2350 | */ | 2344 | */ |
2351 | static void scic_sds_port_resetting_state_enter(void *object) | 2345 | static void scic_sds_port_resetting_state_enter(void *object) |
2352 | { | 2346 | { |
2353 | struct scic_sds_port *sci_port; | 2347 | struct scic_sds_port *sci_port = object; |
2354 | |||
2355 | sci_port = (struct scic_sds_port *)object; | ||
2356 | 2348 | ||
2357 | scic_sds_port_set_base_state_handlers( | 2349 | scic_sds_port_set_base_state_handlers( |
2358 | sci_port, SCI_BASE_PORT_STATE_RESETTING | 2350 | sci_port, SCI_BASE_PORT_STATE_RESETTING |
@@ -2369,7 +2361,7 @@ static void scic_sds_port_resetting_state_enter(void *object) | |||
2369 | */ | 2361 | */ |
2370 | static inline void scic_sds_port_resetting_state_exit(void *object) | 2362 | static inline void scic_sds_port_resetting_state_exit(void *object) |
2371 | { | 2363 | { |
2372 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 2364 | struct scic_sds_port *sci_port = object; |
2373 | 2365 | ||
2374 | isci_timer_stop(sci_port->timer_handle); | 2366 | isci_timer_stop(sci_port->timer_handle); |
2375 | } | 2367 | } |
@@ -2385,9 +2377,7 @@ static inline void scic_sds_port_resetting_state_exit(void *object) | |||
2385 | */ | 2377 | */ |
2386 | static void scic_sds_port_stopping_state_enter(void *object) | 2378 | static void scic_sds_port_stopping_state_enter(void *object) |
2387 | { | 2379 | { |
2388 | struct scic_sds_port *sci_port; | 2380 | struct scic_sds_port *sci_port = object; |
2389 | |||
2390 | sci_port = (struct scic_sds_port *)object; | ||
2391 | 2381 | ||
2392 | scic_sds_port_set_base_state_handlers( | 2382 | scic_sds_port_set_base_state_handlers( |
2393 | sci_port, SCI_BASE_PORT_STATE_STOPPING | 2383 | sci_port, SCI_BASE_PORT_STATE_STOPPING |
@@ -2405,7 +2395,7 @@ static void scic_sds_port_stopping_state_enter(void *object) | |||
2405 | static inline void | 2395 | static inline void |
2406 | scic_sds_port_stopping_state_exit(void *object) | 2396 | scic_sds_port_stopping_state_exit(void *object) |
2407 | { | 2397 | { |
2408 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 2398 | struct scic_sds_port *sci_port = object; |
2409 | 2399 | ||
2410 | isci_timer_stop(sci_port->timer_handle); | 2400 | isci_timer_stop(sci_port->timer_handle); |
2411 | 2401 | ||
@@ -2423,8 +2413,8 @@ scic_sds_port_stopping_state_exit(void *object) | |||
2423 | */ | 2413 | */ |
2424 | static void scic_sds_port_failed_state_enter(void *object) | 2414 | static void scic_sds_port_failed_state_enter(void *object) |
2425 | { | 2415 | { |
2426 | struct scic_sds_port *sci_port = (struct scic_sds_port *)object; | 2416 | struct scic_sds_port *sci_port = object; |
2427 | struct isci_port *iport = sci_object_get_association(sci_port); | 2417 | struct isci_port *iport = sci_port->iport; |
2428 | 2418 | ||
2429 | scic_sds_port_set_base_state_handlers(sci_port, | 2419 | scic_sds_port_set_base_state_handlers(sci_port, |
2430 | SCI_BASE_PORT_STATE_FAILED); | 2420 | SCI_BASE_PORT_STATE_FAILED); |
@@ -2461,16 +2451,15 @@ void scic_sds_port_construct(struct scic_sds_port *sci_port, u8 port_index, | |||
2461 | { | 2451 | { |
2462 | u32 index; | 2452 | u32 index; |
2463 | 2453 | ||
2464 | sci_port->parent.private = NULL; | ||
2465 | sci_base_state_machine_construct(&sci_port->state_machine, | 2454 | sci_base_state_machine_construct(&sci_port->state_machine, |
2466 | &sci_port->parent, | 2455 | sci_port, |
2467 | scic_sds_port_state_table, | 2456 | scic_sds_port_state_table, |
2468 | SCI_BASE_PORT_STATE_STOPPED); | 2457 | SCI_BASE_PORT_STATE_STOPPED); |
2469 | 2458 | ||
2470 | sci_base_state_machine_start(&sci_port->state_machine); | 2459 | sci_base_state_machine_start(&sci_port->state_machine); |
2471 | 2460 | ||
2472 | sci_base_state_machine_construct(&sci_port->ready_substate_machine, | 2461 | sci_base_state_machine_construct(&sci_port->ready_substate_machine, |
2473 | &sci_port->parent, | 2462 | sci_port, |
2474 | scic_sds_port_ready_substate_table, | 2463 | scic_sds_port_ready_substate_table, |
2475 | SCIC_SDS_PORT_READY_SUBSTATE_WAITING); | 2464 | SCIC_SDS_PORT_READY_SUBSTATE_WAITING); |
2476 | 2465 | ||
diff --git a/drivers/scsi/isci/core/scic_sds_port.h b/drivers/scsi/isci/core/scic_sds_port.h index 59c76cd3902f..2253a2ced969 100644 --- a/drivers/scsi/isci/core/scic_sds_port.h +++ b/drivers/scsi/isci/core/scic_sds_port.h | |||
@@ -151,17 +151,17 @@ enum scic_sds_port_states { | |||
151 | 151 | ||
152 | }; | 152 | }; |
153 | 153 | ||
154 | struct isci_port; | ||
154 | /** | 155 | /** |
155 | * struct scic_sds_port - | 156 | * struct scic_sds_port |
156 | * | 157 | * |
157 | * The core port object provides the the abstraction for an SCU port. | 158 | * The core port object provides the the abstraction for an SCU port. |
158 | */ | 159 | */ |
159 | struct scic_sds_port { | 160 | struct scic_sds_port { |
160 | /** | 161 | /** |
161 | * The field specifies that the parent object for the base controller | 162 | * The field specifies the peer object for the port. |
162 | * is the base object itself. | ||
163 | */ | 163 | */ |
164 | struct sci_base_object parent; | 164 | struct isci_port *iport; |
165 | 165 | ||
166 | /** | 166 | /** |
167 | * This field contains the information for the base port state machine. | 167 | * This field contains the information for the base port state machine. |
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index d600b09192e7..30d6ad895ccf 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c | |||
@@ -100,8 +100,8 @@ void isci_port_init( | |||
100 | isci_port_change_state(isci_port, isci_freed); | 100 | isci_port_change_state(isci_port, isci_freed); |
101 | 101 | ||
102 | (void)scic_controller_get_port_handle(controller, index, &scic_port); | 102 | (void)scic_controller_get_port_handle(controller, index, &scic_port); |
103 | sci_object_set_association(scic_port, isci_port); | ||
104 | isci_port->sci_port_handle = scic_port; | 103 | isci_port->sci_port_handle = scic_port; |
104 | scic_port->iport = isci_port; | ||
105 | } | 105 | } |
106 | 106 | ||
107 | 107 | ||
@@ -169,9 +169,8 @@ void isci_port_link_up( | |||
169 | { | 169 | { |
170 | unsigned long flags; | 170 | unsigned long flags; |
171 | struct scic_port_properties properties; | 171 | struct scic_port_properties properties; |
172 | struct isci_port *isci_port | ||
173 | = (struct isci_port *)sci_object_get_association(port); | ||
174 | struct isci_phy *isci_phy = phy->iphy; | 172 | struct isci_phy *isci_phy = phy->iphy; |
173 | struct isci_port *isci_port = port->iport; | ||
175 | enum sci_status call_status; | 174 | enum sci_status call_status; |
176 | unsigned long success = true; | 175 | unsigned long success = true; |
177 | 176 | ||
diff --git a/drivers/scsi/isci/sci_environment.h b/drivers/scsi/isci/sci_environment.h index 744016dffecb..3fb54ddaee1a 100644 --- a/drivers/scsi/isci/sci_environment.h +++ b/drivers/scsi/isci/sci_environment.h | |||
@@ -59,9 +59,6 @@ | |||
59 | #include "isci.h" | 59 | #include "isci.h" |
60 | #include "core/scic_sds_controller.h" | 60 | #include "core/scic_sds_controller.h" |
61 | 61 | ||
62 | struct scic_sds_controller; | ||
63 | struct scic_sds_phy; | ||
64 | struct scic_sds_port; | ||
65 | struct scic_sds_remote_device; | 62 | struct scic_sds_remote_device; |
66 | 63 | ||
67 | static inline struct device *scic_to_dev(struct scic_sds_controller *scic) | 64 | static inline struct device *scic_to_dev(struct scic_sds_controller *scic) |
@@ -83,7 +80,7 @@ static inline struct device *sciphy_to_dev(struct scic_sds_phy *sci_phy) | |||
83 | 80 | ||
84 | static inline struct device *sciport_to_dev(struct scic_sds_port *sci_port) | 81 | static inline struct device *sciport_to_dev(struct scic_sds_port *sci_port) |
85 | { | 82 | { |
86 | struct isci_port *iport = sci_object_get_association(sci_port); | 83 | struct isci_port *iport = sci_port->iport; |
87 | 84 | ||
88 | if (!iport || !iport->isci_host) | 85 | if (!iport || !iport->isci_host) |
89 | return NULL; | 86 | return NULL; |