From eed65aad1447f63ea14634da43153784754e383e Mon Sep 17 00:00:00 2001 From: Janusz Dziedzic Date: Wed, 8 Jan 2014 12:24:11 +0100 Subject: [PATCH] hostapd: DFS setup seg0 correctly for HT40- Fix seg0 calculation for HT40+/HT40-. Signed-hostap: Janusz Dziedzic --- src/ap/dfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index dea4781e5..e4c00f8a1 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -176,6 +176,7 @@ static int dfs_find_channel(struct hostapd_iface *iface, static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface, struct hostapd_channel_data *chan, + int secondary_channel, u8 *vht_oper_centr_freq_seg0_idx, u8 *vht_oper_centr_freq_seg1_idx) { @@ -189,9 +190,9 @@ static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface, switch (iface->conf->vht_oper_chwidth) { case VHT_CHANWIDTH_USE_HT: - if (iface->conf->secondary_channel == 1) + if (secondary_channel == 1) *vht_oper_centr_freq_seg0_idx = chan->chan + 2; - else if (iface->conf->secondary_channel == -1) + else if (secondary_channel == -1) *vht_oper_centr_freq_seg0_idx = chan->chan - 2; else *vht_oper_centr_freq_seg0_idx = chan->chan; @@ -366,6 +367,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface, *secondary_channel = 0; dfs_adjust_vht_center_freq(iface, chan, + *secondary_channel, vht_oper_centr_freq_seg0_idx, vht_oper_centr_freq_seg1_idx);