AP: Add op_class config item to specify 6 GHz channels uniquely

Add hostapd config option "op_class" for fixed channel selection along
with existing "channel" option. "op_class" and "channel" config options
together can specify channels across 2.4 GHz, 5 GHz, and 6 GHz bands
uniquely.

Signed-off-by: Liangwei Dong <liangwei@codeaurora.org>
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
This commit is contained in:
Liangwei Dong 2019-08-09 12:27:46 +08:00 committed by Jouni Malinen
parent 89450024a8
commit a5b2faa714
4 changed files with 15 additions and 0 deletions

View file

@ -875,6 +875,7 @@ struct hostapd_config {
u16 beacon_int;
int rts_threshold;
int fragm_threshold;
u8 op_class;
u8 channel;
int enable_edmg;
u8 edmg_channel;

View file

@ -961,6 +961,7 @@ out:
int hostapd_select_hw_mode(struct hostapd_iface *iface)
{
int i;
int freq = -1;
if (iface->num_hw_features < 1)
return -1;
@ -977,9 +978,14 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
}
iface->current_mode = NULL;
if (iface->conf->channel && iface->conf->op_class)
freq = ieee80211_chan_to_freq(NULL, iface->conf->op_class,
iface->conf->channel);
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 (freq > 0 && !hw_get_chan(mode, freq))
continue;
iface->current_mode = mode;
break;
}