1 /* This program is free software; you can redistribute it and/or modify
2 * it under the terms of the GNU General Public License version 2
3 * as published by the Free Software Foundation.
5 * This program is distributed in the hope that it will be useful,
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8 * GNU General Public License for more details.
11 * (C) 2015 Pengutronix, Alexander Aring <aar@pengutronix.de>
14 #include <linux/module.h>
16 #include <net/6lowpan.h>
18 #include "6lowpan_i.h"
20 int lowpan_register_netdevice(struct net_device
*dev
,
21 enum lowpan_lltypes lltype
)
25 dev
->addr_len
= EUI64_ADDR_LEN
;
26 dev
->type
= ARPHRD_6LOWPAN
;
27 dev
->mtu
= IPV6_MIN_MTU
;
28 dev
->priv_flags
|= IFF_NO_QUEUE
;
30 lowpan_priv(dev
)->lltype
= lltype
;
32 ret
= register_netdevice(dev
);
36 ret
= lowpan_dev_debugfs_init(dev
);
38 unregister_netdevice(dev
);
42 EXPORT_SYMBOL(lowpan_register_netdevice
);
44 int lowpan_register_netdev(struct net_device
*dev
,
45 enum lowpan_lltypes lltype
)
50 ret
= lowpan_register_netdevice(dev
, lltype
);
54 EXPORT_SYMBOL(lowpan_register_netdev
);
56 void lowpan_unregister_netdevice(struct net_device
*dev
)
58 unregister_netdevice(dev
);
59 lowpan_dev_debugfs_exit(dev
);
61 EXPORT_SYMBOL(lowpan_unregister_netdevice
);
63 void lowpan_unregister_netdev(struct net_device
*dev
)
66 lowpan_unregister_netdevice(dev
);
69 EXPORT_SYMBOL(lowpan_unregister_netdev
);
71 static int __init
lowpan_module_init(void)
75 ret
= lowpan_debugfs_init();
79 request_module_nowait("ipv6");
81 request_module_nowait("nhc_dest");
82 request_module_nowait("nhc_fragment");
83 request_module_nowait("nhc_hop");
84 request_module_nowait("nhc_ipv6");
85 request_module_nowait("nhc_mobility");
86 request_module_nowait("nhc_routing");
87 request_module_nowait("nhc_udp");
92 static void __exit
lowpan_module_exit(void)
94 lowpan_debugfs_exit();
97 module_init(lowpan_module_init
);
98 module_exit(lowpan_module_exit
);
100 MODULE_LICENSE("GPL");