diff options
Diffstat (limited to 'drivers/infiniband/hw/nes/nes.c')
-rw-r--r-- | drivers/infiniband/hw/nes/nes.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c index 353c7b05a90a..3b2a6dc8ea99 100644 --- a/drivers/infiniband/hw/nes/nes.c +++ b/drivers/infiniband/hw/nes/nes.c | |||
@@ -68,7 +68,6 @@ MODULE_VERSION(DRV_VERSION); | |||
68 | int max_mtu = 9000; | 68 | int max_mtu = 9000; |
69 | int interrupt_mod_interval = 0; | 69 | int interrupt_mod_interval = 0; |
70 | 70 | ||
71 | |||
72 | /* Interoperability */ | 71 | /* Interoperability */ |
73 | int mpa_version = 1; | 72 | int mpa_version = 1; |
74 | module_param(mpa_version, int, 0644); | 73 | module_param(mpa_version, int, 0644); |
@@ -112,6 +111,16 @@ static struct pci_device_id nes_pci_table[] = { | |||
112 | 111 | ||
113 | MODULE_DEVICE_TABLE(pci, nes_pci_table); | 112 | MODULE_DEVICE_TABLE(pci, nes_pci_table); |
114 | 113 | ||
114 | /* registered nes netlink callbacks */ | ||
115 | static struct ibnl_client_cbs nes_nl_cb_table[] = { | ||
116 | [RDMA_NL_IWPM_REG_PID] = {.dump = iwpm_register_pid_cb}, | ||
117 | [RDMA_NL_IWPM_ADD_MAPPING] = {.dump = iwpm_add_mapping_cb}, | ||
118 | [RDMA_NL_IWPM_QUERY_MAPPING] = {.dump = iwpm_add_and_query_mapping_cb}, | ||
119 | [RDMA_NL_IWPM_HANDLE_ERR] = {.dump = iwpm_mapping_error_cb}, | ||
120 | [RDMA_NL_IWPM_MAPINFO] = {.dump = iwpm_mapping_info_cb}, | ||
121 | [RDMA_NL_IWPM_MAPINFO_NUM] = {.dump = iwpm_ack_mapping_info_cb} | ||
122 | }; | ||
123 | |||
115 | static int nes_inetaddr_event(struct notifier_block *, unsigned long, void *); | 124 | static int nes_inetaddr_event(struct notifier_block *, unsigned long, void *); |
116 | static int nes_net_event(struct notifier_block *, unsigned long, void *); | 125 | static int nes_net_event(struct notifier_block *, unsigned long, void *); |
117 | static int nes_notifiers_registered; | 126 | static int nes_notifiers_registered; |
@@ -672,6 +681,17 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) | |||
672 | } | 681 | } |
673 | nes_notifiers_registered++; | 682 | nes_notifiers_registered++; |
674 | 683 | ||
684 | if (ibnl_add_client(RDMA_NL_NES, RDMA_NL_IWPM_NUM_OPS, nes_nl_cb_table)) | ||
685 | printk(KERN_ERR PFX "%s[%u]: Failed to add netlink callback\n", | ||
686 | __func__, __LINE__); | ||
687 | |||
688 | ret = iwpm_init(RDMA_NL_NES); | ||
689 | if (ret) { | ||
690 | printk(KERN_ERR PFX "%s: port mapper initialization failed\n", | ||
691 | pci_name(pcidev)); | ||
692 | goto bail7; | ||
693 | } | ||
694 | |||
675 | INIT_DELAYED_WORK(&nesdev->work, nes_recheck_link_status); | 695 | INIT_DELAYED_WORK(&nesdev->work, nes_recheck_link_status); |
676 | 696 | ||
677 | /* Initialize network devices */ | 697 | /* Initialize network devices */ |
@@ -710,6 +730,7 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) | |||
710 | 730 | ||
711 | nes_debug(NES_DBG_INIT, "netdev_count=%d, nesadapter->netdev_count=%d\n", | 731 | nes_debug(NES_DBG_INIT, "netdev_count=%d, nesadapter->netdev_count=%d\n", |
712 | nesdev->netdev_count, nesdev->nesadapter->netdev_count); | 732 | nesdev->netdev_count, nesdev->nesadapter->netdev_count); |
733 | ibnl_remove_client(RDMA_NL_NES); | ||
713 | 734 | ||
714 | nes_notifiers_registered--; | 735 | nes_notifiers_registered--; |
715 | if (nes_notifiers_registered == 0) { | 736 | if (nes_notifiers_registered == 0) { |
@@ -773,6 +794,8 @@ static void nes_remove(struct pci_dev *pcidev) | |||
773 | nesdev->nesadapter->netdev_count--; | 794 | nesdev->nesadapter->netdev_count--; |
774 | } | 795 | } |
775 | } | 796 | } |
797 | ibnl_remove_client(RDMA_NL_NES); | ||
798 | iwpm_exit(RDMA_NL_NES); | ||
776 | 799 | ||
777 | nes_notifiers_registered--; | 800 | nes_notifiers_registered--; |
778 | if (nes_notifiers_registered == 0) { | 801 | if (nes_notifiers_registered == 0) { |