summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2013-10-10 14:03:03 +0000
committeralfred <alfred@FreeBSD.org>2013-10-10 14:03:03 +0000
commit07fbeff5fe572445f47498dd0646a3761c2c8cba (patch)
treec1ed0d588df53bf55e36c8e1e84bc0fe7fa1d0fa /sys/ofed
parent64cccdad5e235a4294ffac6ee97453182831a9a4 (diff)
downloadFreeBSD-src-07fbeff5fe572445f47498dd0646a3761c2c8cba.zip
FreeBSD-src-07fbeff5fe572445f47498dd0646a3761c2c8cba.tar.gz
Fix for When more than one NIC is present.
The device name was incorrect due to a specific function we ported from the Linux driver that is not FBSD compatible. This resulted with a false sysctl registration and some more problematic issues. The patch basically revokes it all together. Submitted by: Meny Yossefi (menyy mellanox.com) Approved by: re
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/drivers/infiniband/hw/mlx4/main.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/sys/ofed/drivers/infiniband/hw/mlx4/main.c b/sys/ofed/drivers/infiniband/hw/mlx4/main.c
index 8713c41..056ed197 100644
--- a/sys/ofed/drivers/infiniband/hw/mlx4/main.c
+++ b/sys/ofed/drivers/infiniband/hw/mlx4/main.c
@@ -1859,33 +1859,6 @@ err:
"is incorrect. The parameter value is discarded!");
}
-static int mlx4_ib_dev_idx(struct mlx4_dev *dev)
-{
- int /*bus,*/ slot, fn;
- int i;
-
- if (!dev)
- return -1;
- else if (!dev->pdev)
- return -1;
- //else if (!dev->pdev->bus)
- // return -1;
-
- //bus = dev->pdev->bus->conf.pc_sel.pc_bus;
- slot = PCI_SLOT(dev->pdev->devfn);
- fn = PCI_FUNC(dev->pdev->devfn);
-
- for (i = 0; i < MAX_DR; ++i) {
- if (/*dr[i].bus == bus &&*/
- dr[i].dev == slot &&
- dr[i].func == fn) {
- return dr[i].nr;
- }
- }
-
- return -1;
-}
-
static void *mlx4_ib_add(struct mlx4_dev *dev)
{
struct mlx4_ib_dev *ibdev;
@@ -1893,7 +1866,6 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
int i, j;
int err;
struct mlx4_ib_iboe *iboe;
- int dev_idx;
printk(KERN_INFO "%s", mlx4_ib_version);
@@ -1928,12 +1900,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
ibdev->dev = dev;
- dev_idx = mlx4_ib_dev_idx(dev);
- if (dev_idx >= 0)
- sprintf(ibdev->ib_dev.name, "mlx4_%d", dev_idx);
- else
- strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX);
-
+ strlcpy(ibdev->ib_dev.name, "mlx4_%d", IB_DEVICE_NAME_MAX);
ibdev->ib_dev.owner = THIS_MODULE;
ibdev->ib_dev.node_type = RDMA_NODE_IB_CA;
ibdev->ib_dev.local_dma_lkey = dev->caps.reserved_lkey;
OpenPOWER on IntegriCloud