wifi-scripts: fix missing VHT capabilities detection
authorSean Khan <datapronix@protonmail.com>
Mon, 17 Feb 2025 22:08:09 +0000 (17:08 -0500)
committerJohn Crispin <john@phrozen.org>
Wed, 19 Feb 2025 07:07:20 +0000 (08:07 +0100)
commiteabea737fae4638ace92e1404279f0d2b1839a7a
tree4e1b1cb03312351d5c5506ac108c72ddb9201b2c
parent18511314275bd1056d2e2b6c6a382fa10c0a13f9
wifi-scripts: fix missing VHT capabilities detection

* Add missing parentheses in the conditionals for VHT160/VHT160-80PLUS80
  and VHT_MAX_MPDU capabilities. The missing parentheses caused the bitwise
  AND to be evaluated after the equality comparison due to ECMA's operator
  precedence, where `==` has higher precedence than `&`.

* Fix Max MPDU length detection by changing the comparison operators to
  `>=` vs `>` otherwise the condition would never be met.

* Add missing default values:
  - `true` value for `short_gi_80` (As it exists for `short_gi_20`, `short_gi_40`, `short_gi_160`)
  - `7` for `vht_max_mpdu` (Without it the loop in MAX-MPDU-* calculation always compares with null)

* Change the `vht160` condition to `config.vht160 <= 2`. This flag is
  `2` by default, and only ever set to `0` when `vht_oper_chwidth < 2`.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/18013
Signed-off-by: John Crispin <john@phrozen.org>
package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc