From 345276a6b53303c86c0f803a09a5238d536e7cbe Mon Sep 17 00:00:00 2001 From: Janusz Dziedzic Date: Sat, 26 Oct 2013 16:28:45 +0300 Subject: [PATCH] DFS: Adjust center freq correctly for VHT20/VHT40 Setup correct seg0 for VHT with 20/40 MHz width (VHT_CHANWIDTH_USE_HT). Signed-hostap: Janusz Dziedzic --- src/ap/dfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 7c718a1ef..3abcf5b32 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -154,7 +154,14 @@ 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;