]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev-builtin-net_id: Add DeviceTree-based names for WLAN devices (#39060)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 24 Sep 2025 09:10:27 +0000 (18:10 +0900)
committerGitHub <noreply@github.com>
Wed, 24 Sep 2025 09:10:27 +0000 (18:10 +0900)
commit01598d644f9b84f2c09467f441c8e49ac49833af
treee7e0adacf1c098a660e423adaefcfdca507ff22d
parent696b1263dc78858f96345a366933c66d53ae4899
parent20693ffcd8582af8bf225fbd86192d8928ca01a4
udev-builtin-net_id: Add DeviceTree-based names for WLAN devices (#39060)

Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
u-boot set mac-address for wifi without an eeprom"

So we need to handle both while generating names. Refactor most of the
logic in names_devicetree() into a helper
names_devicetree_alias_prefix() that takes an alias_prefix instead of
hardcoding "ethernet", and, in the new names_devicetree():

- For prefix "en", use alias_prefix "ethernet"
- For prefix "wl", try alias_prefix "wifi" first, and if that was not
found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.