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