Skip to contentSkip to conversation

ieee802154: register a device type for the wpan dev

PATCH Applied Adriano Cordova 3 participants 4 messages Sep 8 – Nov 26 1 message not in the archive

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

PATCH v2 1/1 ieee802154: register a device type for the wpan dev

cfg802154 never assigns a device type to wpan interfaces, so their netdev uevent carries no DEVTYPE key. Mirror cfg80211, which calls SET_NETDEV_DEVTYPE() from a NETDEV_POST_INIT case, and set a new wpan_dev_type so the device is typed DEVTYPE=wpan.

---
v1: https://lore.kernel.org/linux-wpan/[email protected]/T/
Changes since v1:
- Drop WARN_ON patch as it was a dead check.

 net/ieee802154/core.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
net/ieee802154/core.c +7 -1
index c0b8712018a1..c6213412d291 100644
@@ -272,6 +272,10 @@ void cfg802154_dev_free(struct cfg802154_registered_device *rdev)
 	kfree(rdev);
 }
 
+static const struct device_type wpan_dev_type = {
+	.name	= "wpan",
+};
+
 static void
 cfg802154_update_iface_num(struct cfg802154_registered_device *rdev,
 			   int iftype, int num)
@@ -296,7 +300,9 @@ static int cfg802154_netdev_notifier_call(struct notifier_block *nb,
 	/* TODO WARN_ON unspec type */
 
 	switch (state) {
-		/* TODO NETDEV_DEVTYPE */
+	case NETDEV_POST_INIT:
+		SET_NETDEV_DEVTYPE(dev, &wpan_dev_type);
+		break;
 	case NETDEV_REGISTER:
 		dev->netns_immutable = true;
 		wpan_dev->identifier = ++rdev->wpan_dev_id;
Signature · 1 line
2.51.0
maintainer
#1 lore raw

Hi Adriano,

Quoted 7 lines · Adriano Cordova

cfg802154 never assigns a device type to wpan interfaces, so their netdev uevent carries no DEVTYPE key. Mirror cfg80211, which calls SET_NETDEV_DEVTYPE() from a NETDEV_POST_INIT case, and set a new wpan_dev_type so the device is typed DEVTYPE=wpan.

---

Diff is identical, why didn't you kept my Rb?

A message that is not in the archive (sent off-list or not yet received): CAMGU2hX9GSFUqZZCx6j8wRbSCSi92bn24XmxNOXLoNc8iYqViA@mail.gmail.com

author Reviewed-by Miquel Raynal
#3 lore raw
Quoted 21 lines · Adriano Córdova

Hi Miquel,

I reworded the commit message and dropped it by mistake

Quoted 15 lines · Miquel Raynal

Hi Adriano,

Quoted 7 lines · Adriano Cordova

cfg802154 never assigns a device type to wpan interfaces, so their netdev uevent carries no DEVTYPE key. Mirror cfg80211, which calls SET_NETDEV_DEVTYPE() from a NETDEV_POST_INIT case, and set a new wpan_dev_type so the device is typed DEVTYPE=wpan.

---

Diff is identical, why didn't you kept my Rb?

maintainer Applied
#4 lore raw
In reply to Adriano Cordova

Hello Adriano Cordova.

Quoted 6 lines · Adriano Cordova

cfg802154 never assigns a device type to wpan interfaces, so their netdev uevent carries no DEVTYPE key. Mirror cfg80211, which calls SET_NETDEV_DEVTYPE() from a NETDEV_POST_INIT case, and set a new wpan_dev_type so the device is typed DEVTYPE=wpan.

Applied to wpan/wpan.git, thanks!

[1/1] ieee802154: register a device type for the wpan dev

      https://git.kernel.org/wpan/wpan/c/1e277fce233c

regards,
Stefan Schmidt