diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2005-08-14 00:19:38 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2005-08-26 23:37:35 -0400 |
commit | 2e8b981c5d5c6fe5479ad47c44e3e76ebb5408ef (patch) | |
tree | d01fc31cb120666633f92d0eaf48b82b6a22be46 /drivers/infiniband/hw/mthca/mthca_provider.c | |
parent | 97f52eb438be7caebe026421545619d8a0c1398a (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.c | 10 |
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 | ||
961 | static 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 | |||
961 | static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); | 967 | static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL); |
962 | static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); | 968 | static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL); |
963 | static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); | 969 | static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); |
970 | static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL); | ||
964 | 971 | ||
965 | static struct class_device_attribute *mthca_class_attributes[] = { | 972 | static 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 | ||
971 | int mthca_register_device(struct mthca_dev *dev) | 979 | int mthca_register_device(struct mthca_dev *dev) |