add option to change/limit wifi rates

This commit is contained in:
Andreas Ziegler 2016-07-01 03:47:37 +02:00
parent fb8c7a8baf
commit eeb159af1a
4 changed files with 27 additions and 0 deletions

View File

@ -35,6 +35,12 @@
-- Wireless channel. -- Wireless channel.
channel = 1, channel = 1,
-- Supported wifi rates, example removes 802.11b compatibility for better performance (optional, implies basic_rate)
-- supported_rates = '6000 9000 12000 18000 24000 36000 48000 54000',
-- Basic wifi rates, example removes 802.11b compatibility for better performance (optional)
-- basic_rate = '6000 9000 18000 36000 54000',
-- ESSID used for client network. -- ESSID used for client network.
ap = { ap = {
ssid = 'entenhausen.freifunk.net', ssid = 'entenhausen.freifunk.net',

View File

@ -98,6 +98,12 @@ wifi24 \: optional
This will only affect new installations. This will only affect new installations.
Upgrades will not changed the disabled state. Upgrades will not changed the disabled state.
Additionally it is possible to configure the ``supported_rates`` and ``basic_rate``
of each radio. Both are optional, by default hostapd/driver dictate the rates.
``supported_rates`` implies ``basic_rate``, because ``basic_rate`` has to be a subset
of ``supported_rates``.
The example below disables 802.11b rates.
``ap`` requires a single parameter, a string, named ``ssid`` which sets the ``ap`` requires a single parameter, a string, named ``ssid`` which sets the
interface's ESSID. interface's ESSID.
@ -112,6 +118,8 @@ wifi24 \: optional
wifi24 = { wifi24 = {
channel = 11, channel = 11,
supported_rates = '6000 9000 12000 18000 24000 36000 48000 54000',
basic_rate = '6000 9000 18000 36000 54000',
ap = { ap = {
ssid = 'entenhausen.freifunk.net', ssid = 'entenhausen.freifunk.net',
}, },

View File

@ -28,5 +28,10 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured need_string('regdom') -- regdom is only required when wifi24 or wifi5 is configured
need_number(config .. '.channel') need_number(config .. '.channel')
if need_string(config .. '.supported_rates', false) then
need_string(config .. '.basic_rate')
else
need_string(config .. '.basic_rate', false)
end
end end
end end

View File

@ -27,6 +27,14 @@ local function configure_radio(radio, index, config)
uci:set('wireless', radio, 'channel', channel) uci:set('wireless', radio, 'channel', channel)
uci:set('wireless', radio, 'htmode', 'HT20') uci:set('wireless', radio, 'htmode', 'HT20')
uci:set('wireless', radio, 'country', site.regdom) uci:set('wireless', radio, 'country', site.regdom)
if config.supported_rates then
uci:set('wireless', radio, 'supported_rates', config.supported_rates)
end
if config.basic_rate then
uci:set('wireless', radio, 'basic_rate', config.basic_rate)
end
end end
end end