diff options
author | Ishai Rabinovitz <ishai@mellanox.co.il> | 2006-08-15 10:34:52 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-22 18:17:21 -0400 |
commit | ded7f1a16d50527359be02f8b04f9ba56bc923e6 (patch) | |
tree | 5ef2b43576bb1a07e34c902a52475868be4ba711 /drivers/infiniband | |
parent | 2a214182d23594915d6ae517b6368ba2eae055d2 (diff) |
IB/srp: Add port/device attributes
Add local_ib_device and local_ib_port attributes to srp scsi_host.
These are needed when we want to connect to the same target through
multiple distinct ports.
Signed-off-by: Ishai Rabinovitz <ishai@mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index fd8344cdc0db..249a98c06aeb 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1449,12 +1449,28 @@ static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf) | |||
1449 | return sprintf(buf, "%d\n", target->zero_req_lim); | 1449 | return sprintf(buf, "%d\n", target->zero_req_lim); |
1450 | } | 1450 | } |
1451 | 1451 | ||
1452 | static CLASS_DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL); | 1452 | static ssize_t show_local_ib_port(struct class_device *cdev, char *buf) |
1453 | static CLASS_DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL); | 1453 | { |
1454 | static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); | 1454 | struct srp_target_port *target = host_to_target(class_to_shost(cdev)); |
1455 | static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); | 1455 | |
1456 | static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); | 1456 | return sprintf(buf, "%d\n", target->srp_host->port); |
1457 | static CLASS_DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); | 1457 | } |
1458 | |||
1459 | static ssize_t show_local_ib_device(struct class_device *cdev, char *buf) | ||
1460 | { | ||
1461 | struct srp_target_port *target = host_to_target(class_to_shost(cdev)); | ||
1462 | |||
1463 | return sprintf(buf, "%s\n", target->srp_host->dev->dev->name); | ||
1464 | } | ||
1465 | |||
1466 | static CLASS_DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL); | ||
1467 | static CLASS_DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL); | ||
1468 | static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); | ||
1469 | static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); | ||
1470 | static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); | ||
1471 | static CLASS_DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); | ||
1472 | static CLASS_DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); | ||
1473 | static CLASS_DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); | ||
1458 | 1474 | ||
1459 | static struct class_device_attribute *srp_host_attrs[] = { | 1475 | static struct class_device_attribute *srp_host_attrs[] = { |
1460 | &class_device_attr_id_ext, | 1476 | &class_device_attr_id_ext, |
@@ -1463,6 +1479,8 @@ static struct class_device_attribute *srp_host_attrs[] = { | |||
1463 | &class_device_attr_pkey, | 1479 | &class_device_attr_pkey, |
1464 | &class_device_attr_dgid, | 1480 | &class_device_attr_dgid, |
1465 | &class_device_attr_zero_req_lim, | 1481 | &class_device_attr_zero_req_lim, |
1482 | &class_device_attr_local_ib_port, | ||
1483 | &class_device_attr_local_ib_device, | ||
1466 | NULL | 1484 | NULL |
1467 | }; | 1485 | }; |
1468 | 1486 | ||