Patchwork [v2,2/2] hostapd: add second VHT frequency segment config

login
register
mail settings
Submitter Johannes Berg
Date Nov. 21, 2012, 8:34 a.m.
Message ID <1353486882.10444.1.camel@jlt4.sipsolutions.net>
Download mbox | patch
Permalink /patch/200606/
State Accepted
Commit 3117ad428392992a4a06131fc94e42fa0b4dfd68
Headers show

Comments

Johannes Berg - Nov. 21, 2012, 8:34 a.m.
From: Johannes Berg <johannes.berg@intel.com>

Add the configuration option vht_oper_centr_freq_seg1_idx
for the second segment of an 80+80 MHz channel and use it
when building the VHT operation IE.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
---
 hostapd/config_file.c   | 5 +++--
 hostapd/hostapd.conf    | 6 ++++++
 src/ap/ap_config.h      | 1 +
 src/ap/ieee802_11_vht.c | 2 ++
 4 files changed, 12 insertions(+), 2 deletions(-)
Jouni Malinen - Nov. 24, 2012, 4:03 p.m.
On Wed, Nov 21, 2012 at 09:34:42AM +0100, Johannes Berg wrote:
> Add the configuration option vht_oper_centr_freq_seg1_idx
> for the second segment of an 80+80 MHz channel and use it
> when building the VHT operation IE.

Thanks, applied.

Patch

diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index f9b3984..f91fa80 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2515,9 +2515,10 @@  static int hostapd_config_fill(struct hostapd_config *conf,
 			conf->require_vht = atoi(pos);
 		} else if (os_strcmp(buf, "vht_oper_chwidth") == 0) {
 			conf->vht_oper_chwidth = atoi(pos);
-		} else if (os_strcmp(buf, "vht_oper_centr_freq_seg0_idx") == 0)
-		{
+		} else if (os_strcmp(buf, "vht_oper_centr_freq_seg0_idx") == 0) {
 			conf->vht_oper_centr_freq_seg0_idx = atoi(pos);
+		} else if (os_strcmp(buf, "vht_oper_centr_freq_seg1_idx") == 0) {
+			conf->vht_oper_centr_freq_seg1_idx = atoi(pos);
 #endif /* CONFIG_IEEE80211AC */
 		} else if (os_strcmp(buf, "max_listen_interval") == 0) {
 			bss->max_listen_interval = atoi(pos);
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index edbd772..439298c 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -572,6 +572,12 @@  wmm_ac_vo_acm=0
 # which is channel 42 in 5G band
 #
 #vht_oper_centr_freq_seg0_idx=42
+#
+# center freq = 5 GHz + (5 * index)
+# So index 159 gives center freq 5.795 GHz
+# which is channel 159 in 5G band
+#
+#vht_oper_centr_freq_seg1_idx=159
 
 ##### IEEE 802.1X-2004 related configuration ##################################
 
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index f5e4a6a..2722321 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -505,6 +505,7 @@  struct hostapd_config {
 	int require_vht;
 	u8 vht_oper_chwidth;
 	u8 vht_oper_centr_freq_seg0_idx;
+	u8 vht_oper_centr_freq_seg1_idx;
 };
 
 
diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
index 7599ef8..b21c2b7 100644
--- a/src/ap/ieee802_11_vht.c
+++ b/src/ap/ieee802_11_vht.c
@@ -68,6 +68,8 @@  u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid)
 	 */
 	oper->vht_op_info_chan_center_freq_seg0_idx =
 		hapd->iconf->vht_oper_centr_freq_seg0_idx;
+	oper->vht_op_info_chan_center_freq_seg1_idx =
+		hapd->iconf->vht_oper_centr_freq_seg1_idx;
 
 	oper->vht_op_info_chwidth = hapd->iconf->vht_oper_chwidth;