Patchwork [2/4] hostapd: DFS adjust center freq correctly for VHT20/VHT40

login
register
mail settings
Submitter Janusz.Dziedzic@tieto.com
Date Oct. 24, 2013, 3:40 p.m.
Message ID <1382629228-8895-2-git-send-email-janusz.dziedzic@tieto.com>
Download mbox | patch
Permalink /patch/285952/
State Accepted
Commit 345276a6b53303c86c0f803a09a5238d536e7cbe
Headers show

Comments

Janusz.Dziedzic@tieto.com - Oct. 24, 2013, 3:40 p.m.
Setup correct seg0 when VHT and width 20/40 MHz
(VHT_CHANWIDTH_USE_HT).

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
 src/ap/dfs.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/src/ap/dfs.c b/src/ap/dfs.c
index 70696cd..10e7e48 100644
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -150,7 +150,13 @@  static void dfs_adjust_vht_center_freq(struct hostapd_data *hapd,
 
 	switch (hapd->iconf->vht_oper_chwidth) {
 	case VHT_CHANWIDTH_USE_HT:
-		hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 2;
+		if (hapd->iconf->secondary_channel == 1)
+			hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 2;
+		else if (hapd->iconf->secondary_channel == -1)
+			hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan - 2;
+		else
+			hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan;
+
 		break;
 	case VHT_CHANWIDTH_80MHZ:
 		hapd->iconf->vht_oper_centr_freq_seg0_idx = chan->chan + 6;