[PATCH v2] hostapd: Downgrade to 802.11b on channel 14 in hostapd_acs_completed()
Chao Meng
chao.meng at unisoc.com
Wed Nov 4 00:09:18 PST 2026
From: "chao.meng" <chao.meng at unisoc.com>
The channel 14 downgrade (force IEEE 802.11b mode and disable HT, VHT,
HE, and EHT) is done only in hostapd_select_hw_mode(). In the ACS
offload case, the selected channel is applied through
hostapd_acs_channel_selected() and hostapd_acs_completed() without
calling hostapd_select_hw_mode(), so channel 14 (2484 MHz) gets
configured with HT/VHT/HE enabled. The kernel rejects that since
channel 14 is allowed only for IEEE 802.11b without HT
(NL80211_CHAN_WIDTH_20_NOHT), and AP setup fails with -EINVAL.
Apply the same channel 14 downgrade in hostapd_acs_completed() before
validating the selected channels, and reselect current_mode based on
the downgraded mode so that the rate set and ERP information element
are generated for IEEE 802.11b. This is idempotent for the internal
ACS and fixed channel cases where hostapd_select_hw_mode() has already
applied the same downgrade.
Signed-off-by: chao.meng <chao.meng at unisoc.com>
---
src/ap/hw_features.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 2af3d3b57..5f93e1093 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -1383,10 +1383,43 @@ static void hostapd_notify_bad_chans(struct hostapd_iface *iface)
int hostapd_acs_completed(struct hostapd_iface *iface, int err)
{
int ret = -1;
+ int i;
if (err)
goto out;
+ if ((iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211G ||
+ iface->conf->ieee80211n || iface->conf->ieee80211ac ||
+ iface->conf->ieee80211ax || iface->conf->ieee80211be) &&
+ iface->conf->channel == 14) {
+ wpa_printf(MSG_INFO, "Disable OFDM/HT/VHT/HE/EHT on channel 14");
+ iface->conf->hw_mode = HOSTAPD_MODE_IEEE80211B;
+ iface->conf->ieee80211n = 0;
+ iface->conf->ieee80211ac = 0;
+ iface->conf->ieee80211ax = 0;
+ iface->conf->ieee80211be = 0;
+
+ iface->current_mode = NULL;
+ for (i = 0; i < iface->num_hw_features; i++) {
+ struct hostapd_hw_modes *mode = &iface->hw_features[i];
+
+ if (mode->mode == iface->conf->hw_mode) {
+ if (skip_mode(iface, mode))
+ continue;
+
+ iface->current_mode = mode;
+ break;
+ }
+ }
+
+ if (!iface->current_mode) {
+ wpa_printf(MSG_ERROR, "No hw mode available for channel 14");
+ wpa_msg(iface->bss[0]->msg_ctx, MSG_ERROR, ACS_EVENT_FAILED);
+ hostapd_notify_bad_chans(iface);
+ goto out;
+ }
+ }
+
switch (hostapd_check_chans(iface)) {
case HOSTAPD_CHAN_VALID:
iface->is_no_ir = false;
--
2.43.0.windows.1
________________________________
This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions.
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。
More information about the Hostap
mailing list