Lines Matching refs:rphy
490 struct sas_rphy *rphy = dev_to_rphy(parent);
492 rphy->scsi_target_id, number);
681 struct sas_rphy *rphy = dev_to_rphy(parent);
683 rphy->scsi_target_id, port->port_identifier);
714 struct sas_rphy *rphy = dev_to_rphy(parent);
715 struct sas_expander_device *exp = rphy_to_expander_device(rphy);
780 if (port->rphy) {
781 sas_rphy_delete(port->rphy);
782 port->rphy = NULL;
903 struct sas_rphy *rphy = transport_class_to_rphy(cdev); \
905 return snprintf(buf, 20, format_string, cast rphy->field); \
910 static SAS_CLASS_DEVICE_ATTR(rphy, name, S_IRUGO, \
917 struct sas_rphy *rphy = transport_class_to_rphy(cdev); \
919 if (!rphy->field) \
921 return get_sas_protocol_names(rphy->field, buf); \
926 static SAS_CLASS_DEVICE_ATTR(rphy, name, S_IRUGO, \
932 struct sas_rphy *rphy = transport_class_to_rphy(cdev);
934 if (!rphy->identify.device_type)
937 rphy->identify.device_type, buf);
940 static SAS_CLASS_DEVICE_ATTR(rphy, device_type, S_IRUGO,
946 struct sas_rphy *rphy = transport_class_to_rphy(cdev);
947 struct sas_phy *phy = dev_to_phy(rphy->dev.parent);
960 error = i->f->get_enclosure_identifier(rphy, &identifier);
966 static SAS_CLASS_DEVICE_ATTR(rphy, enclosure_identifier, S_IRUGO,
972 struct sas_rphy *rphy = transport_class_to_rphy(cdev);
973 struct sas_phy *phy = dev_to_phy(rphy->dev.parent);
981 val = i->f->get_bay_identifier(rphy);
987 static SAS_CLASS_DEVICE_ATTR(rphy, bay_identifier, S_IRUGO,
1003 struct sas_rphy *rphy = target_to_rphy(sdev->sdev_target);
1008 BUG_ON(rphy->identify.device_type != SAS_END_DEVICE);
1010 rdev = rphy_to_end_device(rphy);
1047 struct sas_rphy *rphy = transport_class_to_rphy(cdev); \
1048 struct sas_end_device *rdev = rphy_to_end_device(rphy); \
1071 struct sas_rphy *rphy = transport_class_to_rphy(cdev); \
1072 struct sas_expander_device *edev = rphy_to_expander_device(rphy); \
1119 struct sas_rphy *rphy;
1124 rphy = dev_to_rphy(dev);
1134 rphy->identify.device_type == SAS_END_DEVICE;
1142 struct sas_rphy *rphy;
1147 rphy = dev_to_rphy(dev);
1157 (rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE ||
1158 rphy->identify.device_type == SAS_FANOUT_EXPANDER_DEVICE);
1163 struct sas_rphy *rphy = dev_to_rphy(dev);
1164 struct sas_expander_device *edev = rphy_to_expander_device(rphy);
1172 struct sas_rphy *rphy = dev_to_rphy(dev);
1173 struct sas_end_device *edev = rphy_to_end_device(rphy);
1180 * sas_rphy_initialize - common rphy intialization
1181 * @rphy: rphy to initialise
1184 * initialise the common rphy component of each.
1186 static void sas_rphy_initialize(struct sas_rphy *rphy)
1188 INIT_LIST_HEAD(&rphy->list);
1192 * sas_end_device_alloc - allocate an rphy for an end device
1209 device_initialize(&rdev->rphy.dev);
1210 rdev->rphy.dev.parent = get_device(&parent->dev);
1211 rdev->rphy.dev.release = sas_end_device_release;
1213 struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent);
1214 sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d:%d",
1215 shost->host_no, rphy->scsi_target_id, parent->port_identifier);
1217 sprintf(rdev->rphy.dev.bus_id, "end_device-%d:%d",
1219 rdev->rphy.identify.device_type = SAS_END_DEVICE;
1220 sas_rphy_initialize(&rdev->rphy);
1221 transport_setup_device(&rdev->rphy.dev);
1223 return &rdev->rphy;
1228 * sas_expander_alloc - allocate an rphy for an end device
1250 device_initialize(&rdev->rphy.dev);
1251 rdev->rphy.dev.parent = get_device(&parent->dev);
1252 rdev->rphy.dev.release = sas_expander_release;
1254 rdev->rphy.scsi_target_id = sas_host->next_expander_id++;
1256 sprintf(rdev->rphy.dev.bus_id, "expander-%d:%d",
1257 shost->host_no, rdev->rphy.scsi_target_id);
1258 rdev->rphy.identify.device_type = type;
1259 sas_rphy_initialize(&rdev->rphy);
1260 transport_setup_device(&rdev->rphy.dev);
1262 return &rdev->rphy;
1268 * @rphy: The remote PHY to be added
1272 int sas_rphy_add(struct sas_rphy *rphy)
1274 struct sas_port *parent = dev_to_sas_port(rphy->dev.parent);
1277 struct sas_identify *identify = &rphy->identify;
1280 if (parent->rphy)
1282 parent->rphy = rphy;
1284 error = device_add(&rphy->dev);
1287 transport_add_device(&rphy->dev);
1288 transport_configure_device(&rphy->dev);
1291 list_add_tail(&rphy->list, &sas_host->rphy_list);
1295 rphy->scsi_target_id = sas_host->next_target_id++;
1297 rphy->scsi_target_id = -1;
1301 rphy->scsi_target_id != -1) {
1302 scsi_scan_target(&rphy->dev, 0,
1303 rphy->scsi_target_id, SCAN_WILD_CARD, 0);
1312 * @rphy SAS remote PHY to free
1321 void sas_rphy_free(struct sas_rphy *rphy)
1323 struct device *dev = &rphy->dev;
1324 struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent);
1328 list_del(&rphy->list);
1339 * @rphy: SAS remote PHY to remove and free
1344 sas_rphy_delete(struct sas_rphy *rphy)
1346 sas_rphy_remove(rphy);
1347 sas_rphy_free(rphy);
1353 * @rphy: SAS remote phy to remove
1358 sas_rphy_remove(struct sas_rphy *rphy)
1360 struct device *dev = &rphy->dev;
1363 switch (rphy->identify.device_type) {
1378 parent->rphy = NULL;
1405 struct sas_rphy *rphy;
1408 list_for_each_entry(rphy, &sas_host->rphy_list, list) {
1409 if (rphy->identify.device_type != SAS_END_DEVICE ||
1410 rphy->scsi_target_id == -1)
1414 (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) {
1415 scsi_scan_target(&rphy->dev, 0,
1416 rphy->scsi_target_id, lun, 1);