diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-15 00:05:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-15 00:05:05 -0500 |
commit | 937f1ba56b4be37d9e2ad77412f95048662058d2 (patch) | |
tree | 154e0c5ce11b5afe25816d667c76b19ac679d530 /include/linux/netdevice.h | |
parent | 2950e952920811be465ec95c6b56f03dc66a05c0 (diff) |
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>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4647604c7ca9..ec54785d34f9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -795,6 +795,7 @@ struct net_device | |||
795 | NETREG_UNREGISTERING, /* called unregister_netdevice */ | 795 | NETREG_UNREGISTERING, /* called unregister_netdevice */ |
796 | NETREG_UNREGISTERED, /* completed unregister todo */ | 796 | NETREG_UNREGISTERED, /* completed unregister todo */ |
797 | NETREG_RELEASED, /* called free_netdev */ | 797 | NETREG_RELEASED, /* called free_netdev */ |
798 | NETREG_DUMMY, /* dummy device for NAPI poll */ | ||
798 | } reg_state; | 799 | } reg_state; |
799 | 800 | ||
800 | /* Called from unregister, can be used to call free_netdev */ | 801 | /* Called from unregister, can be used to call free_netdev */ |
@@ -1077,6 +1078,8 @@ extern void free_netdev(struct net_device *dev); | |||
1077 | extern void synchronize_net(void); | 1078 | extern void synchronize_net(void); |
1078 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1079 | extern int register_netdevice_notifier(struct notifier_block *nb); |
1079 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | 1080 | extern int unregister_netdevice_notifier(struct notifier_block *nb); |
1081 | extern int init_dummy_netdev(struct net_device *dev); | ||
1082 | |||
1080 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1083 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1081 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1084 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1082 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1085 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |