Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302630
b: refs/heads/master
c: 3495566
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed May 8, 2012
1 parent 93b89c1 commit b282ef6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d19081e044356ae6464e939aef04514c5e227b5a
refs/heads/master: 349556692df946b9cd5b84f2b0fa09b98732e986
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/ocrdma/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config INFINIBAND_OCRDMA
tristate "Emulex One Connect HCA support"
depends on ETHERNET && NETDEVICES && PCI
depends on ETHERNET && NETDEVICES && PCI && (IPV6 || IPV6=n)
select NET_VENDOR_EMULEX
select BE2NET
---help---
Expand Down
29 changes: 21 additions & 8 deletions trunk/drivers/infiniband/hw/ocrdma/ocrdma_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ static DEFINE_SPINLOCK(ocrdma_devlist_lock);
static DEFINE_IDR(ocrdma_dev_id);

static union ib_gid ocrdma_zero_sgid;
static int ocrdma_inet6addr_event(struct notifier_block *,
unsigned long, void *);

static struct notifier_block ocrdma_inet6addr_notifier = {
.notifier_call = ocrdma_inet6addr_event
};

static int ocrdma_get_instance(void)
{
Expand Down Expand Up @@ -204,6 +198,8 @@ static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev)
return 0;
}

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)

static int ocrdma_inet6addr_event(struct notifier_block *notifier,
unsigned long event, void *ptr)
{
Expand Down Expand Up @@ -259,6 +255,12 @@ static int ocrdma_inet6addr_event(struct notifier_block *notifier,
return NOTIFY_OK;
}

static struct notifier_block ocrdma_inet6addr_notifier = {
.notifier_call = ocrdma_inet6addr_event
};

#endif /* IPV6 */

static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device,
u8 port_num)
{
Expand Down Expand Up @@ -541,23 +543,34 @@ static struct ocrdma_driver ocrdma_drv = {
.state_change_handler = ocrdma_event_handler,
};

static void ocrdma_unregister_inet6addr_notifier(void)
{
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier);
#endif
}

static int __init ocrdma_init_module(void)
{
int status;

#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier);
if (status)
return status;
#endif

status = be_roce_register_driver(&ocrdma_drv);
if (status)
unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier);
ocrdma_unregister_inet6addr_notifier();

return status;
}

static void __exit ocrdma_exit_module(void)
{
be_roce_unregister_driver(&ocrdma_drv);
unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier);
ocrdma_unregister_inet6addr_notifier();
}

module_init(ocrdma_init_module);
Expand Down

0 comments on commit b282ef6

Please sign in to comment.