mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: Add init_dummy_netdev() and fix EMAC driver using it
This adds an init_dummy_netdev() function that gets a network device structure (allocation and lifetime entirely under caller's control) and initialize the minimum amount of fields so it can be used to schedule NAPI polls without registering a full blown interface. This is to be used by drivers that need to tie several hardware interfaces to a single NAPI poll scheduler due to HW limitations. It also updates the ibm_newemac driver to use that, this fixing the oops on 2.6.29 due to passing NULL as "dev" to netif_napi_add() Symbol is exported GPL only a I don't think we want binary drivers doing that sort of acrobatics (if we want them at all). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2950e95292
commit
937f1ba56b
4 changed files with 47 additions and 1 deletions
|
@ -795,6 +795,7 @@ struct net_device
|
|||
NETREG_UNREGISTERING, /* called unregister_netdevice */
|
||||
NETREG_UNREGISTERED, /* completed unregister todo */
|
||||
NETREG_RELEASED, /* called free_netdev */
|
||||
NETREG_DUMMY, /* dummy device for NAPI poll */
|
||||
} reg_state;
|
||||
|
||||
/* Called from unregister, can be used to call free_netdev */
|
||||
|
@ -1077,6 +1078,8 @@ extern void free_netdev(struct net_device *dev);
|
|||
extern void synchronize_net(void);
|
||||
extern int register_netdevice_notifier(struct notifier_block *nb);
|
||||
extern int unregister_netdevice_notifier(struct notifier_block *nb);
|
||||
extern int init_dummy_netdev(struct net_device *dev);
|
||||
|
||||
extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
|
||||
extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
|
||||
extern struct net_device *__dev_get_by_index(struct net *net, int ifindex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue