Skip to contentSkip to conversation

net: introduce NETDEV_PRE_INIT notifier

PATCH In review Johannes Berg 2 participants 2 messages Sep 27, 2009 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: introduce NETDEV_PRE_INIT notifier

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.

---
 include/linux/notifier.h |    1 +
 net/core/dev.c           |    5 +++++
 2 files changed, 6 insertions(+)
include/linux/notifier.h +1 -0
@@ -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
net/core/dev.c +5 -0
@@ -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);

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Johannes,

Quoted 6 lines

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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html