Linux.com | The source for Linux information
Published on Linux.com | The source for Linux information (https://www.linux.com)

Home > Issue with unregister & registering same netdev without doing free netdev

4 posts / 0 new
Log in [1] or register [2] to post comments
Last post [3]
November 16, 2011
#1 [4]
manoj.bm8 [5]
Issue with unregister & registering same netdev without doing free netdev

Hi Guys,
I have some requirement in driver in which do below operation but facing some bug_on from kernel
-> Depending on application input i have to unregister & register the same netdev without freeing
I am facing the bug_on from kernel during registration as below
BUG_ON(dev->reg_state != NETREG_UNINITIALIZED);

-> If we forcefully reset the state in our driver, then this works fine but kernel warns already registered device & some thing seriously wrong here

Then i have tried to initialize the device after unregistration by calling ether_setup & then again registering BUT same bug_on appeared.

My requirement is quiet simple,
-> Whenever user application want to "delete the netdev interface" then i have to make the interface disappeared for ifconfig/iwconfig, so that user can't play with that
-> Whenever user application want to "Add the netdev interface" then i have to make the interface appearing for ifconfig/iwconfig, so that user can use those

The problem is i don't want to call Alloc_netdev/free_netdev based on application input (dynamically creating/destroying), i just want to register/unregister statically created interfaces accordingly.

If you guys have any idea on this then please reply. Thanks in advance

Thanks,
Manoj

Top

Source URL: https://www.linux.com/forums/networking/issue-unregister-registering-same-netdev-without-doing-free-netdev

Links:
[1] https://www.linux.com/user/login?destination=node/7449%23comment-form
[2] https://www.linux.com/user/register?destination=node/7449%23comment-form
[3] https://www.linux.com/forums/networking/issue-unregister-registering-same-netdev-without-doing-free-netdev#comment-11049
[4] https://www.linux.com/forums/networking/issue-unregister-registering-same-netdev-without-doing-free-netdev
[5] https://www.linux.com/users/manojbm8