Lines Matching refs:phy_id
25 static int sas_configure_phy(struct domain_device *dev, int phy_id,
178 static void sas_set_ex_phy(struct domain_device *dev, int phy_id, in sas_set_ex_phy() argument
187 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_set_ex_phy()
195 phy->phy = sas_phy_alloc(&rphy->dev, phy_id); in sas_set_ex_phy()
223 phy->phy_id = phy_id; in sas_set_ex_phy()
232 phy->phy_id = phy_id; in sas_set_ex_phy()
259 phy->phy->identify.phy_identifier = phy_id; in sas_set_ex_phy()
322 SAS_ADDR(dev->sas_addr), phy->phy_id, in sas_set_ex_phy()
328 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id) in sas_ex_to_ata() argument
330 struct ex_phy *ex_phy = &ex_dev->ex_dev.ex_phy[phy_id]; in sas_ex_to_ata()
555 int sas_smp_phy_control(struct domain_device *dev, int phy_id, in sas_smp_phy_control() argument
574 pc_req[9] = phy_id; in sas_smp_phy_control()
584 SAS_ADDR(dev->sas_addr), phy_id, res); in sas_smp_phy_control()
587 SAS_ADDR(dev->sas_addr), phy_id, pc_resp[2]); in sas_smp_phy_control()
595 static void sas_ex_disable_phy(struct domain_device *dev, int phy_id) in sas_ex_disable_phy() argument
598 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_ex_disable_phy()
600 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE, NULL); in sas_ex_disable_phy()
681 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, in sas_get_report_phy_sata() argument
692 rps_req[9] = phy_id; in sas_get_report_phy_sata()
755 struct domain_device *child, int phy_id) in sas_ex_add_dev() argument
770 rphy->identify.phy_identifier = phy_id; in sas_ex_add_dev()
779 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_add_dev()
789 struct domain_device *parent, int phy_id) in sas_ex_discover_end_dev() argument
792 struct ex_phy *phy = &parent_ex->ex_phy[phy_id]; in sas_ex_discover_end_dev()
810 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_end_dev()
822 res = sas_ata_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
824 res = sas_ex_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
828 phy_id); in sas_ex_discover_end_dev()
847 static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id) in sas_ex_join_wide_port() argument
849 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_join_wide_port()
871 struct domain_device *parent, int phy_id) in sas_ex_discover_expander() argument
874 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_discover_expander()
883 SAS_ADDR(parent->sas_addr), phy_id, in sas_ex_discover_expander()
892 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_expander()
949 static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) in sas_ex_discover_dev() argument
952 struct ex_phy *ex_phy = &ex->ex_phy[phy_id]; in sas_ex_discover_dev()
958 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET, NULL)) in sas_ex_discover_dev()
959 res = sas_ex_phy_discover(dev, phy_id); in sas_ex_discover_dev()
966 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
970 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
972 sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1); in sas_ex_discover_dev()
995 phy_id); in sas_ex_discover_dev()
1007 if (sas_ex_join_wide_port(dev, phy_id)) { in sas_ex_discover_dev()
1009 phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); in sas_ex_discover_dev()
1016 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1024 phy_id); in sas_ex_discover_dev()
1025 sas_ex_disable_phy(dev, phy_id); in sas_ex_discover_dev()
1032 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1040 SAS_ADDR(dev->sas_addr), phy_id); in sas_ex_discover_dev()
1191 parent_phy->phy_id, in sas_print_parent_topology_bug()
1195 child_phy->phy_id, in sas_print_parent_topology_bug()
1212 parent_phy->phy_id, in sas_check_eeds()
1214 child_phy->phy_id, in sas_check_eeds()
1235 parent_phy->phy_id, in sas_check_eeds()
1237 child_phy->phy_id); in sas_check_eeds()
1317 static int sas_configure_present(struct domain_device *dev, int phy_id, in sas_configure_present() argument
1322 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_configure_present()
1340 rri_req[9] = phy_id; in sas_configure_present()
1351 SAS_ADDR(dev->sas_addr), phy_id, i); in sas_configure_present()
1355 __func__, SAS_ADDR(dev->sas_addr), phy_id, in sas_configure_present()
1390 static int sas_configure_set(struct domain_device *dev, int phy_id, in sas_configure_set() argument
1409 cri_req[9] = phy_id; in sas_configure_set()
1421 SAS_ADDR(dev->sas_addr), phy_id, index); in sas_configure_set()
1429 static int sas_configure_phy(struct domain_device *dev, int phy_id, in sas_configure_phy() argument
1436 res = sas_configure_present(dev, phy_id, sas_addr, &index, &present); in sas_configure_phy()
1440 return sas_configure_set(dev, phy_id, sas_addr, index, in sas_configure_phy()
1607 int phy_id, struct smp_disc_resp *disc_resp) in sas_get_phy_discover() argument
1617 disc_req[9] = phy_id; in sas_get_phy_discover()
1631 int phy_id, int *pcc) in sas_get_phy_change_count() argument
1640 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_change_count()
1648 int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, in sas_get_phy_attached_dev() argument
1658 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_attached_dev()
1670 static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, in sas_find_bcast_phy() argument
1695 *phy_id = i; in sas_find_bcast_phy()
1755 int phy_id = -1; in sas_find_bcast_dev() local
1767 res = sas_find_bcast_phy(dev, &phy_id, 0, false); in sas_find_bcast_dev()
1768 if (phy_id != -1) { in sas_find_bcast_dev()
1772 SAS_ADDR(dev->sas_addr), phy_id); in sas_find_bcast_dev()
1805 int phy_id, bool last) in sas_unregister_devs_sas_addr() argument
1808 struct ex_phy *phy = &ex_dev->ex_phy[phy_id]; in sas_unregister_devs_sas_addr()
1876 static int sas_discover_new(struct domain_device *dev, int phy_id) in sas_discover_new() argument
1878 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id]; in sas_discover_new()
1883 SAS_ADDR(dev->sas_addr), phy_id); in sas_discover_new()
1884 res = sas_ex_phy_discover(dev, phy_id); in sas_discover_new()
1888 if (sas_ex_join_wide_port(dev, phy_id)) in sas_discover_new()
1891 res = sas_ex_discover_devices(dev, phy_id); in sas_discover_new()
1919 static int sas_rediscover_dev(struct domain_device *dev, int phy_id, in sas_rediscover_dev() argument
1923 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_rediscover_dev()
1933 SAS_ADDR(dev->sas_addr), phy_id, msg); in sas_rediscover_dev()
1936 res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type); in sas_rediscover_dev()
1940 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1944 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1956 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1961 sas_ex_phy_discover(dev, phy_id); in sas_rediscover_dev()
1965 struct domain_device *ata_dev = sas_ex_to_ata(dev, phy_id); in sas_rediscover_dev()
1968 sas_ex_phy_discover(dev, phy_id); in sas_rediscover_dev()
1973 SAS_ADDR(dev->sas_addr), phy_id, action); in sas_rediscover_dev()
1979 SAS_ADDR(dev->sas_addr), phy_id, in sas_rediscover_dev()
1981 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1983 return sas_discover_new(dev, phy_id); in sas_rediscover_dev()
2000 static int sas_rediscover(struct domain_device *dev, const int phy_id) in sas_rediscover() argument
2003 struct ex_phy *changed_phy = &ex->ex_phy[phy_id]; in sas_rediscover()
2009 SAS_ADDR(dev->sas_addr), phy_id); in sas_rediscover()
2015 if (i == phy_id) in sas_rediscover()
2022 res = sas_rediscover_dev(dev, phy_id, last, i); in sas_rediscover()
2024 res = sas_discover_new(dev, phy_id); in sas_rediscover()
2045 int i = 0, phy_id; in sas_ex_revalidate_domain() local
2048 phy_id = -1; in sas_ex_revalidate_domain()
2049 res = sas_find_bcast_phy(dev, &phy_id, i, true); in sas_ex_revalidate_domain()
2050 if (phy_id == -1) in sas_ex_revalidate_domain()
2052 res = sas_rediscover(dev, phy_id); in sas_ex_revalidate_domain()
2053 i = phy_id + 1; in sas_ex_revalidate_domain()
2063 int phy_id; in sas_find_attached_phy_id() local
2065 for (phy_id = 0; phy_id < ex_dev->num_phys; phy_id++) { in sas_find_attached_phy_id()
2066 phy = &ex_dev->ex_phy[phy_id]; in sas_find_attached_phy_id()
2068 return phy_id; in sas_find_attached_phy_id()