Lines Matching refs:iphy
94 struct isci_phy *iphy = iport->phy_table[index]; in sci_port_get_protocols() local
96 if (!iphy) in sci_port_get_protocols()
98 sci_phy_get_protocols(iphy, proto); in sci_port_get_protocols()
145 struct isci_phy *iphy; in sci_port_bcn_enable() local
150 iphy = iport->phy_table[i]; in sci_port_bcn_enable()
151 if (!iphy) in sci_port_bcn_enable()
153 val = readl(&iphy->link_layer_registers->link_layer_control); in sci_port_bcn_enable()
155 writel(val, &iphy->link_layer_registers->link_layer_control); in sci_port_bcn_enable()
161 struct isci_phy *iphy) in isci_port_bc_change_received() argument
165 __func__, iphy, &iphy->sas_phy); in isci_port_bc_change_received()
167 sas_notify_port_event(&iphy->sas_phy, in isci_port_bc_change_received()
174 struct isci_phy *iphy) in isci_port_link_up() argument
184 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags); in isci_port_link_up()
188 if (iphy->protocol == SAS_PROTOCOL_SATA) { in isci_port_link_up()
191 iphy->sas_phy.oob_mode = SATA_OOB_MODE; in isci_port_link_up()
192 iphy->sas_phy.frame_rcvd_size = sizeof(struct dev_to_host_fis); in isci_port_link_up()
206 memcpy(&iphy->sas_phy.attached_sas_addr, in isci_port_link_up()
208 } else if (iphy->protocol == SAS_PROTOCOL_SSP) { in isci_port_link_up()
209 iphy->sas_phy.oob_mode = SAS_OOB_MODE; in isci_port_link_up()
210 iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame); in isci_port_link_up()
213 memcpy(iphy->sas_phy.attached_sas_addr, in isci_port_link_up()
214 iphy->frame_rcvd.iaf.sas_addr, SAS_ADDR_SIZE); in isci_port_link_up()
220 iphy->sas_phy.phy->negotiated_linkrate = sci_phy_linkrate(iphy); in isci_port_link_up()
222 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags); in isci_port_link_up()
227 sas_notify_port_event(&iphy->sas_phy, in isci_port_link_up()
333 struct isci_phy *iphy = &ihost->phys[phy_idx]; in isci_port_hard_reset_complete() local
339 isci_port_link_down(ihost, iphy, isci_port); in isci_port_hard_reset_complete()
449 struct isci_phy *iphy; in sci_port_get_a_connected_phy() local
455 iphy = iport->phy_table[index]; in sci_port_get_a_connected_phy()
456 if (iphy && sci_port_active_phy(iport, iphy)) in sci_port_get_a_connected_phy()
457 return iphy; in sci_port_get_a_connected_phy()
463 static enum sci_status sci_port_set_phy(struct isci_port *iport, struct isci_phy *iphy) in sci_port_set_phy() argument
469 if (!iport->phy_table[iphy->phy_index] && in sci_port_set_phy()
470 !phy_get_non_dummy_port(iphy) && in sci_port_set_phy()
471 sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) { in sci_port_set_phy()
476 iport->phy_table[iphy->phy_index] = iphy; in sci_port_set_phy()
477 sci_phy_set_port(iphy, iport); in sci_port_set_phy()
485 static enum sci_status sci_port_clear_phy(struct isci_port *iport, struct isci_phy *iphy) in sci_port_clear_phy() argument
488 if (iport->phy_table[iphy->phy_index] == iphy && in sci_port_clear_phy()
489 phy_get_non_dummy_port(iphy) == iport) { in sci_port_clear_phy()
493 sci_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]); in sci_port_clear_phy()
494 iport->phy_table[iphy->phy_index] = NULL; in sci_port_clear_phy()
514 struct isci_phy *iphy; in sci_port_get_attached_sas_address() local
520 iphy = sci_port_get_a_connected_phy(iport); in sci_port_get_attached_sas_address()
521 if (iphy) { in sci_port_get_attached_sas_address()
522 if (iphy->protocol != SAS_PROTOCOL_SATA) { in sci_port_get_attached_sas_address()
523 sci_phy_get_attached_sas_address(iphy, sas); in sci_port_get_attached_sas_address()
525 sci_phy_get_sas_address(iphy, sas); in sci_port_get_attached_sas_address()
526 sas->low += iphy->phy_index; in sci_port_get_attached_sas_address()
617 static void sci_port_resume_phy(struct isci_port *iport, struct isci_phy *iphy) in sci_port_resume_phy() argument
619 sci_phy_resume(iphy); in sci_port_resume_phy()
620 iport->enabled_phy_mask |= 1 << iphy->phy_index; in sci_port_resume_phy()
624 struct isci_phy *iphy, in sci_port_activate_phy() argument
629 if (iphy->protocol != SAS_PROTOCOL_SATA && (flags & PF_RESUME)) in sci_port_activate_phy()
630 sci_phy_resume(iphy); in sci_port_activate_phy()
632 iport->active_phy_mask |= 1 << iphy->phy_index; in sci_port_activate_phy()
634 sci_controller_clear_invalid_phy(ihost, iphy); in sci_port_activate_phy()
637 isci_port_link_up(ihost, iport, iphy); in sci_port_activate_phy()
640 void sci_port_deactivate_phy(struct isci_port *iport, struct isci_phy *iphy, in sci_port_deactivate_phy() argument
645 iport->active_phy_mask &= ~(1 << iphy->phy_index); in sci_port_deactivate_phy()
646 iport->enabled_phy_mask &= ~(1 << iphy->phy_index); in sci_port_deactivate_phy()
648 iport->last_active_phy = iphy->phy_index; in sci_port_deactivate_phy()
650 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; in sci_port_deactivate_phy()
657 writel(iphy->phy_index, in sci_port_deactivate_phy()
658 &iport->port_pe_configuration_register[iphy->phy_index]); in sci_port_deactivate_phy()
661 isci_port_link_down(ihost, iphy, iport); in sci_port_deactivate_phy()
664 static void sci_port_invalid_link_up(struct isci_port *iport, struct isci_phy *iphy) in sci_port_invalid_link_up() argument
673 if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) { in sci_port_invalid_link_up()
674 ihost->invalid_phy_mask |= 1 << iphy->phy_index; in sci_port_invalid_link_up()
691 struct isci_phy *iphy, in sci_port_general_link_up_handler() argument
698 sci_phy_get_attached_sas_address(iphy, &phy_sas_address); in sci_port_general_link_up_handler()
710 sci_port_activate_phy(iport, iphy, flags); in sci_port_general_link_up_handler()
714 sci_port_invalid_link_up(iport, iphy); in sci_port_general_link_up_handler()
758 bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy) in sci_port_link_detected() argument
761 (iphy->protocol == SAS_PROTOCOL_SATA)) { in sci_port_link_detected()
763 sci_port_invalid_link_up(iport, iphy); in sci_port_link_detected()
767 struct isci_port *dst_port = &(ihost->ports[iphy->phy_index]); in sci_port_link_detected()
768 writel(iphy->phy_index, in sci_port_link_detected()
769 &dst_port->port_pe_configuration_register[iphy->phy_index]); in sci_port_link_detected()
851 struct isci_phy *iphy; in sci_port_get_max_allowed_speed() local
858 iphy = iport->phy_table[index]; in sci_port_get_max_allowed_speed()
859 if (iphy && sci_port_active_phy(iport, iphy) && in sci_port_get_max_allowed_speed()
860 iphy->max_negotiated_speed < max_allowed_speed) in sci_port_get_max_allowed_speed()
861 max_allowed_speed = iphy->max_negotiated_speed; in sci_port_get_max_allowed_speed()
1152 struct isci_phy *iphy = NULL; in sci_port_hard_reset() local
1164 for (phy_index = 0; phy_index < SCI_MAX_PHYS && !iphy; phy_index++) { in sci_port_hard_reset()
1165 iphy = iport->phy_table[phy_index]; in sci_port_hard_reset()
1166 if (iphy && !sci_port_active_phy(iport, iphy)) { in sci_port_hard_reset()
1171 iphy = NULL; in sci_port_hard_reset()
1176 if (!iphy) in sci_port_hard_reset()
1178 status = sci_phy_reset(iphy); in sci_port_hard_reset()
1200 struct isci_phy *iphy) in sci_port_add_phy() argument
1221 sci_phy_get_sas_address(iphy, &phy_sas_address); in sci_port_add_phy()
1227 return sci_port_set_phy(iport, iphy); in sci_port_add_phy()
1231 status = sci_port_set_phy(iport, iphy); in sci_port_add_phy()
1236 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME); in sci_port_add_phy()
1242 status = sci_port_set_phy(iport, iphy); in sci_port_add_phy()
1246 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY); in sci_port_add_phy()
1271 struct isci_phy *iphy) in sci_port_remove_phy() argument
1280 return sci_port_clear_phy(iport, iphy); in sci_port_remove_phy()
1282 status = sci_port_clear_phy(iport, iphy); in sci_port_remove_phy()
1286 sci_port_deactivate_phy(iport, iphy, true); in sci_port_remove_phy()
1292 status = sci_port_clear_phy(iport, iphy); in sci_port_remove_phy()
1296 sci_port_deactivate_phy(iport, iphy, true); in sci_port_remove_phy()
1312 struct isci_phy *iphy) in sci_port_link_up() argument
1322 sci_port_activate_phy(iport, iphy, PF_NOTIFY|PF_RESUME); in sci_port_link_up()
1328 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME); in sci_port_link_up()
1345 sci_port_general_link_up_handler(iport, iphy, PF_RESUME); in sci_port_link_up()
1355 struct isci_phy *iphy) in sci_port_link_down() argument
1362 sci_port_deactivate_phy(iport, iphy, true); in sci_port_link_down()
1375 sci_port_deactivate_phy(iport, iphy, false); in sci_port_link_down()
1638 void sci_port_broadcast_change_received(struct isci_port *iport, struct isci_phy *iphy) in sci_port_broadcast_change_received() argument
1643 isci_port_bc_change_received(ihost, iport, iphy); in sci_port_broadcast_change_received()
1652 struct isci_phy *iphy) in isci_port_perform_hard_reset() argument
1750 struct isci_phy *iphy = to_iphy(phy); in isci_port_formed() local
1764 if (iport->active_phy_mask & 1 << iphy->phy_index) in isci_port_formed()