[PATCH v2] ieee802154: register a device type for the wpan dev

Subsystems: ieee 802.15.4 subsystem, networking [general], the rest

COLD36d

2 messages, 2 authors, 2026-09-09 · open the first message on its own page

[PATCH v2] ieee802154: register a device type for the wpan dev

From: Adriano Cordova <hidden>
Date: 2026-09-08 20:35:41

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.

Signed-off-by: Adriano Cordova <redacted>
---
v1: https://lore.kernel.org/linux-wpan/178889163770.219967.16467487407776248344@kernel.org/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(-)
diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
index c0b8712018a1..c6213412d291 100644
--- a/net/ieee802154/core.c
+++ b/net/ieee802154/core.c
@@ -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;
-- 
2.51.0

Re: [PATCH v2] ieee802154: register a device type for the wpan dev

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2026-09-09 07:52:28

Hi Adriano,

On 08/09/2026 at 17:35:33 -03, Adriano Cordova [off-list ref] wrote:
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.

Signed-off-by: Adriano Cordova <redacted>
---
Diff is identical, why didn't you kept my Rb?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help