aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_provider.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2005-08-14 00:19:38 -0400
committerRoland Dreier <rolandd@cisco.com>2005-08-26 23:37:35 -0400
commit2e8b981c5d5c6fe5479ad47c44e3e76ebb5408ef (patch)
treed01fc31cb120666633f92d0eaf48b82b6a22be46 /drivers/infiniband/hw/mthca/mthca_provider.c
parent97f52eb438be7caebe026421545619d8a0c1398a (diff)
[PATCH] IB/mthca: add HCA board ID to sysfs info
Add support for reporting HCA board ID returned from QUERY_ADAPTER firmware command through sysfs. Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index e2db5e001869..f5e135f1dc59 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -958,14 +958,22 @@ static ssize_t show_hca(struct class_device *cdev, char *buf)
958 } 958 }
959} 959}
960 960
961static ssize_t show_board(struct class_device *cdev, char *buf)
962{
963 struct mthca_dev *dev = container_of(cdev, struct mthca_dev, ib_dev.class_dev);
964 return sprintf(buf, "%.*s\n", MTHCA_BOARD_ID_LEN, dev->board_id);
965}
966
961static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); 967static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
962static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); 968static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
963static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); 969static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
970static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
964 971
965static struct class_device_attribute *mthca_class_attributes[] = { 972static struct class_device_attribute *mthca_class_attributes[] = {
966 &class_device_attr_hw_rev, 973 &class_device_attr_hw_rev,
967 &class_device_attr_fw_ver, 974 &class_device_attr_fw_ver,
968 &class_device_attr_hca_type 975 &class_device_attr_hca_type,
976 &class_device_attr_board_id
969}; 977};
970 978
971int mthca_register_device(struct mthca_dev *dev) 979int mthca_register_device(struct mthca_dev *dev)