Lines Matching refs:phy_id
38 static int sas_configure_phy(struct domain_device *dev, int phy_id,
209 static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) in sas_set_ex_phy() argument
218 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_set_ex_phy()
226 phy->phy = sas_phy_alloc(&rphy->dev, phy_id); in sas_set_ex_phy()
254 phy->phy_id = phy_id; in sas_set_ex_phy()
263 phy->phy_id = phy_id; in sas_set_ex_phy()
290 phy->phy->identify.phy_identifier = phy_id; in sas_set_ex_phy()
353 SAS_ADDR(dev->sas_addr), phy->phy_id, in sas_set_ex_phy()
359 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id) in sas_ex_to_ata() argument
361 struct ex_phy *ex_phy = &ex_dev->ex_dev.ex_phy[phy_id]; in sas_ex_to_ata()
591 int sas_smp_phy_control(struct domain_device *dev, int phy_id, in sas_smp_phy_control() argument
610 pc_req[9] = phy_id; in sas_smp_phy_control()
624 static void sas_ex_disable_phy(struct domain_device *dev, int phy_id) in sas_ex_disable_phy() argument
627 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_ex_disable_phy()
629 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE, NULL); in sas_ex_disable_phy()
710 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, in sas_get_report_phy_sata() argument
721 rps_req[9] = phy_id; in sas_get_report_phy_sata()
786 struct domain_device *parent, int phy_id) in sas_ex_discover_end_dev() argument
789 struct ex_phy *phy = &parent_ex->ex_phy[phy_id]; in sas_ex_discover_end_dev()
808 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_end_dev()
843 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_discover_end_dev()
868 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_discover_end_dev()
874 phy_id); in sas_ex_discover_end_dev()
896 static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id) in sas_ex_join_wide_port() argument
898 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_join_wide_port()
920 struct domain_device *parent, int phy_id) in sas_ex_discover_expander() argument
923 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_discover_expander()
933 SAS_ADDR(parent->sas_addr), phy_id, in sas_ex_discover_expander()
942 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_expander()
997 static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) in sas_ex_discover_dev() argument
1000 struct ex_phy *ex_phy = &ex->ex_phy[phy_id]; in sas_ex_discover_dev()
1006 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET, NULL)) in sas_ex_discover_dev()
1007 res = sas_ex_phy_discover(dev, phy_id); in sas_ex_discover_dev()
1015 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
1020 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
1022 sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1); in sas_ex_discover_dev()
1045 phy_id); in sas_ex_discover_dev()
1058 if (sas_ex_join_wide_port(dev, phy_id)) { in sas_ex_discover_dev()
1060 phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); in sas_ex_discover_dev()
1067 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1076 phy_id); in sas_ex_discover_dev()
1077 sas_ex_disable_phy(dev, phy_id); in sas_ex_discover_dev()
1084 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1271 parent_phy->phy_id, in sas_print_parent_topology_bug()
1275 child_phy->phy_id, in sas_print_parent_topology_bug()
1293 parent_phy->phy_id, in sas_check_eeds()
1295 child_phy->phy_id, in sas_check_eeds()
1317 parent_phy->phy_id, in sas_check_eeds()
1319 child_phy->phy_id); in sas_check_eeds()
1400 static int sas_configure_present(struct domain_device *dev, int phy_id, in sas_configure_present() argument
1405 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_configure_present()
1423 rri_req[9] = phy_id; in sas_configure_present()
1435 SAS_ADDR(dev->sas_addr), phy_id, i); in sas_configure_present()
1440 SAS_ADDR(dev->sas_addr), phy_id, i, res); in sas_configure_present()
1474 static int sas_configure_set(struct domain_device *dev, int phy_id, in sas_configure_set() argument
1493 cri_req[9] = phy_id; in sas_configure_set()
1506 SAS_ADDR(dev->sas_addr), phy_id, index); in sas_configure_set()
1514 static int sas_configure_phy(struct domain_device *dev, int phy_id, in sas_configure_phy() argument
1521 res = sas_configure_present(dev, phy_id, sas_addr, &index, &present); in sas_configure_phy()
1525 return sas_configure_set(dev, phy_id, sas_addr, index,include); in sas_configure_phy()
1693 int phy_id, struct smp_resp *disc_resp) in sas_get_phy_discover() argument
1703 disc_req[9] = phy_id; in sas_get_phy_discover()
1719 int phy_id, int *pcc) in sas_get_phy_change_count() argument
1728 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_change_count()
1736 static int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, in sas_get_phy_attached_dev() argument
1748 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_attached_dev()
1759 static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, in sas_find_bcast_phy() argument
1784 *phy_id = i; in sas_find_bcast_phy()
1844 int phy_id = -1; in sas_find_bcast_dev() local
1856 res = sas_find_bcast_phy(dev, &phy_id, 0, false); in sas_find_bcast_dev()
1857 if (phy_id != -1) { in sas_find_bcast_dev()
1893 int phy_id, bool last) in sas_unregister_devs_sas_addr() argument
1896 struct ex_phy *phy = &ex_dev->ex_phy[phy_id]; in sas_unregister_devs_sas_addr()
1967 static int sas_discover_new(struct domain_device *dev, int phy_id) in sas_discover_new() argument
1969 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id]; in sas_discover_new()
1974 SAS_ADDR(dev->sas_addr), phy_id); in sas_discover_new()
1975 res = sas_ex_phy_discover(dev, phy_id); in sas_discover_new()
1979 if (sas_ex_join_wide_port(dev, phy_id)) in sas_discover_new()
1982 res = sas_ex_discover_devices(dev, phy_id); in sas_discover_new()
2012 static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last) in sas_rediscover_dev() argument
2015 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_rediscover_dev()
2021 res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type); in sas_rediscover_dev()
2025 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2029 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2041 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2045 struct domain_device *ata_dev = sas_ex_to_ata(dev, phy_id); in sas_rediscover_dev()
2048 sas_ex_phy_discover(dev, phy_id); in sas_rediscover_dev()
2053 SAS_ADDR(dev->sas_addr), phy_id, action); in sas_rediscover_dev()
2061 SAS_ADDR(dev->sas_addr), phy_id, in sas_rediscover_dev()
2063 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2066 return sas_discover_new(dev, phy_id); in sas_rediscover_dev()
2083 static int sas_rediscover(struct domain_device *dev, const int phy_id) in sas_rediscover() argument
2086 struct ex_phy *changed_phy = &ex->ex_phy[phy_id]; in sas_rediscover()
2092 SAS_ADDR(dev->sas_addr), phy_id); in sas_rediscover()
2098 if (i == phy_id) in sas_rediscover()
2103 "phy%d\n", phy_id, i); in sas_rediscover()
2108 res = sas_rediscover_dev(dev, phy_id, last); in sas_rediscover()
2110 res = sas_discover_new(dev, phy_id); in sas_rediscover()
2131 int i = 0, phy_id; in sas_ex_revalidate_domain() local
2134 phy_id = -1; in sas_ex_revalidate_domain()
2135 res = sas_find_bcast_phy(dev, &phy_id, i, true); in sas_ex_revalidate_domain()
2136 if (phy_id == -1) in sas_ex_revalidate_domain()
2138 res = sas_rediscover(dev, phy_id); in sas_ex_revalidate_domain()
2139 i = phy_id + 1; in sas_ex_revalidate_domain()