aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiangwei Dong <liangwei@codeaurora.org>2019-08-09 04:27:46 (GMT)
committerJouni Malinen <j@w1.fi>2019-10-15 12:39:22 (GMT)
commita5b2faa714e918cb7f81bdf398dd4fa80c9115cb (patch)
treeadbaf475514549e6170e1d9218598b4647c4d949
parent89450024a8756bbb53cc2ed87db91d83d5789fd4 (diff)
downloadhostap-a5b2faa714e918cb7f81bdf398dd4fa80c9115cb.zip
hostap-a5b2faa714e918cb7f81bdf398dd4fa80c9115cb.tar.gz
hostap-a5b2faa714e918cb7f81bdf398dd4fa80c9115cb.tar.bz2
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>
-rw-r--r--hostapd/config_file.c2
-rw-r--r--hostapd/hostapd.conf6
-rw-r--r--src/ap/ap_config.h1
-rw-r--r--src/ap/hw_features.c6
4 files changed, 15 insertions, 0 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index b187ec7..40066ad 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -3136,6 +3136,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
}
} else if (os_strcmp(buf, "acs_exclude_dfs") == 0) {
conf->acs_exclude_dfs = atoi(pos);
+ } else if (os_strcmp(buf, "op_class") == 0) {
+ conf->op_class = atoi(pos);
} else if (os_strcmp(buf, "channel") == 0) {
if (os_strcmp(pos, "acs_survey") == 0) {
#ifndef CONFIG_ACS
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index 9739c61..b8a5445 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -163,6 +163,12 @@ hw_mode=g
# which will enable the ACS survey based algorithm.
channel=1
+# Global operating class (IEEE 802.11, Annex E, Table E-4)
+# This option allows hostapd to specify the operating class of the channel
+# configured with the channel parameter. channel and op_class together can
+# uniquely identify channels across different bands, including the 6 GHz band.
+#op_class=131
+
# ACS tuning - Automatic Channel Selection
# See: http://wireless.kernel.org/en/users/Documentation/acs
#
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 0aa8e0d..2a0c984 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -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;
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 2a1fa0a..2fefaf8 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -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;
}