diff options
Diffstat (limited to 'drivers/infiniband/core/multicast.c')
-rw-r--r-- | drivers/infiniband/core/multicast.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c index fa17b552ff78..2cb865c7ce7a 100644 --- a/drivers/infiniband/core/multicast.c +++ b/drivers/infiniband/core/multicast.c | |||
@@ -780,8 +780,7 @@ static void mcast_event_handler(struct ib_event_handler *handler, | |||
780 | int index; | 780 | int index; |
781 | 781 | ||
782 | dev = container_of(handler, struct mcast_device, event_handler); | 782 | dev = container_of(handler, struct mcast_device, event_handler); |
783 | if (rdma_port_get_link_layer(dev->device, event->element.port_num) != | 783 | if (!rdma_cap_ib_mcast(dev->device, event->element.port_num)) |
784 | IB_LINK_LAYER_INFINIBAND) | ||
785 | return; | 784 | return; |
786 | 785 | ||
787 | index = event->element.port_num - dev->start_port; | 786 | index = event->element.port_num - dev->start_port; |
@@ -808,24 +807,16 @@ static void mcast_add_one(struct ib_device *device) | |||
808 | int i; | 807 | int i; |
809 | int count = 0; | 808 | int count = 0; |
810 | 809 | ||
811 | if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB) | ||
812 | return; | ||
813 | |||
814 | dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port, | 810 | dev = kmalloc(sizeof *dev + device->phys_port_cnt * sizeof *port, |
815 | GFP_KERNEL); | 811 | GFP_KERNEL); |
816 | if (!dev) | 812 | if (!dev) |
817 | return; | 813 | return; |
818 | 814 | ||
819 | if (device->node_type == RDMA_NODE_IB_SWITCH) | 815 | dev->start_port = rdma_start_port(device); |
820 | dev->start_port = dev->end_port = 0; | 816 | dev->end_port = rdma_end_port(device); |
821 | else { | ||
822 | dev->start_port = 1; | ||
823 | dev->end_port = device->phys_port_cnt; | ||
824 | } | ||
825 | 817 | ||
826 | for (i = 0; i <= dev->end_port - dev->start_port; i++) { | 818 | for (i = 0; i <= dev->end_port - dev->start_port; i++) { |
827 | if (rdma_port_get_link_layer(device, dev->start_port + i) != | 819 | if (!rdma_cap_ib_mcast(device, dev->start_port + i)) |
828 | IB_LINK_LAYER_INFINIBAND) | ||
829 | continue; | 820 | continue; |
830 | port = &dev->port[i]; | 821 | port = &dev->port[i]; |
831 | port->dev = dev; | 822 | port->dev = dev; |
@@ -863,8 +854,7 @@ static void mcast_remove_one(struct ib_device *device) | |||
863 | flush_workqueue(mcast_wq); | 854 | flush_workqueue(mcast_wq); |
864 | 855 | ||
865 | for (i = 0; i <= dev->end_port - dev->start_port; i++) { | 856 | for (i = 0; i <= dev->end_port - dev->start_port; i++) { |
866 | if (rdma_port_get_link_layer(device, dev->start_port + i) == | 857 | if (rdma_cap_ib_mcast(device, dev->start_port + i)) { |
867 | IB_LINK_LAYER_INFINIBAND) { | ||
868 | port = &dev->port[i]; | 858 | port = &dev->port[i]; |
869 | deref_port(port); | 859 | deref_port(port); |
870 | wait_for_completion(&port->comp); | 860 | wait_for_completion(&port->comp); |