]> git.neil.brown.name Git - history.git/commitdiff
[NET]: free_netdev - update documentation
authorStephen Hemminger <shemminger@osdl.org>
Tue, 19 Aug 2003 13:52:34 +0000 (06:52 -0700)
committerStephen Hemminger <shemminger@osdl.org>
Tue, 19 Aug 2003 13:52:34 +0000 (06:52 -0700)
Documentation/networking/netdevices.txt

index 0723093cf896a7311fc93ad21e1b743160116fa1..8c456edb6aadef6615e27df83d594b6efad6d85e 100644 (file)
@@ -7,6 +7,18 @@ Introduction
 The following is a random collection of documentation regarding
 network devices.
 
+struct net_device allocation rules
+==================================
+Network device structures need to persist even after module is unloaded and
+must be allocated with kmalloc.  If device has registered successfully,
+it will be freed on last use by free_netdev.  This is required to handle the
+pathologic case cleanly (example: rmmod mydriver </sys/class/net/myeth/mtu )
+
+There are routines in net_init.c to handle the common cases of
+alloc_etherdev, alloc_netdev.  These reserve extra space for driver
+private data which gets freed when the network device is freed. If
+separately allocated data is attached to the network device
+(dev->priv) then it is up to the module exit handler to free that.
 
 
 struct net_device synchronization rules