[PATCH 05/92] common: Set the operating class if it is known
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Wed Apr 22 05:22:56 PDT 2026
From: Ilan Peer <ilan.peer at intel.com>
In ieee80211_freq_to_channel_ext(), when the frequency doesn't map
to a channel, set the operating class if it is known. This is useful
for cases that the channel is not a real channel, e.g., center
frequencies of 80 MHz and 160 MHz channels.
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
src/common/ieee802_11_common.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index b9030497a1..13d578e500 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -1646,7 +1646,11 @@ ieee80211_freq_to_channel_ext(unsigned int freq, int sec_channel,
if ((freq - 5000) % 5)
return NUM_HOSTAPD_MODES;
*channel = (freq - 5000) / 5;
- *op_class = 0; /* TODO */
+ if (vht_opclass)
+ *op_class = vht_opclass;
+ else
+ *op_class = 0;
+
return HOSTAPD_MODE_IEEE80211A;
}
--
2.53.0
More information about the Hostap
mailing list