diff options
author | Aleksander Jan Bajkowski <olek2@wp.pl> | 2024-10-31 22:27:54 +0100 |
---|---|---|
committer | Hannu Nyman <hannu.nyman@iki.fi> | 2024-11-10 16:27:23 +0200 |
commit | d6506880edb0cfbd8e94790911a353a57b23f5c4 (patch) | |
tree | eea3f5ecad9c6648f303bdb2663f16e6a0d66370 /modules/luci-mod-status/htdocs/luci-static/resources | |
parent | c16643f7a75dc4275c64897980846d3137cfd3f2 (diff) |
luci-mod-status: channel_analysis: detect 40 MHz (20+20 bonded) APs
At the moment, 40 MHz detection works only for some APs. HT (802.11n)
exposes the 40 MHz capability of APs in two ways. The first way is
a continuous 40 Mhz band. The second way is two 20MHz bonded channels.
Linux detects the presence of 40 MHz by checking the presence of the
second channel. It is always absent when the AP supports only 20 MHz.
This PR fixes this issue and both ways are supported.
First (40 MHz continuous):
HT Operation:
Primary Channel: 13
Secondary Channel Offset: below
Channel Width: 40 MHz or higher
Second way (20+20MHz bonded):
HT Operation:
Primary Channel: 1
Secondary Channel Offset: above
Channel Width: 20 MHz
Pure 20MHz channel:
HT Operation:
Primary Channel: 1
Secondary Channel Offset: no secondary
Channel Width: 20 MHz
Fixes: #6839
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Diffstat (limited to 'modules/luci-mod-status/htdocs/luci-static/resources')
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js index feb27baef7..c6b1c053f8 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js @@ -291,20 +291,24 @@ return view.extend({ continue; res.channel_width = "20 MHz"; - if (res.ht_operation != null) - if (res.ht_operation.channel_width == 2040) { /* 40 MHz Channel Enabled */ - if (res.ht_operation.secondary_channel_offset == "below") { - res.channel_width = "40 MHz"; - chan_width = 4; /* 40 MHz Channel Used */ - center_channels[0] -= 2; - } else if (res.ht_operation.secondary_channel_offset == "above") { - res.channel_width = "40 MHz"; - chan_width = 4; /* 40 MHz Channel Used */ - center_channels[0] += 2; - } else { + if (res.ht_operation != null) { + /* Detect 40 MHz operation by looking for the presence of + * a secondary channel. */ + if (res.ht_operation.secondary_channel_offset == "below") { + res.channel_width = "40 MHz"; + chan_width = 4; /* 40 MHz Channel Used */ + center_channels[0] -= 2; + } else if (res.ht_operation.secondary_channel_offset == "above") { + res.channel_width = "40 MHz"; + chan_width = 4; /* 40 MHz Channel Used */ + center_channels[0] += 2; + } else { + /* Fallback to 20 MHz due to discovery of other APs on the + * same channel (802.11n coexistence mechanism). */ + if (res.ht_operation.channel_width == 2040) res.channel_width = "20 MHz (40 MHz Intolerant)"; - } } + } /* if channel_width <= 40, refer to HT (above) for actual channel width, * as vht_operation.channel_width == 40 really only means that the used |