aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-12 00:12:51 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-12 02:09:01 +0000
commit6591a7f6919295f2ec2b463d1ae9554a8bbf6104 (patch)
tree4381ea96213ce2995b1eea45d00208d268f310eb
parent952994751911d5d059d53e73eb874e00ee98b9ed (diff)
iflib: Create led(4) devices
When a driver implements ifdi_led_func, have the framework create its led(4) device after attach completes and the ifnet and context locks are released. PR: 246885 Reported by: jlduran Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D32389
-rw-r--r--sys/net/iflib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index f490d7347341..ef2f96c268e5 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -5436,6 +5436,13 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
CTX_UNLOCK(ctx);
IFNET_WUNLOCK();
+ /* Create led(4) devices if the driver defined the method */
+ kobj_desc = &ifdi_led_func_desc;
+ kobj_method = kobj_lookup_method(((kobj_t)ctx)->ops->cls, NULL,
+ kobj_desc);
+ if (kobj_method != &kobj_desc->deflt)
+ iflib_led_create(ctx);
+
return (0);
fail_detach: