DFS: Do not use cf1 to override freq for 20 MHz channels

NL80211_ATTR_CENTER_FREQ1 is defined to be used for anything but 20 MHz
bandwidth, so it could be unset for 20 MHz channels. Do not use it to
override center frequency from NL80211_ATTR_WIPHY_FREQ (if available)
for 20 MHz channels to avoid clearing frequency.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-11-03 21:50:48 +02:00
parent 0dfd2c61a5
commit bb337ddac2

View file

@ -411,7 +411,8 @@ static int set_dfs_state(struct hostapd_iface *iface, int freq, int ht_enabled,
case CHAN_WIDTH_20_NOHT:
case CHAN_WIDTH_20:
n_chans = 1;
frequency = cf1;
if (frequency == 0)
frequency = cf1;
break;
case CHAN_WIDTH_40:
n_chans = 2;
@ -466,7 +467,8 @@ static int dfs_are_channels_overlapped(struct hostapd_iface *iface, int freq,
case CHAN_WIDTH_20_NOHT:
case CHAN_WIDTH_20:
radar_n_chans = 1;
frequency = cf1;
if (frequency == 0)
frequency = cf1;
break;
case CHAN_WIDTH_40:
radar_n_chans = 2;