Lines Matching refs:sas_phy
20 static int hisi_sas_control_phy(struct asd_sas_phy *sas_phy, enum phy_func func,
617 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_bytes_dmaed() local
623 !sas_phy->suspended) { in hisi_sas_bytes_dmaed()
628 sas_notify_phy_event(sas_phy, PHYE_OOB_DONE, gfp_flags); in hisi_sas_bytes_dmaed()
630 if (sas_phy->phy) { in hisi_sas_bytes_dmaed()
631 struct sas_phy *sphy = sas_phy->phy; in hisi_sas_bytes_dmaed()
633 sphy->negotiated_linkrate = sas_phy->linkrate; in hisi_sas_bytes_dmaed()
655 sas_phy->frame_rcvd_size = phy->frame_rcvd_size; in hisi_sas_bytes_dmaed()
656 sas_notify_port_event(sas_phy, PORTE_BYTES_DMAED, gfp_flags); in hisi_sas_bytes_dmaed()
701 struct sas_phy *local_phy; in hisi_sas_init_device()
857 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_phyup_work() local
858 int phy_no = sas_phy->id; in hisi_sas_phyup_work()
870 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_linkreset_work() local
872 hisi_sas_control_phy(sas_phy, PHY_FUNC_LINK_RESET, NULL); in hisi_sas_linkreset_work()
897 int phy_no = phy->sas_phy.id; in hisi_sas_wait_phyup_timedout()
932 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_phy_init() local
939 sas_phy->enabled = (phy_no < hisi_hba->n_phy) ? 1 : 0; in hisi_sas_phy_init()
940 sas_phy->class = SAS; in hisi_sas_phy_init()
941 sas_phy->iproto = SAS_PROTOCOL_ALL; in hisi_sas_phy_init()
942 sas_phy->tproto = 0; in hisi_sas_phy_init()
943 sas_phy->type = PHY_TYPE_PHYSICAL; in hisi_sas_phy_init()
944 sas_phy->role = PHY_ROLE_INITIATOR; in hisi_sas_phy_init()
945 sas_phy->oob_mode = OOB_NOT_CONNECTED; in hisi_sas_phy_init()
946 sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN; in hisi_sas_phy_init()
947 sas_phy->id = phy_no; in hisi_sas_phy_init()
948 sas_phy->sas_addr = &hisi_hba->sas_addr[0]; in hisi_sas_phy_init()
949 sas_phy->frame_rcvd = &phy->frame_rcvd[0]; in hisi_sas_phy_init()
950 sas_phy->ha = (struct sas_ha_struct *)hisi_hba->shost->hostdata; in hisi_sas_phy_init()
951 sas_phy->lldd_phy = phy; in hisi_sas_phy_init()
965 struct asd_sas_phy *aphy = &phy->sas_phy; in hisi_sas_phy_enable()
966 struct sas_phy *sphy = aphy->phy; in hisi_sas_phy_enable()
985 static void hisi_sas_port_notify_formed(struct asd_sas_phy *sas_phy) in hisi_sas_port_notify_formed() argument
987 struct sas_ha_struct *sas_ha = sas_phy->ha; in hisi_sas_port_notify_formed()
989 struct hisi_sas_phy *phy = sas_phy->lldd_phy; in hisi_sas_port_notify_formed()
990 struct asd_sas_port *sas_port = sas_phy->port; in hisi_sas_port_notify_formed()
1106 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_phy_set_linkrate() local
1113 max = sas_phy->phy->maximum_linkrate; in hisi_sas_phy_set_linkrate()
1117 min = sas_phy->phy->minimum_linkrate; in hisi_sas_phy_set_linkrate()
1124 sas_phy->phy->maximum_linkrate = max; in hisi_sas_phy_set_linkrate()
1125 sas_phy->phy->minimum_linkrate = min; in hisi_sas_phy_set_linkrate()
1135 static int hisi_sas_control_phy(struct asd_sas_phy *sas_phy, enum phy_func func, in hisi_sas_control_phy() argument
1138 struct sas_ha_struct *sas_ha = sas_phy->ha; in hisi_sas_control_phy()
1140 int phy_no = sas_phy->id; in hisi_sas_control_phy()
1394 struct asd_sas_phy *sas_phy; in hisi_sas_refresh_port_id() local
1403 list_for_each_entry(sas_phy, &sas_port->phy_list, port_phy_el) in hisi_sas_refresh_port_id()
1404 if (state & BIT(sas_phy->id)) { in hisi_sas_refresh_port_id()
1405 phy = sas_phy->lldd_phy; in hisi_sas_refresh_port_id()
1414 device->linkrate = phy->sas_phy.linkrate; in hisi_sas_refresh_port_id()
1429 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_rescan_topology() local
1430 struct asd_sas_port *sas_port = sas_phy->port; in hisi_sas_rescan_topology()
1433 if (!sas_phy->phy->enabled) in hisi_sas_rescan_topology()
1444 sas_notify_port_event(sas_phy, in hisi_sas_rescan_topology()
1480 struct asd_sas_phy *sas_phy; in hisi_sas_send_ata_reset_each_phy() local
1486 list_for_each_entry(sas_phy, &sas_port->phy_list, port_phy_el) { in hisi_sas_send_ata_reset_each_phy()
1487 if (!(state & BIT(sas_phy->id))) in hisi_sas_send_ata_reset_each_phy()
1493 tmf_task.phy_id = sas_phy->id; in hisi_sas_send_ata_reset_each_phy()
1499 sas_phy->id, rc); in hisi_sas_send_ata_reset_each_phy()
1772 struct sas_phy *local_phy = sas_get_local_phy(device); in hisi_sas_debug_I_T_nexus_reset()
1785 struct asd_sas_phy *sas_phy = in hisi_sas_debug_I_T_nexus_reset() local
1786 sas_ha->sas_phy[local_phy->number]; in hisi_sas_debug_I_T_nexus_reset()
1788 container_of(sas_phy, struct hisi_sas_phy, sas_phy); in hisi_sas_debug_I_T_nexus_reset()
1800 struct asd_sas_phy *sas_phy = in hisi_sas_debug_I_T_nexus_reset() local
1801 sas_ha->sas_phy[local_phy->number]; in hisi_sas_debug_I_T_nexus_reset()
1803 container_of(sas_phy, struct hisi_sas_phy, sas_phy); in hisi_sas_debug_I_T_nexus_reset()
1815 hisi_sas_phy_down(hisi_hba, sas_phy->id, 0, GFP_KERNEL); in hisi_sas_debug_I_T_nexus_reset()
1873 struct sas_phy *phy; in hisi_sas_lu_reset()
2205 static void hisi_sas_port_formed(struct asd_sas_phy *sas_phy) in hisi_sas_port_formed() argument
2207 hisi_sas_port_notify_formed(sas_phy); in hisi_sas_port_formed()
2224 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_phy_disconnected() local
2225 struct sas_phy *sphy = sas_phy->phy; in hisi_sas_phy_disconnected()
2244 struct asd_sas_phy *sas_phy = &phy->sas_phy; in hisi_sas_phy_down() local
2250 hisi_sas_port_notify_formed(sas_phy); in hisi_sas_phy_down()
2260 sas_notify_phy_event(sas_phy, PHYE_LOSS_OF_SIGNAL, gfp_flags); in hisi_sas_phy_down()
2261 sas_phy_disconnected(sas_phy); in hisi_sas_phy_down()
2706 sha->sas_phy = arr_phy; in hisi_sas_probe()
2731 sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy; in hisi_sas_probe()