]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Adjust center freq correctly for VHT20/VHT40
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Sat, 26 Oct 2013 13:28:45 +0000 (16:28 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 26 Oct 2013 14:48:41 +0000 (17:48 +0300)
Setup correct seg0 for VHT with 20/40 MHz width (VHT_CHANWIDTH_USE_HT).

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>

src/ap/dfs.c

index 7c718a1ef902f4c41184391cbcef97627621a700..3abcf5b3224be5a3584b584723890603207596aa 100644 (file)
@@ -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;