mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
6lowpan: add lowpan dev register helpers
This patch introduces register and unregister functionality for lowpan interfaces. While register a lowpan interface there are several things which need to be initialize by the 6lowpan subsystem. Upcoming functionality need to register/unregister per interface components e.g. debugfs entry. Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
43f26e17d0
commit
00f5931411
4 changed files with 42 additions and 12 deletions
|
@ -15,7 +15,8 @@
|
|||
|
||||
#include <net/6lowpan.h>
|
||||
|
||||
void lowpan_netdev_setup(struct net_device *dev, enum lowpan_lltypes lltype)
|
||||
int lowpan_register_netdevice(struct net_device *dev,
|
||||
enum lowpan_lltypes lltype)
|
||||
{
|
||||
dev->addr_len = EUI64_ADDR_LEN;
|
||||
dev->type = ARPHRD_6LOWPAN;
|
||||
|
@ -23,8 +24,36 @@ void lowpan_netdev_setup(struct net_device *dev, enum lowpan_lltypes lltype)
|
|||
dev->priv_flags |= IFF_NO_QUEUE;
|
||||
|
||||
lowpan_priv(dev)->lltype = lltype;
|
||||
|
||||
return register_netdevice(dev);
|
||||
}
|
||||
EXPORT_SYMBOL(lowpan_netdev_setup);
|
||||
EXPORT_SYMBOL(lowpan_register_netdevice);
|
||||
|
||||
int lowpan_register_netdev(struct net_device *dev,
|
||||
enum lowpan_lltypes lltype)
|
||||
{
|
||||
int ret;
|
||||
|
||||
rtnl_lock();
|
||||
ret = lowpan_register_netdevice(dev, lltype);
|
||||
rtnl_unlock();
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(lowpan_register_netdev);
|
||||
|
||||
void lowpan_unregister_netdevice(struct net_device *dev)
|
||||
{
|
||||
unregister_netdevice(dev);
|
||||
}
|
||||
EXPORT_SYMBOL(lowpan_unregister_netdevice);
|
||||
|
||||
void lowpan_unregister_netdev(struct net_device *dev)
|
||||
{
|
||||
rtnl_lock();
|
||||
lowpan_unregister_netdevice(dev);
|
||||
rtnl_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL(lowpan_unregister_netdev);
|
||||
|
||||
static int __init lowpan_module_init(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue