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_gfp(&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_gfp(&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()
448 struct isci_phy *iphy; in sci_port_get_a_connected_phy() local
454 iphy = iport->phy_table[index]; in sci_port_get_a_connected_phy()
455 if (iphy && sci_port_active_phy(iport, iphy)) in sci_port_get_a_connected_phy()
456 return iphy; in sci_port_get_a_connected_phy()
462 static enum sci_status sci_port_set_phy(struct isci_port *iport, struct isci_phy *iphy) in sci_port_set_phy() argument
468 if (!iport->phy_table[iphy->phy_index] && in sci_port_set_phy()
469 !phy_get_non_dummy_port(iphy) && in sci_port_set_phy()
470 sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) { in sci_port_set_phy()
475 iport->phy_table[iphy->phy_index] = iphy; in sci_port_set_phy()
476 sci_phy_set_port(iphy, iport); in sci_port_set_phy()
484 static enum sci_status sci_port_clear_phy(struct isci_port *iport, struct isci_phy *iphy) in sci_port_clear_phy() argument
487 if (iport->phy_table[iphy->phy_index] == iphy && in sci_port_clear_phy()
488 phy_get_non_dummy_port(iphy) == iport) { in sci_port_clear_phy()
492 sci_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]); in sci_port_clear_phy()
493 iport->phy_table[iphy->phy_index] = NULL; in sci_port_clear_phy()
513 struct isci_phy *iphy; in sci_port_get_attached_sas_address() local
519 iphy = sci_port_get_a_connected_phy(iport); in sci_port_get_attached_sas_address()
520 if (iphy) { in sci_port_get_attached_sas_address()
521 if (iphy->protocol != SAS_PROTOCOL_SATA) { in sci_port_get_attached_sas_address()
522 sci_phy_get_attached_sas_address(iphy, sas); in sci_port_get_attached_sas_address()
524 sci_phy_get_sas_address(iphy, sas); in sci_port_get_attached_sas_address()
525 sas->low += iphy->phy_index; in sci_port_get_attached_sas_address()
616 static void sci_port_resume_phy(struct isci_port *iport, struct isci_phy *iphy) in sci_port_resume_phy() argument
618 sci_phy_resume(iphy); in sci_port_resume_phy()
619 iport->enabled_phy_mask |= 1 << iphy->phy_index; in sci_port_resume_phy()
623 struct isci_phy *iphy, in sci_port_activate_phy() argument
628 if (iphy->protocol != SAS_PROTOCOL_SATA && (flags & PF_RESUME)) in sci_port_activate_phy()
629 sci_phy_resume(iphy); in sci_port_activate_phy()
631 iport->active_phy_mask |= 1 << iphy->phy_index; in sci_port_activate_phy()
633 sci_controller_clear_invalid_phy(ihost, iphy); in sci_port_activate_phy()
636 isci_port_link_up(ihost, iport, iphy); in sci_port_activate_phy()
639 void sci_port_deactivate_phy(struct isci_port *iport, struct isci_phy *iphy, in sci_port_deactivate_phy() argument
644 iport->active_phy_mask &= ~(1 << iphy->phy_index); in sci_port_deactivate_phy()
645 iport->enabled_phy_mask &= ~(1 << iphy->phy_index); in sci_port_deactivate_phy()
647 iport->last_active_phy = iphy->phy_index; in sci_port_deactivate_phy()
649 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN; in sci_port_deactivate_phy()
656 writel(iphy->phy_index, in sci_port_deactivate_phy()
657 &iport->port_pe_configuration_register[iphy->phy_index]); in sci_port_deactivate_phy()
660 isci_port_link_down(ihost, iphy, iport); in sci_port_deactivate_phy()
663 static void sci_port_invalid_link_up(struct isci_port *iport, struct isci_phy *iphy) in sci_port_invalid_link_up() argument
672 if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) { in sci_port_invalid_link_up()
673 ihost->invalid_phy_mask |= 1 << iphy->phy_index; in sci_port_invalid_link_up()
690 struct isci_phy *iphy, in sci_port_general_link_up_handler() argument
697 sci_phy_get_attached_sas_address(iphy, &phy_sas_address); in sci_port_general_link_up_handler()
709 sci_port_activate_phy(iport, iphy, flags); in sci_port_general_link_up_handler()
713 sci_port_invalid_link_up(iport, iphy); in sci_port_general_link_up_handler()
755 bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy) in sci_port_link_detected() argument
758 (iphy->protocol == SAS_PROTOCOL_SATA)) { in sci_port_link_detected()
760 sci_port_invalid_link_up(iport, iphy); in sci_port_link_detected()
764 struct isci_port *dst_port = &(ihost->ports[iphy->phy_index]); in sci_port_link_detected()
765 writel(iphy->phy_index, in sci_port_link_detected()
766 &dst_port->port_pe_configuration_register[iphy->phy_index]); in sci_port_link_detected()
850 struct isci_phy *iphy; in sci_port_get_max_allowed_speed() local
857 iphy = iport->phy_table[index]; in sci_port_get_max_allowed_speed()
858 if (iphy && sci_port_active_phy(iport, iphy) && in sci_port_get_max_allowed_speed()
859 iphy->max_negotiated_speed < max_allowed_speed) in sci_port_get_max_allowed_speed()
860 max_allowed_speed = iphy->max_negotiated_speed; in sci_port_get_max_allowed_speed()
1150 struct isci_phy *iphy = NULL; in sci_port_hard_reset() local
1162 for (phy_index = 0; phy_index < SCI_MAX_PHYS && !iphy; phy_index++) { in sci_port_hard_reset()
1163 iphy = iport->phy_table[phy_index]; in sci_port_hard_reset()
1164 if (iphy && !sci_port_active_phy(iport, iphy)) { in sci_port_hard_reset()
1169 iphy = NULL; in sci_port_hard_reset()
1174 if (!iphy) in sci_port_hard_reset()
1176 status = sci_phy_reset(iphy); in sci_port_hard_reset()
1198 struct isci_phy *iphy) in sci_port_add_phy() argument
1219 sci_phy_get_sas_address(iphy, &phy_sas_address); in sci_port_add_phy()
1225 return sci_port_set_phy(iport, iphy); in sci_port_add_phy()
1229 status = sci_port_set_phy(iport, iphy); in sci_port_add_phy()
1234 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME); in sci_port_add_phy()
1240 status = sci_port_set_phy(iport, iphy); in sci_port_add_phy()
1244 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY); in sci_port_add_phy()
1269 struct isci_phy *iphy) in sci_port_remove_phy() argument
1278 return sci_port_clear_phy(iport, iphy); in sci_port_remove_phy()
1280 status = sci_port_clear_phy(iport, iphy); in sci_port_remove_phy()
1284 sci_port_deactivate_phy(iport, iphy, true); in sci_port_remove_phy()
1290 status = sci_port_clear_phy(iport, iphy); in sci_port_remove_phy()
1294 sci_port_deactivate_phy(iport, iphy, true); in sci_port_remove_phy()
1310 struct isci_phy *iphy) in sci_port_link_up() argument
1320 sci_port_activate_phy(iport, iphy, PF_NOTIFY|PF_RESUME); in sci_port_link_up()
1326 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME); in sci_port_link_up()
1343 sci_port_general_link_up_handler(iport, iphy, PF_RESUME); in sci_port_link_up()
1353 struct isci_phy *iphy) in sci_port_link_down() argument
1360 sci_port_deactivate_phy(iport, iphy, true); in sci_port_link_down()
1373 sci_port_deactivate_phy(iport, iphy, false); in sci_port_link_down()
1636 void sci_port_broadcast_change_received(struct isci_port *iport, struct isci_phy *iphy) in sci_port_broadcast_change_received() argument
1641 isci_port_bc_change_received(ihost, iport, iphy); in sci_port_broadcast_change_received()
1650 struct isci_phy *iphy) in isci_port_perform_hard_reset() argument
1748 struct isci_phy *iphy = to_iphy(phy); in isci_port_formed() local
1762 if (iport->active_phy_mask & 1 << iphy->phy_index) in isci_port_formed()