Merge pull request #261505 from philiptaron/wlanConfig

systemd.network.netdev: add support for WLAN devices
This commit is contained in:
Arian van Putten 2023-10-19 16:33:30 +00:00 committed by GitHub
commit 8caf3dcf34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View File

@ -65,6 +65,9 @@ in {
'' + optionalString (def.vrfConfig != { }) ''
[VRF]
${attrsToSection def.vrfConfig}
'' + optionalString (def.wlanConfig != { }) ''
[WLAN]
${attrsToSection def.wlanConfig}
'' + optionalString (def.batmanAdvancedConfig != { }) ''
[BatmanAdvanced]
${attrsToSection def.batmanAdvancedConfig}

View File

@ -159,6 +159,7 @@ let
"geneve"
"l2tp"
"macsec"
"wlan"
"vrf"
"vcan"
"vxcan"
@ -468,6 +469,30 @@ let
(assertMinimum "Table" 0)
];
sectionWLAN = checkUnitConfig "WLAN" [
(assertOnlyFields [
"PhysicalDevice" # systemd supports both strings ("phy0") and indexes (0) here.
"Type"
"WDS"
])
# See https://github.com/systemd/systemd/blob/main/src/basic/linux/nl80211.h#L3382
(assertValueOneOf "Type" [
"ad-hoc"
"station"
"ap"
"ap-vlan"
"wds"
"monitor"
"mesh-point"
"p2p-client"
"p2p-go"
"p2p-device"
"ocb"
"nan"
])
(assertValueOneOf "WDS" boolValues)
];
sectionBatmanAdvanced = checkUnitConfig "BatmanAdvanced" [
(assertOnlyFields [
"GatewayMode"
@ -1779,6 +1804,16 @@ let
'';
};
wlanConfig = mkOption {
default = {};
example = { PhysicalDevice = 0; Type = "station"; };
type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionWLAN;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the `[WLAN]` section of the unit.
See {manpage}`systemd.netdev(5)` for details.
'';
};
batmanAdvancedConfig = mkOption {
default = {};
example = {