aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb3/iwch_provider.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/cxgb3/iwch_provider.c')
-rw-r--r--drivers/infiniband/hw/cxgb3/iwch_provider.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index b89640aa6e10..eb778bfd6f66 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -1187,28 +1187,6 @@ static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
1187 return sprintf(buf, "%d\n", iwch_dev->rdev.t3cdev_p->type); 1187 return sprintf(buf, "%d\n", iwch_dev->rdev.t3cdev_p->type);
1188} 1188}
1189 1189
1190static int fw_supports_fastreg(struct iwch_dev *iwch_dev)
1191{
1192 struct ethtool_drvinfo info;
1193 struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
1194 char *cp, *next;
1195 unsigned fw_maj, fw_min;
1196
1197 rtnl_lock();
1198 lldev->ethtool_ops->get_drvinfo(lldev, &info);
1199 rtnl_unlock();
1200
1201 next = info.fw_version+1;
1202 cp = strsep(&next, ".");
1203 sscanf(cp, "%i", &fw_maj);
1204 cp = strsep(&next, ".");
1205 sscanf(cp, "%i", &fw_min);
1206
1207 PDBG("%s maj %u min %u\n", __func__, fw_maj, fw_min);
1208
1209 return fw_maj > 6 || (fw_maj == 6 && fw_min > 0);
1210}
1211
1212static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, char *buf) 1190static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, char *buf)
1213{ 1191{
1214 struct iwch_dev *iwch_dev = container_of(dev, struct iwch_dev, 1192 struct iwch_dev *iwch_dev = container_of(dev, struct iwch_dev,
@@ -1325,12 +1303,12 @@ int iwch_register_device(struct iwch_dev *dev)
1325 memset(&dev->ibdev.node_guid, 0, sizeof(dev->ibdev.node_guid)); 1303 memset(&dev->ibdev.node_guid, 0, sizeof(dev->ibdev.node_guid));
1326 memcpy(&dev->ibdev.node_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6); 1304 memcpy(&dev->ibdev.node_guid, dev->rdev.t3cdev_p->lldev->dev_addr, 6);
1327 dev->ibdev.owner = THIS_MODULE; 1305 dev->ibdev.owner = THIS_MODULE;
1328 dev->device_cap_flags = IB_DEVICE_LOCAL_DMA_LKEY | IB_DEVICE_MEM_WINDOW; 1306 dev->device_cap_flags = IB_DEVICE_LOCAL_DMA_LKEY |
1307 IB_DEVICE_MEM_WINDOW |
1308 IB_DEVICE_MEM_MGT_EXTENSIONS;
1329 1309
1330 /* cxgb3 supports STag 0. */ 1310 /* cxgb3 supports STag 0. */
1331 dev->ibdev.local_dma_lkey = 0; 1311 dev->ibdev.local_dma_lkey = 0;
1332 if (fw_supports_fastreg(dev))
1333 dev->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
1334 1312
1335 dev->ibdev.uverbs_cmd_mask = 1313 dev->ibdev.uverbs_cmd_mask =
1336 (1ull << IB_USER_VERBS_CMD_GET_CONTEXT) | 1314 (1ull << IB_USER_VERBS_CMD_GET_CONTEXT) |