Commit f65c52ca authored by Ira Weiny's avatar Ira Weiny Committed by Doug Ledford

IB/i40iw: Support device FW version string

And remove sysfs support in favor of the core version.
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent ce192243
...@@ -1972,18 +1972,6 @@ static ssize_t i40iw_show_rev(struct device *dev, ...@@ -1972,18 +1972,6 @@ static ssize_t i40iw_show_rev(struct device *dev,
return sprintf(buf, "%x\n", hw_rev); return sprintf(buf, "%x\n", hw_rev);
} }
/**
* i40iw_show_fw_ver
*/
static ssize_t i40iw_show_fw_ver(struct device *dev,
struct device_attribute *attr, char *buf)
{
u32 firmware_version = I40IW_FW_VERSION;
return sprintf(buf, "%u.%u\n", firmware_version,
(firmware_version & 0x000000ff));
}
/** /**
* i40iw_show_hca * i40iw_show_hca
*/ */
...@@ -2004,13 +1992,11 @@ static ssize_t i40iw_show_board(struct device *dev, ...@@ -2004,13 +1992,11 @@ static ssize_t i40iw_show_board(struct device *dev,
} }
static DEVICE_ATTR(hw_rev, S_IRUGO, i40iw_show_rev, NULL); static DEVICE_ATTR(hw_rev, S_IRUGO, i40iw_show_rev, NULL);
static DEVICE_ATTR(fw_ver, S_IRUGO, i40iw_show_fw_ver, NULL);
static DEVICE_ATTR(hca_type, S_IRUGO, i40iw_show_hca, NULL); static DEVICE_ATTR(hca_type, S_IRUGO, i40iw_show_hca, NULL);
static DEVICE_ATTR(board_id, S_IRUGO, i40iw_show_board, NULL); static DEVICE_ATTR(board_id, S_IRUGO, i40iw_show_board, NULL);
static struct device_attribute *i40iw_dev_attributes[] = { static struct device_attribute *i40iw_dev_attributes[] = {
&dev_attr_hw_rev, &dev_attr_hw_rev,
&dev_attr_fw_ver,
&dev_attr_hca_type, &dev_attr_hca_type,
&dev_attr_board_id &dev_attr_board_id
}; };
...@@ -2427,6 +2413,15 @@ static const char * const i40iw_hw_stat_names[] = { ...@@ -2427,6 +2413,15 @@ static const char * const i40iw_hw_stat_names[] = {
"iwRdmaInv" "iwRdmaInv"
}; };
static void i40iw_get_dev_fw_str(struct ib_device *dev, char *str,
size_t str_len)
{
u32 firmware_version = I40IW_FW_VERSION;
snprintf(str, str_len, "%u.%u", firmware_version,
(firmware_version & 0x000000ff));
}
/** /**
* i40iw_alloc_hw_stats - Allocate a hw stats structure * i40iw_alloc_hw_stats - Allocate a hw stats structure
* @ibdev: device pointer from stack * @ibdev: device pointer from stack
...@@ -2650,6 +2645,7 @@ static struct i40iw_ib_device *i40iw_init_rdma_device(struct i40iw_device *iwdev ...@@ -2650,6 +2645,7 @@ static struct i40iw_ib_device *i40iw_init_rdma_device(struct i40iw_device *iwdev
memcpy(iwibdev->ibdev.iwcm->ifname, netdev->name, memcpy(iwibdev->ibdev.iwcm->ifname, netdev->name,
sizeof(iwibdev->ibdev.iwcm->ifname)); sizeof(iwibdev->ibdev.iwcm->ifname));
iwibdev->ibdev.get_port_immutable = i40iw_port_immutable; iwibdev->ibdev.get_port_immutable = i40iw_port_immutable;
iwibdev->ibdev.get_dev_fw_str = i40iw_get_dev_fw_str;
iwibdev->ibdev.poll_cq = i40iw_poll_cq; iwibdev->ibdev.poll_cq = i40iw_poll_cq;
iwibdev->ibdev.req_notify_cq = i40iw_req_notify_cq; iwibdev->ibdev.req_notify_cq = i40iw_req_notify_cq;
iwibdev->ibdev.post_send = i40iw_post_send; iwibdev->ibdev.post_send = i40iw_post_send;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment