• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/

Lines Matching refs:rphy

160 	struct sas_rphy *rphy = target_to_rphy(sdev->sdev_target);
163 BUG_ON(rphy->identify.device_type != SAS_END_DEVICE);
165 rdev = rphy_to_end_device(rphy);
170 struct sas_rphy *rphy)
184 ret = handler(shost, rphy, req);
200 struct sas_rphy *rphy = q->queuedata;
201 sas_smp_request(q, rphy_to_shost(rphy), rphy);
214 static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
228 if (rphy) {
230 dev = &rphy->dev;
250 if (rphy)
251 rphy->q = q;
255 if (rphy)
256 q->queuedata = rphy;
264 static void sas_bsg_remove(struct Scsi_Host *shost, struct sas_rphy *rphy)
268 if (rphy)
269 q = rphy->q;
719 struct sas_rphy *rphy = dev_to_rphy(parent);
721 rphy->scsi_target_id, number);
911 struct sas_rphy *rphy = dev_to_rphy(parent);
913 rphy->scsi_target_id, port->port_identifier);
944 struct sas_rphy *rphy = dev_to_rphy(parent);
945 struct sas_expander_device *exp = rphy_to_expander_device(rphy);
1009 if (port->rphy) {
1010 sas_rphy_delete(port->rphy);
1011 port->rphy = NULL;
1134 struct sas_rphy *rphy = transport_class_to_rphy(dev); \
1136 return snprintf(buf, 20, format_string, cast rphy->field); \
1141 static SAS_DEVICE_ATTR(rphy, name, S_IRUGO, \
1149 struct sas_rphy *rphy = transport_class_to_rphy(dev); \
1151 if (!rphy->field) \
1153 return get_sas_protocol_names(rphy->field, buf); \
1158 static SAS_DEVICE_ATTR(rphy, name, S_IRUGO, \
1165 struct sas_rphy *rphy = transport_class_to_rphy(dev);
1167 if (!rphy->identify.device_type)
1170 rphy->identify.device_type, buf);
1173 static SAS_DEVICE_ATTR(rphy, device_type, S_IRUGO,
1180 struct sas_rphy *rphy = transport_class_to_rphy(dev);
1181 struct sas_phy *phy = dev_to_phy(rphy->dev.parent);
1194 error = i->f->get_enclosure_identifier(rphy, &identifier);
1200 static SAS_DEVICE_ATTR(rphy, enclosure_identifier, S_IRUGO,
1207 struct sas_rphy *rphy = transport_class_to_rphy(dev);
1208 struct sas_phy *phy = dev_to_phy(rphy->dev.parent);
1216 val = i->f->get_bay_identifier(rphy);
1222 static SAS_DEVICE_ATTR(rphy, bay_identifier, S_IRUGO,
1278 struct sas_rphy *rphy = transport_class_to_rphy(dev); \
1279 struct sas_end_device *rdev = rphy_to_end_device(rphy); \
1307 struct sas_rphy *rphy = transport_class_to_rphy(dev); \
1308 struct sas_expander_device *edev = rphy_to_expander_device(rphy); \
1355 struct sas_rphy *rphy;
1360 rphy = dev_to_rphy(dev);
1370 rphy->identify.device_type == SAS_END_DEVICE;
1378 struct sas_rphy *rphy;
1383 rphy = dev_to_rphy(dev);
1393 (rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE ||
1394 rphy->identify.device_type == SAS_FANOUT_EXPANDER_DEVICE);
1399 struct sas_rphy *rphy = dev_to_rphy(dev);
1400 struct sas_expander_device *edev = rphy_to_expander_device(rphy);
1402 if (rphy->q)
1403 blk_cleanup_queue(rphy->q);
1411 struct sas_rphy *rphy = dev_to_rphy(dev);
1412 struct sas_end_device *edev = rphy_to_end_device(rphy);
1414 if (rphy->q)
1415 blk_cleanup_queue(rphy->q);
1422 * sas_rphy_initialize - common rphy intialization
1423 * @rphy: rphy to initialise
1426 * initialise the common rphy component of each.
1428 static void sas_rphy_initialize(struct sas_rphy *rphy)
1430 INIT_LIST_HEAD(&rphy->list);
1434 * sas_end_device_alloc - allocate an rphy for an end device
1452 device_initialize(&rdev->rphy.dev);
1453 rdev->rphy.dev.parent = get_device(&parent->dev);
1454 rdev->rphy.dev.release = sas_end_device_release;
1456 struct sas_rphy *rphy = dev_to_rphy(parent->dev.parent);
1457 dev_set_name(&rdev->rphy.dev, "end_device-%d:%d:%d",
1458 shost->host_no, rphy->scsi_target_id,
1461 dev_set_name(&rdev->rphy.dev, "end_device-%d:%d",
1463 rdev->rphy.identify.device_type = SAS_END_DEVICE;
1464 sas_rphy_initialize(&rdev->rphy);
1465 transport_setup_device(&rdev->rphy.dev);
1467 return &rdev->rphy;
1472 * sas_expander_alloc - allocate an rphy for an end device
1496 device_initialize(&rdev->rphy.dev);
1497 rdev->rphy.dev.parent = get_device(&parent->dev);
1498 rdev->rphy.dev.release = sas_expander_release;
1500 rdev->rphy.scsi_target_id = sas_host->next_expander_id++;
1502 dev_set_name(&rdev->rphy.dev, "expander-%d:%d",
1503 shost->host_no, rdev->rphy.scsi_target_id);
1504 rdev->rphy.identify.device_type = type;
1505 sas_rphy_initialize(&rdev->rphy);
1506 transport_setup_device(&rdev->rphy.dev);
1508 return &rdev->rphy;
1514 * @rphy: The remote PHY to be added
1518 int sas_rphy_add(struct sas_rphy *rphy)
1520 struct sas_port *parent = dev_to_sas_port(rphy->dev.parent);
1523 struct sas_identify *identify = &rphy->identify;
1526 if (parent->rphy)
1528 parent->rphy = rphy;
1530 error = device_add(&rphy->dev);
1533 transport_add_device(&rphy->dev);
1534 transport_configure_device(&rphy->dev);
1535 if (sas_bsg_initialize(shost, rphy))
1536 printk("fail to a bsg device %s\n", dev_name(&rphy->dev));
1540 list_add_tail(&rphy->list, &sas_host->rphy_list);
1544 rphy->scsi_target_id = sas_host->next_target_id++;
1546 rphy->scsi_target_id = -1;
1550 rphy->scsi_target_id != -1) {
1551 scsi_scan_target(&rphy->dev, 0,
1552 rphy->scsi_target_id, SCAN_WILD_CARD, 0);
1561 * @rphy: SAS remote PHY to free
1570 void sas_rphy_free(struct sas_rphy *rphy)
1572 struct device *dev = &rphy->dev;
1573 struct Scsi_Host *shost = dev_to_shost(rphy->dev.parent->parent);
1577 list_del(&rphy->list);
1580 sas_bsg_remove(shost, rphy);
1590 * @rphy: SAS remote PHY to remove and free
1595 sas_rphy_delete(struct sas_rphy *rphy)
1597 sas_rphy_remove(rphy);
1598 sas_rphy_free(rphy);
1604 * @rphy: SAS remote phy to remove
1609 sas_rphy_remove(struct sas_rphy *rphy)
1611 struct device *dev = &rphy->dev;
1614 switch (rphy->identify.device_type) {
1629 parent->rphy = NULL;
1656 struct sas_rphy *rphy;
1659 list_for_each_entry(rphy, &sas_host->rphy_list, list) {
1660 if (rphy->identify.device_type != SAS_END_DEVICE ||
1661 rphy->scsi_target_id == -1)
1665 (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) {
1666 scsi_scan_target(&rphy->dev, 0,
1667 rphy->scsi_target_id, lun, 1);