Patch for using 802.11ah (S1G) by config file.
>From 5f24f3a5d22731a28c14d6923a1b0ed5fde001f0 Mon Sep 17 00:00:00 2001 From: jkshin <jk.shin@xxxxxxxxxxxx> Date: Wed, 9 Nov 2022 11:14:27 +0900 Subject: [PATCH] Patch for using 802.11ah (S1G) by config file. Signed-off-by: JUN-KYU SHIN <jk.shinr@xxxxxxxxxxxx> --- hostapd/config_file.c | 2 ++ src/common/defs.h | 1 + src/common/ieee802_11_common.c | 1 + src/drivers/driver_nl80211_capa.c | 9 ++++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 5715ded42..a1255a380 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -3094,6 +3094,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, conf->hw_mode = HOSTAPD_MODE_IEEE80211G; else if (os_strcmp(pos, "ad") == 0) conf->hw_mode = HOSTAPD_MODE_IEEE80211AD; + else if (os_strcmp(pos, "ah") == 0) + conf->hw_mode = HOSTAPD_MODE_IEEE80211AH; else if (os_strcmp(pos, "any") == 0) conf->hw_mode = HOSTAPD_MODE_IEEE80211ANY; else { diff --git a/src/common/defs.h b/src/common/defs.h index 3e658cbcf..6dee85fa3 100644 --- a/src/common/defs.h +++ b/src/common/defs.h @@ -375,6 +375,7 @@ enum hostapd_hw_mode { HOSTAPD_MODE_IEEE80211G, HOSTAPD_MODE_IEEE80211A, HOSTAPD_MODE_IEEE80211AD, + HOSTAPD_MODE_IEEE80211AH, HOSTAPD_MODE_IEEE80211ANY, NUM_HOSTAPD_MODES }; diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c index 924fe24f0..e047bee6a 100644 --- a/src/common/ieee802_11_common.c +++ b/src/common/ieee802_11_common.c @@ -2011,6 +2011,7 @@ static enum phy_type ieee80211_phy_type_by_freq(int freq) switch (hw_mode) { case HOSTAPD_MODE_IEEE80211A: + case HOSTAPD_MODE_IEEE80211AH: return PHY_TYPE_OFDM; case HOSTAPD_MODE_IEEE80211B: return PHY_TYPE_HRDSSS; diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 512bbb6de..286c137f7 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -2089,7 +2089,9 @@ wpa_driver_nl80211_postprocess_modes(struct hostapd_hw_modes *modes, for (m = 0; m < *num_modes; m++) { if (!modes[m].num_channels) continue; - if (modes[m].channels[0].freq < 2000) { + if (modes[m].channels[0].freq < 1000) { + modes[m].mode = HOSTAPD_MODE_IEEE80211AH; + } else if (modes[m].channels[0].freq < 2000) { modes[m].num_channels = 0; continue; } else if (modes[m].channels[0].freq < 4000) { @@ -2132,6 +2134,9 @@ wpa_driver_nl80211_postprocess_modes(struct hostapd_hw_modes *modes, return modes; /* 802.11b already included */ if (modes[m].mode == HOSTAPD_MODE_IEEE80211G) mode11g_idx = m; + if (modes[m].mode == HOSTAPD_MODE_IEEE80211AH) { + return modes; + } } if (mode11g_idx < 0) @@ -2514,6 +2519,8 @@ static const char * modestr(enum hostapd_hw_mode mode) return "802.11a"; case HOSTAPD_MODE_IEEE80211AD: return "802.11ad"; + case HOSTAPD_MODE_IEEE80211AH: + return "802.11ah"; default: return "?"; } -- 2.25.1
_______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap