Page MenuHomeFreeBSD

iflib: Create led(4) devices
ClosedPublic

Authored by kbowling on Oct 9 2021, 3:14 AM.
Tags
None
Referenced Files
F167072713: D32389.id96528.diff
Tue, Aug 18, 8:42 PM
F167062474: D32389.id183905.diff
Tue, Aug 18, 8:24 PM
F167037961: D32389.id183905.diff
Tue, Aug 18, 5:06 PM
F167036043: D32389.id183905.diff
Tue, Aug 18, 4:57 PM
F167026207: D32389.id96528.diff
Tue, Aug 18, 3:59 PM
F166996186: D32389.id.diff
Tue, Aug 18, 11:31 AM
Unknown Object (File)
Sun, Aug 16, 9:42 PM
Unknown Object (File)
Sun, Aug 16, 12:48 PM

Details

Summary

If the driver defines an led_func, have the framework create them during attach.

PR: 246885
Reported by: Jose Luis Duran <jlduran@gmail.com>

Test Plan

Tested on I350:
echo "f3" > /dev/led/igb0
echo "0" > /dev/led/igb0

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Jose submitted a variant where the driver (e1000 in this case) calls the iflib_led_create() function in its post attach. I am open to either approach if anyone has any thoughts one way or the other.

I prefer this approach.

Regardless of which patch you choose, on my home router (2 i211-based NICs), identifying /dev/led/igb0 works, but /dev/led/igb1 do not.

Nevertheless, the LED devices are created as well. Thank you!

Seems ok. This kind of reflection looks a bit hacky but I see it used elsewhere. Probably we should have some kobj.h helper to do it.

sys/net/iflib.c
5440

And on the next line too.

5444
This revision was not accepted when it landed; it landed in state Needs Review.Wed, Aug 12, 2:11 AM
This revision was automatically updated to reflect the committed changes.