diff options
author | Steve Wise <swise@opengridcomputing.com> | 2008-07-15 02:48:47 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-07-15 02:48:47 -0400 |
commit | 97d1cc8055c7b3fbd35bf693775d61102e65d174 (patch) | |
tree | e120b64dacf4a7b2dc3de88aefbe4888807fd7fb /drivers/infiniband/hw/cxgb3/iwch_provider.c | |
parent | 6f7bc01a7382641c61ec036d68ff3a9140b48a1c (diff) |
RDMA/cxgb3: Fix up some ib_device_attr fields
- set fw_ver
- set hw_ver
- set max_qp_wr to something reasonable
- set max_cqe to something reasonable
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb3/iwch_provider.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_provider.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 5d504f3ed68b..5f4380657392 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c | |||
@@ -1093,6 +1093,29 @@ static int iwch_query_gid(struct ib_device *ibdev, u8 port, | |||
1093 | return 0; | 1093 | return 0; |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | static u64 fw_vers_string_to_u64(struct iwch_dev *iwch_dev) | ||
1097 | { | ||
1098 | struct ethtool_drvinfo info; | ||
1099 | struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev; | ||
1100 | char *cp, *next; | ||
1101 | unsigned fw_maj, fw_min, fw_mic; | ||
1102 | |||
1103 | rtnl_lock(); | ||
1104 | lldev->ethtool_ops->get_drvinfo(lldev, &info); | ||
1105 | rtnl_unlock(); | ||
1106 | |||
1107 | next = info.fw_version + 1; | ||
1108 | cp = strsep(&next, "."); | ||
1109 | sscanf(cp, "%i", &fw_maj); | ||
1110 | cp = strsep(&next, "."); | ||
1111 | sscanf(cp, "%i", &fw_min); | ||
1112 | cp = strsep(&next, "."); | ||
1113 | sscanf(cp, "%i", &fw_mic); | ||
1114 | |||
1115 | return (((u64)fw_maj & 0xffff) << 32) | ((fw_min & 0xffff) << 16) | | ||
1116 | (fw_mic & 0xffff); | ||
1117 | } | ||
1118 | |||
1096 | static int iwch_query_device(struct ib_device *ibdev, | 1119 | static int iwch_query_device(struct ib_device *ibdev, |
1097 | struct ib_device_attr *props) | 1120 | struct ib_device_attr *props) |
1098 | { | 1121 | { |
@@ -1103,6 +1126,8 @@ static int iwch_query_device(struct ib_device *ibdev, | |||
1103 | dev = to_iwch_dev(ibdev); | 1126 | dev = to_iwch_dev(ibdev); |
1104 | memset(props, 0, sizeof *props); | 1127 | memset(props, 0, sizeof *props); |
1105 | memcpy(&props->sys_image_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6); | 1128 | memcpy(&props->sys_image_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6); |
1129 | props->hw_ver = dev->rdev.t3cdev_p->type; | ||
1130 | props->fw_ver = fw_vers_string_to_u64(dev); | ||
1106 | props->device_cap_flags = dev->device_cap_flags; | 1131 | props->device_cap_flags = dev->device_cap_flags; |
1107 | props->vendor_id = (u32)dev->rdev.rnic_info.pdev->vendor; | 1132 | props->vendor_id = (u32)dev->rdev.rnic_info.pdev->vendor; |
1108 | props->vendor_part_id = (u32)dev->rdev.rnic_info.pdev->device; | 1133 | props->vendor_part_id = (u32)dev->rdev.rnic_info.pdev->device; |