Files
wlan-ap/feeds/wifi-ax/hostapd/patches/800-fix-ap-sta-channel-setup-failed.patch
John Crispin 606e27e256 wifi: fix channel select when using ACS
there were several small issues that caused ACS to leave the radio in a bad state
during sanity runs.

Signed-off-by: John Crispin <john@phrozen.org>
2022-03-31 10:58:45 +02:00

30 lines
961 B
Diff

diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c
index ad2aebf..355b4a8 100644
--- a/src/common/hw_features_common.c
+++ b/src/common/hw_features_common.c
@@ -615,9 +615,21 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
center_segment0 == channel - 6)
data->center_freq1 = 5000 + center_segment0 * 5;
else {
- wpa_printf(MSG_ERROR,
- "Wrong coupling between HT and VHT/HE channel setting");
- return -1;
+ if (channel <= 48)
+ center_segment0 = 42;
+ else if (channel <= 64)
+ center_segment0 = 58;
+ else if (channel <= 112)
+ center_segment0 = 106;
+ else if (channel <= 128)
+ center_segment0 = 122;
+ else if (channel <= 144)
+ center_segment0 = 138;
+ else if (channel <= 161)
+ center_segment0 = 155;
+ else if (channel <= 177)
+ center_segment0 = 171;
+ data->center_freq1 = 5000 + center_segment0 * 5;
}
}
break;