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,
187 struct ex_phy *phy = &ex->ex_phy[phy_id];
195 phy->phy = sas_phy_alloc(&rphy->dev, phy_id);
223 phy->phy_id = phy_id;
232 phy->phy_id = phy_id;
259 phy->phy->identify.phy_identifier = phy_id;
322 SAS_ADDR(dev->sas_addr), phy->phy_id,
328 struct domain_device *sas_ex_to_ata(struct domain_device *ex_dev, int phy_id)
330 struct ex_phy *ex_phy = &ex_dev->ex_dev.ex_phy[phy_id];
555 int sas_smp_phy_control(struct domain_device *dev, int phy_id,
574 pc_req[9] = phy_id;
584 SAS_ADDR(dev->sas_addr), phy_id, res);
587 SAS_ADDR(dev->sas_addr), phy_id, pc_resp[2]);
595 static void sas_ex_disable_phy(struct domain_device *dev, int phy_id)
598 struct ex_phy *phy = &ex->ex_phy[phy_id];
600 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE, NULL);
681 int sas_get_report_phy_sata(struct domain_device *dev, int phy_id,
692 rps_req[9] = phy_id;
755 struct domain_device *child, int phy_id)
770 rphy->identify.phy_identifier = phy_id;
779 SAS_ADDR(parent->sas_addr), phy_id, res);
789 struct domain_device *parent, int phy_id)
792 struct ex_phy *phy = &parent_ex->ex_phy[phy_id];
810 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id);
822 res = sas_ata_add_dev(parent, phy, child, phy_id);
824 res = sas_ex_add_dev(parent, phy, child, phy_id);
828 phy_id);
847 static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
849 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id];
871 struct domain_device *parent, int phy_id)
874 struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id];
883 SAS_ADDR(parent->sas_addr), phy_id,
892 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id);
949 static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
952 struct ex_phy *ex_phy = &ex->ex_phy[phy_id];
958 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET, NULL))
959 res = sas_ex_phy_discover(dev, phy_id);
966 sas_add_parent_port(dev, phy_id);
970 sas_add_parent_port(dev, phy_id);
972 sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1);
995 phy_id);
1007 if (sas_ex_join_wide_port(dev, phy_id)) {
1009 phy_id, SAS_ADDR(ex_phy->attached_sas_addr));
1016 child = sas_ex_discover_end_dev(dev, phy_id);
1024 phy_id);
1025 sas_ex_disable_phy(dev, phy_id);
1032 child = sas_ex_discover_expander(dev, phy_id);
1040 SAS_ADDR(dev->sas_addr), phy_id);
1191 parent_phy->phy_id,
1195 child_phy->phy_id,
1224 parent_phy->phy_id,
1226 child_phy->phy_id,
1235 parent_phy->phy_id,
1237 child_phy->phy_id);
1335 static int sas_configure_present(struct domain_device *dev, int phy_id,
1340 struct ex_phy *phy = &ex->ex_phy[phy_id];
1358 rri_req[9] = phy_id;
1369 SAS_ADDR(dev->sas_addr), phy_id, i);
1373 __func__, SAS_ADDR(dev->sas_addr), phy_id,
1408 static int sas_configure_set(struct domain_device *dev, int phy_id,
1427 cri_req[9] = phy_id;
1439 SAS_ADDR(dev->sas_addr), phy_id, index);
1447 static int sas_configure_phy(struct domain_device *dev, int phy_id,
1454 res = sas_configure_present(dev, phy_id, sas_addr, &index, &present);
1458 return sas_configure_set(dev, phy_id, sas_addr, index,
1625 int phy_id, struct smp_disc_resp *disc_resp)
1635 disc_req[9] = phy_id;
1649 int phy_id, int *pcc)
1658 res = sas_get_phy_discover(dev, phy_id, disc_resp);
1666 int sas_get_phy_attached_dev(struct domain_device *dev, int phy_id,
1676 res = sas_get_phy_discover(dev, phy_id, disc_resp);
1688 static int sas_find_bcast_phy(struct domain_device *dev, int *phy_id,
1713 *phy_id = i;
1773 int phy_id = -1;
1785 res = sas_find_bcast_phy(dev, &phy_id, 0, false);
1786 if (phy_id != -1) {
1790 SAS_ADDR(dev->sas_addr), phy_id);
1823 int phy_id, bool last)
1826 struct ex_phy *phy = &ex_dev->ex_phy[phy_id];
1894 static int sas_discover_new(struct domain_device *dev, int phy_id)
1896 struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id];
1901 SAS_ADDR(dev->sas_addr), phy_id);
1902 res = sas_ex_phy_discover(dev, phy_id);
1906 if (sas_ex_join_wide_port(dev, phy_id))
1909 res = sas_ex_discover_devices(dev, phy_id);
1937 static int sas_rediscover_dev(struct domain_device *dev, int phy_id,
1941 struct ex_phy *phy = &ex->ex_phy[phy_id];
1951 SAS_ADDR(dev->sas_addr), phy_id, msg);
1954 res = sas_get_phy_attached_dev(dev, phy_id, sas_addr, &type);
1958 sas_unregister_devs_sas_addr(dev, phy_id, last);
1962 sas_unregister_devs_sas_addr(dev, phy_id, last);
1974 sas_unregister_devs_sas_addr(dev, phy_id, last);
1979 sas_ex_phy_discover(dev, phy_id);
1983 struct domain_device *ata_dev = sas_ex_to_ata(dev, phy_id);
1986 sas_ex_phy_discover(dev, phy_id);
1991 SAS_ADDR(dev->sas_addr), phy_id, action);
1997 SAS_ADDR(dev->sas_addr), phy_id,
1999 sas_unregister_devs_sas_addr(dev, phy_id, last);
2001 return sas_discover_new(dev, phy_id);
2007 * @phy_id: the phy id will be detected.
2018 static int sas_rediscover(struct domain_device *dev, const int phy_id)
2021 struct ex_phy *changed_phy = &ex->ex_phy[phy_id];
2027 SAS_ADDR(dev->sas_addr), phy_id);
2033 if (i == phy_id)
2040 res = sas_rediscover_dev(dev, phy_id, last, i);
2042 res = sas_discover_new(dev, phy_id);
2063 int i = 0, phy_id;
2066 phy_id = -1;
2067 res = sas_find_bcast_phy(dev, &phy_id, i, true);
2068 if (phy_id == -1)
2070 res = sas_rediscover(dev, phy_id);
2071 i = phy_id + 1;
2081 int phy_id;
2083 for (phy_id = 0; phy_id < ex_dev->num_phys; phy_id++) {
2084 phy = &ex_dev->ex_phy[phy_id];
2086 return phy_id;