Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions renderer/templates/radio.uc
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,33 @@
return modes[require_mode] || '';
}

function match_puncture_threshold(phy, radio) {
if (!radio.puncture_threshold)
return 0;

if (radio.band == "2G" || radio.band == "HaLow") {
warn("puncture-threshold is not supported on the %s band, ignoring", radio.band);
return 0;
}

if (radio.channel_mode != "EHT") {
warn("puncture-threshold requires channel-mode EHT, ignoring for band %s", radio.band);
return 0;
}

if (match_channel(phy, radio) != 0) {
warn("puncture-threshold is only supported with 'auto' channel mode, ignoring for band %s", radio.band);
return 0;
}

if (radio.channel_width < 80) {
warn("puncture-threshold is not supported with channel-width below 80MHz, ignoring for band %s", radio.band);
return 0;
}

return radio.puncture_threshold;
}

if (restrict.dfs && radio.allow_dfs && radio.band == "5G") {
warn('DFS is restricted.');
radio.allow_dfs = false;
Expand Down Expand Up @@ -234,6 +261,7 @@ set wireless.{{ phy.section }}.maxassoc={{ radio.maximum_clients }}
set wireless.{{ phy.section }}.maxassoc_ignore_probe={{ b(radio.maximum_clients_ignore_probe) }}
set wireless.{{ phy.section }}.reconf={{ b(reconf) }}
set wireless.{{ phy.section }}.acs_exclude_dfs={{ b(!radio.allow_dfs) }}
set wireless.{{ phy.section }}.ru_punct_acs_threshold={{ match_puncture_threshold(phy, radio) }}
{% for (let channel in radio.valid_channels): %}
{% if (!(channel in phy.channels)) continue %}
{% if (!radio.allow_dfs && channel in phy.dfs_channels) continue %}
Expand Down
13 changes: 13 additions & 0 deletions schema/radio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ properties:
Exclude non-psc when doing auto channel selection on 6GHz
type: boolean
default: false
puncture-threshold:
description:
Enables preamble puncturing during auto channel selection (ACS). The value is
an RSSI-like threshold that indicates how aggressively the ACS algorithm may
puncture individual sub-channels of the operating channel. A value of 0 disables
preamble puncturing, meaning the ACS algorithm will not puncture any channel.
Puncturing can only be enabled when the radio is using the 'auto' channel mode,
requires a channel-mode of EHT, is not supported on the 2G or HaLow bands,
and requires a channel-width of at least 80MHz.
type: integer
maximum: 100
minimum: 0
default: 0
country:
description:
Specifies the country code, affects the available channels and
Expand Down
23 changes: 23 additions & 0 deletions schemareader.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,29 @@ function instantiateRadio(location, value, errors) {
obj.acs_exclude_6ghz_non_psc = false;
}

function parsePunctureThreshold(location, value, errors) {
if (type(value) in [ "int", "double" ]) {
if (value > 100)
push(errors, [ location, "must be lower than or equal to 100" ]);

if (value < 0)
push(errors, [ location, "must be bigger than or equal to 0" ]);

}

if (type(value) != "int")
push(errors, [ location, "must be of type integer" ]);

return value;
}

if (exists(value, "puncture-threshold")) {
obj.puncture_threshold = parsePunctureThreshold(location + "/puncture-threshold", value["puncture-threshold"], errors);
}
else {
obj.puncture_threshold = 0;
}

function parseCountry(location, value, errors) {
if (type(value) == "string") {
if (length(value) > 2)
Expand Down
7 changes: 7 additions & 0 deletions ucentral.schema.full.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,13 @@
"type": "boolean",
"default": false
},
"puncture-threshold": {
"description": "Enables preamble puncturing during auto channel selection (ACS). The value is an RSSI-like threshold that indicates how aggressively the ACS algorithm may puncture individual sub-channels of the operating channel. A value of 0 disables preamble puncturing, meaning the ACS algorithm will not puncture any channel. Puncturing can only be enabled when the radio is using the 'auto' channel mode, requires a channel-mode of EHT, is not supported on the 2G or HaLow bands, and requires a channel-width of at least 80MHz.",
"type": "integer",
"maximum": 100,
"minimum": 0,
"default": 0
},
"country": {
"description": "Specifies the country code, affects the available channels and transmission powers.",
"type": "string",
Expand Down
6 changes: 6 additions & 0 deletions ucentral.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,12 @@
"type": "boolean",
"default": false
},
"puncture-threshold": {
"type": "integer",
"maximum": 100,
"minimum": 0,
"default": 0
},
"country": {
"type": "string",
"maxLength": 2,
Expand Down
7 changes: 7 additions & 0 deletions ucentral.schema.pretty.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,13 @@
"type": "boolean",
"default": false
},
"puncture-threshold": {
"description": "Enables preamble puncturing during auto channel selection (ACS). The value is an RSSI-like threshold that indicates how aggressively the ACS algorithm may puncture individual sub-channels of the operating channel. A value of 0 disables preamble puncturing, meaning the ACS algorithm will not puncture any channel. Puncturing can only be enabled when the radio is using the 'auto' channel mode, requires a channel-mode of EHT, is not supported on the 2G or HaLow bands, and requires a channel-width of at least 80MHz.",
"type": "integer",
"maximum": 100,
"minimum": 0,
"default": 0
},
"country": {
"description": "Specifies the country code, affects the available channels and transmission powers.",
"type": "string",
Expand Down