Lines Matching refs:phy_id

25 static int sas_configure_phy(struct domain_device *dev, int phy_id,
195 static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) in sas_set_ex_phy() argument
204 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_set_ex_phy()
212 phy->phy = sas_phy_alloc(&rphy->dev, phy_id); in sas_set_ex_phy()
240 phy->phy_id = phy_id; in sas_set_ex_phy()
249 phy->phy_id = phy_id; in sas_set_ex_phy()
276 phy->phy->identify.phy_identifier = phy_id; in sas_set_ex_phy()
339 SAS_ADDR(dev->sas_addr), phy->phy_id, in sas_set_ex_phy()
345 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id) in sas_ex_to_ata() argument
347 struct ex_phy *ex_phy = &ex_dev->ex_dev.ex_phy[phy_id]; in sas_ex_to_ata()
577 int sas_smp_phy_control(struct domain_device *dev, int phy_id, in sas_smp_phy_control() argument
596 pc_req[9] = phy_id; in sas_smp_phy_control()
606 SAS_ADDR(dev->sas_addr), phy_id, res); in sas_smp_phy_control()
609 SAS_ADDR(dev->sas_addr), phy_id, pc_resp[2]); in sas_smp_phy_control()
617 static void sas_ex_disable_phy(struct domain_device *dev, int phy_id) in sas_ex_disable_phy() argument
620 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_ex_disable_phy()
622 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE, NULL); in sas_ex_disable_phy()
703 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, in sas_get_report_phy_sata() argument
714 rps_req[9] = phy_id; in sas_get_report_phy_sata()
779 struct domain_device *parent, int phy_id) in sas_ex_discover_end_dev() argument
782 struct ex_phy *phy = &parent_ex->ex_phy[phy_id]; in sas_ex_discover_end_dev()
801 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_end_dev()
827 SAS_ADDR(child->sas_addr), phy_id); in sas_ex_discover_end_dev()
828 ret = sas_smp_phy_control(parent, phy_id, in sas_ex_discover_end_dev()
832 SAS_ADDR(child->sas_addr), phy_id, ret); in sas_ex_discover_end_dev()
836 SAS_ADDR(child->sas_addr), phy_id); in sas_ex_discover_end_dev()
850 rphy->identify.phy_identifier = phy_id; in sas_ex_discover_end_dev()
861 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_discover_end_dev()
877 rphy->identify.phy_identifier = phy_id; in sas_ex_discover_end_dev()
886 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_discover_end_dev()
892 phy_id); in sas_ex_discover_end_dev()
914 static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id) in sas_ex_join_wide_port() argument
916 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_join_wide_port()
938 struct domain_device *parent, int phy_id) in sas_ex_discover_expander() argument
941 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_discover_expander()
950 SAS_ADDR(parent->sas_addr), phy_id, in sas_ex_discover_expander()
959 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_expander()
1016 static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) in sas_ex_discover_dev() argument
1019 struct ex_phy *ex_phy = &ex->ex_phy[phy_id]; in sas_ex_discover_dev()
1025 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET, NULL)) in sas_ex_discover_dev()
1026 res = sas_ex_phy_discover(dev, phy_id); in sas_ex_discover_dev()
1034 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
1039 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
1041 sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1); in sas_ex_discover_dev()
1064 phy_id); in sas_ex_discover_dev()
1076 if (sas_ex_join_wide_port(dev, phy_id)) { in sas_ex_discover_dev()
1078 phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); in sas_ex_discover_dev()
1085 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1093 phy_id); in sas_ex_discover_dev()
1094 sas_ex_disable_phy(dev, phy_id); in sas_ex_discover_dev()
1101 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1109 SAS_ADDR(dev->sas_addr), phy_id); in sas_ex_discover_dev()
1260 parent_phy->phy_id, in sas_print_parent_topology_bug()
1264 child_phy->phy_id, in sas_print_parent_topology_bug()
1281 parent_phy->phy_id, in sas_check_eeds()
1283 child_phy->phy_id, in sas_check_eeds()
1304 parent_phy->phy_id, in sas_check_eeds()
1306 child_phy->phy_id); in sas_check_eeds()
1386 static int sas_configure_present(struct domain_device *dev, int phy_id, in sas_configure_present() argument
1391 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_configure_present()
1409 rri_req[9] = phy_id; in sas_configure_present()
1420 SAS_ADDR(dev->sas_addr), phy_id, i); in sas_configure_present()
1424 __func__, SAS_ADDR(dev->sas_addr), phy_id, in sas_configure_present()
1459 static int sas_configure_set(struct domain_device *dev, int phy_id, in sas_configure_set() argument
1478 cri_req[9] = phy_id; in sas_configure_set()
1490 SAS_ADDR(dev->sas_addr), phy_id, index); in sas_configure_set()
1498 static int sas_configure_phy(struct domain_device *dev, int phy_id, in sas_configure_phy() argument
1505 res = sas_configure_present(dev, phy_id, sas_addr, &index, &present); in sas_configure_phy()
1509 return sas_configure_set(dev, phy_id, sas_addr, index,include); in sas_configure_phy()
1676 int phy_id, struct smp_resp *disc_resp) in sas_get_phy_discover() argument
1686 disc_req[9] = phy_id; in sas_get_phy_discover()
1702 int phy_id, int *pcc) in sas_get_phy_change_count() argument
1711 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_change_count()
1719 static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, in sas_get_phy_attached_dev() argument
1731 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_attached_dev()
1743 static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, in sas_find_bcast_phy() argument
1768 *phy_id = i; in sas_find_bcast_phy()
1828 int phy_id = -1; in sas_find_bcast_dev() local
1840 res = sas_find_bcast_phy(dev, &phy_id, 0, false); in sas_find_bcast_dev()
1841 if (phy_id != -1) { in sas_find_bcast_dev()
1845 SAS_ADDR(dev->sas_addr), phy_id); in sas_find_bcast_dev()
1878 int phy_id, bool last) in sas_unregister_devs_sas_addr() argument
1881 struct ex_phy *phy = &ex_dev->ex_phy[phy_id]; in sas_unregister_devs_sas_addr()
1950 static int sas_discover_new(struct domain_device *dev, int phy_id) in sas_discover_new() argument
1952 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id]; in sas_discover_new()
1957 SAS_ADDR(dev->sas_addr), phy_id); in sas_discover_new()
1958 res = sas_ex_phy_discover(dev, phy_id); in sas_discover_new()
1962 if (sas_ex_join_wide_port(dev, phy_id)) in sas_discover_new()
1965 res = sas_ex_discover_devices(dev, phy_id); in sas_discover_new()
1994 static int sas_rediscover_dev(struct domain_device *dev, int phy_id, in sas_rediscover_dev() argument
1998 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_rediscover_dev()
2008 SAS_ADDR(dev->sas_addr), phy_id, msg); in sas_rediscover_dev()
2011 res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type); in sas_rediscover_dev()
2015 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2019 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2031 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2036 sas_ex_phy_discover(dev, phy_id); in sas_rediscover_dev()
2040 struct domain_device *ata_dev = sas_ex_to_ata(dev, phy_id); in sas_rediscover_dev()
2043 sas_ex_phy_discover(dev, phy_id); in sas_rediscover_dev()
2048 SAS_ADDR(dev->sas_addr), phy_id, action); in sas_rediscover_dev()
2054 SAS_ADDR(dev->sas_addr), phy_id, in sas_rediscover_dev()
2056 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2058 return sas_discover_new(dev, phy_id); in sas_rediscover_dev()
2075 static int sas_rediscover(struct domain_device *dev, const int phy_id) in sas_rediscover() argument
2078 struct ex_phy *changed_phy = &ex->ex_phy[phy_id]; in sas_rediscover()
2084 SAS_ADDR(dev->sas_addr), phy_id); in sas_rediscover()
2090 if (i == phy_id) in sas_rediscover()
2098 res = sas_rediscover_dev(dev, phy_id, last, i); in sas_rediscover()
2100 res = sas_discover_new(dev, phy_id); in sas_rediscover()
2121 int i = 0, phy_id; in sas_ex_revalidate_domain() local
2124 phy_id = -1; in sas_ex_revalidate_domain()
2125 res = sas_find_bcast_phy(dev, &phy_id, i, true); in sas_ex_revalidate_domain()
2126 if (phy_id == -1) in sas_ex_revalidate_domain()
2128 res = sas_rediscover(dev, phy_id); in sas_ex_revalidate_domain()
2129 i = phy_id + 1; in sas_ex_revalidate_domain()