* [PATCH 1/2] net: introduce NETDEV_PRE_INIT notifier
@ 2009-09-27 18:26 Johannes Berg
2009-09-27 20:11 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2009-09-27 18:26 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless
For various purposes including a wireless extensions
bugfix, we need to hook into the netdev creation at
a point before netdev_register_kobject(). It seems
more generic, however, to have it even earlier. This
will also ease doing the dev type assignment that
Marcel was working on generically.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/linux/notifier.h | 1 +
net/core/dev.c | 5 +++++
2 files changed, 6 insertions(+)
--- wireless-testing.orig/include/linux/notifier.h 2009-09-27 15:09:10.000000000 +0200
+++ wireless-testing/include/linux/notifier.h 2009-09-27 15:10:19.000000000 +0200
@@ -199,6 +199,7 @@ static inline int notifier_to_errno(int
#define NETDEV_FEAT_CHANGE 0x000B
#define NETDEV_BONDING_FAILOVER 0x000C
#define NETDEV_PRE_UP 0x000D
+#define NETDEV_PRE_INIT 0x000E
#define SYS_DOWN 0x0001 /* Notify of system down */
#define SYS_RESTART SYS_DOWN
--- wireless-testing.orig/net/core/dev.c 2009-09-27 15:09:56.000000000 +0200
+++ wireless-testing/net/core/dev.c 2009-09-27 15:11:40.000000000 +0200
@@ -4734,6 +4734,11 @@ int register_netdevice(struct net_device
dev->iflink = -1;
+ ret = call_netdevice_notifiers(NETDEV_PRE_INIT, dev);
+ ret = notifier_to_errno(ret);
+ if (ret)
+ goto out;
+
/* Init, if this function is available */
if (dev->netdev_ops->ndo_init) {
ret = dev->netdev_ops->ndo_init(dev);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] net: introduce NETDEV_PRE_INIT notifier
2009-09-27 18:26 [PATCH 1/2] net: introduce NETDEV_PRE_INIT notifier Johannes Berg
@ 2009-09-27 20:11 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2009-09-27 20:11 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev, linux-wireless
Hi Johannes,
> For various purposes including a wireless extensions
> bugfix, we need to hook into the netdev creation at
> a point before netdev_register_kobject(). It seems
> more generic, however, to have it even earlier. This
> will also ease doing the dev type assignment that
> Marcel was working on generically.
you are beating me to it. I can only second that this is a good idea for
the dev type assignment. Once Dave acks this I can sent a rebased patch
for the dev type stuff for WiFi.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-27 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-27 18:26 [PATCH 1/2] net: introduce NETDEV_PRE_INIT notifier Johannes Berg
2009-09-27 20:11 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).