History

isci: unify isci_port and scic_sds_port

Remove the distinction between these two implementations and unify on isci_port (local instances named iport). The duplicate '->owning_port' and '->isci_port' in both isci_phy and isci_remote_device will be fixed in a later patch... this is just the straightforward rename/unification.

Dan Williams committed 15 years ago

Commit ffe191c1 parent 76802ce10 files · +481 −581Browse files

Unified · Split

10 files
  1. drivers/scsi/isci/host.c +16 −16
  2. drivers/scsi/isci/host.h +5 −6
  3. drivers/scsi/isci/phy.c +5 −5
  4. drivers/scsi/isci/phy.h +5 −5
  5. drivers/scsi/isci/port.c +305 −317
  6. drivers/scsi/isci/port.h +51 −123
  7. drivers/scsi/isci/port_config.c +47 −52
  8. drivers/scsi/isci/remote_device.c +30 −31
  9. drivers/scsi/isci/remote_device.h +1 −9
  10. drivers/scsi/isci/request.c +16 −17
drivers/scsi/isci/host.c+16−16
@@ -1054,9 +1054,9 @@ static enum sci_status scic_controller_start(struct scic_sds_controller *scic, · 1053 unmodified lines
10541054
10551055 /* Start all of the ports on this controller */
10561056 for (index = 0; index < scic->logical_port_entries; index++) {
1057− struct scic_sds_port *sci_port = &ihost->ports[index].sci;
1057+ struct isci_port *iport = &ihost->ports[index];
10581058
1059− result = scic_sds_port_start(sci_port);
1059+ result = scic_sds_port_start(iport);
10601060 if (result)
10611061 return result;
10621062 }
@@ -1306,8 +1306,8 @@ void isci_host_deinit(struct isci_host *ihost) · 243 unmodified lines
13061306
13071307 /* Cancel any/all outstanding port timers */
13081308 for (i = 0; i < ihost->sci.logical_port_entries; i++) {
1309− struct scic_sds_port *sci_port = &ihost->ports[i].sci;
1310− del_timer_sync(&sci_port->timer.timer);
1309+ struct isci_port *iport = &ihost->ports[i];
1310+ del_timer_sync(&iport->timer.timer);
13111311 }
13121312
13131313 /* Cancel any/all outstanding phy timers */
@@ -1552,9 +1552,9 @@ static enum sci_status scic_sds_controller_stop_ports(struct scic_sds_controller · 238 unmodified lines
15521552 struct isci_host *ihost = scic_to_ihost(scic);
15531553
15541554 for (index = 0; index < scic->logical_port_entries; index++) {
1555− struct scic_sds_port *sci_port = &ihost->ports[index].sci;
1555+ struct isci_port *iport = &ihost->ports[index];
15561556
1557− port_status = scic_sds_port_stop(sci_port);
1557+ port_status = scic_sds_port_stop(iport);
15581558
15591559 if ((port_status != SCI_SUCCESS) &&
15601560 (port_status != SCI_FAILURE_INVALID_STATE)) {
@@ -1564,7 +1564,7 @@ static enum sci_status scic_sds_controller_stop_ports(struct scic_sds_controller · 3 unmodified lines
15641564 "%s: Controller stop operation failed to "
15651565 "stop port %d because of status %d.\n",
15661566 __func__,
1567− sci_port->logical_port_index,
1567+ iport->logical_port_index,
15681568 port_status);
15691569 }
15701570 }
@@ -1780,14 +1780,14 @@ static enum sci_status scic_controller_construct(struct scic_sds_controller *sci · 209 unmodified lines
17801780
17811781 /* Construct the ports for this controller */
17821782 for (i = 0; i < SCI_MAX_PORTS; i++)
1783− scic_sds_port_construct(&ihost->ports[i].sci, i, scic);
1784− scic_sds_port_construct(&ihost->ports[i].sci, SCIC_SDS_DUMMY_PORT, scic);
1783+ scic_sds_port_construct(&ihost->ports[i], i, scic);
1784+ scic_sds_port_construct(&ihost->ports[i], SCIC_SDS_DUMMY_PORT, scic);
17851785
17861786 /* Construct the phys for this controller */
17871787 for (i = 0; i < SCI_MAX_PHYS; i++) {
17881788 /* Add all the PHYs to the dummy port */
17891789 scic_sds_phy_construct(&ihost->phys[i],
1790− &ihost->ports[SCI_MAX_PORTS].sci, i);
1790+ &ihost->ports[SCI_MAX_PORTS], i);
17911791 }
17921792
17931793 scic->invalid_phy_mask = 0;
@@ -2233,7 +2233,7 @@ static enum sci_status scic_controller_initialize(struct scic_sds_controller *sc · 439 unmodified lines
22332233 }
22342234
22352235 for (i = 0; i < scic->logical_port_entries; i++) {
2236− result = scic_sds_port_initialize(&ihost->ports[i].sci,
2236+ result = scic_sds_port_initialize(&ihost->ports[i],
22372237 &scic->scu_registers->peg0.ptsg.port[i],
22382238 &scic->scu_registers->peg0.ptsg.protocol_engine,
22392239 &scic->scu_registers->peg0.viit[i]);
@@ -2484,19 +2484,19 @@ int isci_host_init(struct isci_host *isci_host) · 244 unmodified lines
24842484 }
24852485
24862486 void scic_sds_controller_link_up(struct scic_sds_controller *scic,
2487− struct scic_sds_port *port, struct isci_phy *iphy)
2487+ struct isci_port *iport, struct isci_phy *iphy)
24882488 {
24892489 switch (scic->sm.current_state_id) {
24902490 case SCIC_STARTING:
24912491 sci_del_timer(&scic->phy_timer);
24922492 scic->phy_startup_timer_pending = false;
24932493 scic->port_agent.link_up_handler(scic, &scic->port_agent,
2494− port, iphy);
2494+ iport, iphy);
24952495 scic_sds_controller_start_next_phy(scic);
24962496 break;
24972497 case SCIC_READY:
24982498 scic->port_agent.link_up_handler(scic, &scic->port_agent,
2499− port, iphy);
2499+ iport, iphy);
25002500 break;
25012501 default:
25022502 dev_dbg(scic_to_dev(scic),
@@ -2507,13 +2507,13 @@ void scic_sds_controller_link_up(struct scic_sds_controller *scic, · 4 unmodified lines
25072507 }
25082508
25092509 void scic_sds_controller_link_down(struct scic_sds_controller *scic,
2510− struct scic_sds_port *port, struct isci_phy *iphy)
2510+ struct isci_port *iport, struct isci_phy *iphy)
25112511 {
25122512 switch (scic->sm.current_state_id) {
25132513 case SCIC_STARTING:
25142514 case SCIC_READY:
25152515 scic->port_agent.link_down_handler(scic, &scic->port_agent,
2516− port, iphy);
2516+ iport, iphy);
25172517 break;
25182518 default:
25192519 dev_dbg(scic_to_dev(scic),
drivers/scsi/isci/host.h+5−6
@@ -108,7 +108,7 @@ struct scic_power_control { · 107 unmodified lines
108108 struct scic_sds_port_configuration_agent;
109109 typedef void (*port_config_fn)(struct scic_sds_controller *,
110110 struct scic_sds_port_configuration_agent *,
111− struct scic_sds_port *, struct isci_phy *);
111+ struct isci_port *, struct isci_phy *);
112112
113113 struct scic_sds_port_configuration_agent {
114114 u16 phy_configured_mask;
@@ -532,9 +532,8 @@ static inline struct device *sciphy_to_dev(struct isci_phy *iphy) · 417 unmodified lines
532532 return &iphy->isci_port->isci_host->pdev->dev;
533533 }
534534
535−static inline struct device *sciport_to_dev(struct scic_sds_port *sci_port)
535+static inline struct device *sciport_to_dev(struct isci_port *iport)
536536 {
537− struct isci_port *iport = sci_port_to_iport(sci_port);
538537
539538 if (!iport || !iport->isci_host)
540539 return NULL;
@@ -613,12 +612,12 @@ void scic_sds_controller_power_control_queue_remove( · 72 unmodified lines
613612
614613 void scic_sds_controller_link_up(
615614 struct scic_sds_controller *scic,
616− struct scic_sds_port *sci_port,
615+ struct isci_port *iport,
617616 struct isci_phy *iphy);
618617
619618 void scic_sds_controller_link_down(
620619 struct scic_sds_controller *scic,
621− struct scic_sds_port *sci_port,
620+ struct isci_port *iport,
622621 struct isci_phy *iphy);
623622
624623 void scic_sds_controller_remote_device_stopped(
@@ -649,7 +648,7 @@ void isci_host_deinit( · 24 unmodified lines
649648
650649 void isci_host_port_link_up(
651650 struct isci_host *,
652− struct scic_sds_port *,
651+ struct isci_port *,
653652 struct isci_phy *);
654653 int isci_host_dev_found(struct domain_device *);
655654
drivers/scsi/isci/phy.c+5−5
@@ -286,7 +286,7 @@ done: · 285 unmodified lines
286286 * port (i.e. it's contained in the dummy port). !NULL All other
287287 * values indicate a handle/pointer to the port containing the phy.
288288 */
289−struct scic_sds_port *phy_get_non_dummy_port(
289+struct isci_port *phy_get_non_dummy_port(
290290 struct isci_phy *iphy)
291291 {
292292 if (scic_sds_port_get_index(iphy->owning_port) == SCIC_SDS_DUMMY_PORT)
@@ -304,9 +304,9 @@ struct scic_sds_port *phy_get_non_dummy_port( · 11 unmodified lines
304304 */
305305 void scic_sds_phy_set_port(
306306 struct isci_phy *iphy,
307− struct scic_sds_port *sci_port)
307+ struct isci_port *iport)
308308 {
309− iphy->owning_port = sci_port;
309+ iphy->owning_port = iport;
310310
311311 if (iphy->bcn_received_while_port_unassigned) {
312312 iphy->bcn_received_while_port_unassigned = false;
@@ -1291,12 +1291,12 @@ static const struct sci_base_state scic_sds_phy_state_table[] = { · 978 unmodified lines
12911291 };
12921292
12931293 void scic_sds_phy_construct(struct isci_phy *iphy,
1294− struct scic_sds_port *owning_port, u8 phy_index)
1294+ struct isci_port *iport, u8 phy_index)
12951295 {
12961296 sci_init_sm(&iphy->sm, scic_sds_phy_state_table, SCI_PHY_INITIAL);
12971297
12981298 /* Copy the rest of the input data to our locals */
1299− iphy->owning_port = owning_port;
1299+ iphy->owning_port = iport;
13001300 iphy->phy_index = phy_index;
13011301 iphy->bcn_received_while_port_unassigned = false;
13021302 iphy->protocol = SCIC_SDS_PHY_PROTOCOL_UNKNOWN;
drivers/scsi/isci/phy.h+5−5
@@ -93,7 +93,7 @@ enum scic_sds_phy_protocol { · 92 unmodified lines
9393 */
9494 struct isci_phy {
9595 struct sci_base_state_machine sm;
96− struct scic_sds_port *owning_port;
96+ struct isci_port *owning_port;
9797 enum sas_linkrate max_negotiated_speed;
9898 enum scic_sds_phy_protocol protocol;
9999 u8 phy_index;
@@ -178,7 +178,7 @@ struct scic_phy_properties { · 78 unmodified lines
178178 * supplied phy. This field may be set to NULL
179179 * if the phy is not currently contained in a port.
180180 */
181− struct scic_sds_port *owning_port;
181+ struct isci_port *iport;
182182
183183 /**
184184 * This field specifies the link rate at which the phy is
@@ -459,14 +459,14 @@ enum scic_sds_phy_states { · 274 unmodified lines
459459
460460 void scic_sds_phy_construct(
461461 struct isci_phy *iphy,
462− struct scic_sds_port *owning_port,
462+ struct isci_port *iport,
463463 u8 phy_index);
464464
465−struct scic_sds_port *phy_get_non_dummy_port(struct isci_phy *iphy);
465+struct isci_port *phy_get_non_dummy_port(struct isci_phy *iphy);
466466
467467 void scic_sds_phy_set_port(
468468 struct isci_phy *iphy,
469− struct scic_sds_port *owning_port);
469+ struct isci_port *iport);
470470
471471 enum sci_status scic_sds_phy_initialize(
472472 struct isci_phy *iphy,
drivers/scsi/isci/port.c+305−317
@@ -83,7 +83,7 @@ static void isci_port_change_state(struct isci_port *iport, enum isci_status sta · 82 unmodified lines
8383 * transmit_identification register.
8484 */
8585 static void
86−scic_sds_port_get_protocols(struct scic_sds_port *sci_port,
86+scic_sds_port_get_protocols(struct isci_port *iport,
8787 struct scic_phy_proto *protocols)
8888 {
8989 u8 index;
@@ -91,8 +91,8 @@ scic_sds_port_get_protocols(struct scic_sds_port *sci_port, · 1 unmodified line
9191 protocols->all = 0;
9292
9393 for (index = 0; index < SCI_MAX_PHYS; index++) {
94− if (sci_port->phy_table[index] != NULL) {
95− scic_sds_phy_get_protocols(sci_port->phy_table[index],
94+ if (iport->phy_table[index] != NULL) {
95+ scic_sds_phy_get_protocols(iport->phy_table[index],
9696 protocols);
9797 }
9898 }
@@ -107,7 +107,7 @@ scic_sds_port_get_protocols(struct scic_sds_port *sci_port, · 8 unmodified lines
107107 * Return a bit mask indicating which phys are a part of this port. Each bit
108108 * corresponds to a phy identifier (e.g. bit 0 = phy id 0).
109109 */
110−static u32 scic_sds_port_get_phys(struct scic_sds_port *sci_port)
110+static u32 scic_sds_port_get_phys(struct isci_port *iport)
111111 {
112112 u32 index;
113113 u32 mask;
@@ -115,7 +115,7 @@ static u32 scic_sds_port_get_phys(struct scic_sds_port *sci_port) · 1 unmodified line
115115 mask = 0;
116116
117117 for (index = 0; index < SCI_MAX_PHYS; index++) {
118− if (sci_port->phy_table[index] != NULL) {
118+ if (iport->phy_table[index] != NULL) {
119119 mask |= (1 << index);
120120 }
121121 }
@@ -136,30 +136,29 @@ static u32 scic_sds_port_get_phys(struct scic_sds_port *sci_port) · 14 unmodified lines
136136 * value is returned if the specified port is not valid. When this value is
137137 * returned, no data is copied to the properties output parameter.
138138 */
139−static enum sci_status scic_port_get_properties(struct scic_sds_port *port,
139+static enum sci_status scic_port_get_properties(struct isci_port *iport,
140140 struct scic_port_properties *prop)
141141 {
142− if ((port == NULL) ||
143− (port->logical_port_index == SCIC_SDS_DUMMY_PORT))
142+ if (!iport || iport->logical_port_index == SCIC_SDS_DUMMY_PORT)
144143 return SCI_FAILURE_INVALID_PORT;
145144
146− prop->index = port->logical_port_index;
147− prop->phy_mask = scic_sds_port_get_phys(port);
148− scic_sds_port_get_sas_address(port, &prop->local.sas_address);
149− scic_sds_port_get_protocols(port, &prop->local.protocols);
150− scic_sds_port_get_attached_sas_address(port, &prop->remote.sas_address);
145+ prop->index = iport->logical_port_index;
146+ prop->phy_mask = scic_sds_port_get_phys(iport);
147+ scic_sds_port_get_sas_address(iport, &prop->local.sas_address);
148+ scic_sds_port_get_protocols(iport, &prop->local.protocols);
149+ scic_sds_port_get_attached_sas_address(iport, &prop->remote.sas_address);
151150
152151 return SCI_SUCCESS;
153152 }
154153
155−static void scic_port_bcn_enable(struct scic_sds_port *sci_port)
154+static void scic_port_bcn_enable(struct isci_port *iport)
156155 {
157156 struct isci_phy *iphy;
158157 u32 val;
159158 int i;
160159
161− for (i = 0; i < ARRAY_SIZE(sci_port->phy_table); i++) {
162− iphy = sci_port->phy_table[i];
160+ for (i = 0; i < ARRAY_SIZE(iport->phy_table); i++) {
161+ iphy = iport->phy_table[i];
163162 if (!iphy)
164163 continue;
165164 val = readl(&iphy->link_layer_registers->link_layer_control);
@@ -179,8 +178,8 @@ void isci_port_bcn_enable(struct isci_host *ihost, struct isci_port *iport) · 13 unmodified lines
179178 if (!test_and_clear_bit(IPORT_BCN_PENDING, &iport->flags))
180179 return;
181180
182− for (i = 0; i < ARRAY_SIZE(iport->sci.phy_table); i++) {
183− struct isci_phy *iphy = iport->sci.phy_table[i];
181+ for (i = 0; i < ARRAY_SIZE(iport->phy_table); i++) {
182+ struct isci_phy *iphy = iport->phy_table[i];
184183
185184 if (!iphy)
186185 continue;
@@ -191,12 +190,10 @@ void isci_port_bcn_enable(struct isci_host *ihost, struct isci_port *iport) · 4 unmodified lines
191190 }
192191 }
193192
194−void isci_port_bc_change_received(struct isci_host *ihost,
195− struct scic_sds_port *sci_port,
196− struct isci_phy *iphy)
193+static void isci_port_bc_change_received(struct isci_host *ihost,
194+ struct isci_port *iport,
195+ struct isci_phy *iphy)
197196 {
198− struct isci_port *iport = iphy->isci_port;
199−
200197 if (iport && test_bit(IPORT_BCN_BLOCKED, &iport->flags)) {
201198 dev_dbg(&ihost->pdev->dev,
202199 "%s: disabled BCN; isci_phy = %p, sas_phy = %p\n",
@@ -212,31 +209,30 @@ void isci_port_bc_change_received(struct isci_host *ihost, · 9 unmodified lines
212209 ihost->sas_ha.notify_port_event(&iphy->sas_phy,
213210 PORTE_BROADCAST_RCVD);
214211 }
215− scic_port_bcn_enable(sci_port);
212+ scic_port_bcn_enable(iport);
216213 }
217214
218215 static void isci_port_link_up(struct isci_host *isci_host,
219− struct scic_sds_port *port,
216+ struct isci_port *iport,
220217 struct isci_phy *iphy)
221218 {
222219 unsigned long flags;
223220 struct scic_port_properties properties;
224− struct isci_port *isci_port = sci_port_to_iport(port);
225221 unsigned long success = true;
226222
227223 BUG_ON(iphy->isci_port != NULL);
228224
229− iphy->isci_port = isci_port;
225+ iphy->isci_port = iport;
230226
231227 dev_dbg(&isci_host->pdev->dev,
232228 "%s: isci_port = %p\n",
233− __func__, isci_port);
229+ __func__, iport);
234230
235231 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags);
236232
237233 isci_port_change_state(iphy->isci_port, isci_starting);
238234
239− scic_port_get_properties(port, &properties);
235+ scic_port_get_properties(iport, &properties);
240236
241237 if (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) {
242238 u64 attached_sas_address;
@@ -370,7 +366,7 @@ static void isci_port_not_ready(struct isci_host *isci_host, struct isci_port *i · 127 unmodified lines
370366 }
371367
372368 static void isci_port_stop_complete(struct scic_sds_controller *scic,
373− struct scic_sds_port *sci_port,
369+ struct isci_port *iport,
374370 enum sci_status completion_status)
375371 {
376372 dev_dbg(&scic_to_ihost(scic)->pdev->dev, "Port stop complete\n");
@@ -408,30 +404,30 @@ static void isci_port_hard_reset_complete(struct isci_port *isci_port, · 31 unmodified lines
408404 * assignment for the port false if this is not a valid phy assignment for the
409405 * port
410406 */
411−bool scic_sds_port_is_valid_phy_assignment(struct scic_sds_port *sci_port,
407+bool scic_sds_port_is_valid_phy_assignment(struct isci_port *iport,
412408 u32 phy_index)
413409 {
414410 /* Initialize to invalid value. */
415411 u32 existing_phy_index = SCI_MAX_PHYS;
416412 u32 index;
417413
418− if ((sci_port->physical_port_index == 1) && (phy_index != 1)) {
414+ if ((iport->physical_port_index == 1) && (phy_index != 1)) {
419415 return false;
420416 }
421417
422− if (sci_port->physical_port_index == 3 && phy_index != 3) {
418+ if (iport->physical_port_index == 3 && phy_index != 3) {
423419 return false;
424420 }
425421
426422 if (
427− (sci_port->physical_port_index == 2)
423+ (iport->physical_port_index == 2)
428424 && ((phy_index == 0) || (phy_index == 1))
429425 ) {
430426 return false;
431427 }
432428
433429 for (index = 0; index < SCI_MAX_PHYS; index++) {
434− if ((sci_port->phy_table[index] != NULL)
430+ if ((iport->phy_table[index] != NULL)
435431 && (index != phy_index)) {
436432 existing_phy_index = index;
437433 }
@@ -442,9 +438,9 @@ bool scic_sds_port_is_valid_phy_assignment(struct scic_sds_port *sci_port, · 4 unmodified lines
442438 * operating at the same maximum link rate. */
443439 if (
444440 (existing_phy_index < SCI_MAX_PHYS)
445− && (sci_port->owning_controller->user_parameters.sds1.phys[
441+ && (iport->owning_controller->user_parameters.sds1.phys[
446442 phy_index].max_speed_generation !=
447− sci_port->owning_controller->user_parameters.sds1.phys[
443+ iport->owning_controller->user_parameters.sds1.phys[
448444 existing_phy_index].max_speed_generation)
449445 )
450446 return false;
@@ -465,25 +461,25 @@ bool scic_sds_port_is_valid_phy_assignment(struct scic_sds_port *sci_port, · 14 unmodified lines
465461 * port false if this is not a valid phy assignment for the port
466462 */
467463 static bool scic_sds_port_is_phy_mask_valid(
468− struct scic_sds_port *sci_port,
464+ struct isci_port *iport,
469465 u32 phy_mask)
470466 {
471− if (sci_port->physical_port_index == 0) {
467+ if (iport->physical_port_index == 0) {
472468 if (((phy_mask & 0x0F) == 0x0F)
473469 || ((phy_mask & 0x03) == 0x03)
474470 || ((phy_mask & 0x01) == 0x01)
475471 || (phy_mask == 0))
476472 return true;
477− } else if (sci_port->physical_port_index == 1) {
473+ } else if (iport->physical_port_index == 1) {
478474 if (((phy_mask & 0x02) == 0x02)
479475 || (phy_mask == 0))
480476 return true;
481− } else if (sci_port->physical_port_index == 2) {
477+ } else if (iport->physical_port_index == 2) {
482478 if (((phy_mask & 0x0C) == 0x0C)
483479 || ((phy_mask & 0x04) == 0x04)
484480 || (phy_mask == 0))
485481 return true;
486− } else if (sci_port->physical_port_index == 3) {
482+ } else if (iport->physical_port_index == 3) {
487483 if (((phy_mask & 0x08) == 0x08)
488484 || (phy_mask == 0))
489485 return true;
@@ -500,7 +496,7 @@ static bool scic_sds_port_is_phy_mask_valid( · 10 unmodified lines
500496 * point) phys contained in the port. All other values specify a struct scic_sds_phy
501497 * object that is active in the port.
502498 */
503−static struct isci_phy *scic_sds_port_get_a_connected_phy(struct scic_sds_port *sci_port)
499+static struct isci_phy *scic_sds_port_get_a_connected_phy(struct isci_port *iport)
504500 {
505501 u32 index;
506502 struct isci_phy *iphy;
@@ -509,29 +505,29 @@ static struct isci_phy *scic_sds_port_get_a_connected_phy(struct scic_sds_port * · 2 unmodified lines
509505 /* Ensure that the phy is both part of the port and currently
510506 * connected to the remote end-point.
511507 */
512− iphy = sci_port->phy_table[index];
513− if (iphy && scic_sds_port_active_phy(sci_port, iphy))
508+ iphy = iport->phy_table[index];
509+ if (iphy && scic_sds_port_active_phy(iport, iphy))
514510 return iphy;
515511 }
516512
517513 return NULL;
518514 }
519515
520−static enum sci_status scic_sds_port_set_phy(struct scic_sds_port *port, struct isci_phy *iphy)
516+static enum sci_status scic_sds_port_set_phy(struct isci_port *iport, struct isci_phy *iphy)
521517 {
522518 /* Check to see if we can add this phy to a port
523519 * that means that the phy is not part of a port and that the port does
524520 * not already have a phy assinged to the phy index.
525521 */
526− if (!port->phy_table[iphy->phy_index] &&
522+ if (!iport->phy_table[iphy->phy_index] &&
527523 !phy_get_non_dummy_port(iphy) &&
528− scic_sds_port_is_valid_phy_assignment(port, iphy->phy_index)) {
524+ scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) {
529525 /* Phy is being added in the stopped state so we are in MPC mode
530526 * make logical port index = physical port index
531527 */
532− port->logical_port_index = port->physical_port_index;
533− port->phy_table[iphy->phy_index] = iphy;
534− scic_sds_phy_set_port(iphy, port);
528+ iport->logical_port_index = iport->physical_port_index;
529+ iport->phy_table[iphy->phy_index] = iphy;
530+ scic_sds_phy_set_port(iphy, iport);
535531
536532 return SCI_SUCCESS;
537533 }
@@ -539,18 +535,18 @@ static enum sci_status scic_sds_port_set_phy(struct scic_sds_port *port, struct · 1 unmodified line
539535 return SCI_FAILURE;
540536 }
541537
542−static enum sci_status scic_sds_port_clear_phy(struct scic_sds_port *port,
538+static enum sci_status scic_sds_port_clear_phy(struct isci_port *iport,
543539 struct isci_phy *iphy)
544540 {
545541 /* Make sure that this phy is part of this port */
546− if (port->phy_table[iphy->phy_index] == iphy &&
547− phy_get_non_dummy_port(iphy) == port) {
548− struct scic_sds_controller *scic = port->owning_controller;
542+ if (iport->phy_table[iphy->phy_index] == iphy &&
543+ phy_get_non_dummy_port(iphy) == iport) {
544+ struct scic_sds_controller *scic = iport->owning_controller;
549545 struct isci_host *ihost = scic_to_ihost(scic);
550546
551547 /* Yep it is assigned to this port so remove it */
552− scic_sds_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS].sci);
553− port->phy_table[iphy->phy_index] = NULL;
548+ scic_sds_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]);
549+ iport->phy_table[iphy->phy_index] = NULL;
554550 return SCI_SUCCESS;
555551 }
556552
@@ -568,7 +564,7 @@ static enum sci_status scic_sds_port_clear_phy(struct scic_sds_port *port, · 11 unmodified lines
568564 *
569565 */
570566 void scic_sds_port_get_sas_address(
571− struct scic_sds_port *sci_port,
567+ struct isci_port *iport,
572568 struct sci_sas_address *sas_address)
573569 {
574570 u32 index;
@@ -577,8 +573,8 @@ void scic_sds_port_get_sas_address( · 2 unmodified lines
577573 sas_address->low = 0;
578574
579575 for (index = 0; index < SCI_MAX_PHYS; index++) {
580− if (sci_port->phy_table[index] != NULL) {
581− scic_sds_phy_get_sas_address(sci_port->phy_table[index], sas_address);
576+ if (iport->phy_table[index] != NULL) {
577+ scic_sds_phy_get_sas_address(iport->phy_table[index], sas_address);
582578 }
583579 }
584580 }
@@ -594,7 +590,7 @@ void scic_sds_port_get_sas_address( · 9 unmodified lines
594590 *
595591 */
596592 void scic_sds_port_get_attached_sas_address(
597− struct scic_sds_port *sci_port,
593+ struct isci_port *iport,
598594 struct sci_sas_address *sas_address)
599595 {
600596 struct isci_phy *iphy;
@@ -603,7 +599,7 @@ void scic_sds_port_get_attached_sas_address( · 2 unmodified lines
603599 * Ensure that the phy is both part of the port and currently
604600 * connected to the remote end-point.
605601 */
606− iphy = scic_sds_port_get_a_connected_phy(sci_port);
602+ iphy = scic_sds_port_get_a_connected_phy(iport);
607603 if (iphy) {
608604 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA) {
609605 scic_sds_phy_get_attached_sas_address(iphy,
@@ -628,11 +624,11 @@ void scic_sds_port_get_attached_sas_address( · 18 unmodified lines
628624 * This structure will be posted to the hardware to work around a scheduler
629625 * error in the hardware.
630626 */
631−static void scic_sds_port_construct_dummy_rnc(struct scic_sds_port *sci_port, u16 rni)
627+static void scic_sds_port_construct_dummy_rnc(struct isci_port *iport, u16 rni)
632628 {
633629 union scu_remote_node_context *rnc;
634630
635− rnc = &sci_port->owning_controller->remote_node_context_table[rni];
631+ rnc = &iport->owning_controller->remote_node_context_table[rni];
636632
637633 memset(rnc, 0, sizeof(union scu_remote_node_context));
638634
@@ -641,7 +637,7 @@ static void scic_sds_port_construct_dummy_rnc(struct scic_sds_port *sci_port, u1 · 2 unmodified lines
641637
642638 rnc->ssp.remote_node_index = rni;
643639 rnc->ssp.remote_node_port_width = 1;
644− rnc->ssp.logical_port_index = sci_port->physical_port_index;
640+ rnc->ssp.logical_port_index = iport->physical_port_index;
645641
646642 rnc->ssp.nexus_loss_timer_enable = false;
647643 rnc->ssp.check_bit = false;
@@ -656,9 +652,9 @@ static void scic_sds_port_construct_dummy_rnc(struct scic_sds_port *sci_port, u1 · 8 unmodified lines
656652 * structure will be posted to the hardwre to work around a scheduler error
657653 * in the hardware.
658654 */
659−static void scic_sds_port_construct_dummy_task(struct scic_sds_port *sci_port, u16 tag)
655+static void scic_sds_port_construct_dummy_task(struct isci_port *iport, u16 tag)
660656 {
661− struct scic_sds_controller *scic = sci_port->owning_controller;
657+ struct scic_sds_controller *scic = iport->owning_controller;
662658 struct scu_task_context *task_context;
663659
664660 task_context = &scic->task_context_table[ISCI_TAG_TCI(tag)];
@@ -666,29 +662,29 @@ static void scic_sds_port_construct_dummy_task(struct scic_sds_port *sci_port, u · 1 unmodified line
666662
667663 task_context->initiator_request = 1;
668664 task_context->connection_rate = 1;
669− task_context->logical_port_index = sci_port->physical_port_index;
665+ task_context->logical_port_index = iport->physical_port_index;
670666 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SSP;
671667 task_context->task_index = ISCI_TAG_TCI(tag);
672668 task_context->valid = SCU_TASK_CONTEXT_VALID;
673669 task_context->context_type = SCU_TASK_CONTEXT_TYPE;
674− task_context->remote_node_index = sci_port->reserved_rni;
670+ task_context->remote_node_index = iport->reserved_rni;
675671 task_context->do_not_dma_ssp_good_response = 1;
676672 task_context->task_phase = 0x01;
677673 }
678674
679−static void scic_sds_port_destroy_dummy_resources(struct scic_sds_port *sci_port)
675+static void scic_sds_port_destroy_dummy_resources(struct isci_port *iport)
680676 {
681− struct scic_sds_controller *scic = sci_port->owning_controller;
677+ struct scic_sds_controller *scic = iport->owning_controller;
682678
683− if (sci_port->reserved_tag != SCI_CONTROLLER_INVALID_IO_TAG)
684− isci_free_tag(scic_to_ihost(scic), sci_port->reserved_tag);
679+ if (iport->reserved_tag != SCI_CONTROLLER_INVALID_IO_TAG)
680+ isci_free_tag(scic_to_ihost(scic), iport->reserved_tag);
685681
686− if (sci_port->reserved_rni != SCU_DUMMY_INDEX)
682+ if (iport->reserved_rni != SCU_DUMMY_INDEX)
687683 scic_sds_remote_node_table_release_remote_node_index(&scic->available_remote_nodes,
688− 1, sci_port->reserved_rni);
684+ 1, iport->reserved_rni);
689685
690− sci_port->reserved_rni = SCU_DUMMY_INDEX;
691− sci_port->reserved_tag = SCI_CONTROLLER_INVALID_IO_TAG;
686+ iport->reserved_rni = SCU_DUMMY_INDEX;
687+ iport->reserved_tag = SCI_CONTROLLER_INVALID_IO_TAG;
692688 }
693689
694690 /**
@@ -704,14 +700,14 @@ static void scic_sds_port_destroy_dummy_resources(struct scic_sds_port *sci_port · 9 unmodified lines
704700 * if the phy being added to the port
705701 */
706702 enum sci_status scic_sds_port_initialize(
707− struct scic_sds_port *sci_port,
703+ struct isci_port *iport,
708704 void __iomem *port_task_scheduler_registers,
709705 void __iomem *port_configuration_regsiter,
710706 void __iomem *viit_registers)
711707 {
712− sci_port->port_task_scheduler_registers = port_task_scheduler_registers;
713− sci_port->port_pe_configuration_register = port_configuration_regsiter;
714− sci_port->viit_registers = viit_registers;
708+ iport->port_task_scheduler_registers = port_task_scheduler_registers;
709+ iport->port_pe_configuration_register = port_configuration_regsiter;
710+ iport->viit_registers = viit_registers;
715711
716712 return SCI_SUCCESS;
717713 }
@@ -720,20 +716,20 @@ enum sci_status scic_sds_port_initialize( · 2 unmodified lines
720716 /**
721717 * This method assigns the direct attached device ID for this port.
722718 *
723− * @param[in] sci_port The port for which the direct attached device id is to
719+ * @param[in] iport The port for which the direct attached device id is to
724720 * be assigned.
725721 * @param[in] device_id The direct attached device ID to assign to the port.
726722 * This will be the RNi for the device
727723 */
728724 void scic_sds_port_setup_transports(
729− struct scic_sds_port *sci_port,
725+ struct isci_port *iport,
730726 u32 device_id)
731727 {
732728 u8 index;
733729
734730 for (index = 0; index < SCI_MAX_PHYS; index++) {
735− if (sci_port->active_phy_mask & (1 << index))
736− scic_sds_phy_setup_transport(sci_port->phy_table[index], device_id);
731+ if (iport->active_phy_mask & (1 << index))
732+ scic_sds_phy_setup_transport(iport->phy_table[index], device_id);
737733 }
738734 }
739735
@@ -749,39 +745,38 @@ void scic_sds_port_setup_transports( · 9 unmodified lines
749745 * the phy to the port - enabling the Protocol Engine in the silicon. -
750746 * notifying the user that the link is up. none
751747 */
752−static void scic_sds_port_activate_phy(struct scic_sds_port *sci_port,
748+static void scic_sds_port_activate_phy(struct isci_port *iport,
753749 struct isci_phy *iphy,
754750 bool do_notify_user)
755751 {
756− struct scic_sds_controller *scic = sci_port->owning_controller;
752+ struct scic_sds_controller *scic = iport->owning_controller;
757753 struct isci_host *ihost = scic_to_ihost(scic);
758754
759755 if (iphy->protocol != SCIC_SDS_PHY_PROTOCOL_SATA)
760756 scic_sds_phy_resume(iphy);
761757
762− sci_port->active_phy_mask |= 1 << iphy->phy_index;
758+ iport->active_phy_mask |= 1 << iphy->phy_index;
763759
764760 scic_sds_controller_clear_invalid_phy(scic, iphy);
765761
766762 if (do_notify_user == true)
767− isci_port_link_up(ihost, sci_port, iphy);
763+ isci_port_link_up(ihost, iport, iphy);
768764 }
769765
770−void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port,
766+void scic_sds_port_deactivate_phy(struct isci_port *iport,
771767 struct isci_phy *iphy,
772768 bool do_notify_user)
773769 {
774− struct scic_sds_controller *scic = scic_sds_port_get_controller(sci_port);
775− struct isci_port *iport = sci_port_to_iport(sci_port);
770+ struct scic_sds_controller *scic = scic_sds_port_get_controller(iport);
776771 struct isci_host *ihost = scic_to_ihost(scic);
777772
778− sci_port->active_phy_mask &= ~(1 << iphy->phy_index);
773+ iport->active_phy_mask &= ~(1 << iphy->phy_index);
779774
780775 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
781776
782777 /* Re-assign the phy back to the LP as if it were a narrow port */
783778 writel(iphy->phy_index,
784− &sci_port->port_pe_configuration_register[iphy->phy_index]);
779+ &iport->port_pe_configuration_register[iphy->phy_index]);
785780
786781 if (do_notify_user == true)
787782 isci_port_link_down(ihost, iphy, iport);
@@ -795,10 +790,10 @@ void scic_sds_port_deactivate_phy(struct scic_sds_port *sci_port, · 7 unmodified lines
795790 * This function will disable the phy and report that the phy is not valid for
796791 * this port object. None
797792 */
798−static void scic_sds_port_invalid_link_up(struct scic_sds_port *sci_port,
793+static void scic_sds_port_invalid_link_up(struct isci_port *iport,
799794 struct isci_phy *iphy)
800795 {
801− struct scic_sds_controller *scic = sci_port->owning_controller;
796+ struct scic_sds_controller *scic = iport->owning_controller;
802797
803798 /*
804799 * Check to see if we have alreay reported this link as bad and if
@@ -825,17 +820,17 @@ static bool is_port_ready_state(enum scic_sds_port_states state) · 20 unmodified lines
825820 }
826821
827822 /* flag dummy rnc hanling when exiting a ready state */
828−static void port_state_machine_change(struct scic_sds_port *sci_port,
823+static void port_state_machine_change(struct isci_port *iport,
829824 enum scic_sds_port_states state)
830825 {
831− struct sci_base_state_machine *sm = &sci_port->sm;
826+ struct sci_base_state_machine *sm = &iport->sm;
832827 enum scic_sds_port_states old_state = sm->current_state_id;
833828
834829 if (is_port_ready_state(old_state) && !is_port_ready_state(state))
835− sci_port->ready_exit = true;
830+ iport->ready_exit = true;
836831
837832 sci_change_state(sm, state);
838− sci_port->ready_exit = false;
833+ iport->ready_exit = false;
839834 }
840835
841836 /**
@@ -851,14 +846,14 @@ static void port_state_machine_change(struct scic_sds_port *sci_port, · 9 unmodified lines
851846 * part of a port if it's attached SAS ADDRESS is the same as all other PHYs in
852847 * the same port. none
853848 */
854−static void scic_sds_port_general_link_up_handler(struct scic_sds_port *sci_port,
849+static void scic_sds_port_general_link_up_handler(struct isci_port *iport,
855850 struct isci_phy *iphy,
856851 bool do_notify_user)
857852 {
858853 struct sci_sas_address port_sas_address;
859854 struct sci_sas_address phy_sas_address;
860855
861− scic_sds_port_get_attached_sas_address(sci_port, &port_sas_address);
856+ scic_sds_port_get_attached_sas_address(iport, &port_sas_address);
862857 scic_sds_phy_get_attached_sas_address(iphy, &phy_sas_address);
863858
864859 /* If the SAS address of the new phy matches the SAS address of
@@ -868,14 +863,14 @@ static void scic_sds_port_general_link_up_handler(struct scic_sds_port *sci_port · 3 unmodified lines
868863 */
869864 if ((phy_sas_address.high == port_sas_address.high &&
870865 phy_sas_address.low == port_sas_address.low) ||
871− sci_port->active_phy_mask == 0) {
872− struct sci_base_state_machine *sm = &sci_port->sm;
866+ iport->active_phy_mask == 0) {
867+ struct sci_base_state_machine *sm = &iport->sm;
873868
874− scic_sds_port_activate_phy(sci_port, iphy, do_notify_user);
869+ scic_sds_port_activate_phy(iport, iphy, do_notify_user);
875870 if (sm->current_state_id == SCI_PORT_RESETTING)
876− port_state_machine_change(sci_port, SCI_PORT_READY);
871+ port_state_machine_change(iport, SCI_PORT_READY);
877872 } else
878− scic_sds_port_invalid_link_up(sci_port, iphy);
873+ scic_sds_port_invalid_link_up(iport, iphy);
879874 }
880875
881876
@@ -889,13 +884,13 @@ static void scic_sds_port_general_link_up_handler(struct scic_sds_port *sci_port · 7 unmodified lines
889884 * bool true Is returned if this is a wide ported port. false Is returned if
890885 * this is a narrow port.
891886 */
892−static bool scic_sds_port_is_wide(struct scic_sds_port *sci_port)
887+static bool scic_sds_port_is_wide(struct isci_port *iport)
893888 {
894889 u32 index;
895890 u32 phy_count = 0;
896891
897892 for (index = 0; index < SCI_MAX_PHYS; index++) {
898− if (sci_port->phy_table[index] != NULL) {
893+ if (iport->phy_table[index] != NULL) {
899894 phy_count++;
900895 }
901896 }
@@ -918,13 +913,13 @@ static bool scic_sds_port_is_wide(struct scic_sds_port *sci_port) · 16 unmodified lines
918913 * devices this could become an invalid port configuration.
919914 */
920915 bool scic_sds_port_link_detected(
921− struct scic_sds_port *sci_port,
916+ struct isci_port *iport,
922917 struct isci_phy *iphy)
923918 {
924− if ((sci_port->logical_port_index != SCIC_SDS_DUMMY_PORT) &&
919+ if ((iport->logical_port_index != SCIC_SDS_DUMMY_PORT) &&
925920 (iphy->protocol == SCIC_SDS_PHY_PROTOCOL_SATA) &&
926− scic_sds_port_is_wide(sci_port)) {
927− scic_sds_port_invalid_link_up(sci_port, iphy);
921+ scic_sds_port_is_wide(iport)) {
922+ scic_sds_port_invalid_link_up(iport, iphy);
928923
929924 return false;
930925 }
@@ -935,8 +930,8 @@ bool scic_sds_port_link_detected( · 4 unmodified lines
935930 static void port_timeout(unsigned long data)
936931 {
937932 struct sci_timer *tmr = (struct sci_timer *)data;
938− struct scic_sds_port *sci_port = container_of(tmr, typeof(*sci_port), timer);
939− struct isci_host *ihost = scic_to_ihost(sci_port->owning_controller);
933+ struct isci_port *iport = container_of(tmr, typeof(*iport), timer);
934+ struct isci_host *ihost = scic_to_ihost(iport->owning_controller);
940935 unsigned long flags;
941936 u32 current_state;
942937
@@ -945,33 +940,33 @@ static void port_timeout(unsigned long data) · 2 unmodified lines
945940 if (tmr->cancel)
946941 goto done;
947942
948− current_state = sci_port->sm.current_state_id;
943+ current_state = iport->sm.current_state_id;
949944
950945 if (current_state == SCI_PORT_RESETTING) {
951946 /* if the port is still in the resetting state then the timeout
952947 * fired before the reset completed.
953948 */
954− port_state_machine_change(sci_port, SCI_PORT_FAILED);
949+ port_state_machine_change(iport, SCI_PORT_FAILED);
955950 } else if (current_state == SCI_PORT_STOPPED) {
956951 /* if the port is stopped then the start request failed In this
957952 * case stay in the stopped state.
958953 */
959− dev_err(sciport_to_dev(sci_port),
954+ dev_err(sciport_to_dev(iport),
960955 "%s: SCIC Port 0x%p failed to stop before tiemout.\n",
961956 __func__,
962− sci_port);
957+ iport);
963958 } else if (current_state == SCI_PORT_STOPPING) {
964959 /* if the port is still stopping then the stop has not completed */
965− isci_port_stop_complete(sci_port->owning_controller,
966− sci_port,
960+ isci_port_stop_complete(iport->owning_controller,
961+ iport,
967962 SCI_FAILURE_TIMEOUT);
968963 } else {
969964 /* The port is in the ready state and we have a timer
970965 * reporting a timeout this should not happen.
971966 */
972− dev_err(sciport_to_dev(sci_port),
967+ dev_err(sciport_to_dev(iport),
973968 "%s: SCIC Port 0x%p is processing a timeout operation "
974− "in state %d.\n", __func__, sci_port, current_state);
969+ "in state %d.\n", __func__, iport, current_state);
975970 }
976971
977972 done:
@@ -985,29 +980,29 @@ done: · 7 unmodified lines
985980 *
986981 *
987982 */
988−static void scic_sds_port_update_viit_entry(struct scic_sds_port *sci_port)
983+static void scic_sds_port_update_viit_entry(struct isci_port *iport)
989984 {
990985 struct sci_sas_address sas_address;
991986
992− scic_sds_port_get_sas_address(sci_port, &sas_address);
987+ scic_sds_port_get_sas_address(iport, &sas_address);
993988
994989 writel(sas_address.high,
995− &sci_port->viit_registers->initiator_sas_address_hi);
990+ &iport->viit_registers->initiator_sas_address_hi);
996991 writel(sas_address.low,
997− &sci_port->viit_registers->initiator_sas_address_lo);
992+ &iport->viit_registers->initiator_sas_address_lo);
998993
999994 /* This value get cleared just in case its not already cleared */
1000− writel(0, &sci_port->viit_registers->reserved);
995+ writel(0, &iport->viit_registers->reserved);
1001996
1002997 /* We are required to update the status register last */
1003998 writel(SCU_VIIT_ENTRY_ID_VIIT |
1004999 SCU_VIIT_IPPT_INITIATOR |
1005− ((1 << sci_port->physical_port_index) << SCU_VIIT_ENTRY_LPVIE_SHIFT) |
1000+ ((1 << iport->physical_port_index) << SCU_VIIT_ENTRY_LPVIE_SHIFT) |
10061001 SCU_VIIT_STATUS_ALL_VALID,
1007− &sci_port->viit_registers->status);
1002+ &iport->viit_registers->status);
10081003 }
10091004
1010−enum sas_linkrate scic_sds_port_get_max_allowed_speed(struct scic_sds_port *sci_port)
1005+enum sas_linkrate scic_sds_port_get_max_allowed_speed(struct isci_port *iport)
10111006 {
10121007 u16 index;
10131008 struct isci_phy *iphy;
@@ -1017,8 +1012,8 @@ enum sas_linkrate scic_sds_port_get_max_allowed_speed(struct scic_sds_port *sci_ · 3 unmodified lines
10171012 * Loop through all of the phys in this port and find the phy with the
10181013 * lowest maximum link rate. */
10191014 for (index = 0; index < SCI_MAX_PHYS; index++) {
1020− iphy = sci_port->phy_table[index];
1021− if (iphy && scic_sds_port_active_phy(sci_port, iphy) &&
1015+ iphy = iport->phy_table[index];
1016+ if (iphy && scic_sds_port_active_phy(iport, iphy) &&
10221017 iphy->max_negotiated_speed < max_allowed_speed)
10231018 max_allowed_speed = iphy->max_negotiated_speed;
10241019 }
@@ -1026,13 +1021,13 @@ enum sas_linkrate scic_sds_port_get_max_allowed_speed(struct scic_sds_port *sci_ · 1 unmodified line
10261021 return max_allowed_speed;
10271022 }
10281023
1029−static void scic_sds_port_suspend_port_task_scheduler(struct scic_sds_port *port)
1024+static void scic_sds_port_suspend_port_task_scheduler(struct isci_port *iport)
10301025 {
10311026 u32 pts_control_value;
10321027
1033− pts_control_value = readl(&port->port_task_scheduler_registers->control);
1028+ pts_control_value = readl(&iport->port_task_scheduler_registers->control);
10341029 pts_control_value |= SCU_PTSxCR_GEN_BIT(SUSPEND);
1035− writel(pts_control_value, &port->port_task_scheduler_registers->control);
1030+ writel(pts_control_value, &iport->port_task_scheduler_registers->control);
10361031 }
10371032
10381033 /**
@@ -1044,10 +1039,10 @@ static void scic_sds_port_suspend_port_task_scheduler(struct scic_sds_port *port · 5 unmodified lines
10441039 * ongoing requests.
10451040 *
10461041 */
1047−static void scic_sds_port_post_dummy_request(struct scic_sds_port *sci_port)
1042+static void scic_sds_port_post_dummy_request(struct isci_port *iport)
10481043 {
1049− struct scic_sds_controller *scic = sci_port->owning_controller;
1050− u16 tag = sci_port->reserved_tag;
1044+ struct scic_sds_controller *scic = iport->owning_controller;
1045+ u16 tag = iport->reserved_tag;
10511046 struct scu_task_context *tc;
10521047 u32 command;
10531048
@@ -1055,7 +1050,7 @@ static void scic_sds_port_post_dummy_request(struct scic_sds_port *sci_port) · 1 unmodified line
10551050 tc->abort = 0;
10561051
10571052 command = SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
1058− sci_port->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
1053+ iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
10591054 ISCI_TAG_TCI(tag);
10601055
10611056 scic_sds_controller_post_request(scic, command);
@@ -1068,10 +1063,10 @@ static void scic_sds_port_post_dummy_request(struct scic_sds_port *sci_port) · 6 unmodified lines
10681063 * @sci_port: The port on which the task must be aborted.
10691064 *
10701065 */
1071−static void scic_sds_port_abort_dummy_request(struct scic_sds_port *sci_port)
1066+static void scic_sds_port_abort_dummy_request(struct isci_port *iport)
10721067 {
1073− struct scic_sds_controller *scic = sci_port->owning_controller;
1074− u16 tag = sci_port->reserved_tag;
1068+ struct scic_sds_controller *scic = iport->owning_controller;
1069+ u16 tag = iport->reserved_tag;
10751070 struct scu_task_context *tc;
10761071 u32 command;
10771072
@@ -1079,7 +1074,7 @@ static void scic_sds_port_abort_dummy_request(struct scic_sds_port *sci_port) · 1 unmodified line
10791074 tc->abort = 1;
10801075
10811076 command = SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT |
1082− sci_port->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
1077+ iport->physical_port_index << SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT |
10831078 ISCI_TAG_TCI(tag);
10841079
10851080 scic_sds_controller_post_request(scic, command);
@@ -1087,31 +1082,31 @@ static void scic_sds_port_abort_dummy_request(struct scic_sds_port *sci_port) · 1 unmodified line
10871082
10881083 /**
10891084 *
1090− * @sci_port: This is the struct scic_sds_port object to resume.
1085+ * @sci_port: This is the struct isci_port object to resume.
10911086 *
10921087 * This method will resume the port task scheduler for this port object. none
10931088 */
10941089 static void
1095−scic_sds_port_resume_port_task_scheduler(struct scic_sds_port *port)
1090+scic_sds_port_resume_port_task_scheduler(struct isci_port *iport)
10961091 {
10971092 u32 pts_control_value;
10981093
1099− pts_control_value = readl(&port->port_task_scheduler_registers->control);
1094+ pts_control_value = readl(&iport->port_task_scheduler_registers->control);
11001095 pts_control_value &= ~SCU_PTSxCR_GEN_BIT(SUSPEND);
1101− writel(pts_control_value, &port->port_task_scheduler_registers->control);
1096+ writel(pts_control_value, &iport->port_task_scheduler_registers->control);
11021097 }
11031098
11041099 static void scic_sds_port_ready_substate_waiting_enter(struct sci_base_state_machine *sm)
11051100 {
1106− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1101+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
11071102
1108− scic_sds_port_suspend_port_task_scheduler(sci_port);
1103+ scic_sds_port_suspend_port_task_scheduler(iport);
11091104
1110− sci_port->not_ready_reason = SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS;
1105+ iport->not_ready_reason = SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS;
11111106
1112− if (sci_port->active_phy_mask != 0) {
1107+ if (iport->active_phy_mask != 0) {
11131108 /* At least one of the phys on the port is ready */
1114− port_state_machine_change(sci_port,
1109+ port_state_machine_change(iport,
11151110 SCI_PORT_SUB_OPERATIONAL);
11161111 }
11171112 }
@@ -1119,38 +1114,37 @@ static void scic_sds_port_ready_substate_waiting_enter(struct sci_base_state_mac · 1 unmodified line
11191114 static void scic_sds_port_ready_substate_operational_enter(struct sci_base_state_machine *sm)
11201115 {
11211116 u32 index;
1122− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1123− struct scic_sds_controller *scic = sci_port->owning_controller;
1117+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1118+ struct scic_sds_controller *scic = iport->owning_controller;
11241119 struct isci_host *ihost = scic_to_ihost(scic);
1125− struct isci_port *iport = sci_port_to_iport(sci_port);
11261120
11271121 isci_port_ready(ihost, iport);
11281122
11291123 for (index = 0; index < SCI_MAX_PHYS; index++) {
1130− if (sci_port->phy_table[index]) {
1131− writel(sci_port->physical_port_index,
1132− &sci_port->port_pe_configuration_register[
1133− sci_port->phy_table[index]->phy_index]);
1124+ if (iport->phy_table[index]) {
1125+ writel(iport->physical_port_index,
1126+ &iport->port_pe_configuration_register[
1127+ iport->phy_table[index]->phy_index]);
11341128 }
11351129 }
11361130
1137− scic_sds_port_update_viit_entry(sci_port);
1131+ scic_sds_port_update_viit_entry(iport);
11381132
1139− scic_sds_port_resume_port_task_scheduler(sci_port);
1133+ scic_sds_port_resume_port_task_scheduler(iport);
11401134
11411135 /*
11421136 * Post the dummy task for the port so the hardware can schedule
11431137 * io correctly
11441138 */
1145− scic_sds_port_post_dummy_request(sci_port);
1139+ scic_sds_port_post_dummy_request(iport);
11461140 }
11471141
1148−static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci_port)
1142+static void scic_sds_port_invalidate_dummy_remote_node(struct isci_port *iport)
11491143 {
1150− struct scic_sds_controller *scic = sci_port->owning_controller;
1151− u8 phys_index = sci_port->physical_port_index;
1144+ struct scic_sds_controller *scic = iport->owning_controller;
1145+ u8 phys_index = iport->physical_port_index;
11521146 union scu_remote_node_context *rnc;
1153− u16 rni = sci_port->reserved_rni;
1147+ u16 rni = iport->reserved_rni;
11541148 u32 command;
11551149
11561150 rnc = &scic->remote_node_context_table[rni];
@@ -1172,73 +1166,71 @@ static void scic_sds_port_invalidate_dummy_remote_node(struct scic_sds_port *sci · 15 unmodified lines
11721166
11731167 /**
11741168 *
1175− * @object: This is the object which is cast to a struct scic_sds_port object.
1169+ * @object: This is the object which is cast to a struct isci_port object.
11761170 *
1177− * This method will perform the actions required by the struct scic_sds_port on
1171+ * This method will perform the actions required by the struct isci_port on
11781172 * exiting the SCI_PORT_SUB_OPERATIONAL. This function reports
11791173 * the port not ready and suspends the port task scheduler. none
11801174 */
11811175 static void scic_sds_port_ready_substate_operational_exit(struct sci_base_state_machine *sm)
11821176 {
1183− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1184− struct scic_sds_controller *scic = sci_port->owning_controller;
1177+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1178+ struct scic_sds_controller *scic = iport->owning_controller;
11851179 struct isci_host *ihost = scic_to_ihost(scic);
1186− struct isci_port *iport = sci_port_to_iport(sci_port);
11871180
11881181 /*
11891182 * Kill the dummy task for this port if it has not yet posted
11901183 * the hardware will treat this as a NOP and just return abort
11911184 * complete.
11921185 */
1193− scic_sds_port_abort_dummy_request(sci_port);
1186+ scic_sds_port_abort_dummy_request(iport);
11941187
11951188 isci_port_not_ready(ihost, iport);
11961189
1197− if (sci_port->ready_exit)
1198− scic_sds_port_invalidate_dummy_remote_node(sci_port);
1190+ if (iport->ready_exit)
1191+ scic_sds_port_invalidate_dummy_remote_node(iport);
11991192 }
12001193
12011194 static void scic_sds_port_ready_substate_configuring_enter(struct sci_base_state_machine *sm)
12021195 {
1203− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1204− struct scic_sds_controller *scic = sci_port->owning_controller;
1196+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1197+ struct scic_sds_controller *scic = iport->owning_controller;
12051198 struct isci_host *ihost = scic_to_ihost(scic);
1206− struct isci_port *iport = sci_port_to_iport(sci_port);
12071199
1208− if (sci_port->active_phy_mask == 0) {
1200+ if (iport->active_phy_mask == 0) {
12091201 isci_port_not_ready(ihost, iport);
12101202
1211− port_state_machine_change(sci_port,
1203+ port_state_machine_change(iport,
12121204 SCI_PORT_SUB_WAITING);
1213− } else if (sci_port->started_request_count == 0)
1214− port_state_machine_change(sci_port,
1205+ } else if (iport->started_request_count == 0)
1206+ port_state_machine_change(iport,
12151207 SCI_PORT_SUB_OPERATIONAL);
12161208 }
12171209
12181210 static void scic_sds_port_ready_substate_configuring_exit(struct sci_base_state_machine *sm)
12191211 {
1220− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1212+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
12211213
1222− scic_sds_port_suspend_port_task_scheduler(sci_port);
1223− if (sci_port->ready_exit)
1224− scic_sds_port_invalidate_dummy_remote_node(sci_port);
1214+ scic_sds_port_suspend_port_task_scheduler(iport);
1215+ if (iport->ready_exit)
1216+ scic_sds_port_invalidate_dummy_remote_node(iport);
12251217 }
12261218
1227−enum sci_status scic_sds_port_start(struct scic_sds_port *sci_port)
1219+enum sci_status scic_sds_port_start(struct isci_port *iport)
12281220 {
1229− struct scic_sds_controller *scic = sci_port->owning_controller;
1221+ struct scic_sds_controller *scic = iport->owning_controller;
12301222 enum sci_status status = SCI_SUCCESS;
12311223 enum scic_sds_port_states state;
12321224 u32 phy_mask;
12331225
1234− state = sci_port->sm.current_state_id;
1226+ state = iport->sm.current_state_id;
12351227 if (state != SCI_PORT_STOPPED) {
1236− dev_warn(sciport_to_dev(sci_port),
1228+ dev_warn(sciport_to_dev(iport),
12371229 "%s: in wrong state: %d\n", __func__, state);
12381230 return SCI_FAILURE_INVALID_STATE;
12391231 }
12401232
1241− if (sci_port->assigned_device_count > 0) {
1233+ if (iport->assigned_device_count > 0) {
12421234 /* TODO This is a start failure operation because
12431235 * there are still devices assigned to this port.
12441236 * There must be no devices assigned to a port on a
@@ -1247,18 +1239,18 @@ enum sci_status scic_sds_port_start(struct scic_sds_port *sci_port) · 2 unmodified lines
12471239 return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION;
12481240 }
12491241
1250− if (sci_port->reserved_rni == SCU_DUMMY_INDEX) {
1242+ if (iport->reserved_rni == SCU_DUMMY_INDEX) {
12511243 u16 rni = scic_sds_remote_node_table_allocate_remote_node(
12521244 &scic->available_remote_nodes, 1);
12531245
12541246 if (rni != SCU_DUMMY_INDEX)
1255− scic_sds_port_construct_dummy_rnc(sci_port, rni);
1247+ scic_sds_port_construct_dummy_rnc(iport, rni);
12561248 else
12571249 status = SCI_FAILURE_INSUFFICIENT_RESOURCES;
1258− sci_port->reserved_rni = rni;
1250+ iport->reserved_rni = rni;
12591251 }
12601252
1261− if (sci_port->reserved_tag == SCI_CONTROLLER_INVALID_IO_TAG) {
1253+ if (iport->reserved_tag == SCI_CONTROLLER_INVALID_IO_TAG) {
12621254 struct isci_host *ihost = scic_to_ihost(scic);
12631255 u16 tag;
12641256
@@ -1266,20 +1258,20 @@ enum sci_status scic_sds_port_start(struct scic_sds_port *sci_port) · 1 unmodified line
12661258 if (tag == SCI_CONTROLLER_INVALID_IO_TAG)
12671259 status = SCI_FAILURE_INSUFFICIENT_RESOURCES;
12681260 else
1269− scic_sds_port_construct_dummy_task(sci_port, tag);
1270− sci_port->reserved_tag = tag;
1261+ scic_sds_port_construct_dummy_task(iport, tag);
1262+ iport->reserved_tag = tag;
12711263 }
12721264
12731265 if (status == SCI_SUCCESS) {
1274− phy_mask = scic_sds_port_get_phys(sci_port);
1266+ phy_mask = scic_sds_port_get_phys(iport);
12751267
12761268 /*
12771269 * There are one or more phys assigned to this port. Make sure
12781270 * the port's phy mask is in fact legal and supported by the
12791271 * silicon.
12801272 */
1281− if (scic_sds_port_is_phy_mask_valid(sci_port, phy_mask) == true) {
1282− port_state_machine_change(sci_port,
1273+ if (scic_sds_port_is_phy_mask_valid(iport, phy_mask) == true) {
1274+ port_state_machine_change(iport,
12831275 SCI_PORT_READY);
12841276
12851277 return SCI_SUCCESS;
@@ -1288,16 +1280,16 @@ enum sci_status scic_sds_port_start(struct scic_sds_port *sci_port) · 2 unmodified lines
12881280 }
12891281
12901282 if (status != SCI_SUCCESS)
1291− scic_sds_port_destroy_dummy_resources(sci_port);
1283+ scic_sds_port_destroy_dummy_resources(iport);
12921284
12931285 return status;
12941286 }
12951287
1296−enum sci_status scic_sds_port_stop(struct scic_sds_port *sci_port)
1288+enum sci_status scic_sds_port_stop(struct isci_port *iport)
12971289 {
12981290 enum scic_sds_port_states state;
12991291
1300− state = sci_port->sm.current_state_id;
1292+ state = iport->sm.current_state_id;
13011293 switch (state) {
13021294 case SCI_PORT_STOPPED:
13031295 return SCI_SUCCESS;
@@ -1305,34 +1297,34 @@ enum sci_status scic_sds_port_stop(struct scic_sds_port *sci_port) · 1 unmodified line
13051297 case SCI_PORT_SUB_OPERATIONAL:
13061298 case SCI_PORT_SUB_CONFIGURING:
13071299 case SCI_PORT_RESETTING:
1308− port_state_machine_change(sci_port,
1300+ port_state_machine_change(iport,
13091301 SCI_PORT_STOPPING);
13101302 return SCI_SUCCESS;
13111303 default:
1312− dev_warn(sciport_to_dev(sci_port),
1304+ dev_warn(sciport_to_dev(iport),
13131305 "%s: in wrong state: %d\n", __func__, state);
13141306 return SCI_FAILURE_INVALID_STATE;
13151307 }
13161308 }
13171309
1318−static enum sci_status scic_port_hard_reset(struct scic_sds_port *sci_port, u32 timeout)
1310+static enum sci_status scic_port_hard_reset(struct isci_port *iport, u32 timeout)
13191311 {
13201312 enum sci_status status = SCI_FAILURE_INVALID_PHY;
13211313 struct isci_phy *iphy = NULL;
13221314 enum scic_sds_port_states state;
13231315 u32 phy_index;
13241316
1325− state = sci_port->sm.current_state_id;
1317+ state = iport->sm.current_state_id;
13261318 if (state != SCI_PORT_SUB_OPERATIONAL) {
1327− dev_warn(sciport_to_dev(sci_port),
1319+ dev_warn(sciport_to_dev(iport),
13281320 "%s: in wrong state: %d\n", __func__, state);
13291321 return SCI_FAILURE_INVALID_STATE;
13301322 }
13311323
13321324 /* Select a phy on which we can send the hard reset request. */
13331325 for (phy_index = 0; phy_index < SCI_MAX_PHYS && !iphy; phy_index++) {
1334− iphy = sci_port->phy_table[phy_index];
1335− if (iphy && !scic_sds_port_active_phy(sci_port, iphy)) {
1326+ iphy = iport->phy_table[phy_index];
1327+ if (iphy && !scic_sds_port_active_phy(iport, iphy)) {
13361328 /*
13371329 * We found a phy but it is not ready select
13381330 * different phy
@@ -1349,10 +1341,10 @@ static enum sci_status scic_port_hard_reset(struct scic_sds_port *sci_port, u32 · 10 unmodified lines
13491341 if (status != SCI_SUCCESS)
13501342 return status;
13511343
1352− sci_mod_timer(&sci_port->timer, timeout);
1353− sci_port->not_ready_reason = SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED;
1344+ sci_mod_timer(&iport->timer, timeout);
1345+ iport->not_ready_reason = SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED;
13541346
1355− port_state_machine_change(sci_port, SCI_PORT_RESETTING);
1347+ port_state_machine_change(iport, SCI_PORT_RESETTING);
13561348 return SCI_SUCCESS;
13571349 }
13581350
@@ -1365,19 +1357,19 @@ static enum sci_status scic_port_hard_reset(struct scic_sds_port *sci_port, u32 · 6 unmodified lines
13651357 * enum sci_status. SCI_SUCCESS the phy has been added to the port. Any other
13661358 * status is a failure to add the phy to the port.
13671359 */
1368−enum sci_status scic_sds_port_add_phy(struct scic_sds_port *sci_port,
1360+enum sci_status scic_sds_port_add_phy(struct isci_port *iport,
13691361 struct isci_phy *iphy)
13701362 {
13711363 enum sci_status status;
13721364 enum scic_sds_port_states state;
13731365
1374− state = sci_port->sm.current_state_id;
1366+ state = iport->sm.current_state_id;
13751367 switch (state) {
13761368 case SCI_PORT_STOPPED: {
13771369 struct sci_sas_address port_sas_address;
13781370
13791371 /* Read the port assigned SAS Address if there is one */
1380− scic_sds_port_get_sas_address(sci_port, &port_sas_address);
1372+ scic_sds_port_get_sas_address(iport, &port_sas_address);
13811373
13821374 if (port_sas_address.high != 0 && port_sas_address.low != 0) {
13831375 struct sci_sas_address phy_sas_address;
@@ -1391,35 +1383,35 @@ enum sci_status scic_sds_port_add_phy(struct scic_sds_port *sci_port, · 7 unmodified lines
13911383 port_sas_address.low != phy_sas_address.low)
13921384 return SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION;
13931385 }
1394− return scic_sds_port_set_phy(sci_port, iphy);
1386+ return scic_sds_port_set_phy(iport, iphy);
13951387 }
13961388 case SCI_PORT_SUB_WAITING:
13971389 case SCI_PORT_SUB_OPERATIONAL:
1398− status = scic_sds_port_set_phy(sci_port, iphy);
1390+ status = scic_sds_port_set_phy(iport, iphy);
13991391
14001392 if (status != SCI_SUCCESS)
14011393 return status;
14021394
1403− scic_sds_port_general_link_up_handler(sci_port, iphy, true);
1404− sci_port->not_ready_reason = SCIC_PORT_NOT_READY_RECONFIGURING;
1405− port_state_machine_change(sci_port, SCI_PORT_SUB_CONFIGURING);
1395+ scic_sds_port_general_link_up_handler(iport, iphy, true);
1396+ iport->not_ready_reason = SCIC_PORT_NOT_READY_RECONFIGURING;
1397+ port_state_machine_change(iport, SCI_PORT_SUB_CONFIGURING);
14061398
14071399 return status;
14081400 case SCI_PORT_SUB_CONFIGURING:
1409− status = scic_sds_port_set_phy(sci_port, iphy);
1401+ status = scic_sds_port_set_phy(iport, iphy);
14101402
14111403 if (status != SCI_SUCCESS)
14121404 return status;
1413− scic_sds_port_general_link_up_handler(sci_port, iphy, true);
1405+ scic_sds_port_general_link_up_handler(iport, iphy, true);
14141406
14151407 /* Re-enter the configuring state since this may be the last phy in
14161408 * the port.
14171409 */
1418− port_state_machine_change(sci_port,
1410+ port_state_machine_change(iport,
14191411 SCI_PORT_SUB_CONFIGURING);
14201412 return SCI_SUCCESS;
14211413 default:
1422− dev_warn(sciport_to_dev(sci_port),
1414+ dev_warn(sciport_to_dev(iport),
14231415 "%s: in wrong state: %d\n", __func__, state);
14241416 return SCI_FAILURE_INVALID_STATE;
14251417 }
@@ -1434,65 +1426,65 @@ enum sci_status scic_sds_port_add_phy(struct scic_sds_port *sci_port, · 8 unmodified lines
14341426 * an enum sci_status. SCI_SUCCESS the phy has been removed from the port. Any
14351427 * other status is a failure to add the phy to the port.
14361428 */
1437−enum sci_status scic_sds_port_remove_phy(struct scic_sds_port *sci_port,
1429+enum sci_status scic_sds_port_remove_phy(struct isci_port *iport,
14381430 struct isci_phy *iphy)
14391431 {
14401432 enum sci_status status;
14411433 enum scic_sds_port_states state;
14421434
1443− state = sci_port->sm.current_state_id;
1435+ state = iport->sm.current_state_id;
14441436
14451437 switch (state) {
14461438 case SCI_PORT_STOPPED:
1447− return scic_sds_port_clear_phy(sci_port, iphy);
1439+ return scic_sds_port_clear_phy(iport, iphy);
14481440 case SCI_PORT_SUB_OPERATIONAL:
1449− status = scic_sds_port_clear_phy(sci_port, iphy);
1441+ status = scic_sds_port_clear_phy(iport, iphy);
14501442 if (status != SCI_SUCCESS)
14511443 return status;
14521444
1453− scic_sds_port_deactivate_phy(sci_port, iphy, true);
1454− sci_port->not_ready_reason = SCIC_PORT_NOT_READY_RECONFIGURING;
1455− port_state_machine_change(sci_port,
1445+ scic_sds_port_deactivate_phy(iport, iphy, true);
1446+ iport->not_ready_reason = SCIC_PORT_NOT_READY_RECONFIGURING;
1447+ port_state_machine_change(iport,
14561448 SCI_PORT_SUB_CONFIGURING);
14571449 return SCI_SUCCESS;
14581450 case SCI_PORT_SUB_CONFIGURING:
1459− status = scic_sds_port_clear_phy(sci_port, iphy);
1451+ status = scic_sds_port_clear_phy(iport, iphy);
14601452
14611453 if (status != SCI_SUCCESS)
14621454 return status;
1463− scic_sds_port_deactivate_phy(sci_port, iphy, true);
1455+ scic_sds_port_deactivate_phy(iport, iphy, true);
14641456
14651457 /* Re-enter the configuring state since this may be the last phy in
14661458 * the port
14671459 */
1468− port_state_machine_change(sci_port,
1460+ port_state_machine_change(iport,
14691461 SCI_PORT_SUB_CONFIGURING);
14701462 return SCI_SUCCESS;
14711463 default:
1472− dev_warn(sciport_to_dev(sci_port),
1464+ dev_warn(sciport_to_dev(iport),
14731465 "%s: in wrong state: %d\n", __func__, state);
14741466 return SCI_FAILURE_INVALID_STATE;
14751467 }
14761468 }
14771469
1478−enum sci_status scic_sds_port_link_up(struct scic_sds_port *sci_port,
1470+enum sci_status scic_sds_port_link_up(struct isci_port *iport,
14791471 struct isci_phy *iphy)
14801472 {
14811473 enum scic_sds_port_states state;
14821474
1483− state = sci_port->sm.current_state_id;
1475+ state = iport->sm.current_state_id;
14841476 switch (state) {
14851477 case SCI_PORT_SUB_WAITING:
14861478 /* Since this is the first phy going link up for the port we
14871479 * can just enable it and continue
14881480 */
1489− scic_sds_port_activate_phy(sci_port, iphy, true);
1481+ scic_sds_port_activate_phy(iport, iphy, true);
14901482
1491− port_state_machine_change(sci_port,
1483+ port_state_machine_change(iport,
14921484 SCI_PORT_SUB_OPERATIONAL);
14931485 return SCI_SUCCESS;
14941486 case SCI_PORT_SUB_OPERATIONAL:
1495− scic_sds_port_general_link_up_handler(sci_port, iphy, true);
1487+ scic_sds_port_general_link_up_handler(iport, iphy, true);
14961488 return SCI_SUCCESS;
14971489 case SCI_PORT_RESETTING:
14981490 /* TODO We should make sure that the phy that has gone
@@ -1509,82 +1501,82 @@ enum sci_status scic_sds_port_link_up(struct scic_sds_port *sci_port, · 10 unmodified lines
15091501 /* In the resetting state we don't notify the user regarding
15101502 * link up and link down notifications.
15111503 */
1512− scic_sds_port_general_link_up_handler(sci_port, iphy, false);
1504+ scic_sds_port_general_link_up_handler(iport, iphy, false);
15131505 return SCI_SUCCESS;
15141506 default:
1515− dev_warn(sciport_to_dev(sci_port),
1507+ dev_warn(sciport_to_dev(iport),
15161508 "%s: in wrong state: %d\n", __func__, state);
15171509 return SCI_FAILURE_INVALID_STATE;
15181510 }
15191511 }
15201512
1521−enum sci_status scic_sds_port_link_down(struct scic_sds_port *sci_port,
1513+enum sci_status scic_sds_port_link_down(struct isci_port *iport,
15221514 struct isci_phy *iphy)
15231515 {
15241516 enum scic_sds_port_states state;
15251517
1526− state = sci_port->sm.current_state_id;
1518+ state = iport->sm.current_state_id;
15271519 switch (state) {
15281520 case SCI_PORT_SUB_OPERATIONAL:
1529− scic_sds_port_deactivate_phy(sci_port, iphy, true);
1521+ scic_sds_port_deactivate_phy(iport, iphy, true);
15301522
15311523 /* If there are no active phys left in the port, then
15321524 * transition the port to the WAITING state until such time
15331525 * as a phy goes link up
15341526 */
1535− if (sci_port->active_phy_mask == 0)
1536− port_state_machine_change(sci_port,
1527+ if (iport->active_phy_mask == 0)
1528+ port_state_machine_change(iport,
15371529 SCI_PORT_SUB_WAITING);
15381530 return SCI_SUCCESS;
15391531 case SCI_PORT_RESETTING:
15401532 /* In the resetting state we don't notify the user regarding
15411533 * link up and link down notifications. */
1542− scic_sds_port_deactivate_phy(sci_port, iphy, false);
1534+ scic_sds_port_deactivate_phy(iport, iphy, false);
15431535 return SCI_SUCCESS;
15441536 default:
1545− dev_warn(sciport_to_dev(sci_port),
1537+ dev_warn(sciport_to_dev(iport),
15461538 "%s: in wrong state: %d\n", __func__, state);
15471539 return SCI_FAILURE_INVALID_STATE;
15481540 }
15491541 }
15501542
1551−enum sci_status scic_sds_port_start_io(struct scic_sds_port *sci_port,
1543+enum sci_status scic_sds_port_start_io(struct isci_port *iport,
15521544 struct scic_sds_remote_device *sci_dev,
15531545 struct isci_request *ireq)
15541546 {
15551547 enum scic_sds_port_states state;
15561548
1557− state = sci_port->sm.current_state_id;
1549+ state = iport->sm.current_state_id;
15581550 switch (state) {
15591551 case SCI_PORT_SUB_WAITING:
15601552 return SCI_FAILURE_INVALID_STATE;
15611553 case SCI_PORT_SUB_OPERATIONAL:
1562− sci_port->started_request_count++;
1554+ iport->started_request_count++;
15631555 return SCI_SUCCESS;
15641556 default:
1565− dev_warn(sciport_to_dev(sci_port),
1557+ dev_warn(sciport_to_dev(iport),
15661558 "%s: in wrong state: %d\n", __func__, state);
15671559 return SCI_FAILURE_INVALID_STATE;
15681560 }
15691561 }
15701562
1571−enum sci_status scic_sds_port_complete_io(struct scic_sds_port *sci_port,
1563+enum sci_status scic_sds_port_complete_io(struct isci_port *iport,
15721564 struct scic_sds_remote_device *sci_dev,
15731565 struct isci_request *ireq)
15741566 {
15751567 enum scic_sds_port_states state;
15761568
1577− state = sci_port->sm.current_state_id;
1569+ state = iport->sm.current_state_id;
15781570 switch (state) {
15791571 case SCI_PORT_STOPPED:
1580− dev_warn(sciport_to_dev(sci_port),
1572+ dev_warn(sciport_to_dev(iport),
15811573 "%s: in wrong state: %d\n", __func__, state);
15821574 return SCI_FAILURE_INVALID_STATE;
15831575 case SCI_PORT_STOPPING:
1584− scic_sds_port_decrement_request_count(sci_port);
1576+ scic_sds_port_decrement_request_count(iport);
15851577
1586− if (sci_port->started_request_count == 0)
1587− port_state_machine_change(sci_port,
1578+ if (iport->started_request_count == 0)
1579+ port_state_machine_change(iport,
15881580 SCI_PORT_STOPPED);
15891581 break;
15901582 case SCI_PORT_READY:
@@ -1592,12 +1584,12 @@ enum sci_status scic_sds_port_complete_io(struct scic_sds_port *sci_port, · 1 unmodified line
15921584 case SCI_PORT_FAILED:
15931585 case SCI_PORT_SUB_WAITING:
15941586 case SCI_PORT_SUB_OPERATIONAL:
1595− scic_sds_port_decrement_request_count(sci_port);
1587+ scic_sds_port_decrement_request_count(iport);
15961588 break;
15971589 case SCI_PORT_SUB_CONFIGURING:
1598− scic_sds_port_decrement_request_count(sci_port);
1599− if (sci_port->started_request_count == 0) {
1600− port_state_machine_change(sci_port,
1590+ scic_sds_port_decrement_request_count(iport);
1591+ if (iport->started_request_count == 0) {
1592+ port_state_machine_change(iport,
16011593 SCI_PORT_SUB_OPERATIONAL);
16021594 }
16031595 break;
@@ -1613,13 +1605,13 @@ enum sci_status scic_sds_port_complete_io(struct scic_sds_port *sci_port, · 9 unmodified lines
16131605 * will leave the port task scheduler in a suspended state. none
16141606 */
16151607 static void
1616−scic_sds_port_enable_port_task_scheduler(struct scic_sds_port *port)
1608+scic_sds_port_enable_port_task_scheduler(struct isci_port *iport)
16171609 {
16181610 u32 pts_control_value;
16191611
1620− pts_control_value = readl(&port->port_task_scheduler_registers->control);
1612+ pts_control_value = readl(&iport->port_task_scheduler_registers->control);
16211613 pts_control_value |= SCU_PTSxCR_GEN_BIT(ENABLE) | SCU_PTSxCR_GEN_BIT(SUSPEND);
1622− writel(pts_control_value, &port->port_task_scheduler_registers->control);
1614+ writel(pts_control_value, &iport->port_task_scheduler_registers->control);
16231615 }
16241616
16251617 /**
@@ -1630,22 +1622,22 @@ scic_sds_port_enable_port_task_scheduler(struct scic_sds_port *port) · 4 unmodified lines
16301622 * none
16311623 */
16321624 static void
1633−scic_sds_port_disable_port_task_scheduler(struct scic_sds_port *port)
1625+scic_sds_port_disable_port_task_scheduler(struct isci_port *iport)
16341626 {
16351627 u32 pts_control_value;
16361628
1637− pts_control_value = readl(&port->port_task_scheduler_registers->control);
1629+ pts_control_value = readl(&iport->port_task_scheduler_registers->control);
16381630 pts_control_value &=
16391631 ~(SCU_PTSxCR_GEN_BIT(ENABLE) | SCU_PTSxCR_GEN_BIT(SUSPEND));
1640− writel(pts_control_value, &port->port_task_scheduler_registers->control);
1632+ writel(pts_control_value, &iport->port_task_scheduler_registers->control);
16411633 }
16421634
1643−static void scic_sds_port_post_dummy_remote_node(struct scic_sds_port *sci_port)
1635+static void scic_sds_port_post_dummy_remote_node(struct isci_port *iport)
16441636 {
1645− struct scic_sds_controller *scic = sci_port->owning_controller;
1646− u8 phys_index = sci_port->physical_port_index;
1637+ struct scic_sds_controller *scic = iport->owning_controller;
1638+ u8 phys_index = iport->physical_port_index;
16471639 union scu_remote_node_context *rnc;
1648− u16 rni = sci_port->reserved_rni;
1640+ u16 rni = iport->reserved_rni;
16491641 u32 command;
16501642
16511643 rnc = &scic->remote_node_context_table[rni];
@@ -1670,67 +1662,65 @@ static void scic_sds_port_post_dummy_remote_node(struct scic_sds_port *sci_port) · 18 unmodified lines
16701662
16711663 static void scic_sds_port_stopped_state_enter(struct sci_base_state_machine *sm)
16721664 {
1673− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1665+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
16741666
1675− if (sci_port->sm.previous_state_id == SCI_PORT_STOPPING) {
1667+ if (iport->sm.previous_state_id == SCI_PORT_STOPPING) {
16761668 /*
16771669 * If we enter this state becasuse of a request to stop
16781670 * the port then we want to disable the hardwares port
16791671 * task scheduler. */
1680− scic_sds_port_disable_port_task_scheduler(sci_port);
1672+ scic_sds_port_disable_port_task_scheduler(iport);
16811673 }
16821674 }
16831675
16841676 static void scic_sds_port_stopped_state_exit(struct sci_base_state_machine *sm)
16851677 {
1686− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1678+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
16871679
16881680 /* Enable and suspend the port task scheduler */
1689− scic_sds_port_enable_port_task_scheduler(sci_port);
1681+ scic_sds_port_enable_port_task_scheduler(iport);
16901682 }
16911683
16921684 static void scic_sds_port_ready_state_enter(struct sci_base_state_machine *sm)
16931685 {
1694− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1695− struct scic_sds_controller *scic = sci_port->owning_controller;
1686+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
1687+ struct scic_sds_controller *scic = iport->owning_controller;
16961688 struct isci_host *ihost = scic_to_ihost(scic);
1697− struct isci_port *iport = sci_port_to_iport(sci_port);
16981689 u32 prev_state;
16991690
1700− prev_state = sci_port->sm.previous_state_id;
1691+ prev_state = iport->sm.previous_state_id;
17011692 if (prev_state == SCI_PORT_RESETTING)
17021693 isci_port_hard_reset_complete(iport, SCI_SUCCESS);
17031694 else
17041695 isci_port_not_ready(ihost, iport);
17051696
17061697 /* Post and suspend the dummy remote node context for this port. */
1707− scic_sds_port_post_dummy_remote_node(sci_port);
1698+ scic_sds_port_post_dummy_remote_node(iport);
17081699
17091700 /* Start the ready substate machine */
1710− port_state_machine_change(sci_port,
1701+ port_state_machine_change(iport,
17111702 SCI_PORT_SUB_WAITING);
17121703 }
17131704
17141705 static void scic_sds_port_resetting_state_exit(struct sci_base_state_machine *sm)
17151706 {
1716− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1707+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
17171708
1718− sci_del_timer(&sci_port->timer);
1709+ sci_del_timer(&iport->timer);
17191710 }
17201711
17211712 static void scic_sds_port_stopping_state_exit(struct sci_base_state_machine *sm)
17221713 {
1723− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1714+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
17241715
1725− sci_del_timer(&sci_port->timer);
1716+ sci_del_timer(&iport->timer);
17261717
1727− scic_sds_port_destroy_dummy_resources(sci_port);
1718+ scic_sds_port_destroy_dummy_resources(iport);
17281719 }
17291720
17301721 static void scic_sds_port_failed_state_enter(struct sci_base_state_machine *sm)
17311722 {
1732− struct scic_sds_port *sci_port = container_of(sm, typeof(*sci_port), sm);
1733− struct isci_port *iport = sci_port_to_iport(sci_port);
1723+ struct isci_port *iport = container_of(sm, typeof(*iport), sm);
17341724
17351725 isci_port_hard_reset_complete(iport, SCI_FAILURE_TIMEOUT);
17361726 }
@@ -1767,30 +1757,30 @@ static const struct sci_base_state scic_sds_port_state_table[] = { · 30 unmodified lines
17671757 }
17681758 };
17691759
1770−void scic_sds_port_construct(struct scic_sds_port *sci_port, u8 index,
1760+void scic_sds_port_construct(struct isci_port *iport, u8 index,
17711761 struct scic_sds_controller *scic)
17721762 {
1773− sci_init_sm(&sci_port->sm, scic_sds_port_state_table, SCI_PORT_STOPPED);
1763+ sci_init_sm(&iport->sm, scic_sds_port_state_table, SCI_PORT_STOPPED);
17741764
1775− sci_port->logical_port_index = SCIC_SDS_DUMMY_PORT;
1776− sci_port->physical_port_index = index;
1777− sci_port->active_phy_mask = 0;
1778− sci_port->ready_exit = false;
1765+ iport->logical_port_index = SCIC_SDS_DUMMY_PORT;
1766+ iport->physical_port_index = index;
1767+ iport->active_phy_mask = 0;
1768+ iport->ready_exit = false;
17791769
1780− sci_port->owning_controller = scic;
1770+ iport->owning_controller = scic;
17811771
1782− sci_port->started_request_count = 0;
1783− sci_port->assigned_device_count = 0;
1772+ iport->started_request_count = 0;
1773+ iport->assigned_device_count = 0;
17841774
1785− sci_port->reserved_rni = SCU_DUMMY_INDEX;
1786− sci_port->reserved_tag = SCI_CONTROLLER_INVALID_IO_TAG;
1775+ iport->reserved_rni = SCU_DUMMY_INDEX;
1776+ iport->reserved_tag = SCI_CONTROLLER_INVALID_IO_TAG;
17871777
1788− sci_init_timer(&sci_port->timer, port_timeout);
1778+ sci_init_timer(&iport->timer, port_timeout);
17891779
1790− sci_port->port_task_scheduler_registers = NULL;
1780+ iport->port_task_scheduler_registers = NULL;
17911781
17921782 for (index = 0; index < SCI_MAX_PHYS; index++)
1793− sci_port->phy_table[index] = NULL;
1783+ iport->phy_table[index] = NULL;
17941784 }
17951785
17961786 void isci_port_init(struct isci_port *iport, struct isci_host *ihost, int index)
@@ -1817,14 +1807,14 @@ enum isci_status isci_port_get_state( · 20 unmodified lines
18171807 }
18181808
18191809 void scic_sds_port_broadcast_change_received(
1820− struct scic_sds_port *sci_port,
1810+ struct isci_port *iport,
18211811 struct isci_phy *iphy)
18221812 {
1823− struct scic_sds_controller *scic = sci_port->owning_controller;
1813+ struct scic_sds_controller *scic = iport->owning_controller;
18241814 struct isci_host *ihost = scic_to_ihost(scic);
18251815
18261816 /* notify the user. */
1827− isci_port_bc_change_received(ihost, sci_port, iphy);
1817+ isci_port_bc_change_received(ihost, iport, iphy);
18281818 }
18291819
18301820 int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *iport,
@@ -1842,7 +1832,7 @@ int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *ipor · 11 unmodified lines
18421832 spin_lock_irqsave(&ihost->scic_lock, flags);
18431833
18441834 #define ISCI_PORT_RESET_TIMEOUT SCIC_SDS_SIGNATURE_FIS_TIMEOUT
1845− status = scic_port_hard_reset(&iport->sci, ISCI_PORT_RESET_TIMEOUT);
1835+ status = scic_port_hard_reset(iport, ISCI_PORT_RESET_TIMEOUT);
18461836
18471837 spin_unlock_irqrestore(&ihost->scic_lock, flags);
18481838
@@ -1878,14 +1868,12 @@ int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *ipor · 29 unmodified lines
18781868 /* Down all phys in the port. */
18791869 spin_lock_irqsave(&ihost->scic_lock, flags);
18801870 for (idx = 0; idx < SCI_MAX_PHYS; ++idx) {
1871+ struct isci_phy *iphy = iport->phy_table[idx];
18811872
1882− if (iport->sci.phy_table[idx] != NULL) {
1883−
1884− scic_sds_phy_stop(
1885− iport->sci.phy_table[idx]);
1886− scic_sds_phy_start(
1887− iport->sci.phy_table[idx]);
1888− }
1873+ if (!iphy)
1874+ continue;
1875+ scic_sds_phy_stop(iphy);
1876+ scic_sds_phy_start(iphy);
18891877 }
18901878 spin_unlock_irqrestore(&ihost->scic_lock, flags);
18911879 }
drivers/scsi/isci/port.h+51−123
@@ -76,100 +76,19 @@ enum isci_status { · 75 unmodified lines
7676 };
7777
7878 /**
79− * struct scic_sds_port
80− *
81− * The core port object provides the the abstraction for an SCU port.
82− */
83−struct scic_sds_port {
84− /**
85− * This field contains the information for the base port state machine.
86− */
87− struct sci_base_state_machine sm;
88−
89− bool ready_exit;
90−
91− /**
92− * This field is the port index that is reported to the SCI USER.
93− * This allows the actual hardware physical port to change without
94− * the SCI USER getting a different answer for the get port index.
95− */
96− u8 logical_port_index;
97−
98− /**
99− * This field is the port index used to program the SCU hardware.
100− */
101− u8 physical_port_index;
102−
103− /**
104− * This field contains the active phy mask for the port.
105− * This mask is used in conjunction with the phy state to determine
106− * which phy to select for some port operations.
107− */
108− u8 active_phy_mask;
109−
110− u16 reserved_rni;
111− u16 reserved_tag;
112−
113− /**
114− * This field contains the count of the io requests started on this port
115− * object. It is used to control controller shutdown.
116− */
117− u32 started_request_count;
118−
119− /**
120− * This field contains the number of devices assigned to this port.
121− * It is used to control port start requests.
122− */
123− u32 assigned_device_count;
124−
125− /**
126− * This field contains the reason for the port not going ready. It is
127− * assigned in the state handlers and used in the state transition.
128− */
129− u32 not_ready_reason;
130−
131− /**
132− * This field is the table of phys assigned to the port.
133− */
134− struct isci_phy *phy_table[SCI_MAX_PHYS];
135−
136− /**
137− * This field is a pointer back to the controller that owns this
138− * port object.
139− */
140− struct scic_sds_controller *owning_controller;
141−
142− /* timer used for port start/stop operations */
143− struct sci_timer timer;
144−
145− /**
146− * This field is the pointer to the port task scheduler registers
147− * for the SCU hardware.
148− */
149− struct scu_port_task_scheduler_registers __iomem
150− *port_task_scheduler_registers;
151−
152− /**
153− * This field is identical for all port objects and points to the port
154− * task scheduler group PE configuration registers.
155− * It is used to assign PEs to a port.
156− */
157− u32 __iomem *port_pe_configuration_register;
158−
159− /**
160− * This field is the VIIT register space for ths port object.
161− */
162− struct scu_viit_entry __iomem *viit_registers;
163−};
164−
165−
166−
167−/**
168− * struct isci_port - This class represents the port object used to internally
169− * represent libsas port objects. It also keeps a list of remote device
170− * objects.
171− *
172− *
79+ * struct isci_port - isci direct attached sas port object
80+ * @event: counts bcns and port stop events (for bcn filtering)
81+ * @ready_exit: several states constitute 'ready'. When exiting ready we
82+ * need to take extra port-teardown actions that are
83+ * skipped when exiting to another 'ready' state.
84+ * @logical_port_index: software port index
85+ * @physical_port_index: hardware port index
86+ * @active_phy_mask: identifies phy members
87+ * @reserved_tag:
88+ * @reserved_rni: reserver for port task scheduler workaround
89+ * @started_request_count: reference count for outstanding commands
90+ * @not_ready_reason: set during state transitions and notified
91+ * @timer: timeout start/stop operations
17392 */
17493 struct isci_port {
17594 enum isci_status status;
@@ -185,16 +104,25 @@ struct isci_port { · 9 unmodified lines
185104 struct completion start_complete;
186105 struct completion hard_reset_complete;
187106 enum sci_status hard_reset_status;
188− struct scic_sds_port sci;
107+ struct sci_base_state_machine sm;
108+ bool ready_exit;
109+ u8 logical_port_index;
110+ u8 physical_port_index;
111+ u8 active_phy_mask;
112+ u16 reserved_rni;
113+ u16 reserved_tag;
114+ u32 started_request_count;
115+ u32 assigned_device_count;
116+ u32 not_ready_reason;
117+ struct isci_phy *phy_table[SCI_MAX_PHYS];
118+ struct scic_sds_controller *owning_controller;
119+ struct sci_timer timer;
120+ struct scu_port_task_scheduler_registers __iomem *port_task_scheduler_registers;
121+ /* XXX rework: only one register, no need to replicate per-port */
122+ u32 __iomem *port_pe_configuration_register;
123+ struct scu_viit_entry __iomem *viit_registers;
189124 };
190125
191−static inline struct isci_port *sci_port_to_iport(struct scic_sds_port *sci_port)
192−{
193− struct isci_port *iport = container_of(sci_port, typeof(*iport), sci);
194−
195− return iport;
196−}
197−
198126 enum scic_port_not_ready_reason_code {
199127 SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS,
200128 SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED,
@@ -299,90 +227,90 @@ enum scic_sds_port_states { · 98 unmodified lines
299227 ((this_port)->physical_port_index)
300228
301229
302−static inline void scic_sds_port_decrement_request_count(struct scic_sds_port *sci_port)
230+static inline void scic_sds_port_decrement_request_count(struct isci_port *iport)
303231 {
304− if (WARN_ONCE(sci_port->started_request_count == 0,
232+ if (WARN_ONCE(iport->started_request_count == 0,
305233 "%s: tried to decrement started_request_count past 0!?",
306234 __func__))
307235 /* pass */;
308236 else
309− sci_port->started_request_count--;
237+ iport->started_request_count--;
310238 }
311239
312240 #define scic_sds_port_active_phy(port, phy) \
313241 (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0)
314242
315243 void scic_sds_port_construct(
316− struct scic_sds_port *sci_port,
244+ struct isci_port *iport,
317245 u8 port_index,
318246 struct scic_sds_controller *scic);
319247
320248 enum sci_status scic_sds_port_initialize(
321− struct scic_sds_port *sci_port,
249+ struct isci_port *iport,
322250 void __iomem *port_task_scheduler_registers,
323251 void __iomem *port_configuration_regsiter,
324252 void __iomem *viit_registers);
325253
326−enum sci_status scic_sds_port_start(struct scic_sds_port *sci_port);
327−enum sci_status scic_sds_port_stop(struct scic_sds_port *sci_port);
254+enum sci_status scic_sds_port_start(struct isci_port *iport);
255+enum sci_status scic_sds_port_stop(struct isci_port *iport);
328256
329257 enum sci_status scic_sds_port_add_phy(
330− struct scic_sds_port *sci_port,
258+ struct isci_port *iport,
331259 struct isci_phy *iphy);
332260
333261 enum sci_status scic_sds_port_remove_phy(
334− struct scic_sds_port *sci_port,
262+ struct isci_port *iport,
335263 struct isci_phy *iphy);
336264
337265 void scic_sds_port_setup_transports(
338− struct scic_sds_port *sci_port,
266+ struct isci_port *iport,
339267 u32 device_id);
340268
341269 void isci_port_bcn_enable(struct isci_host *, struct isci_port *);
342270
343271 void scic_sds_port_deactivate_phy(
344− struct scic_sds_port *sci_port,
272+ struct isci_port *iport,
345273 struct isci_phy *iphy,
346274 bool do_notify_user);
347275
348276 bool scic_sds_port_link_detected(
349− struct scic_sds_port *sci_port,
277+ struct isci_port *iport,
350278 struct isci_phy *iphy);
351279
352−enum sci_status scic_sds_port_link_up(struct scic_sds_port *sci_port,
280+enum sci_status scic_sds_port_link_up(struct isci_port *iport,
353281 struct isci_phy *iphy);
354−enum sci_status scic_sds_port_link_down(struct scic_sds_port *sci_port,
282+enum sci_status scic_sds_port_link_down(struct isci_port *iport,
355283 struct isci_phy *iphy);
356284
357285 struct isci_request;
358286 struct scic_sds_remote_device;
359287 enum sci_status scic_sds_port_start_io(
360− struct scic_sds_port *sci_port,
288+ struct isci_port *iport,
361289 struct scic_sds_remote_device *sci_dev,
362290 struct isci_request *ireq);
363291
364292 enum sci_status scic_sds_port_complete_io(
365− struct scic_sds_port *sci_port,
293+ struct isci_port *iport,
366294 struct scic_sds_remote_device *sci_dev,
367295 struct isci_request *ireq);
368296
369297 enum sas_linkrate scic_sds_port_get_max_allowed_speed(
370− struct scic_sds_port *sci_port);
298+ struct isci_port *iport);
371299
372300 void scic_sds_port_broadcast_change_received(
373− struct scic_sds_port *sci_port,
301+ struct isci_port *iport,
374302 struct isci_phy *iphy);
375303
376304 bool scic_sds_port_is_valid_phy_assignment(
377− struct scic_sds_port *sci_port,
305+ struct isci_port *iport,
378306 u32 phy_index);
379307
380308 void scic_sds_port_get_sas_address(
381− struct scic_sds_port *sci_port,
309+ struct isci_port *iport,
382310 struct sci_sas_address *sas_address);
383311
384312 void scic_sds_port_get_attached_sas_address(
385− struct scic_sds_port *sci_port,
313+ struct isci_port *iport,
386314 struct sci_sas_address *sas_address);
387315
388316 enum isci_status isci_port_get_state(
drivers/scsi/isci/port_config.c+47−52
@@ -112,7 +112,7 @@ static s32 sci_sas_address_compare( · 111 unmodified lines
112112 * port. port address if the port can be found to match the phy.
113113 * NULL if there is no matching port for the phy.
114114 */
115−static struct scic_sds_port *scic_sds_port_configuration_agent_find_port(
115+static struct isci_port *scic_sds_port_configuration_agent_find_port(
116116 struct scic_sds_controller *scic,
117117 struct isci_phy *iphy)
118118 {
@@ -132,14 +132,14 @@ static struct scic_sds_port *scic_sds_port_configuration_agent_find_port( · 13 unmodified lines
132132
133133 for (i = 0; i < scic->logical_port_entries; i++) {
134134 struct isci_host *ihost = scic_to_ihost(scic);
135− struct scic_sds_port *sci_port = &ihost->ports[i].sci;
135+ struct isci_port *iport = &ihost->ports[i];
136136
137− scic_sds_port_get_sas_address(sci_port, &port_sas_address);
138− scic_sds_port_get_attached_sas_address(sci_port, &port_attached_device_address);
137+ scic_sds_port_get_sas_address(iport, &port_sas_address);
138+ scic_sds_port_get_attached_sas_address(iport, &port_attached_device_address);
139139
140140 if (sci_sas_address_compare(port_sas_address, phy_sas_address) == 0 &&
141141 sci_sas_address_compare(port_attached_device_address, phy_attached_device_address) == 0)
142− return sci_port;
142+ return iport;
143143 }
144144
145145 return NULL;
@@ -315,7 +315,7 @@ static enum sci_status scic_sds_mpc_agent_validate_phy_configuration( · 169 unmodified lines
315315 port_agent->phy_valid_port_range[phy_index].min_index = port_index;
316316 port_agent->phy_valid_port_range[phy_index].max_index = phy_index;
317317
318− scic_sds_port_add_phy(&ihost->ports[port_index].sci,
318+ scic_sds_port_add_phy(&ihost->ports[port_index],
319319 &ihost->phys[phy_index]);
320320
321321 assigned_phy_mask |= (1 << phy_index);
@@ -367,22 +367,20 @@ done: · 45 unmodified lines
367367
368368 static void scic_sds_mpc_agent_link_up(struct scic_sds_controller *controller,
369369 struct scic_sds_port_configuration_agent *port_agent,
370− struct scic_sds_port *port,
370+ struct isci_port *iport,
371371 struct isci_phy *iphy)
372372 {
373− /* If the port has an invalid handle then the phy was not assigned to
374− * a port. This is because the phy was not given the same SAS Address
375− * as the other PHYs in the port.
373+ /* If the port is NULL then the phy was not assigned to a port.
374+ * This is because the phy was not given the same SAS Address as
375+ * the other PHYs in the port.
376376 */
377− if (port != NULL) {
378− port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(iphy));
379−
380− scic_sds_port_link_up(port, iphy);
377+ if (!iport)
378+ return;
381379
382− if ((port->active_phy_mask & (1 << scic_sds_phy_get_index(iphy))) != 0) {
383− port_agent->phy_configured_mask |= (1 << scic_sds_phy_get_index(iphy));
384− }
385− }
380+ port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(iphy));
381+ scic_sds_port_link_up(iport, iphy);
382+ if ((iport->active_phy_mask & (1 << scic_sds_phy_get_index(iphy))))
383+ port_agent->phy_configured_mask |= (1 << scic_sds_phy_get_index(iphy));
386384 }
387385
388386 /**
@@ -405,10 +403,10 @@ static void scic_sds_mpc_agent_link_up(struct scic_sds_controller *controller, · 16 unmodified lines
405403 static void scic_sds_mpc_agent_link_down(
406404 struct scic_sds_controller *scic,
407405 struct scic_sds_port_configuration_agent *port_agent,
408− struct scic_sds_port *sci_port,
406+ struct isci_port *iport,
409407 struct isci_phy *iphy)
410408 {
411− if (sci_port != NULL) {
409+ if (iport != NULL) {
412410 /*
413411 * If we can form a new port from the remainder of the phys
414412 * then we want to start the timer to allow the SCI User to
@@ -436,7 +434,7 @@ static void scic_sds_mpc_agent_link_down( · 21 unmodified lines
436434 SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT);
437435 }
438436
439− scic_sds_port_link_down(sci_port, iphy);
437+ scic_sds_port_link_down(iport, iphy);
440438 }
441439 }
442440
@@ -496,14 +494,14 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 53 unmodified lines
496494 {
497495 u8 port_index;
498496 enum sci_status status;
499− struct scic_sds_port *port;
497+ struct isci_port *iport;
500498 enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY;
501499 struct isci_host *ihost = scic_to_ihost(controller);
502500
503− port = scic_sds_port_configuration_agent_find_port(controller, iphy);
501+ iport = scic_sds_port_configuration_agent_find_port(controller, iphy);
504502
505− if (port != NULL) {
506− if (scic_sds_port_is_valid_phy_assignment(port, iphy->phy_index))
503+ if (iport) {
504+ if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index))
507505 apc_activity = SCIC_SDS_APC_ADD_PHY;
508506 else
509507 apc_activity = SCIC_SDS_APC_SKIP_PHY;
@@ -514,21 +512,19 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 4 unmodified lines
514512 * the timer and wait to see if a wider port can be made.
515513 *
516514 * Note the break when we reach the condition of the port id == phy id */
517− for (
518− port_index = port_agent->phy_valid_port_range[iphy->phy_index].min_index;
519− port_index <= port_agent->phy_valid_port_range[iphy->phy_index].max_index;
520− port_index++
521− ) {
515+ for (port_index = port_agent->phy_valid_port_range[iphy->phy_index].min_index;
516+ port_index <= port_agent->phy_valid_port_range[iphy->phy_index].max_index;
517+ port_index++) {
522518
523− port = &ihost->ports[port_index].sci;
519+ iport = &ihost->ports[port_index];
524520
525521 /* First we must make sure that this PHY can be added to this Port. */
526− if (scic_sds_port_is_valid_phy_assignment(port, iphy->phy_index)) {
522+ if (scic_sds_port_is_valid_phy_assignment(iport, iphy->phy_index)) {
527523 /*
528524 * Port contains a PHY with a greater PHY ID than the current
529525 * PHY that has gone link up. This phy can not be part of any
530526 * port so skip it and move on. */
531− if (port->active_phy_mask > (1 << iphy->phy_index)) {
527+ if (iport->active_phy_mask > (1 << iphy->phy_index)) {
532528 apc_activity = SCIC_SDS_APC_SKIP_PHY;
533529 break;
534530 }
@@ -537,7 +533,7 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 2 unmodified lines
537533 * We have reached the end of our Port list and have not found
538534 * any reason why we should not either add the PHY to the port
539535 * or wait for more phys to become active. */
540− if (port->physical_port_index == iphy->phy_index) {
536+ if (iport->physical_port_index == iphy->phy_index) {
541537 /*
542538 * The Port either has no active PHYs.
543539 * Consider that if the port had any active PHYs we would have
@@ -554,10 +550,10 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 10 unmodified lines
554550 * The current Port has no active PHYs and this PHY could be part
555551 * of this Port. Since we dont know as yet setup to start the
556552 * timer and see if there is a better configuration. */
557− if (port->active_phy_mask == 0) {
553+ if (iport->active_phy_mask == 0) {
558554 apc_activity = SCIC_SDS_APC_START_TIMER;
559555 }
560− } else if (port->active_phy_mask != 0) {
556+ } else if (iport->active_phy_mask != 0) {
561557 /*
562558 * The Port has an active phy and the current Phy can not
563559 * participate in this port so skip the PHY and see if
@@ -583,7 +579,7 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 19 unmodified lines
583579
584580 switch (apc_activity) {
585581 case SCIC_SDS_APC_ADD_PHY:
586− status = scic_sds_port_add_phy(port, iphy);
582+ status = scic_sds_port_add_phy(iport, iphy);
587583
588584 if (status == SCI_SUCCESS) {
589585 port_agent->phy_configured_mask |= (1 << iphy->phy_index);
@@ -625,18 +621,18 @@ static void scic_sds_apc_agent_configure_ports(struct scic_sds_controller *contr · 35 unmodified lines
625621 */
626622 static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic,
627623 struct scic_sds_port_configuration_agent *port_agent,
628− struct scic_sds_port *sci_port,
624+ struct isci_port *iport,
629625 struct isci_phy *iphy)
630626 {
631627 u8 phy_index = iphy->phy_index;
632628
633− if (!sci_port) {
629+ if (!iport) {
634630 /* the phy is not the part of this port */
635631 port_agent->phy_ready_mask |= 1 << phy_index;
636632 scic_sds_apc_agent_configure_ports(scic, port_agent, iphy, true);
637633 } else {
638634 /* the phy is already the part of the port */
639− u32 port_state = sci_port->sm.current_state_id;
635+ u32 port_state = iport->sm.current_state_id;
640636
641637 /* if the PORT'S state is resetting then the link up is from
642638 * port hard reset in this case, we need to tell the port
@@ -644,7 +640,7 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic, · 1 unmodified line
644640 */
645641 BUG_ON(port_state != SCI_PORT_RESETTING);
646642 port_agent->phy_ready_mask |= 1 << phy_index;
647− scic_sds_port_link_up(sci_port, iphy);
643+ scic_sds_port_link_up(iport, iphy);
648644 }
649645 }
650646
@@ -652,9 +648,9 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic, · 1 unmodified line
652648 *
653649 * @controller: This is the controller object that receives the link down
654650 * notification.
655− * @port: This is the port object associated with the phy. If the is no
651+ * @iport: This is the port object associated with the phy. If the is no
656652 * associated port this is an NULL.
657− * @phy: This is the phy object which has gone link down.
653+ * @iphy: This is the phy object which has gone link down.
658654 *
659655 * This method handles the automatic port configuration link down
660656 * notifications. not associated with a port there is no action taken. Is it
@@ -664,21 +660,20 @@ static void scic_sds_apc_agent_link_up(struct scic_sds_controller *scic, · 3 unmodified lines
664660 static void scic_sds_apc_agent_link_down(
665661 struct scic_sds_controller *controller,
666662 struct scic_sds_port_configuration_agent *port_agent,
667− struct scic_sds_port *port,
663+ struct isci_port *iport,
668664 struct isci_phy *iphy)
669665 {
670666 port_agent->phy_ready_mask &= ~(1 << scic_sds_phy_get_index(iphy));
671667
672− if (port != NULL) {
673− if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) {
674− enum sci_status status;
668+ if (!iport)
669+ return;
670+ if (port_agent->phy_configured_mask & (1 << iphy->phy_index)) {
671+ enum sci_status status;
675672
676− status = scic_sds_port_remove_phy(port, iphy);
673+ status = scic_sds_port_remove_phy(iport, iphy);
677674
678− if (status == SCI_SUCCESS) {
679− port_agent->phy_configured_mask &= ~(1 << iphy->phy_index);
680− }
681− }
675+ if (status == SCI_SUCCESS)
676+ port_agent->phy_configured_mask &= ~(1 << iphy->phy_index);
682677 }
683678 }
684679
drivers/scsi/isci/remote_device.c+30−31
@@ -450,11 +450,11 @@ static void scic_sds_remote_device_start_request(struct scic_sds_remote_device * · 449 unmodified lines
450450 struct isci_request *ireq,
451451 enum sci_status status)
452452 {
453− struct scic_sds_port *sci_port = sci_dev->owning_port;
453+ struct isci_port *iport = sci_dev->owning_port;
454454
455455 /* cleanup requests that failed after starting on the port */
456456 if (status != SCI_SUCCESS)
457− scic_sds_port_complete_io(sci_port, sci_dev, ireq);
457+ scic_sds_port_complete_io(iport, sci_dev, ireq);
458458 else {
459459 kref_get(&sci_dev_to_idev(sci_dev)->kref);
460460 scic_sds_remote_device_increment_request_count(sci_dev);
@@ -467,7 +467,7 @@ enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic · 6 unmodified lines
467467 {
468468 struct sci_base_state_machine *sm = &sci_dev->sm;
469469 enum scic_sds_remote_device_states state = sm->current_state_id;
470− struct scic_sds_port *sci_port = sci_dev->owning_port;
470+ struct isci_port *iport = sci_dev->owning_port;
471471 enum sci_status status;
472472
473473 switch (state) {
@@ -489,7 +489,7 @@ enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic · 15 unmodified lines
489489 * successful it will start the request for the port object then
490490 * increment its own request count.
491491 */
492− status = scic_sds_port_start_io(sci_port, sci_dev, ireq);
492+ status = scic_sds_port_start_io(iport, sci_dev, ireq);
493493 if (status != SCI_SUCCESS)
494494 return status;
495495
@@ -511,7 +511,7 @@ enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic · 15 unmodified lines
511511 enum scic_sds_remote_device_states new_state;
512512 struct sas_task *task = isci_request_access_task(ireq);
513513
514− status = scic_sds_port_start_io(sci_port, sci_dev, ireq);
514+ status = scic_sds_port_start_io(iport, sci_dev, ireq);
515515 if (status != SCI_SUCCESS)
516516 return status;
517517
@@ -536,7 +536,7 @@ enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic · 18 unmodified lines
536536 struct sas_task *task = isci_request_access_task(ireq);
537537
538538 if (task->ata_task.use_ncq) {
539− status = scic_sds_port_start_io(sci_port, sci_dev, ireq);
539+ status = scic_sds_port_start_io(iport, sci_dev, ireq);
540540 if (status != SCI_SUCCESS)
541541 return status;
542542
@@ -552,7 +552,7 @@ enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic · 9 unmodified lines
552552 case SCI_STP_DEV_AWAIT_RESET:
553553 return SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED;
554554 case SCI_SMP_DEV_IDLE:
555− status = scic_sds_port_start_io(sci_port, sci_dev, ireq);
555+ status = scic_sds_port_start_io(iport, sci_dev, ireq);
556556 if (status != SCI_SUCCESS)
557557 return status;
558558
@@ -579,7 +579,7 @@ enum sci_status scic_sds_remote_device_start_io(struct scic_sds_controller *scic · 20 unmodified lines
579579 return status;
580580 }
581581
582−static enum sci_status common_complete_io(struct scic_sds_port *sci_port,
582+static enum sci_status common_complete_io(struct isci_port *iport,
583583 struct scic_sds_remote_device *sci_dev,
584584 struct isci_request *ireq)
585585 {
@@ -589,7 +589,7 @@ static enum sci_status common_complete_io(struct scic_sds_port *sci_port, · 3 unmodified lines
589589 if (status != SCI_SUCCESS)
590590 return status;
591591
592− status = scic_sds_port_complete_io(sci_port, sci_dev, ireq);
592+ status = scic_sds_port_complete_io(iport, sci_dev, ireq);
593593 if (status != SCI_SUCCESS)
594594 return status;
595595
@@ -603,7 +603,7 @@ enum sci_status scic_sds_remote_device_complete_io(struct scic_sds_controller *s · 7 unmodified lines
603603 {
604604 struct sci_base_state_machine *sm = &sci_dev->sm;
605605 enum scic_sds_remote_device_states state = sm->current_state_id;
606− struct scic_sds_port *sci_port = sci_dev->owning_port;
606+ struct isci_port *iport = sci_dev->owning_port;
607607 enum sci_status status;
608608
609609 switch (state) {
@@ -621,12 +621,12 @@ enum sci_status scic_sds_remote_device_complete_io(struct scic_sds_controller *s · 11 unmodified lines
621621 case SCI_DEV_READY:
622622 case SCI_STP_DEV_AWAIT_RESET:
623623 case SCI_DEV_RESETTING:
624− status = common_complete_io(sci_port, sci_dev, ireq);
624+ status = common_complete_io(iport, sci_dev, ireq);
625625 break;
626626 case SCI_STP_DEV_CMD:
627627 case SCI_STP_DEV_NCQ:
628628 case SCI_STP_DEV_NCQ_ERROR:
629− status = common_complete_io(sci_port, sci_dev, ireq);
629+ status = common_complete_io(iport, sci_dev, ireq);
630630 if (status != SCI_SUCCESS)
631631 break;
632632
@@ -641,13 +641,13 @@ enum sci_status scic_sds_remote_device_complete_io(struct scic_sds_controller *s · 8 unmodified lines
641641 sci_change_state(sm, SCI_STP_DEV_IDLE);
642642 break;
643643 case SCI_SMP_DEV_CMD:
644− status = common_complete_io(sci_port, sci_dev, ireq);
644+ status = common_complete_io(iport, sci_dev, ireq);
645645 if (status != SCI_SUCCESS)
646646 break;
647647 sci_change_state(sm, SCI_SMP_DEV_IDLE);
648648 break;
649649 case SCI_DEV_STOPPING:
650− status = common_complete_io(sci_port, sci_dev, ireq);
650+ status = common_complete_io(iport, sci_dev, ireq);
651651 if (status != SCI_SUCCESS)
652652 break;
653653
@@ -661,7 +661,7 @@ enum sci_status scic_sds_remote_device_complete_io(struct scic_sds_controller *s · 7 unmodified lines
661661 if (status != SCI_SUCCESS)
662662 dev_err(scirdev_to_dev(sci_dev),
663663 "%s: Port:0x%p Device:0x%p Request:0x%p Status:0x%x "
664− "could not complete\n", __func__, sci_port,
664+ "could not complete\n", __func__, iport,
665665 sci_dev, ireq, status);
666666 else
667667 isci_put_device(sci_dev_to_idev(sci_dev));
@@ -684,7 +684,7 @@ enum sci_status scic_sds_remote_device_start_task(struct scic_sds_controller *sc · 16 unmodified lines
684684 {
685685 struct sci_base_state_machine *sm = &sci_dev->sm;
686686 enum scic_sds_remote_device_states state = sm->current_state_id;
687− struct scic_sds_port *sci_port = sci_dev->owning_port;
687+ struct isci_port *iport = sci_dev->owning_port;
688688 enum sci_status status;
689689
690690 switch (state) {
@@ -706,7 +706,7 @@ enum sci_status scic_sds_remote_device_start_task(struct scic_sds_controller *sc · 15 unmodified lines
706706 case SCI_STP_DEV_NCQ:
707707 case SCI_STP_DEV_NCQ_ERROR:
708708 case SCI_STP_DEV_AWAIT_RESET:
709− status = scic_sds_port_start_io(sci_port, sci_dev, ireq);
709+ status = scic_sds_port_start_io(iport, sci_dev, ireq);
710710 if (status != SCI_SUCCESS)
711711 return status;
712712
@@ -746,7 +746,7 @@ enum sci_status scic_sds_remote_device_start_task(struct scic_sds_controller *sc · 33 unmodified lines
746746 */
747747 return SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS;
748748 case SCI_DEV_READY:
749− status = scic_sds_port_start_io(sci_port, sci_dev, ireq);
749+ status = scic_sds_port_start_io(iport, sci_dev, ireq);
750750 if (status != SCI_SUCCESS)
751751 return status;
752752
@@ -1064,10 +1064,10 @@ static const struct sci_base_state scic_sds_remote_device_state_table[] = { · 311 unmodified lines
10641064 * scic_remote_device_[de]a_construct(). scic_remote_device_destruct()
10651065 * frees the remote_node_context(s) for the device.
10661066 */
1067−static void scic_remote_device_construct(struct scic_sds_port *sci_port,
1067+static void scic_remote_device_construct(struct isci_port *iport,
10681068 struct scic_sds_remote_device *sci_dev)
10691069 {
1070− sci_dev->owning_port = sci_port;
1070+ sci_dev->owning_port = iport;
10711071 sci_dev->started_request_count = 0;
10721072
10731073 sci_init_sm(&sci_dev->sm, scic_sds_remote_device_state_table, SCI_DEV_INITIAL);
@@ -1090,20 +1090,20 @@ static void scic_remote_device_construct(struct scic_sds_port *sci_port, · 16 unmodified lines
10901090 * sata-only controller instance.
10911091 * SCI_FAILURE_INSUFFICIENT_RESOURCES - remote node contexts exhausted.
10921092 */
1093−static enum sci_status scic_remote_device_da_construct(struct scic_sds_port *sci_port,
1093+static enum sci_status scic_remote_device_da_construct(struct isci_port *iport,
10941094 struct scic_sds_remote_device *sci_dev)
10951095 {
10961096 enum sci_status status;
10971097 struct domain_device *dev = sci_dev_to_domain(sci_dev);
10981098
1099− scic_remote_device_construct(sci_port, sci_dev);
1099+ scic_remote_device_construct(iport, sci_dev);
11001100
11011101 /*
11021102 * This information is request to determine how many remote node context
11031103 * entries will be needed to store the remote node.
11041104 */
11051105 sci_dev->is_direct_attached = true;
1106− status = scic_sds_controller_allocate_remote_node_context(sci_port->owning_controller,
1106+ status = scic_sds_controller_allocate_remote_node_context(iport->owning_controller,
11071107 sci_dev,
11081108 &sci_dev->rnc.remote_node_index);
11091109
@@ -1116,7 +1116,7 @@ static enum sci_status scic_remote_device_da_construct(struct scic_sds_port *sci · 6 unmodified lines
11161116 else
11171117 return SCI_FAILURE_UNSUPPORTED_PROTOCOL;
11181118
1119− sci_dev->connection_rate = scic_sds_port_get_max_allowed_speed(sci_port);
1119+ sci_dev->connection_rate = scic_sds_port_get_max_allowed_speed(iport);
11201120
11211121 /* / @todo Should I assign the port width by reading all of the phys on the port? */
11221122 sci_dev->device_port_width = 1;
@@ -1136,15 +1136,15 @@ static enum sci_status scic_remote_device_da_construct(struct scic_sds_port *sci · 13 unmodified lines
11361136 * sata-only controller instance.
11371137 * SCI_FAILURE_INSUFFICIENT_RESOURCES - remote node contexts exhausted.
11381138 */
1139−static enum sci_status scic_remote_device_ea_construct(struct scic_sds_port *sci_port,
1139+static enum sci_status scic_remote_device_ea_construct(struct isci_port *iport,
11401140 struct scic_sds_remote_device *sci_dev)
11411141 {
11421142 struct domain_device *dev = sci_dev_to_domain(sci_dev);
11431143 enum sci_status status;
11441144
1145− scic_remote_device_construct(sci_port, sci_dev);
1145+ scic_remote_device_construct(iport, sci_dev);
11461146
1147− status = scic_sds_controller_allocate_remote_node_context(sci_port->owning_controller,
1147+ status = scic_sds_controller_allocate_remote_node_context(iport->owning_controller,
11481148 sci_dev,
11491149 &sci_dev->rnc.remote_node_index);
11501150 if (status != SCI_SUCCESS)
@@ -1163,7 +1163,7 @@ static enum sci_status scic_remote_device_ea_construct(struct scic_sds_port *sci · 12 unmodified lines
11631163 * connection the logical link rate is that same as the
11641164 * physical. Furthermore, the SAS-2 and SAS-1.1 fields overlay
11651165 * one another, so this code works for both situations. */
1166− sci_dev->connection_rate = min_t(u16, scic_sds_port_get_max_allowed_speed(sci_port),
1166+ sci_dev->connection_rate = min_t(u16, scic_sds_port_get_max_allowed_speed(iport),
11671167 dev->linkrate);
11681168
11691169 /* / @todo Should I assign the port width by reading all of the phys on the port? */
@@ -1212,15 +1212,14 @@ static enum sci_status scic_remote_device_start(struct scic_sds_remote_device *s · 42 unmodified lines
12121212 static enum sci_status isci_remote_device_construct(struct isci_port *iport,
12131213 struct isci_remote_device *idev)
12141214 {
1215− struct scic_sds_port *sci_port = &iport->sci;
12161215 struct isci_host *ihost = iport->isci_host;
12171216 struct domain_device *dev = idev->domain_dev;
12181217 enum sci_status status;
12191218
12201219 if (dev->parent && dev_is_expander(dev->parent))
1221− status = scic_remote_device_ea_construct(sci_port, &idev->sci);
1220+ status = scic_remote_device_ea_construct(iport, &idev->sci);
12221221 else
1223− status = scic_remote_device_da_construct(sci_port, &idev->sci);
1222+ status = scic_remote_device_da_construct(iport, &idev->sci);
12241223
12251224 if (status != SCI_SUCCESS) {
12261225 dev_dbg(&ihost->pdev->dev, "%s: construct failed: %d\n",
drivers/scsi/isci/remote_device.h+1−9
@@ -100,7 +100,7 @@ struct scic_sds_remote_device { · 99 unmodified lines
100100 * This filed contains a pointer back to the port to which this device
101101 * is assigned.
102102 */
103− struct scic_sds_port *owning_port;
103+ struct isci_port *owning_port;
104104
105105 /**
106106 * This field contains the SCU silicon remote node context specific
@@ -387,14 +387,6 @@ static inline bool dev_is_expander(struct domain_device *dev) · 280 unmodified lines
387387 #define scic_sds_remote_device_get_request_count(sci_dev) \
388388 ((sci_dev)->started_request_count)
389389
390−/**
391− * scic_sds_remote_device_get_port() -
392− *
393− * This macro returns the owning port of this remote device obejct.
394− */
395−#define scic_sds_remote_device_get_port(sci_dev) \
396− ((sci_dev)->owning_port)
397−
398390 /**
399391 * scic_sds_remote_device_get_controller() -
400392 *
drivers/scsi/isci/request.c+16−17
@@ -210,10 +210,10 @@ static void scu_ssp_reqeust_construct_task_context( · 209 unmodified lines
210210 {
211211 dma_addr_t dma_addr;
212212 struct scic_sds_remote_device *target_device;
213− struct scic_sds_port *target_port;
213+ struct isci_port *iport;
214214
215215 target_device = scic_sds_request_get_device(ireq);
216− target_port = scic_sds_request_get_port(ireq);
216+ iport = scic_sds_request_get_port(ireq);
217217
218218 /* Fill in the TC with the its required data */
219219 task_context->abort = 0;
@@ -222,8 +222,7 @@ static void scu_ssp_reqeust_construct_task_context( · 2 unmodified lines
222222 task_context->connection_rate = target_device->connection_rate;
223223 task_context->protocol_engine_index =
224224 scic_sds_controller_get_protocol_engine_group(controller);
225− task_context->logical_port_index =
226− scic_sds_port_get_index(target_port);
225+ task_context->logical_port_index = scic_sds_port_get_index(iport);
227226 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SSP;
228227 task_context->valid = SCU_TASK_CONTEXT_VALID;
229228 task_context->context_type = SCU_TASK_CONTEXT_TYPE;
@@ -245,11 +244,11 @@ static void scu_ssp_reqeust_construct_task_context( · 15 unmodified lines
245244 task_context->task_phase = 0x01;
246245
247246 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
248− (scic_sds_controller_get_protocol_engine_group(controller) <<
249− SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
250− (scic_sds_port_get_index(target_port) <<
251− SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
252− ISCI_TAG_TCI(ireq->io_tag));
247+ (scic_sds_controller_get_protocol_engine_group(controller) <<
248+ SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
249+ (scic_sds_port_get_index(iport) <<
250+ SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
251+ ISCI_TAG_TCI(ireq->io_tag));
253252
254253 /*
255254 * Copy the physical address for the command buffer to the
@@ -350,10 +349,10 @@ static void scu_sata_reqeust_construct_task_context( · 94 unmodified lines
350349 {
351350 dma_addr_t dma_addr;
352351 struct scic_sds_remote_device *target_device;
353− struct scic_sds_port *target_port;
352+ struct isci_port *iport;
354353
355354 target_device = scic_sds_request_get_device(ireq);
356− target_port = scic_sds_request_get_port(ireq);
355+ iport = scic_sds_request_get_port(ireq);
357356
358357 /* Fill in the TC with the its required data */
359358 task_context->abort = 0;
@@ -363,7 +362,7 @@ static void scu_sata_reqeust_construct_task_context( · 3 unmodified lines
363362 task_context->protocol_engine_index =
364363 scic_sds_controller_get_protocol_engine_group(controller);
365364 task_context->logical_port_index =
366− scic_sds_port_get_index(target_port);
365+ scic_sds_port_get_index(iport);
367366 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_STP;
368367 task_context->valid = SCU_TASK_CONTEXT_VALID;
369368 task_context->context_type = SCU_TASK_CONTEXT_TYPE;
@@ -391,7 +390,7 @@ static void scu_sata_reqeust_construct_task_context( · 21 unmodified lines
391390 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
392391 (scic_sds_controller_get_protocol_engine_group(controller) <<
393392 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
394− (scic_sds_port_get_index(target_port) <<
393+ (scic_sds_port_get_index(iport) <<
395394 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
396395 ISCI_TAG_TCI(ireq->io_tag));
397396 /*
@@ -3105,7 +3104,7 @@ scic_io_request_construct_smp(struct device *dev, · 2707 unmodified lines
31053104 struct scatterlist *sg = &task->smp_task.smp_req;
31063105 struct scic_sds_remote_device *sci_dev;
31073106 struct scu_task_context *task_context;
3108− struct scic_sds_port *sci_port;
3107+ struct isci_port *iport;
31093108 struct smp_req *smp_req;
31103109 void *kaddr;
31113110 u8 req_len;
@@ -3149,7 +3148,7 @@ scic_io_request_construct_smp(struct device *dev, · 37 unmodified lines
31493148 task_context = ireq->tc;
31503149
31513150 sci_dev = scic_sds_request_get_device(ireq);
3152− sci_port = scic_sds_request_get_port(ireq);
3151+ iport = scic_sds_request_get_port(ireq);
31533152
31543153 /*
31553154 * Fill in the TC with the its required data
@@ -3160,7 +3159,7 @@ scic_io_request_construct_smp(struct device *dev, · 4 unmodified lines
31603159 task_context->connection_rate = sci_dev->connection_rate;
31613160 task_context->protocol_engine_index =
31623161 scic_sds_controller_get_protocol_engine_group(scic);
3163− task_context->logical_port_index = scic_sds_port_get_index(sci_port);
3162+ task_context->logical_port_index = scic_sds_port_get_index(iport);
31643163 task_context->protocol_type = SCU_TASK_CONTEXT_PROTOCOL_SMP;
31653164 task_context->abort = 0;
31663165 task_context->valid = SCU_TASK_CONTEXT_VALID;
@@ -3204,7 +3203,7 @@ scic_io_request_construct_smp(struct device *dev, · 37 unmodified lines
32043203 ireq->post_context = (SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC |
32053204 (scic_sds_controller_get_protocol_engine_group(scic) <<
32063205 SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT) |
3207− (scic_sds_port_get_index(sci_port) <<
3206+ (scic_sds_port_get_index(iport) <<
32083207 SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT) |
32093208 ISCI_TAG_TCI(ireq->io_tag));
32103209 /*