Lines Matching refs:iphy
94 struct isci_phy *iphy = iport->phy_table[index];
96 if (!iphy)
98 sci_phy_get_protocols(iphy, proto);
145 struct isci_phy *iphy;
150 iphy = iport->phy_table[i];
151 if (!iphy)
153 val = readl(&iphy->link_layer_registers->link_layer_control);
155 writel(val, &iphy->link_layer_registers->link_layer_control);
161 struct isci_phy *iphy)
165 __func__, iphy, &iphy->sas_phy);
167 sas_notify_port_event_gfp(&iphy->sas_phy,
174 struct isci_phy *iphy)
184 spin_lock_irqsave(&iphy->sas_phy.frame_rcvd_lock, flags);
188 if (iphy->protocol == SAS_PROTOCOL_SATA) {
191 iphy->sas_phy.oob_mode = SATA_OOB_MODE;
192 iphy->sas_phy.frame_rcvd_size = sizeof(struct dev_to_host_fis);
206 memcpy(&iphy->sas_phy.attached_sas_addr,
208 } else if (iphy->protocol == SAS_PROTOCOL_SSP) {
209 iphy->sas_phy.oob_mode = SAS_OOB_MODE;
210 iphy->sas_phy.frame_rcvd_size = sizeof(struct sas_identify_frame);
213 memcpy(iphy->sas_phy.attached_sas_addr,
214 iphy->frame_rcvd.iaf.sas_addr, SAS_ADDR_SIZE);
220 iphy->sas_phy.phy->negotiated_linkrate = sci_phy_linkrate(iphy);
222 spin_unlock_irqrestore(&iphy->sas_phy.frame_rcvd_lock, flags);
227 sas_notify_port_event_gfp(&iphy->sas_phy,
333 struct isci_phy *iphy = &ihost->phys[phy_idx];
339 isci_port_link_down(ihost, iphy, isci_port);
448 struct isci_phy *iphy;
454 iphy = iport->phy_table[index];
455 if (iphy && sci_port_active_phy(iport, iphy))
456 return iphy;
462 static enum sci_status sci_port_set_phy(struct isci_port *iport, struct isci_phy *iphy)
468 if (!iport->phy_table[iphy->phy_index] &&
469 !phy_get_non_dummy_port(iphy) &&
470 sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) {
475 iport->phy_table[iphy->phy_index] = iphy;
476 sci_phy_set_port(iphy, iport);
484 static enum sci_status sci_port_clear_phy(struct isci_port *iport, struct isci_phy *iphy)
487 if (iport->phy_table[iphy->phy_index] == iphy &&
488 phy_get_non_dummy_port(iphy) == iport) {
492 sci_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]);
493 iport->phy_table[iphy->phy_index] = NULL;
513 struct isci_phy *iphy;
519 iphy = sci_port_get_a_connected_phy(iport);
520 if (iphy) {
521 if (iphy->protocol != SAS_PROTOCOL_SATA) {
522 sci_phy_get_attached_sas_address(iphy, sas);
524 sci_phy_get_sas_address(iphy, sas);
525 sas->low += iphy->phy_index;
616 static void sci_port_resume_phy(struct isci_port *iport, struct isci_phy *iphy)
618 sci_phy_resume(iphy);
619 iport->enabled_phy_mask |= 1 << iphy->phy_index;
623 struct isci_phy *iphy,
628 if (iphy->protocol != SAS_PROTOCOL_SATA && (flags & PF_RESUME))
629 sci_phy_resume(iphy);
631 iport->active_phy_mask |= 1 << iphy->phy_index;
633 sci_controller_clear_invalid_phy(ihost, iphy);
636 isci_port_link_up(ihost, iport, iphy);
639 void sci_port_deactivate_phy(struct isci_port *iport, struct isci_phy *iphy,
644 iport->active_phy_mask &= ~(1 << iphy->phy_index);
645 iport->enabled_phy_mask &= ~(1 << iphy->phy_index);
647 iport->last_active_phy = iphy->phy_index;
649 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
656 writel(iphy->phy_index,
657 &iport->port_pe_configuration_register[iphy->phy_index]);
660 isci_port_link_down(ihost, iphy, iport);
663 static void sci_port_invalid_link_up(struct isci_port *iport, struct isci_phy *iphy)
672 if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) {
673 ihost->invalid_phy_mask |= 1 << iphy->phy_index;
690 struct isci_phy *iphy,
697 sci_phy_get_attached_sas_address(iphy, &phy_sas_address);
709 sci_port_activate_phy(iport, iphy, flags);
713 sci_port_invalid_link_up(iport, iphy);
755 bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy)
758 (iphy->protocol == SAS_PROTOCOL_SATA)) {
760 sci_port_invalid_link_up(iport, iphy);
764 struct isci_port *dst_port = &(ihost->ports[iphy->phy_index]);
765 writel(iphy->phy_index,
766 &dst_port->port_pe_configuration_register[iphy->phy_index]);
850 struct isci_phy *iphy;
857 iphy = iport->phy_table[index];
858 if (iphy && sci_port_active_phy(iport, iphy) &&
859 iphy->max_negotiated_speed < max_allowed_speed)
860 max_allowed_speed = iphy->max_negotiated_speed;
1150 struct isci_phy *iphy = NULL;
1162 for (phy_index = 0; phy_index < SCI_MAX_PHYS && !iphy; phy_index++) {
1163 iphy = iport->phy_table[phy_index];
1164 if (iphy && !sci_port_active_phy(iport, iphy)) {
1169 iphy = NULL;
1174 if (!iphy)
1176 status = sci_phy_reset(iphy);
1198 struct isci_phy *iphy)
1219 sci_phy_get_sas_address(iphy, &phy_sas_address);
1225 return sci_port_set_phy(iport, iphy);
1229 status = sci_port_set_phy(iport, iphy);
1234 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME);
1240 status = sci_port_set_phy(iport, iphy);
1244 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY);
1269 struct isci_phy *iphy)
1278 return sci_port_clear_phy(iport, iphy);
1280 status = sci_port_clear_phy(iport, iphy);
1284 sci_port_deactivate_phy(iport, iphy, true);
1290 status = sci_port_clear_phy(iport, iphy);
1294 sci_port_deactivate_phy(iport, iphy, true);
1310 struct isci_phy *iphy)
1320 sci_port_activate_phy(iport, iphy, PF_NOTIFY|PF_RESUME);
1326 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME);
1343 sci_port_general_link_up_handler(iport, iphy, PF_RESUME);
1353 struct isci_phy *iphy)
1360 sci_port_deactivate_phy(iport, iphy, true);
1373 sci_port_deactivate_phy(iport, iphy, false);
1636 void sci_port_broadcast_change_received(struct isci_port *iport, struct isci_phy *iphy)
1641 isci_port_bc_change_received(ihost, iport, iphy);
1650 struct isci_phy *iphy)
1748 struct isci_phy *iphy = to_iphy(phy);
1762 if (iport->active_phy_mask & 1 << iphy->phy_index)