aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/Makefile2
-rw-r--r--drivers/infiniband/hw/ipath/Kconfig21
-rw-r--r--drivers/infiniband/hw/ipath/Makefile27
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c13
-rw-r--r--drivers/infiniband/hw/ipath/ipath_intr.c3
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h11
-rw-r--r--drivers/infiniband/hw/ipath/ipath_layer.c214
-rw-r--r--drivers/infiniband/hw/ipath/ipath_layer.h8
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.c45
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.h10
10 files changed, 62 insertions, 292 deletions
diff --git a/drivers/infiniband/Makefile b/drivers/infiniband/Makefile
index 893bee0a50b5..08cff32d900e 100644
--- a/drivers/infiniband/Makefile
+++ b/drivers/infiniband/Makefile
@@ -1,6 +1,6 @@
1obj-$(CONFIG_INFINIBAND) += core/ 1obj-$(CONFIG_INFINIBAND) += core/
2obj-$(CONFIG_INFINIBAND_MTHCA) += hw/mthca/ 2obj-$(CONFIG_INFINIBAND_MTHCA) += hw/mthca/
3obj-$(CONFIG_IPATH_CORE) += hw/ipath/ 3obj-$(CONFIG_INFINIBAND_IPATH) += hw/ipath/
4obj-$(CONFIG_INFINIBAND_EHCA) += hw/ehca/ 4obj-$(CONFIG_INFINIBAND_EHCA) += hw/ehca/
5obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/ 5obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/
6obj-$(CONFIG_INFINIBAND_SRP) += ulp/srp/ 6obj-$(CONFIG_INFINIBAND_SRP) += ulp/srp/
diff --git a/drivers/infiniband/hw/ipath/Kconfig b/drivers/infiniband/hw/ipath/Kconfig
index 1db9489f1e82..574a678e7fdd 100644
--- a/drivers/infiniband/hw/ipath/Kconfig
+++ b/drivers/infiniband/hw/ipath/Kconfig
@@ -1,16 +1,9 @@
1config IPATH_CORE
2 tristate "QLogic InfiniPath Driver"
3 depends on 64BIT && PCI_MSI && NET
4 ---help---
5 This is a low-level driver for QLogic InfiniPath host channel
6 adapters (HCAs) based on the HT-400 and PE-800 chips.
7
8config INFINIBAND_IPATH 1config INFINIBAND_IPATH
9 tristate "QLogic InfiniPath Verbs Driver" 2 tristate "QLogic InfiniPath Driver"
10 depends on IPATH_CORE && INFINIBAND 3 depends on PCI_MSI && 64BIT && INFINIBAND
11 ---help--- 4 ---help---
12 This is a driver that provides InfiniBand verbs support for 5 This is a driver for QLogic InfiniPath host channel adapters,
13 QLogic InfiniPath host channel adapters (HCAs). This 6 including InfiniBand verbs support. This driver allows these
14 allows these devices to be used with both kernel upper level 7 devices to be used with both kernel upper level protocols such
15 protocols such as IP-over-InfiniBand as well as with userspace 8 as IP-over-InfiniBand as well as with userspace applications
16 applications (in conjunction with InfiniBand userspace access). 9 (in conjunction with InfiniBand userspace access).
diff --git a/drivers/infiniband/hw/ipath/Makefile b/drivers/infiniband/hw/ipath/Makefile
index 075e313941fe..690dc713e63e 100644
--- a/drivers/infiniband/hw/ipath/Makefile
+++ b/drivers/infiniband/hw/ipath/Makefile
@@ -1,10 +1,10 @@
1EXTRA_CFLAGS += -DIPATH_IDSTR='"QLogic kernel.org driver"' \ 1EXTRA_CFLAGS += -DIPATH_IDSTR='"QLogic kernel.org driver"' \
2 -DIPATH_KERN_TYPE=0 2 -DIPATH_KERN_TYPE=0
3 3
4obj-$(CONFIG_IPATH_CORE) += ipath_core.o
5obj-$(CONFIG_INFINIBAND_IPATH) += ib_ipath.o 4obj-$(CONFIG_INFINIBAND_IPATH) += ib_ipath.o
6 5
7ipath_core-y := \ 6ib_ipath-y := \
7 ipath_cq.o \
8 ipath_diag.o \ 8 ipath_diag.o \
9 ipath_driver.o \ 9 ipath_driver.o \
10 ipath_eeprom.o \ 10 ipath_eeprom.o \
@@ -13,26 +13,23 @@ ipath_core-y := \
13 ipath_ht400.o \ 13 ipath_ht400.o \
14 ipath_init_chip.o \ 14 ipath_init_chip.o \
15 ipath_intr.o \ 15 ipath_intr.o \
16 ipath_layer.o \
17 ipath_pe800.o \
18 ipath_stats.o \
19 ipath_sysfs.o \
20 ipath_user_pages.o
21
22ipath_core-$(CONFIG_X86_64) += ipath_wc_x86_64.o
23ipath_core-$(CONFIG_PPC64) += ipath_wc_ppc64.o
24
25ib_ipath-y := \
26 ipath_cq.o \
27 ipath_keys.o \ 16 ipath_keys.o \
17 ipath_layer.o \
28 ipath_mad.o \ 18 ipath_mad.o \
29 ipath_mmap.o \ 19 ipath_mmap.o \
30 ipath_mr.o \ 20 ipath_mr.o \
21 ipath_pe800.o \
31 ipath_qp.o \ 22 ipath_qp.o \
32 ipath_rc.o \ 23 ipath_rc.o \
33 ipath_ruc.o \ 24 ipath_ruc.o \
34 ipath_srq.o \ 25 ipath_srq.o \
26 ipath_stats.o \
27 ipath_sysfs.o \
35 ipath_uc.o \ 28 ipath_uc.o \
36 ipath_ud.o \ 29 ipath_ud.o \
37 ipath_verbs.o \ 30 ipath_user_pages.o \
38 ipath_verbs_mcast.o 31 ipath_verbs_mcast.o \
32 ipath_verbs.o
33
34ib_ipath-$(CONFIG_X86_64) += ipath_wc_x86_64.o
35ib_ipath-$(CONFIG_PPC64) += ipath_wc_ppc64.o
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 6ded914f9eb9..9af7406d6a62 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -40,6 +40,7 @@
40 40
41#include "ipath_kernel.h" 41#include "ipath_kernel.h"
42#include "ipath_layer.h" 42#include "ipath_layer.h"
43#include "ipath_verbs.h"
43#include "ipath_common.h" 44#include "ipath_common.h"
44 45
45static void ipath_update_pio_bufs(struct ipath_devdata *); 46static void ipath_update_pio_bufs(struct ipath_devdata *);
@@ -51,8 +52,6 @@ const char *ipath_get_unit_name(int unit)
51 return iname; 52 return iname;
52} 53}
53 54
54EXPORT_SYMBOL_GPL(ipath_get_unit_name);
55
56#define DRIVER_LOAD_MSG "QLogic " IPATH_DRV_NAME " loaded: " 55#define DRIVER_LOAD_MSG "QLogic " IPATH_DRV_NAME " loaded: "
57#define PFX IPATH_DRV_NAME ": " 56#define PFX IPATH_DRV_NAME ": "
58 57
@@ -510,6 +509,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
510 ipath_user_add(dd); 509 ipath_user_add(dd);
511 ipath_diag_add(dd); 510 ipath_diag_add(dd);
512 ipath_layer_add(dd); 511 ipath_layer_add(dd);
512 ipath_register_ib_device(dd);
513 513
514 goto bail; 514 goto bail;
515 515
@@ -538,6 +538,7 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
538 return; 538 return;
539 539
540 dd = pci_get_drvdata(pdev); 540 dd = pci_get_drvdata(pdev);
541 ipath_unregister_ib_device(dd->verbs_dev);
541 ipath_layer_remove(dd); 542 ipath_layer_remove(dd);
542 ipath_diag_remove(dd); 543 ipath_diag_remove(dd);
543 ipath_user_remove(dd); 544 ipath_user_remove(dd);
@@ -978,12 +979,8 @@ reloop:
978 if (unlikely(eflags)) 979 if (unlikely(eflags))
979 ipath_rcv_hdrerr(dd, eflags, l, etail, rc); 980 ipath_rcv_hdrerr(dd, eflags, l, etail, rc);
980 else if (etype == RCVHQ_RCV_TYPE_NON_KD) { 981 else if (etype == RCVHQ_RCV_TYPE_NON_KD) {
981 int ret = __ipath_verbs_rcv(dd, rc + 1, 982 ipath_ib_rcv(dd->verbs_dev, rc + 1, ebuf,
982 ebuf, tlen); 983 tlen);
983 if (ret == -ENODEV)
984 ipath_cdbg(VERBOSE,
985 "received IB packet, "
986 "not SMA (QP=%x)\n", qp);
987 if (dd->ipath_lli_counter) 984 if (dd->ipath_lli_counter)
988 dd->ipath_lli_counter--; 985 dd->ipath_lli_counter--;
989 986
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c
index 280e732660a1..ed54f8f2945e 100644
--- a/drivers/infiniband/hw/ipath/ipath_intr.c
+++ b/drivers/infiniband/hw/ipath/ipath_intr.c
@@ -35,6 +35,7 @@
35 35
36#include "ipath_kernel.h" 36#include "ipath_kernel.h"
37#include "ipath_layer.h" 37#include "ipath_layer.h"
38#include "ipath_verbs.h"
38#include "ipath_common.h" 39#include "ipath_common.h"
39 40
40/* These are all rcv-related errors which we want to count for stats */ 41/* These are all rcv-related errors which we want to count for stats */
@@ -712,7 +713,7 @@ static void handle_layer_pioavail(struct ipath_devdata *dd)
712 if (ret > 0) 713 if (ret > 0)
713 goto set; 714 goto set;
714 715
715 ret = __ipath_verbs_piobufavail(dd); 716 ret = ipath_ib_piobufavail(dd->verbs_dev);
716 if (ret > 0) 717 if (ret > 0)
717 goto set; 718 goto set;
718 719
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index e9f374fb641e..f1931105adb3 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -132,12 +132,6 @@ struct _ipath_layer {
132 void *l_arg; 132 void *l_arg;
133}; 133};
134 134
135/* Verbs layer interface */
136struct _verbs_layer {
137 void *l_arg;
138 struct timer_list l_timer;
139};
140
141struct ipath_devdata { 135struct ipath_devdata {
142 struct list_head ipath_list; 136 struct list_head ipath_list;
143 137
@@ -198,7 +192,8 @@ struct ipath_devdata {
198 void (*ipath_f_setextled)(struct ipath_devdata *, u64, u64); 192 void (*ipath_f_setextled)(struct ipath_devdata *, u64, u64);
199 /* fill out chip-specific fields */ 193 /* fill out chip-specific fields */
200 int (*ipath_f_get_base_info)(struct ipath_portdata *, void *); 194 int (*ipath_f_get_base_info)(struct ipath_portdata *, void *);
201 struct _verbs_layer verbs_layer; 195 struct ipath_ibdev *verbs_dev;
196 struct timer_list verbs_timer;
202 /* total dwords sent (summed from counter) */ 197 /* total dwords sent (summed from counter) */
203 u64 ipath_sword; 198 u64 ipath_sword;
204 /* total dwords rcvd (summed from counter) */ 199 /* total dwords rcvd (summed from counter) */
@@ -529,8 +524,6 @@ extern int ipath_layer_intr(struct ipath_devdata *, u32);
529extern int __ipath_layer_rcv(struct ipath_devdata *, void *, 524extern int __ipath_layer_rcv(struct ipath_devdata *, void *,
530 struct sk_buff *); 525 struct sk_buff *);
531extern int __ipath_layer_rcv_lid(struct ipath_devdata *, void *); 526extern int __ipath_layer_rcv_lid(struct ipath_devdata *, void *);
532extern int __ipath_verbs_piobufavail(struct ipath_devdata *);
533extern int __ipath_verbs_rcv(struct ipath_devdata *, void *, void *, u32);
534 527
535void ipath_layer_add(struct ipath_devdata *); 528void ipath_layer_add(struct ipath_devdata *);
536void ipath_layer_remove(struct ipath_devdata *); 529void ipath_layer_remove(struct ipath_devdata *);
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.c b/drivers/infiniband/hw/ipath/ipath_layer.c
index b28c6f81c731..acc32200cc0e 100644
--- a/drivers/infiniband/hw/ipath/ipath_layer.c
+++ b/drivers/infiniband/hw/ipath/ipath_layer.c
@@ -42,26 +42,20 @@
42 42
43#include "ipath_kernel.h" 43#include "ipath_kernel.h"
44#include "ipath_layer.h" 44#include "ipath_layer.h"
45#include "ipath_verbs.h"
45#include "ipath_common.h" 46#include "ipath_common.h"
46 47
47/* Acquire before ipath_devs_lock. */ 48/* Acquire before ipath_devs_lock. */
48static DEFINE_MUTEX(ipath_layer_mutex); 49static DEFINE_MUTEX(ipath_layer_mutex);
49 50
50static int ipath_verbs_registered;
51
52u16 ipath_layer_rcv_opcode; 51u16 ipath_layer_rcv_opcode;
53 52
54static int (*layer_intr)(void *, u32); 53static int (*layer_intr)(void *, u32);
55static int (*layer_rcv)(void *, void *, struct sk_buff *); 54static int (*layer_rcv)(void *, void *, struct sk_buff *);
56static int (*layer_rcv_lid)(void *, void *); 55static int (*layer_rcv_lid)(void *, void *);
57static int (*verbs_piobufavail)(void *);
58static void (*verbs_rcv)(void *, void *, void *, u32);
59 56
60static void *(*layer_add_one)(int, struct ipath_devdata *); 57static void *(*layer_add_one)(int, struct ipath_devdata *);
61static void (*layer_remove_one)(void *); 58static void (*layer_remove_one)(void *);
62static void *(*verbs_add_one)(int, struct ipath_devdata *);
63static void (*verbs_remove_one)(void *);
64static void (*verbs_timer_cb)(void *);
65 59
66int __ipath_layer_intr(struct ipath_devdata *dd, u32 arg) 60int __ipath_layer_intr(struct ipath_devdata *dd, u32 arg)
67{ 61{
@@ -107,29 +101,6 @@ int __ipath_layer_rcv_lid(struct ipath_devdata *dd, void *hdr)
107 return ret; 101 return ret;
108} 102}
109 103
110int __ipath_verbs_piobufavail(struct ipath_devdata *dd)
111{
112 int ret = -ENODEV;
113
114 if (dd->verbs_layer.l_arg && verbs_piobufavail)
115 ret = verbs_piobufavail(dd->verbs_layer.l_arg);
116
117 return ret;
118}
119
120int __ipath_verbs_rcv(struct ipath_devdata *dd, void *rc, void *ebuf,
121 u32 tlen)
122{
123 int ret = -ENODEV;
124
125 if (dd->verbs_layer.l_arg && verbs_rcv) {
126 verbs_rcv(dd->verbs_layer.l_arg, rc, ebuf, tlen);
127 ret = 0;
128 }
129
130 return ret;
131}
132
133int ipath_layer_set_linkstate(struct ipath_devdata *dd, u8 newstate) 104int ipath_layer_set_linkstate(struct ipath_devdata *dd, u8 newstate)
134{ 105{
135 u32 lstate; 106 u32 lstate;
@@ -212,8 +183,6 @@ bail:
212 return ret; 183 return ret;
213} 184}
214 185
215EXPORT_SYMBOL_GPL(ipath_layer_set_linkstate);
216
217/** 186/**
218 * ipath_layer_set_mtu - set the MTU 187 * ipath_layer_set_mtu - set the MTU
219 * @dd: the infinipath device 188 * @dd: the infinipath device
@@ -298,8 +267,6 @@ bail:
298 return ret; 267 return ret;
299} 268}
300 269
301EXPORT_SYMBOL_GPL(ipath_layer_set_mtu);
302
303int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc) 270int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc)
304{ 271{
305 dd->ipath_lid = arg; 272 dd->ipath_lid = arg;
@@ -315,8 +282,6 @@ int ipath_set_lid(struct ipath_devdata *dd, u32 arg, u8 lmc)
315 return 0; 282 return 0;
316} 283}
317 284
318EXPORT_SYMBOL_GPL(ipath_set_lid);
319
320int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid) 285int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid)
321{ 286{
322 /* XXX - need to inform anyone who cares this just happened. */ 287 /* XXX - need to inform anyone who cares this just happened. */
@@ -324,85 +289,56 @@ int ipath_layer_set_guid(struct ipath_devdata *dd, __be64 guid)
324 return 0; 289 return 0;
325} 290}
326 291
327EXPORT_SYMBOL_GPL(ipath_layer_set_guid);
328
329__be64 ipath_layer_get_guid(struct ipath_devdata *dd) 292__be64 ipath_layer_get_guid(struct ipath_devdata *dd)
330{ 293{
331 return dd->ipath_guid; 294 return dd->ipath_guid;
332} 295}
333 296
334EXPORT_SYMBOL_GPL(ipath_layer_get_guid);
335
336u32 ipath_layer_get_nguid(struct ipath_devdata *dd)
337{
338 return dd->ipath_nguid;
339}
340
341EXPORT_SYMBOL_GPL(ipath_layer_get_nguid);
342
343u32 ipath_layer_get_majrev(struct ipath_devdata *dd) 297u32 ipath_layer_get_majrev(struct ipath_devdata *dd)
344{ 298{
345 return dd->ipath_majrev; 299 return dd->ipath_majrev;
346} 300}
347 301
348EXPORT_SYMBOL_GPL(ipath_layer_get_majrev);
349
350u32 ipath_layer_get_minrev(struct ipath_devdata *dd) 302u32 ipath_layer_get_minrev(struct ipath_devdata *dd)
351{ 303{
352 return dd->ipath_minrev; 304 return dd->ipath_minrev;
353} 305}
354 306
355EXPORT_SYMBOL_GPL(ipath_layer_get_minrev);
356
357u32 ipath_layer_get_pcirev(struct ipath_devdata *dd) 307u32 ipath_layer_get_pcirev(struct ipath_devdata *dd)
358{ 308{
359 return dd->ipath_pcirev; 309 return dd->ipath_pcirev;
360} 310}
361 311
362EXPORT_SYMBOL_GPL(ipath_layer_get_pcirev);
363
364u32 ipath_layer_get_flags(struct ipath_devdata *dd) 312u32 ipath_layer_get_flags(struct ipath_devdata *dd)
365{ 313{
366 return dd->ipath_flags; 314 return dd->ipath_flags;
367} 315}
368 316
369EXPORT_SYMBOL_GPL(ipath_layer_get_flags);
370
371struct device *ipath_layer_get_device(struct ipath_devdata *dd) 317struct device *ipath_layer_get_device(struct ipath_devdata *dd)
372{ 318{
373 return &dd->pcidev->dev; 319 return &dd->pcidev->dev;
374} 320}
375 321
376EXPORT_SYMBOL_GPL(ipath_layer_get_device);
377
378u16 ipath_layer_get_deviceid(struct ipath_devdata *dd) 322u16 ipath_layer_get_deviceid(struct ipath_devdata *dd)
379{ 323{
380 return dd->ipath_deviceid; 324 return dd->ipath_deviceid;
381} 325}
382 326
383EXPORT_SYMBOL_GPL(ipath_layer_get_deviceid);
384
385u32 ipath_layer_get_vendorid(struct ipath_devdata *dd) 327u32 ipath_layer_get_vendorid(struct ipath_devdata *dd)
386{ 328{
387 return dd->ipath_vendorid; 329 return dd->ipath_vendorid;
388} 330}
389 331
390EXPORT_SYMBOL_GPL(ipath_layer_get_vendorid);
391
392u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd) 332u64 ipath_layer_get_lastibcstat(struct ipath_devdata *dd)
393{ 333{
394 return dd->ipath_lastibcstat; 334 return dd->ipath_lastibcstat;
395} 335}
396 336
397EXPORT_SYMBOL_GPL(ipath_layer_get_lastibcstat);
398
399u32 ipath_layer_get_ibmtu(struct ipath_devdata *dd) 337u32 ipath_layer_get_ibmtu(struct ipath_devdata *dd)
400{ 338{
401 return dd->ipath_ibmtu; 339 return dd->ipath_ibmtu;
402} 340}
403 341
404EXPORT_SYMBOL_GPL(ipath_layer_get_ibmtu);
405
406void ipath_layer_add(struct ipath_devdata *dd) 342void ipath_layer_add(struct ipath_devdata *dd)
407{ 343{
408 mutex_lock(&ipath_layer_mutex); 344 mutex_lock(&ipath_layer_mutex);
@@ -411,10 +347,6 @@ void ipath_layer_add(struct ipath_devdata *dd)
411 dd->ipath_layer.l_arg = 347 dd->ipath_layer.l_arg =
412 layer_add_one(dd->ipath_unit, dd); 348 layer_add_one(dd->ipath_unit, dd);
413 349
414 if (verbs_add_one)
415 dd->verbs_layer.l_arg =
416 verbs_add_one(dd->ipath_unit, dd);
417
418 mutex_unlock(&ipath_layer_mutex); 350 mutex_unlock(&ipath_layer_mutex);
419} 351}
420 352
@@ -427,11 +359,6 @@ void ipath_layer_remove(struct ipath_devdata *dd)
427 dd->ipath_layer.l_arg = NULL; 359 dd->ipath_layer.l_arg = NULL;
428 } 360 }
429 361
430 if (dd->verbs_layer.l_arg && verbs_remove_one) {
431 verbs_remove_one(dd->verbs_layer.l_arg);
432 dd->verbs_layer.l_arg = NULL;
433 }
434
435 mutex_unlock(&ipath_layer_mutex); 362 mutex_unlock(&ipath_layer_mutex);
436} 363}
437 364
@@ -521,95 +448,10 @@ static void __ipath_verbs_timer(unsigned long arg)
521 ipath_kreceive(dd); 448 ipath_kreceive(dd);
522 449
523 /* Handle verbs layer timeouts. */ 450 /* Handle verbs layer timeouts. */
524 if (dd->verbs_layer.l_arg && verbs_timer_cb) 451 ipath_ib_timer(dd->verbs_dev);
525 verbs_timer_cb(dd->verbs_layer.l_arg); 452 mod_timer(&dd->verbs_timer, jiffies + 1);
526
527 mod_timer(&dd->verbs_layer.l_timer, jiffies + 1);
528}
529
530/**
531 * ipath_verbs_register - verbs layer registration
532 * @l_piobufavail: callback for when PIO buffers become available
533 * @l_rcv: callback for receiving a packet
534 * @l_timer_cb: timer callback
535 * @ipath_devdata: device data structure is put here
536 */
537int ipath_verbs_register(void *(*l_add)(int, struct ipath_devdata *),
538 void (*l_remove)(void *arg),
539 int (*l_piobufavail) (void *arg),
540 void (*l_rcv) (void *arg, void *rhdr,
541 void *data, u32 tlen),
542 void (*l_timer_cb) (void *arg))
543{
544 struct ipath_devdata *dd, *tmp;
545 unsigned long flags;
546
547 mutex_lock(&ipath_layer_mutex);
548
549 verbs_add_one = l_add;
550 verbs_remove_one = l_remove;
551 verbs_piobufavail = l_piobufavail;
552 verbs_rcv = l_rcv;
553 verbs_timer_cb = l_timer_cb;
554
555 spin_lock_irqsave(&ipath_devs_lock, flags);
556
557 list_for_each_entry_safe(dd, tmp, &ipath_dev_list, ipath_list) {
558 if (!(dd->ipath_flags & IPATH_INITTED))
559 continue;
560
561 if (dd->verbs_layer.l_arg)
562 continue;
563
564 spin_unlock_irqrestore(&ipath_devs_lock, flags);
565 dd->verbs_layer.l_arg = l_add(dd->ipath_unit, dd);
566 spin_lock_irqsave(&ipath_devs_lock, flags);
567 }
568
569 spin_unlock_irqrestore(&ipath_devs_lock, flags);
570 mutex_unlock(&ipath_layer_mutex);
571
572 ipath_verbs_registered = 1;
573
574 return 0;
575}
576
577EXPORT_SYMBOL_GPL(ipath_verbs_register);
578
579void ipath_verbs_unregister(void)
580{
581 struct ipath_devdata *dd, *tmp;
582 unsigned long flags;
583
584 mutex_lock(&ipath_layer_mutex);
585 spin_lock_irqsave(&ipath_devs_lock, flags);
586
587 list_for_each_entry_safe(dd, tmp, &ipath_dev_list, ipath_list) {
588 *dd->ipath_statusp &= ~IPATH_STATUS_OIB_SMA;
589
590 if (dd->verbs_layer.l_arg && verbs_remove_one) {
591 spin_unlock_irqrestore(&ipath_devs_lock, flags);
592 verbs_remove_one(dd->verbs_layer.l_arg);
593 spin_lock_irqsave(&ipath_devs_lock, flags);
594 dd->verbs_layer.l_arg = NULL;
595 }
596 }
597
598 spin_unlock_irqrestore(&ipath_devs_lock, flags);
599
600 verbs_add_one = NULL;
601 verbs_remove_one = NULL;
602 verbs_piobufavail = NULL;
603 verbs_rcv = NULL;
604 verbs_timer_cb = NULL;
605
606 ipath_verbs_registered = 0;
607
608 mutex_unlock(&ipath_layer_mutex);
609} 453}
610 454
611EXPORT_SYMBOL_GPL(ipath_verbs_unregister);
612
613int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax) 455int ipath_layer_open(struct ipath_devdata *dd, u32 * pktmax)
614{ 456{
615 int ret; 457 int ret;
@@ -703,8 +545,6 @@ u32 ipath_layer_get_cr_errpkey(struct ipath_devdata *dd)
703 return ipath_read_creg32(dd, dd->ipath_cregs->cr_errpkey); 545 return ipath_read_creg32(dd, dd->ipath_cregs->cr_errpkey);
704} 546}
705 547
706EXPORT_SYMBOL_GPL(ipath_layer_get_cr_errpkey);
707
708static void update_sge(struct ipath_sge_state *ss, u32 length) 548static void update_sge(struct ipath_sge_state *ss, u32 length)
709{ 549{
710 struct ipath_sge *sge = &ss->sge; 550 struct ipath_sge *sge = &ss->sge;
@@ -981,8 +821,6 @@ bail:
981 return ret; 821 return ret;
982} 822}
983 823
984EXPORT_SYMBOL_GPL(ipath_verbs_send);
985
986int ipath_layer_snapshot_counters(struct ipath_devdata *dd, u64 *swords, 824int ipath_layer_snapshot_counters(struct ipath_devdata *dd, u64 *swords,
987 u64 *rwords, u64 *spkts, u64 *rpkts, 825 u64 *rwords, u64 *spkts, u64 *rpkts,
988 u64 *xmit_wait) 826 u64 *xmit_wait)
@@ -1007,8 +845,6 @@ bail:
1007 return ret; 845 return ret;
1008} 846}
1009 847
1010EXPORT_SYMBOL_GPL(ipath_layer_snapshot_counters);
1011
1012/** 848/**
1013 * ipath_layer_get_counters - get various chip counters 849 * ipath_layer_get_counters - get various chip counters
1014 * @dd: the infinipath device 850 * @dd: the infinipath device
@@ -1069,8 +905,6 @@ bail:
1069 return ret; 905 return ret;
1070} 906}
1071 907
1072EXPORT_SYMBOL_GPL(ipath_layer_get_counters);
1073
1074int ipath_layer_want_buffer(struct ipath_devdata *dd) 908int ipath_layer_want_buffer(struct ipath_devdata *dd)
1075{ 909{
1076 set_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl); 910 set_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl);
@@ -1080,8 +914,6 @@ int ipath_layer_want_buffer(struct ipath_devdata *dd)
1080 return 0; 914 return 0;
1081} 915}
1082 916
1083EXPORT_SYMBOL_GPL(ipath_layer_want_buffer);
1084
1085int ipath_layer_send_hdr(struct ipath_devdata *dd, struct ether_header *hdr) 917int ipath_layer_send_hdr(struct ipath_devdata *dd, struct ether_header *hdr)
1086{ 918{
1087 int ret = 0; 919 int ret = 0;
@@ -1174,30 +1006,26 @@ int ipath_layer_enable_timer(struct ipath_devdata *dd)
1174 (u64) (1 << 2)); 1006 (u64) (1 << 2));
1175 } 1007 }
1176 1008
1177 init_timer(&dd->verbs_layer.l_timer); 1009 init_timer(&dd->verbs_timer);
1178 dd->verbs_layer.l_timer.function = __ipath_verbs_timer; 1010 dd->verbs_timer.function = __ipath_verbs_timer;
1179 dd->verbs_layer.l_timer.data = (unsigned long)dd; 1011 dd->verbs_timer.data = (unsigned long)dd;
1180 dd->verbs_layer.l_timer.expires = jiffies + 1; 1012 dd->verbs_timer.expires = jiffies + 1;
1181 add_timer(&dd->verbs_layer.l_timer); 1013 add_timer(&dd->verbs_timer);
1182 1014
1183 return 0; 1015 return 0;
1184} 1016}
1185 1017
1186EXPORT_SYMBOL_GPL(ipath_layer_enable_timer);
1187
1188int ipath_layer_disable_timer(struct ipath_devdata *dd) 1018int ipath_layer_disable_timer(struct ipath_devdata *dd)
1189{ 1019{
1190 /* Disable GPIO bit 2 interrupt */ 1020 /* Disable GPIO bit 2 interrupt */
1191 if (dd->ipath_flags & IPATH_GPIO_INTR) 1021 if (dd->ipath_flags & IPATH_GPIO_INTR)
1192 ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_mask, 0); 1022 ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_mask, 0);
1193 1023
1194 del_timer_sync(&dd->verbs_layer.l_timer); 1024 del_timer_sync(&dd->verbs_timer);
1195 1025
1196 return 0; 1026 return 0;
1197} 1027}
1198 1028
1199EXPORT_SYMBOL_GPL(ipath_layer_disable_timer);
1200
1201/** 1029/**
1202 * ipath_layer_set_verbs_flags - set the verbs layer flags 1030 * ipath_layer_set_verbs_flags - set the verbs layer flags
1203 * @dd: the infinipath device 1031 * @dd: the infinipath device
@@ -1225,8 +1053,6 @@ int ipath_layer_set_verbs_flags(struct ipath_devdata *dd, unsigned flags)
1225 return 0; 1053 return 0;
1226} 1054}
1227 1055
1228EXPORT_SYMBOL_GPL(ipath_layer_set_verbs_flags);
1229
1230/** 1056/**
1231 * ipath_layer_get_npkeys - return the size of the PKEY table for port 0 1057 * ipath_layer_get_npkeys - return the size of the PKEY table for port 0
1232 * @dd: the infinipath device 1058 * @dd: the infinipath device
@@ -1236,8 +1062,6 @@ unsigned ipath_layer_get_npkeys(struct ipath_devdata *dd)
1236 return ARRAY_SIZE(dd->ipath_pd[0]->port_pkeys); 1062 return ARRAY_SIZE(dd->ipath_pd[0]->port_pkeys);
1237} 1063}
1238 1064
1239EXPORT_SYMBOL_GPL(ipath_layer_get_npkeys);
1240
1241/** 1065/**
1242 * ipath_layer_get_pkey - return the indexed PKEY from the port 0 PKEY table 1066 * ipath_layer_get_pkey - return the indexed PKEY from the port 0 PKEY table
1243 * @dd: the infinipath device 1067 * @dd: the infinipath device
@@ -1255,8 +1079,6 @@ unsigned ipath_layer_get_pkey(struct ipath_devdata *dd, unsigned index)
1255 return ret; 1079 return ret;
1256} 1080}
1257 1081
1258EXPORT_SYMBOL_GPL(ipath_layer_get_pkey);
1259
1260/** 1082/**
1261 * ipath_layer_get_pkeys - return the PKEY table for port 0 1083 * ipath_layer_get_pkeys - return the PKEY table for port 0
1262 * @dd: the infinipath device 1084 * @dd: the infinipath device
@@ -1271,8 +1093,6 @@ int ipath_layer_get_pkeys(struct ipath_devdata *dd, u16 * pkeys)
1271 return 0; 1093 return 0;
1272} 1094}
1273 1095
1274EXPORT_SYMBOL_GPL(ipath_layer_get_pkeys);
1275
1276/** 1096/**
1277 * rm_pkey - decrecment the reference count for the given PKEY 1097 * rm_pkey - decrecment the reference count for the given PKEY
1278 * @dd: the infinipath device 1098 * @dd: the infinipath device
@@ -1419,8 +1239,6 @@ int ipath_layer_set_pkeys(struct ipath_devdata *dd, u16 * pkeys)
1419 return 0; 1239 return 0;
1420} 1240}
1421 1241
1422EXPORT_SYMBOL_GPL(ipath_layer_set_pkeys);
1423
1424/** 1242/**
1425 * ipath_layer_get_linkdowndefaultstate - get the default linkdown state 1243 * ipath_layer_get_linkdowndefaultstate - get the default linkdown state
1426 * @dd: the infinipath device 1244 * @dd: the infinipath device
@@ -1432,8 +1250,6 @@ int ipath_layer_get_linkdowndefaultstate(struct ipath_devdata *dd)
1432 return !!(dd->ipath_ibcctrl & INFINIPATH_IBCC_LINKDOWNDEFAULTSTATE); 1250 return !!(dd->ipath_ibcctrl & INFINIPATH_IBCC_LINKDOWNDEFAULTSTATE);
1433} 1251}
1434 1252
1435EXPORT_SYMBOL_GPL(ipath_layer_get_linkdowndefaultstate);
1436
1437/** 1253/**
1438 * ipath_layer_set_linkdowndefaultstate - set the default linkdown state 1254 * ipath_layer_set_linkdowndefaultstate - set the default linkdown state
1439 * @dd: the infinipath device 1255 * @dd: the infinipath device
@@ -1453,8 +1269,6 @@ int ipath_layer_set_linkdowndefaultstate(struct ipath_devdata *dd,
1453 return 0; 1269 return 0;
1454} 1270}
1455 1271
1456EXPORT_SYMBOL_GPL(ipath_layer_set_linkdowndefaultstate);
1457
1458int ipath_layer_get_phyerrthreshold(struct ipath_devdata *dd) 1272int ipath_layer_get_phyerrthreshold(struct ipath_devdata *dd)
1459{ 1273{
1460 return (dd->ipath_ibcctrl >> 1274 return (dd->ipath_ibcctrl >>
@@ -1462,8 +1276,6 @@ int ipath_layer_get_phyerrthreshold(struct ipath_devdata *dd)
1462 INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK; 1276 INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK;
1463} 1277}
1464 1278
1465EXPORT_SYMBOL_GPL(ipath_layer_get_phyerrthreshold);
1466
1467/** 1279/**
1468 * ipath_layer_set_phyerrthreshold - set the physical error threshold 1280 * ipath_layer_set_phyerrthreshold - set the physical error threshold
1469 * @dd: the infinipath device 1281 * @dd: the infinipath device
@@ -1489,8 +1301,6 @@ int ipath_layer_set_phyerrthreshold(struct ipath_devdata *dd, unsigned n)
1489 return 0; 1301 return 0;
1490} 1302}
1491 1303
1492EXPORT_SYMBOL_GPL(ipath_layer_set_phyerrthreshold);
1493
1494int ipath_layer_get_overrunthreshold(struct ipath_devdata *dd) 1304int ipath_layer_get_overrunthreshold(struct ipath_devdata *dd)
1495{ 1305{
1496 return (dd->ipath_ibcctrl >> 1306 return (dd->ipath_ibcctrl >>
@@ -1498,8 +1308,6 @@ int ipath_layer_get_overrunthreshold(struct ipath_devdata *dd)
1498 INFINIPATH_IBCC_OVERRUNTHRESHOLD_MASK; 1308 INFINIPATH_IBCC_OVERRUNTHRESHOLD_MASK;
1499} 1309}
1500 1310
1501EXPORT_SYMBOL_GPL(ipath_layer_get_overrunthreshold);
1502
1503/** 1311/**
1504 * ipath_layer_set_overrunthreshold - set the overrun threshold 1312 * ipath_layer_set_overrunthreshold - set the overrun threshold
1505 * @dd: the infinipath device 1313 * @dd: the infinipath device
@@ -1525,17 +1333,13 @@ int ipath_layer_set_overrunthreshold(struct ipath_devdata *dd, unsigned n)
1525 return 0; 1333 return 0;
1526} 1334}
1527 1335
1528EXPORT_SYMBOL_GPL(ipath_layer_set_overrunthreshold);
1529
1530int ipath_layer_get_boardname(struct ipath_devdata *dd, char *name, 1336int ipath_layer_get_boardname(struct ipath_devdata *dd, char *name,
1531 size_t namelen) 1337 size_t namelen)
1532{ 1338{
1533 return dd->ipath_f_get_boardname(dd, name, namelen); 1339 return dd->ipath_f_get_boardname(dd, name, namelen);
1534} 1340}
1535EXPORT_SYMBOL_GPL(ipath_layer_get_boardname);
1536 1341
1537u32 ipath_layer_get_rcvhdrentsize(struct ipath_devdata *dd) 1342u32 ipath_layer_get_rcvhdrentsize(struct ipath_devdata *dd)
1538{ 1343{
1539 return dd->ipath_rcvhdrentsize; 1344 return dd->ipath_rcvhdrentsize;
1540} 1345}
1541EXPORT_SYMBOL_GPL(ipath_layer_get_rcvhdrentsize);
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.h b/drivers/infiniband/hw/ipath/ipath_layer.h
index 71485096fcac..57c990a5715f 100644
--- a/drivers/infiniband/hw/ipath/ipath_layer.h
+++ b/drivers/infiniband/hw/ipath/ipath_layer.h
@@ -114,14 +114,7 @@ int ipath_layer_register(void *(*l_add)(int, struct ipath_devdata *),
114 struct sk_buff *), 114 struct sk_buff *),
115 u16 rcv_opcode, 115 u16 rcv_opcode,
116 int (*l_rcv_lid)(void *, void *)); 116 int (*l_rcv_lid)(void *, void *));
117int ipath_verbs_register(void *(*l_add)(int, struct ipath_devdata *),
118 void (*l_remove)(void *arg),
119 int (*l_piobufavail)(void *arg),
120 void (*l_rcv)(void *arg, void *rhdr,
121 void *data, u32 tlen),
122 void (*l_timer_cb)(void *arg));
123void ipath_layer_unregister(void); 117void ipath_layer_unregister(void);
124void ipath_verbs_unregister(void);
125int ipath_layer_open(struct ipath_devdata *, u32 * pktmax); 118int ipath_layer_open(struct ipath_devdata *, u32 * pktmax);
126u16 ipath_layer_get_lid(struct ipath_devdata *dd); 119u16 ipath_layer_get_lid(struct ipath_devdata *dd);
127int ipath_layer_get_mac(struct ipath_devdata *dd, u8 *); 120int ipath_layer_get_mac(struct ipath_devdata *dd, u8 *);
@@ -145,7 +138,6 @@ int ipath_layer_get_counters(struct ipath_devdata *dd,
145int ipath_layer_want_buffer(struct ipath_devdata *dd); 138int ipath_layer_want_buffer(struct ipath_devdata *dd);
146int ipath_layer_set_guid(struct ipath_devdata *, __be64 guid); 139int ipath_layer_set_guid(struct ipath_devdata *, __be64 guid);
147__be64 ipath_layer_get_guid(struct ipath_devdata *); 140__be64 ipath_layer_get_guid(struct ipath_devdata *);
148u32 ipath_layer_get_nguid(struct ipath_devdata *);
149u32 ipath_layer_get_majrev(struct ipath_devdata *); 141u32 ipath_layer_get_majrev(struct ipath_devdata *);
150u32 ipath_layer_get_minrev(struct ipath_devdata *); 142u32 ipath_layer_get_minrev(struct ipath_devdata *);
151u32 ipath_layer_get_pcirev(struct ipath_devdata *); 143u32 ipath_layer_get_pcirev(struct ipath_devdata *);
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index 5b8ee65c6cd3..15edec9227e4 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -368,7 +368,7 @@ static void ipath_qp_rcv(struct ipath_ibdev *dev,
368} 368}
369 369
370/** 370/**
371 * ipath_ib_rcv - process and incoming packet 371 * ipath_ib_rcv - process an incoming packet
372 * @arg: the device pointer 372 * @arg: the device pointer
373 * @rhdr: the header of the packet 373 * @rhdr: the header of the packet
374 * @data: the packet data 374 * @data: the packet data
@@ -377,9 +377,9 @@ static void ipath_qp_rcv(struct ipath_ibdev *dev,
377 * This is called from ipath_kreceive() to process an incoming packet at 377 * This is called from ipath_kreceive() to process an incoming packet at
378 * interrupt level. Tlen is the length of the header + data + CRC in bytes. 378 * interrupt level. Tlen is the length of the header + data + CRC in bytes.
379 */ 379 */
380static void ipath_ib_rcv(void *arg, void *rhdr, void *data, u32 tlen) 380void ipath_ib_rcv(struct ipath_ibdev *dev, void *rhdr, void *data,
381 u32 tlen)
381{ 382{
382 struct ipath_ibdev *dev = (struct ipath_ibdev *) arg;
383 struct ipath_ib_header *hdr = rhdr; 383 struct ipath_ib_header *hdr = rhdr;
384 struct ipath_other_headers *ohdr; 384 struct ipath_other_headers *ohdr;
385 struct ipath_qp *qp; 385 struct ipath_qp *qp;
@@ -468,9 +468,8 @@ bail:;
468 * This is called from ipath_do_rcv_timer() at interrupt level to check for 468 * This is called from ipath_do_rcv_timer() at interrupt level to check for
469 * QPs which need retransmits and to collect performance numbers. 469 * QPs which need retransmits and to collect performance numbers.
470 */ 470 */
471static void ipath_ib_timer(void *arg) 471void ipath_ib_timer(struct ipath_ibdev *dev)
472{ 472{
473 struct ipath_ibdev *dev = (struct ipath_ibdev *) arg;
474 struct ipath_qp *resend = NULL; 473 struct ipath_qp *resend = NULL;
475 struct list_head *last; 474 struct list_head *last;
476 struct ipath_qp *qp; 475 struct ipath_qp *qp;
@@ -564,9 +563,8 @@ static void ipath_ib_timer(void *arg)
564 * QPs waiting for buffers (for now, just do a tasklet_hi_schedule and 563 * QPs waiting for buffers (for now, just do a tasklet_hi_schedule and
565 * return zero). 564 * return zero).
566 */ 565 */
567static int ipath_ib_piobufavail(void *arg) 566int ipath_ib_piobufavail(struct ipath_ibdev *dev)
568{ 567{
569 struct ipath_ibdev *dev = (struct ipath_ibdev *) arg;
570 struct ipath_qp *qp; 568 struct ipath_qp *qp;
571 unsigned long flags; 569 unsigned long flags;
572 570
@@ -957,11 +955,10 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev);
957 955
958/** 956/**
959 * ipath_register_ib_device - register our device with the infiniband core 957 * ipath_register_ib_device - register our device with the infiniband core
960 * @unit: the device number to register
961 * @dd: the device data structure 958 * @dd: the device data structure
962 * Return the allocated ipath_ibdev pointer or NULL on error. 959 * Return the allocated ipath_ibdev pointer or NULL on error.
963 */ 960 */
964static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd) 961int ipath_register_ib_device(struct ipath_devdata *dd)
965{ 962{
966 struct ipath_layer_counters cntrs; 963 struct ipath_layer_counters cntrs;
967 struct ipath_ibdev *idev; 964 struct ipath_ibdev *idev;
@@ -969,8 +966,10 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd)
969 int ret; 966 int ret;
970 967
971 idev = (struct ipath_ibdev *)ib_alloc_device(sizeof *idev); 968 idev = (struct ipath_ibdev *)ib_alloc_device(sizeof *idev);
972 if (idev == NULL) 969 if (idev == NULL) {
970 ret = -ENOMEM;
973 goto bail; 971 goto bail;
972 }
974 973
975 dev = &idev->ibdev; 974 dev = &idev->ibdev;
976 975
@@ -1047,7 +1046,7 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd)
1047 if (!sys_image_guid) 1046 if (!sys_image_guid)
1048 sys_image_guid = ipath_layer_get_guid(dd); 1047 sys_image_guid = ipath_layer_get_guid(dd);
1049 idev->sys_image_guid = sys_image_guid; 1048 idev->sys_image_guid = sys_image_guid;
1050 idev->ib_unit = unit; 1049 idev->ib_unit = dd->ipath_unit;
1051 idev->dd = dd; 1050 idev->dd = dd;
1052 1051
1053 strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX); 1052 strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX);
@@ -1153,16 +1152,16 @@ err_lk:
1153err_qp: 1152err_qp:
1154 ib_dealloc_device(dev); 1153 ib_dealloc_device(dev);
1155 _VERBS_ERROR("ib_ipath%d cannot register verbs (%d)!\n", 1154 _VERBS_ERROR("ib_ipath%d cannot register verbs (%d)!\n",
1156 unit, -ret); 1155 dd->ipath_unit, -ret);
1157 idev = NULL; 1156 idev = NULL;
1158 1157
1159bail: 1158bail:
1160 return idev; 1159 dd->verbs_dev = idev;
1160 return ret;
1161} 1161}
1162 1162
1163static void ipath_unregister_ib_device(void *arg) 1163void ipath_unregister_ib_device(struct ipath_ibdev *dev)
1164{ 1164{
1165 struct ipath_ibdev *dev = (struct ipath_ibdev *) arg;
1166 struct ib_device *ibdev = &dev->ibdev; 1165 struct ib_device *ibdev = &dev->ibdev;
1167 1166
1168 ipath_layer_disable_timer(dev->dd); 1167 ipath_layer_disable_timer(dev->dd);
@@ -1193,19 +1192,6 @@ static void ipath_unregister_ib_device(void *arg)
1193 ib_dealloc_device(ibdev); 1192 ib_dealloc_device(ibdev);
1194} 1193}
1195 1194
1196static int __init ipath_verbs_init(void)
1197{
1198 return ipath_verbs_register(ipath_register_ib_device,
1199 ipath_unregister_ib_device,
1200 ipath_ib_piobufavail, ipath_ib_rcv,
1201 ipath_ib_timer);
1202}
1203
1204static void __exit ipath_verbs_cleanup(void)
1205{
1206 ipath_verbs_unregister();
1207}
1208
1209static ssize_t show_rev(struct class_device *cdev, char *buf) 1195static ssize_t show_rev(struct class_device *cdev, char *buf)
1210{ 1196{
1211 struct ipath_ibdev *dev = 1197 struct ipath_ibdev *dev =
@@ -1297,6 +1283,3 @@ static int ipath_verbs_register_sysfs(struct ib_device *dev)
1297bail: 1283bail:
1298 return ret; 1284 return ret;
1299} 1285}
1300
1301module_init(ipath_verbs_init);
1302module_exit(ipath_verbs_cleanup);
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.h b/drivers/infiniband/hw/ipath/ipath_verbs.h
index a9baa9101432..d6faa4ba6067 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.h
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.h
@@ -711,6 +711,16 @@ int ipath_make_rc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
711int ipath_make_uc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr, 711int ipath_make_uc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
712 u32 pmtu, u32 *bth0p, u32 *bth2p); 712 u32 pmtu, u32 *bth0p, u32 *bth2p);
713 713
714int ipath_register_ib_device(struct ipath_devdata *);
715
716void ipath_unregister_ib_device(struct ipath_ibdev *);
717
718void ipath_ib_rcv(struct ipath_ibdev *, void *, void *, u32);
719
720int ipath_ib_piobufavail(struct ipath_ibdev *);
721
722void ipath_ib_timer(struct ipath_ibdev *);
723
714extern const enum ib_wc_opcode ib_ipath_wc_opcode[]; 724extern const enum ib_wc_opcode ib_ipath_wc_opcode[];
715 725
716extern const u8 ipath_cvt_physportstate[]; 726extern const u8 ipath_cvt_physportstate[];