On Thu, Nov 10, 2005 at 10:21:26PM +0800, Tony wrote:I have a radio connected to host using ethernet. I'm writing a radio driver that masquerade radio as a NIC. when the module is loaded, I just register_netdev a net_device struct, while unregister_netdev at module cleanup.
But when the module is used by a net_device(interface is up), rmmod also works. Strange, isn't it?
Not strange at all. The typical network driver is implemented using
pci_register_driver which will set the owner filed of the driver's struct
driver which then is being used for internal reference counting. Other
busses or line disciplines (SLIP, PPP, AX.25 ...) need to do the equivalent
or the kernel will believe reference counting isn't necessary and it's
ok to unload the module at any time.
In which driver did you hit this problem?
Ralf