mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-18 18:01:23 +00:00
127 lines
4.3 KiB
Diff
127 lines
4.3 KiB
Diff
From 69e25643c80531592bd048ba08ff66d14aee4ca5 Mon Sep 17 00:00:00 2001
|
|
From: Aloka Dixit <quic_alokad@quicinc.com>
|
|
Date: Mon, 20 Sep 2021 13:53:40 -0700
|
|
Subject: [PATCH 04/23] eht: operating channel width configuration
|
|
|
|
Add new configuration options to configure EHT operating channel width
|
|
and center frequency.
|
|
|
|
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
|
|
---
|
|
hostapd/config_file.c | 4 ++++
|
|
hostapd/hostapd.conf | 9 +++++++++
|
|
src/ap/ap_config.h | 20 ++++++++++++++++++++
|
|
src/ap/ctrl_iface_ap.c | 13 +++++++++++++
|
|
4 files changed, 46 insertions(+)
|
|
|
|
--- a/hostapd/config_file.c
|
|
+++ b/hostapd/config_file.c
|
|
@@ -4626,6 +4626,10 @@ static int hostapd_config_fill(struct ho
|
|
#ifdef CONFIG_IEEE80211BE
|
|
} else if (os_strcmp(buf, "ieee80211be") == 0) {
|
|
conf->ieee80211be = atoi(pos);
|
|
+ } else if (os_strcmp(buf, "eht_oper_chwidth") == 0) {
|
|
+ conf->eht_oper_chwidth = atoi(pos);
|
|
+ } else if (os_strcmp(buf, "eht_oper_centr_freq_seg0_idx") == 0) {
|
|
+ conf->eht_oper_centr_freq_seg0_idx = atoi(pos);
|
|
#endif /* CONFIG_IEEE80211BE */
|
|
} else {
|
|
wpa_printf(MSG_ERROR,
|
|
--- a/hostapd/hostapd.conf
|
|
+++ b/hostapd/hostapd.conf
|
|
@@ -973,6 +973,15 @@ wmm_ac_vo_acm=0
|
|
#disable_11be: Boolean (0/1) to disable EHT for a specific BSS
|
|
#disable_11be=0
|
|
|
|
+# EHT operating channel information; see matching he_* parameters for details.
|
|
+# The field eht_oper_centr_freq_seg0_idx field is used to indicate center
|
|
+# frequency of 40, 80 and 160 MHz bandwidth operation.
|
|
+# In 6 GHz band, eht_oper_chwidth is ignored and the channel width is
|
|
+# derived from the configured operating class (IEEE P802.11be/D1.1, July 2021,
|
|
+# Annex E, E.1 Country information and operating classes).
|
|
+#eht_oper_chwidth
|
|
+#eht_oper_centr_freq_seg0_idx
|
|
+
|
|
##### IEEE 802.1X-2004 related configuration ##################################
|
|
|
|
# Require IEEE 802.1X authorization
|
|
--- a/src/ap/ap_config.h
|
|
+++ b/src/ap/ap_config.h
|
|
@@ -1113,6 +1113,10 @@ struct hostapd_config {
|
|
#endif /* CONFIG_AIRTIME_POLICY */
|
|
|
|
int ieee80211be;
|
|
+#ifdef CONFIG_IEEE80211BE
|
|
+ u8 eht_oper_chwidth;
|
|
+ u8 eht_oper_centr_freq_seg0_idx;
|
|
+#endif /* CONFIG_IEEE80211BE */
|
|
};
|
|
|
|
static inline u8 hostapd_get_he_6ghz_reg_pwr_type(struct hostapd_config *conf)
|
|
@@ -1127,6 +1131,10 @@ static inline u8 hostapd_get_he_6ghz_reg
|
|
|
|
static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf)
|
|
{
|
|
+#ifdef CONFIG_IEEE80211BE
|
|
+ if (conf->ieee80211be)
|
|
+ return conf->eht_oper_chwidth;
|
|
+#endif /* CONFIG_IEEE80211BE */
|
|
#ifdef CONFIG_IEEE80211AX
|
|
if (conf->ieee80211ax)
|
|
return conf->he_oper_chwidth;
|
|
@@ -1137,6 +1145,10 @@ static inline u8 hostapd_get_oper_chwidt
|
|
static inline void
|
|
hostapd_set_oper_chwidth(struct hostapd_config *conf, u8 oper_chwidth)
|
|
{
|
|
+#ifdef CONFIG_IEEE80211BE
|
|
+ if (conf->ieee80211be)
|
|
+ conf->eht_oper_chwidth = oper_chwidth;
|
|
+#endif /* CONFIG_IEEE80211BE */
|
|
#ifdef CONFIG_IEEE80211AX
|
|
if (conf->ieee80211ax)
|
|
conf->he_oper_chwidth = oper_chwidth;
|
|
@@ -1147,6 +1159,10 @@ hostapd_set_oper_chwidth(struct hostapd_
|
|
static inline u8
|
|
hostapd_get_oper_centr_freq_seg0_idx(struct hostapd_config *conf)
|
|
{
|
|
+#ifdef CONFIG_IEEE80211BE
|
|
+ if (conf->ieee80211be)
|
|
+ return conf->eht_oper_centr_freq_seg0_idx;
|
|
+#endif /* CONFIG_IEEE80211BE */
|
|
#ifdef CONFIG_IEEE80211AX
|
|
if (conf->ieee80211ax)
|
|
return conf->he_oper_centr_freq_seg0_idx;
|
|
@@ -1158,6 +1174,10 @@ static inline void
|
|
hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
|
|
u8 oper_centr_freq_seg0_idx)
|
|
{
|
|
+#ifdef CONFIG_IEEE80211BE
|
|
+ if (conf->ieee80211be)
|
|
+ conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
|
|
+#endif /* CONFIG_IEEE80211BE */
|
|
#ifdef CONFIG_IEEE80211AX
|
|
if (conf->ieee80211ax)
|
|
conf->he_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
|
|
--- a/src/ap/ctrl_iface_ap.c
|
|
+++ b/src/ap/ctrl_iface_ap.c
|
|
@@ -1050,6 +1050,19 @@ int hostapd_ctrl_iface_status(struct hos
|
|
return len;
|
|
len += ret;
|
|
|
|
+#ifdef CONFIG_IEEE80211BE
|
|
+ if (iface->conf->ieee80211be && !hapd->conf->disable_11be) {
|
|
+ ret = os_snprintf(buf + len, buflen - len,
|
|
+ "eht_oper_chwidth=%d\n"
|
|
+ "eht_oper_centr_freq_seg0_idx=%d\n",
|
|
+ iface->conf->eht_oper_chwidth,
|
|
+ iface->conf->eht_oper_centr_freq_seg0_idx);
|
|
+ if (os_snprintf_error(buflen - len, ret))
|
|
+ return len;
|
|
+ len += ret;
|
|
+ }
|
|
+#endif /* CONFIG_IEEE80211BE */
|
|
+
|
|
#ifdef CONFIG_IEEE80211AX
|
|
if (iface->conf->ieee80211ax && !hapd->conf->disable_11ax) {
|
|
ret = os_snprintf(buf + len, buflen - len,
|