hostapd: DFS setup seg0 correctly for HT40-

Fix seg0 calculation for HT40+/HT40-.

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
Janusz Dziedzic 2014-01-08 12:24:11 +01:00 committed by Jouni Malinen
parent 25592b236b
commit eed65aad14

View file

@ -176,6 +176,7 @@ static int dfs_find_channel(struct hostapd_iface *iface,
static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface, static void dfs_adjust_vht_center_freq(struct hostapd_iface *iface,
struct hostapd_channel_data *chan, struct hostapd_channel_data *chan,
int secondary_channel,
u8 *vht_oper_centr_freq_seg0_idx, u8 *vht_oper_centr_freq_seg0_idx,
u8 *vht_oper_centr_freq_seg1_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) { switch (iface->conf->vht_oper_chwidth) {
case VHT_CHANWIDTH_USE_HT: case VHT_CHANWIDTH_USE_HT:
if (iface->conf->secondary_channel == 1) if (secondary_channel == 1)
*vht_oper_centr_freq_seg0_idx = chan->chan + 2; *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; *vht_oper_centr_freq_seg0_idx = chan->chan - 2;
else else
*vht_oper_centr_freq_seg0_idx = chan->chan; *vht_oper_centr_freq_seg0_idx = chan->chan;
@ -366,6 +367,7 @@ dfs_get_valid_channel(struct hostapd_iface *iface,
*secondary_channel = 0; *secondary_channel = 0;
dfs_adjust_vht_center_freq(iface, chan, dfs_adjust_vht_center_freq(iface, chan,
*secondary_channel,
vht_oper_centr_freq_seg0_idx, vht_oper_centr_freq_seg0_idx,
vht_oper_centr_freq_seg1_idx); vht_oper_centr_freq_seg1_idx);