diff options
author | Bart Van Assche <bvanassche@acm.org> | 2011-06-18 12:35:42 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-07-18 19:44:30 -0400 |
commit | 10e1b54bbb51ac134c51996022f3bd10579fbd3b (patch) | |
tree | 6b535275efbefb7f32d6bec89c21a05a902f655d /drivers/infiniband | |
parent | 620917de59eeb934b9f8cf35cc2d95c1ac8ed0fc (diff) |
RDMA: Allow for NULL .modify_device() and .modify_port() methods
These methods don't make sense for iWARP devices, so rather than
forcing them to implement stubs, just return -ENOSYS in the core if
the hardware driver doesn't set .modify_device and/or .modify_port.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/device.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/amso1100/c2_provider.c | 9 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_provider.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb4/provider.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_verbs.c | 11 |
5 files changed, 6 insertions, 36 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 4007f721d25d..e711de400a01 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -627,6 +627,9 @@ int ib_modify_device(struct ib_device *device, | |||
627 | int device_modify_mask, | 627 | int device_modify_mask, |
628 | struct ib_device_modify *device_modify) | 628 | struct ib_device_modify *device_modify) |
629 | { | 629 | { |
630 | if (!device->modify_device) | ||
631 | return -ENOSYS; | ||
632 | |||
630 | return device->modify_device(device, device_modify_mask, | 633 | return device->modify_device(device, device_modify_mask, |
631 | device_modify); | 634 | device_modify); |
632 | } | 635 | } |
@@ -647,6 +650,9 @@ int ib_modify_port(struct ib_device *device, | |||
647 | u8 port_num, int port_modify_mask, | 650 | u8 port_num, int port_modify_mask, |
648 | struct ib_port_modify *port_modify) | 651 | struct ib_port_modify *port_modify) |
649 | { | 652 | { |
653 | if (!device->modify_port) | ||
654 | return -ENOSYS; | ||
655 | |||
650 | if (port_num < start_port(device) || port_num > end_port(device)) | 656 | if (port_num < start_port(device) || port_num > end_port(device)) |
651 | return -EINVAL; | 657 | return -EINVAL; |
652 | 658 | ||
diff --git a/drivers/infiniband/hw/amso1100/c2_provider.c b/drivers/infiniband/hw/amso1100/c2_provider.c index aeebc4d37e33..f101bb73be63 100644 --- a/drivers/infiniband/hw/amso1100/c2_provider.c +++ b/drivers/infiniband/hw/amso1100/c2_provider.c | |||
@@ -99,14 +99,6 @@ static int c2_query_port(struct ib_device *ibdev, | |||
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
101 | 101 | ||
102 | static int c2_modify_port(struct ib_device *ibdev, | ||
103 | u8 port, int port_modify_mask, | ||
104 | struct ib_port_modify *props) | ||
105 | { | ||
106 | pr_debug("%s:%u\n", __func__, __LINE__); | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static int c2_query_pkey(struct ib_device *ibdev, | 102 | static int c2_query_pkey(struct ib_device *ibdev, |
111 | u8 port, u16 index, u16 * pkey) | 103 | u8 port, u16 index, u16 * pkey) |
112 | { | 104 | { |
@@ -817,7 +809,6 @@ int c2_register_device(struct c2_dev *dev) | |||
817 | dev->ibdev.dma_device = &dev->pcidev->dev; | 809 | dev->ibdev.dma_device = &dev->pcidev->dev; |
818 | dev->ibdev.query_device = c2_query_device; | 810 | dev->ibdev.query_device = c2_query_device; |
819 | dev->ibdev.query_port = c2_query_port; | 811 | dev->ibdev.query_port = c2_query_port; |
820 | dev->ibdev.modify_port = c2_modify_port; | ||
821 | dev->ibdev.query_pkey = c2_query_pkey; | 812 | dev->ibdev.query_pkey = c2_query_pkey; |
822 | dev->ibdev.query_gid = c2_query_gid; | 813 | dev->ibdev.query_gid = c2_query_gid; |
823 | dev->ibdev.alloc_ucontext = c2_alloc_ucontext; | 814 | dev->ibdev.alloc_ucontext = c2_alloc_ucontext; |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 2e2741307af4..c7d9411f2954 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c | |||
@@ -61,13 +61,6 @@ | |||
61 | #include "iwch_user.h" | 61 | #include "iwch_user.h" |
62 | #include "common.h" | 62 | #include "common.h" |
63 | 63 | ||
64 | static int iwch_modify_port(struct ib_device *ibdev, | ||
65 | u8 port, int port_modify_mask, | ||
66 | struct ib_port_modify *props) | ||
67 | { | ||
68 | return -ENOSYS; | ||
69 | } | ||
70 | |||
71 | static struct ib_ah *iwch_ah_create(struct ib_pd *pd, | 64 | static struct ib_ah *iwch_ah_create(struct ib_pd *pd, |
72 | struct ib_ah_attr *ah_attr) | 65 | struct ib_ah_attr *ah_attr) |
73 | { | 66 | { |
@@ -1392,7 +1385,6 @@ int iwch_register_device(struct iwch_dev *dev) | |||
1392 | dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev); | 1385 | dev->ibdev.dma_device = &(dev->rdev.rnic_info.pdev->dev); |
1393 | dev->ibdev.query_device = iwch_query_device; | 1386 | dev->ibdev.query_device = iwch_query_device; |
1394 | dev->ibdev.query_port = iwch_query_port; | 1387 | dev->ibdev.query_port = iwch_query_port; |
1395 | dev->ibdev.modify_port = iwch_modify_port; | ||
1396 | dev->ibdev.query_pkey = iwch_query_pkey; | 1388 | dev->ibdev.query_pkey = iwch_query_pkey; |
1397 | dev->ibdev.query_gid = iwch_query_gid; | 1389 | dev->ibdev.query_gid = iwch_query_gid; |
1398 | dev->ibdev.alloc_ucontext = iwch_alloc_ucontext; | 1390 | dev->ibdev.alloc_ucontext = iwch_alloc_ucontext; |
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 5b9e4220ca08..247fe706e7fa 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c | |||
@@ -58,13 +58,6 @@ static int fastreg_support = 1; | |||
58 | module_param(fastreg_support, int, 0644); | 58 | module_param(fastreg_support, int, 0644); |
59 | MODULE_PARM_DESC(fastreg_support, "Advertise fastreg support (default=1)"); | 59 | MODULE_PARM_DESC(fastreg_support, "Advertise fastreg support (default=1)"); |
60 | 60 | ||
61 | static int c4iw_modify_port(struct ib_device *ibdev, | ||
62 | u8 port, int port_modify_mask, | ||
63 | struct ib_port_modify *props) | ||
64 | { | ||
65 | return -ENOSYS; | ||
66 | } | ||
67 | |||
68 | static struct ib_ah *c4iw_ah_create(struct ib_pd *pd, | 61 | static struct ib_ah *c4iw_ah_create(struct ib_pd *pd, |
69 | struct ib_ah_attr *ah_attr) | 62 | struct ib_ah_attr *ah_attr) |
70 | { | 63 | { |
@@ -456,7 +449,6 @@ int c4iw_register_device(struct c4iw_dev *dev) | |||
456 | dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev); | 449 | dev->ibdev.dma_device = &(dev->rdev.lldi.pdev->dev); |
457 | dev->ibdev.query_device = c4iw_query_device; | 450 | dev->ibdev.query_device = c4iw_query_device; |
458 | dev->ibdev.query_port = c4iw_query_port; | 451 | dev->ibdev.query_port = c4iw_query_port; |
459 | dev->ibdev.modify_port = c4iw_modify_port; | ||
460 | dev->ibdev.query_pkey = c4iw_query_pkey; | 452 | dev->ibdev.query_pkey = c4iw_query_pkey; |
461 | dev->ibdev.query_gid = c4iw_query_gid; | 453 | dev->ibdev.query_gid = c4iw_query_gid; |
462 | dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext; | 454 | dev->ibdev.alloc_ucontext = c4iw_alloc_ucontext; |
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 95ca93ceedac..9f2f7d4b1197 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -605,16 +605,6 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr | |||
605 | 605 | ||
606 | 606 | ||
607 | /** | 607 | /** |
608 | * nes_modify_port | ||
609 | */ | ||
610 | static int nes_modify_port(struct ib_device *ibdev, u8 port, | ||
611 | int port_modify_mask, struct ib_port_modify *props) | ||
612 | { | ||
613 | return 0; | ||
614 | } | ||
615 | |||
616 | |||
617 | /** | ||
618 | * nes_query_pkey | 608 | * nes_query_pkey |
619 | */ | 609 | */ |
620 | static int nes_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey) | 610 | static int nes_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey) |
@@ -3882,7 +3872,6 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev) | |||
3882 | nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev; | 3872 | nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev; |
3883 | nesibdev->ibdev.query_device = nes_query_device; | 3873 | nesibdev->ibdev.query_device = nes_query_device; |
3884 | nesibdev->ibdev.query_port = nes_query_port; | 3874 | nesibdev->ibdev.query_port = nes_query_port; |
3885 | nesibdev->ibdev.modify_port = nes_modify_port; | ||
3886 | nesibdev->ibdev.query_pkey = nes_query_pkey; | 3875 | nesibdev->ibdev.query_pkey = nes_query_pkey; |
3887 | nesibdev->ibdev.query_gid = nes_query_gid; | 3876 | nesibdev->ibdev.query_gid = nes_query_gid; |
3888 | nesibdev->ibdev.alloc_ucontext = nes_alloc_ucontext; | 3877 | nesibdev->ibdev.alloc_ucontext = nes_alloc_ucontext; |