diff options
-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 | ||