Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

wifi: 40 MHz HE/VHT htmodes unusable — validator only accepts HE40±/VHT40±, which OpenWrt 24.10 ignores (silent 20 MHz)

未关闭 适合新手
#344 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
lua, shell

调研方向

首先阅读 src/services/hal/types/capability_args.lua 和 src/services/hal/drivers/radio.lua 中的 htmode 允许列表,然后将其与 issue 中描述的 mac80211.sh 匹配行为进行比较。找到现有的验证器测试,并为 HE40 和 VHT40 添加测试覆盖,以及针对带符号的 40 MHz 变体所选处理方式的测试覆盖。当验证能够接受与 OpenWrt 兼容的值,能够处理或明确拒绝 HE40±/VHT40±,并且相关测试全部通过时,此项更改即告完成。

由索引模型根据 Issue 内容生成。

描述

bug

Summary

The radio htmode allow-list accepts HE40+, HE40-, VHT40+, VHT40- and rejects HE40/VHT40. OpenWrt 24.10's mac80211.sh understands HE40/VHT40 (and HT40+/HT40-/HT40), not HE40±/VHT40±. As a result:

  • htmode = HE40 is rejected (radio_args_invalid), and the radio keeps its previous settings.
  • htmode = HE40+ passes validation and is written to uci, but hostapd brings the radio up at 20 MHz, with no error anywhere.

So no HE/VHT radio can run at 40 MHz, and validation gives false confidence.

Where

  • src/services/hal/types/capability_args.lua:527 (RADIO_VALID_HTMODES) and the RadioHtmode alias at :545.
  • src/services/hal/drivers/radio.lua:16 (VALID_HTMODES).

Evidence

bigbox-v1-cm-2, devicecode-lua v0.11.3, OpenWrt 24.10.7. Radio1 (5 GHz) on channel 100, 2026-10-20:

  • htmode = HE40: logread shows LOG wifi warn radio_args_invalid err=htmode must be one of: HE20, HE40+, HE40-, HE80, HE160, HT20, HT40+, HT40-, VHT20, VHT40+, VHT40-, VHT80, VHT160 method=set_channels. uci is unchanged.
  • htmode = HE40+:
    • uci show wireless.radio1 has htmode='HE40+';
    • /var/run/hostapd-phy1.conf has he_oper_chwidth=0 and no 40 MHz ht_capab;
    • hostapd logs DFS-CAC-START freq=5500 chan=100 sec_chan=0, width=0;
    • iw dev reports width: 20 MHz.
  • On the box, /lib/netifd/wireless/mac80211.sh matches htmode with case patterns such as HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160|EHT40|EHT80|EHT160 (around lines 169, 246 and 749). HE40+ doesn't match any of them.
  • HE80 works (verified).
  • VHT40± is inferred from the same script, not tested on hardware.

Impact

40 MHz operation isn't available for HE/VHT configs, and the fallback to 20 MHz is silent. That matters wherever 80 MHz is too wide, e.g. dense sites or DFS channels.

Suggested fix

  • Accept HE40 and VHT40: OpenWrt chooses the secondary channel itself.
  • Either map HE40±/VHT40± to those values, or reject them with a clear error.
  • Keep HT40±.
  • Add validator tests.

Found while setting up the grand-pipeline Wi-Fi client test (jangala-dev/grand-pipeline#18).

主要语言
Lua
星标
1
派生
0
平均合并
5 天 15 小时
30 天内合并 PR
3

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

jangala-dev/devicecode-lua 的其他 Issue

查看 jangala-dev/devicecode-lua 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。