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(&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(&iphy->sas_phy,
333 struct isci_phy *iphy = &ihost->phys[phy_idx];
339 isci_port_link_down(ihost, iphy, isci_port);
449 struct isci_phy *iphy;
455 iphy = iport->phy_table[index];
456 if (iphy && sci_port_active_phy(iport, iphy))
457 return iphy;
463 static enum sci_status sci_port_set_phy(struct isci_port *iport, struct isci_phy *iphy)
469 if (!iport->phy_table[iphy->phy_index] &&
470 !phy_get_non_dummy_port(iphy) &&
471 sci_port_is_valid_phy_assignment(iport, iphy->phy_index)) {
476 iport->phy_table[iphy->phy_index] = iphy;
477 sci_phy_set_port(iphy, iport);
485 static enum sci_status sci_port_clear_phy(struct isci_port *iport, struct isci_phy *iphy)
488 if (iport->phy_table[iphy->phy_index] == iphy &&
489 phy_get_non_dummy_port(iphy) == iport) {
493 sci_phy_set_port(iphy, &ihost->ports[SCI_MAX_PORTS]);
494 iport->phy_table[iphy->phy_index] = NULL;
514 struct isci_phy *iphy;
520 iphy = sci_port_get_a_connected_phy(iport);
521 if (iphy) {
522 if (iphy->protocol != SAS_PROTOCOL_SATA) {
523 sci_phy_get_attached_sas_address(iphy, sas);
525 sci_phy_get_sas_address(iphy, sas);
526 sas->low += iphy->phy_index;
617 static void sci_port_resume_phy(struct isci_port *iport, struct isci_phy *iphy)
619 sci_phy_resume(iphy);
620 iport->enabled_phy_mask |= 1 << iphy->phy_index;
624 struct isci_phy *iphy,
629 if (iphy->protocol != SAS_PROTOCOL_SATA && (flags & PF_RESUME))
630 sci_phy_resume(iphy);
632 iport->active_phy_mask |= 1 << iphy->phy_index;
634 sci_controller_clear_invalid_phy(ihost, iphy);
637 isci_port_link_up(ihost, iport, iphy);
640 void sci_port_deactivate_phy(struct isci_port *iport, struct isci_phy *iphy,
645 iport->active_phy_mask &= ~(1 << iphy->phy_index);
646 iport->enabled_phy_mask &= ~(1 << iphy->phy_index);
648 iport->last_active_phy = iphy->phy_index;
650 iphy->max_negotiated_speed = SAS_LINK_RATE_UNKNOWN;
657 writel(iphy->phy_index,
658 &iport->port_pe_configuration_register[iphy->phy_index]);
661 isci_port_link_down(ihost, iphy, iport);
664 static void sci_port_invalid_link_up(struct isci_port *iport, struct isci_phy *iphy)
673 if ((ihost->invalid_phy_mask & (1 << iphy->phy_index)) == 0) {
674 ihost->invalid_phy_mask |= 1 << iphy->phy_index;
682 * @iphy: This is the struct isci_phy object that has gone link up.
691 struct isci_phy *iphy,
698 sci_phy_get_attached_sas_address(iphy, &phy_sas_address);
710 sci_port_activate_phy(iport, iphy, flags);
714 sci_port_invalid_link_up(iport, iphy);
750 * @iphy: The phy object that is trying to go link up.
758 bool sci_port_link_detected(struct isci_port *iport, struct isci_phy *iphy)
761 (iphy->protocol == SAS_PROTOCOL_SATA)) {
763 sci_port_invalid_link_up(iport, iphy);
767 struct isci_port *dst_port = &(ihost->ports[iphy->phy_index]);
768 writel(iphy->phy_index,
769 &dst_port->port_pe_configuration_register[iphy->phy_index]);
851 struct isci_phy *iphy;
858 iphy = iport->phy_table[index];
859 if (iphy && sci_port_active_phy(iport, iphy) &&
860 iphy->max_negotiated_speed < max_allowed_speed)
861 max_allowed_speed = iphy->max_negotiated_speed;
1152 struct isci_phy *iphy = NULL;
1164 for (phy_index = 0; phy_index < SCI_MAX_PHYS && !iphy; phy_index++) {
1165 iphy = iport->phy_table[phy_index];
1166 if (iphy && !sci_port_active_phy(iport, iphy)) {
1171 iphy = NULL;
1176 if (!iphy)
1178 status = sci_phy_reset(iphy);
1193 * @iphy: This parameter is the phy which is to be added to the port.
1200 struct isci_phy *iphy)
1221 sci_phy_get_sas_address(iphy, &phy_sas_address);
1227 return sci_port_set_phy(iport, iphy);
1231 status = sci_port_set_phy(iport, iphy);
1236 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME);
1242 status = sci_port_set_phy(iport, iphy);
1246 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY);
1264 * @iphy: This parameter is the phy which is to be added to the port.
1271 struct isci_phy *iphy)
1280 return sci_port_clear_phy(iport, iphy);
1282 status = sci_port_clear_phy(iport, iphy);
1286 sci_port_deactivate_phy(iport, iphy, true);
1292 status = sci_port_clear_phy(iport, iphy);
1296 sci_port_deactivate_phy(iport, iphy, true);
1312 struct isci_phy *iphy)
1322 sci_port_activate_phy(iport, iphy, PF_NOTIFY|PF_RESUME);
1328 sci_port_general_link_up_handler(iport, iphy, PF_NOTIFY|PF_RESUME);
1345 sci_port_general_link_up_handler(iport, iphy, PF_RESUME);
1355 struct isci_phy *iphy)
1362 sci_port_deactivate_phy(iport, iphy, true);
1375 sci_port_deactivate_phy(iport, iphy, false);
1638 void sci_port_broadcast_change_received(struct isci_port *iport, struct isci_phy *iphy)
1643 isci_port_bc_change_received(ihost, iport, iphy);
1652 struct isci_phy *iphy)
1750 struct isci_phy *iphy = to_iphy(phy);
1764 if (iport->active_phy_mask & 1 << iphy->phy_index)