Hack for .11ac channels

This commit is contained in:
Ivaylo Markov 2017-10-31 12:51:46 +02:00
parent c967f7ffd3
commit 42ef0793c7
11 changed files with 56 additions and 25 deletions

View File

@ -15,12 +15,28 @@ def wifi(name)
wlans = CONFIGURATIONS[name]['wlans']
wlan_config = File.read(config_path)
# TODO: hack for 11ac channels, make more generic
fiveg_channels = {}
fiveg_channels['42'] = [36, 40, 44, 48]
fiveg_channels['58'] = [52, 56, 60, 64]
fiveg_channels['106'] = [100, 104, 108, 112]
fiveg_channels['122'] = [116, 120, 124, 128]
fiveg_channels['138'] = [132, 136, 140, 144]
fiveg_channels['155'] = [149, 153, 157, 161]
wlans.each do |id, wlan|
wlan_config.sub!("<radio#{id}-channel>", wlan['channel'].to_s)
wlan_config.sub!("<wlan#{id}-macaddr>", wlan['bssid'].to_s)
# 2.4 GHz
if id == 1
wlan_config.sub!("<radio#{id}-channel>", wlan['channel'].to_s)
# 5 GHz
else
channels = fiveg_channels[wlan['channel'].to_s]
(0..3).each do |chan|
wlan_config.sub!("<radio#{id}-channel#{chan}>", channels[chan].to_s)
end
end
end
#wlan_config.gsub!("# option channel", " option channel")
wlan_config.gsub!("# option macaddr", " option macaddr")
File.open(config_path, 'w') do |f|
f.puts wlan_config

View File

@ -94,4 +94,5 @@ CONFIG_VERSION_MANUFACTURER_URL=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_SUPPORT_URL=""
CONFIG_WPA_SUPPLICANT_INTERNAL=y
CONFIG_VERSION_REPO="https://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_VERSION_REPO="http://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_PACKAGE_wifi-sentinel=y

View File

@ -94,4 +94,5 @@ CONFIG_VERSION_MANUFACTURER_URL=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_SUPPORT_URL=""
CONFIG_WPA_SUPPLICANT_INTERNAL=y
CONFIG_VERSION_REPO="https://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_VERSION_REPO="http://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_PACKAGE_wifi-sentinel=y

View File

@ -7,7 +7,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:10:00
channel: 108
channel: 106
1:
bssid: 02:00:0f:20:10:01
channel: 13
@ -21,7 +21,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:10:10
channel: 60
channel: 58
1:
bssid: 02:00:0f:20:10:11
channel: 5
@ -36,7 +36,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:20:00
channel: 124
channel: 122
1:
bssid: 02:00:0f:20:20:01
channel: 5
@ -50,7 +50,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:20:10
channel: 44
channel: 42
1:
bssid: 02:00:0f:20:20:11
channel: 1
@ -64,7 +64,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:20:20
channel: 108
channel: 106
1:
bssid: 02:00:0f:20:20:21
channel: 9
@ -78,7 +78,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:20:30
channel: 60
channel: 58
1:
bssid: 02:00:0f:20:20:31
channel: 13
@ -93,7 +93,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:30:00
channel: 44
channel: 42
1:
bssid: 02:00:0f:20:30:01
channel: 1
@ -107,7 +107,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:30:10
channel: 60
channel: 58
1:
bssid: 02:00:0f:20:30:11
channel: 1
@ -122,7 +122,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:40:00
channel: 44
channel: 42
1:
bssid: 02:00:0f:20:40:01
channel: 1
@ -136,7 +136,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:40:10
channel: 44
channel: 42
1:
bssid: 02:00:0f:20:40:11
channel: 1
@ -151,7 +151,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:50:00
channel: 44
channel: 42
1:
bssid: 02:00:0f:20:50:01
channel: 9
@ -165,7 +165,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:50:10
channel: 108
channel: 106
1:
bssid: 02:00:0f:20:50:11
channel: 1
@ -180,7 +180,7 @@ configurations:
wlans:
0:
bssid: 02:00:0f:20:50:20
channel: 108
channel: 106
1:
bssid: 02:00:0f:20:50:21
channel: 13

View File

@ -79,4 +79,5 @@ CONFIG_PACKAGE_wpad=y
# CONFIG_PACKAGE_wpad-mini is not set
CONFIG_PACKAGE_zlib=y
CONFIG_WPA_SUPPLICANT_INTERNAL=y
CONFIG_VERSION_REPO="https://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_VERSION_REPO="http://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_PACKAGE_wifi-sentinel=y

View File

@ -2,7 +2,10 @@ config wifi-device radio0
option type mac80211
option hwmode 11a
option path 'pci0000:01/0000:01:00.0'
option channel <radio0-channel>
list channels '<radio0-channel0>'
list channels '<radio0-channel1>'
list channels '<radio0-channel2>'
list channels '<radio0-channel3>'
option txpower '30'
option htmode VHT80
option distance '20'

View File

@ -2,7 +2,10 @@ config wifi-device radio0
option type mac80211
option hwmode 11a
option path 'pci0000:00/0000:00:00.0'
option channel <radio0-channel>
list channels '<radio0-channel0>'
list channels '<radio0-channel1>'
list channels '<radio0-channel2>'
list channels '<radio0-channel3>'
option txpower '30'
option htmode VHT80
option distance '20'

View File

@ -2,7 +2,10 @@ config wifi-device radio0
option type mac80211
option hwmode 11a
option path 'soc/soc:pcie-controller/pci0000:00/0000:00:01.0/0000:01:00.0'
option channel <radio0-channel>
list channels '<radio0-channel0>'
list channels '<radio0-channel1>'
list channels '<radio0-channel2>'
list channels '<radio0-channel3>'
option txpower '30'
option htmode VHT80
option distance '20'

View File

@ -73,5 +73,6 @@ CONFIG_PACKAGE_wpa-cli=y
CONFIG_PACKAGE_wpad=y
# CONFIG_PACKAGE_wpad-mini is not set
CONFIG_PACKAGE_zlib=y
CONFIG_VERSION_REPO="https://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_VERSION_REPO="http://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_WPA_SUPPLICANT_INTERNAL=y
CONFIG_PACKAGE_wifi-sentinel=y

View File

@ -107,6 +107,7 @@ CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_NICK="Chaos Calmer"
CONFIG_VERSION_NUMBER="15.05"
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_REPO="https://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_VERSION_REPO="http://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_PACKAGE_wifi-sentinel=y
CONFIG_WPA_SUPPLICANT_INTERNAL=y
# CONFIG_IB_STANDALONE is not set

View File

@ -104,5 +104,6 @@ CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_NICK="Chaos Calmer"
CONFIG_VERSION_NUMBER="15.05"
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_REPO="https://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_VERSION_REPO="http://mirrors.linux-bulgaria.org/lede/releases/17.01.4"
CONFIG_PACKAGE_wifi-sentinel=y
CONFIG_WPA_SUPPLICANT_INTERNAL=y