* [PATCH 1/2] net: introduce NETDEV_POST_INIT notifier
@ 2009-09-28 8:21 Johannes Berg
[not found] ` <1254126089.6583.18.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2009-09-28 8:21 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Hugh Dickins
For various purposes including a wireless extensions
bugfix, we need to hook into the netdev creation before
before netdev_register_kobject(). This will also ease
doing the dev type assignment that Marcel was working
on for cfg80211 drivers w/o touching them all.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
I decided that it doesn't make a lot of sense to be after ndo_init but
before the other name/... checks.
include/linux/notifier.h | 1 +
net/core/dev.c | 5 +++++
2 files changed, 6 insertions(+)
--- wireless-testing.orig/include/linux/notifier.h 2009-09-28 10:14:54.000000000 +0200
+++ wireless-testing/include/linux/notifier.h 2009-09-28 10:16:07.000000000 +0200
@@ -201,6 +201,7 @@ static inline int notifier_to_errno(int
#define NETDEV_PRE_UP 0x000D
#define NETDEV_BONDING_OLDTYPE 0x000E
#define NETDEV_BONDING_NEWTYPE 0x000F
+#define NETDEV_POST_INIT 0x0010
#define SYS_DOWN 0x0001 /* Notify of system down */
#define SYS_RESTART SYS_DOWN
--- wireless-testing.orig/net/core/dev.c 2009-09-28 10:14:54.000000000 +0200
+++ wireless-testing/net/core/dev.c 2009-09-28 10:20:46.000000000 +0200
@@ -4785,6 +4785,11 @@ int register_netdevice(struct net_device
if (dev->features & NETIF_F_SG)
dev->features |= NETIF_F_GSO;
+ ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
+ ret = notifier_to_errno(ret);
+ if (ret)
+ goto err_uninit;
+
netdev_initialize_kobject(dev);
ret = netdev_register_kobject(dev);
if (ret)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] net: introduce NETDEV_POST_INIT notifier
[not found] ` <1254126089.6583.18.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>
@ 2009-09-28 9:29 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2009-09-28 9:29 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Hugh Dickins, Marcel Holtmann
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
On Mon, 2009-09-28 at 10:21 +0200, Johannes Berg wrote:
> For various purposes including a wireless extensions
> bugfix, we need to hook into the netdev creation before
> before netdev_register_kobject(). This will also ease
> doing the dev type assignment that Marcel was working
> on for cfg80211 drivers w/o touching them all.
>
> Signed-off-by: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
> ---
> I decided that it doesn't make a lot of sense to be after ndo_init but
> before the other name/... checks.
Ignore this patch please, I have something better. Marcel, feel free to
pick this up once you continue working on your devtype thing.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-28 9:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-28 8:21 [PATCH 1/2] net: introduce NETDEV_POST_INIT notifier Johannes Berg
[not found] ` <1254126089.6583.18.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>
2009-09-28 9:29 ` Johannes Berg
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).