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()
258 phy->phy->identify.phy_identifier = phy_id; in sas_set_ex_phy()
321 SAS_ADDR(dev->sas_addr), phy->phy_id, in sas_set_ex_phy()
327 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id) in sas_ex_to_ata() argument
329 struct ex_phy *ex_phy = &ex_dev->ex_dev.ex_phy[phy_id]; in sas_ex_to_ata()
554 int sas_smp_phy_control(struct domain_device *dev, int phy_id, in sas_smp_phy_control() argument
573 pc_req[9] = phy_id; in sas_smp_phy_control()
583 SAS_ADDR(dev->sas_addr), phy_id, res); in sas_smp_phy_control()
586 SAS_ADDR(dev->sas_addr), phy_id, pc_resp[2]); in sas_smp_phy_control()
594 static void sas_ex_disable_phy(struct domain_device *dev, int phy_id) in sas_ex_disable_phy() argument
597 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_ex_disable_phy()
599 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE, NULL); in sas_ex_disable_phy()
680 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id, in sas_get_report_phy_sata() argument
691 rps_req[9] = phy_id; in sas_get_report_phy_sata()
754 struct domain_device *child, int phy_id) in sas_ex_add_dev() argument
769 rphy->identify.phy_identifier = phy_id; in sas_ex_add_dev()
778 SAS_ADDR(parent->sas_addr), phy_id, res); in sas_ex_add_dev()
788 struct domain_device *parent, int phy_id) in sas_ex_discover_end_dev() argument
791 struct ex_phy *phy = &parent_ex->ex_phy[phy_id]; in sas_ex_discover_end_dev()
809 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_end_dev()
821 res = sas_ata_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
823 res = sas_ex_add_dev(parent, phy, child, phy_id); in sas_ex_discover_end_dev()
827 phy_id); in sas_ex_discover_end_dev()
846 static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id) in sas_ex_join_wide_port() argument
848 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_join_wide_port()
870 struct domain_device *parent, int phy_id) in sas_ex_discover_expander() argument
873 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id]; in sas_ex_discover_expander()
882 SAS_ADDR(parent->sas_addr), phy_id, in sas_ex_discover_expander()
891 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id); in sas_ex_discover_expander()
948 static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) in sas_ex_discover_dev() argument
951 struct ex_phy *ex_phy = &ex->ex_phy[phy_id]; in sas_ex_discover_dev()
957 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET, NULL)) in sas_ex_discover_dev()
958 res = sas_ex_phy_discover(dev, phy_id); in sas_ex_discover_dev()
965 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
969 sas_add_parent_port(dev, phy_id); in sas_ex_discover_dev()
971 sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1); in sas_ex_discover_dev()
994 phy_id); in sas_ex_discover_dev()
1006 if (sas_ex_join_wide_port(dev, phy_id)) { in sas_ex_discover_dev()
1008 phy_id, SAS_ADDR(ex_phy->attached_sas_addr)); in sas_ex_discover_dev()
1015 child = sas_ex_discover_end_dev(dev, phy_id); in sas_ex_discover_dev()
1023 phy_id); in sas_ex_discover_dev()
1024 sas_ex_disable_phy(dev, phy_id); in sas_ex_discover_dev()
1031 child = sas_ex_discover_expander(dev, phy_id); in sas_ex_discover_dev()
1039 SAS_ADDR(dev->sas_addr), phy_id); in sas_ex_discover_dev()
1190 parent_phy->phy_id, in sas_print_parent_topology_bug()
1194 child_phy->phy_id, in sas_print_parent_topology_bug()
1223 parent_phy->phy_id, in sas_check_eeds()
1225 child_phy->phy_id, in sas_check_eeds()
1234 parent_phy->phy_id, in sas_check_eeds()
1236 child_phy->phy_id); in sas_check_eeds()
1334 static int sas_configure_present(struct domain_device *dev, int phy_id, in sas_configure_present() argument
1339 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_configure_present()
1357 rri_req[9] = phy_id; in sas_configure_present()
1368 SAS_ADDR(dev->sas_addr), phy_id, i); in sas_configure_present()
1372 __func__, SAS_ADDR(dev->sas_addr), phy_id, in sas_configure_present()
1407 static int sas_configure_set(struct domain_device *dev, int phy_id, in sas_configure_set() argument
1426 cri_req[9] = phy_id; in sas_configure_set()
1438 SAS_ADDR(dev->sas_addr), phy_id, index); in sas_configure_set()
1446 static int sas_configure_phy(struct domain_device *dev, int phy_id, in sas_configure_phy() argument
1453 res = sas_configure_present(dev, phy_id, sas_addr, &index, &present); in sas_configure_phy()
1457 return sas_configure_set(dev, phy_id, sas_addr, index, in sas_configure_phy()
1634 int phy_id, struct smp_disc_resp *disc_resp) in sas_get_phy_discover() argument
1644 disc_req[9] = phy_id; in sas_get_phy_discover()
1658 int phy_id, int *pcc) in sas_get_phy_change_count() argument
1667 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_change_count()
1675 int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id, in sas_get_phy_attached_dev() argument
1685 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_get_phy_attached_dev()
1692 static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id, in sas_find_bcast_phy() argument
1717 *phy_id = i; in sas_find_bcast_phy()
1777 int phy_id = -1; in sas_find_bcast_dev() local
1789 res = sas_find_bcast_phy(dev, &phy_id, 0, false); in sas_find_bcast_dev()
1790 if (phy_id != -1) { in sas_find_bcast_dev()
1794 SAS_ADDR(dev->sas_addr), phy_id); in sas_find_bcast_dev()
1827 int phy_id, bool last) in sas_unregister_devs_sas_addr() argument
1830 struct ex_phy *phy = &ex_dev->ex_phy[phy_id]; in sas_unregister_devs_sas_addr()
1898 static int sas_discover_new(struct domain_device *dev, int phy_id) in sas_discover_new() argument
1900 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id]; in sas_discover_new()
1905 SAS_ADDR(dev->sas_addr), phy_id); in sas_discover_new()
1906 res = sas_ex_phy_discover(dev, phy_id); in sas_discover_new()
1910 if (sas_ex_join_wide_port(dev, phy_id)) in sas_discover_new()
1913 res = sas_ex_discover_devices(dev, phy_id); in sas_discover_new()
1941 static int sas_rediscover_dev(struct domain_device *dev, int phy_id, in sas_rediscover_dev() argument
1945 struct ex_phy *phy = &ex->ex_phy[phy_id]; in sas_rediscover_dev()
1956 SAS_ADDR(dev->sas_addr), phy_id, msg); in sas_rediscover_dev()
1963 res = sas_get_phy_discover(dev, phy_id, disc_resp); in sas_rediscover_dev()
1967 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1971 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1986 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
1992 sas_set_ex_phy(dev, phy_id, disc_resp); in sas_rediscover_dev()
1996 struct domain_device *ata_dev = sas_ex_to_ata(dev, phy_id); in sas_rediscover_dev()
1999 sas_ex_phy_discover(dev, phy_id); in sas_rediscover_dev()
2004 SAS_ADDR(dev->sas_addr), phy_id, action); in sas_rediscover_dev()
2010 SAS_ADDR(dev->sas_addr), phy_id, in sas_rediscover_dev()
2012 sas_unregister_devs_sas_addr(dev, phy_id, last); in sas_rediscover_dev()
2014 res = sas_discover_new(dev, phy_id); in sas_rediscover_dev()
2034 static int sas_rediscover(struct domain_device *dev, const int phy_id) in sas_rediscover() argument
2037 struct ex_phy *changed_phy = &ex->ex_phy[phy_id]; in sas_rediscover()
2043 SAS_ADDR(dev->sas_addr), phy_id); in sas_rediscover()
2049 if (i == phy_id) in sas_rediscover()
2056 res = sas_rediscover_dev(dev, phy_id, last, i); in sas_rediscover()
2058 res = sas_discover_new(dev, phy_id); in sas_rediscover()
2079 int i = 0, phy_id; in sas_ex_revalidate_domain() local
2082 phy_id = -1; in sas_ex_revalidate_domain()
2083 res = sas_find_bcast_phy(dev, &phy_id, i, true); in sas_ex_revalidate_domain()
2084 if (phy_id == -1) in sas_ex_revalidate_domain()
2086 res = sas_rediscover(dev, phy_id); in sas_ex_revalidate_domain()
2087 i = phy_id + 1; in sas_ex_revalidate_domain()
2097 int phy_id; in sas_find_attached_phy_id() local
2099 for (phy_id = 0; phy_id < ex_dev->num_phys; phy_id++) { in sas_find_attached_phy_id()
2100 phy = &ex_dev->ex_phy[phy_id]; in sas_find_attached_phy_id()
2102 return phy_id; in sas_find_attached_phy_id()