Use ieee80211_freq_to_chan() when getting segment indices
authorLuciano Coelho <luciano.coelho@intel.com>
Tue, 8 Sep 2015 09:46:29 +0000 (12:46 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 3 Oct 2015 18:19:09 +0000 (21:19 +0300)
commitd308a44fccc0b191956649b2264182621986af27
treee9c4d471251b781fc8f8e16ad3f9910129bfe81e
parent95e551c5f76a31792f27a0e2972ab2cf10978a8c
Use ieee80211_freq_to_chan() when getting segment indices

The hostapd_hw_get_channel() function can't be used to convert center
frequencies to channel numbers, because the hw mode lists don't have all
the center frequencies. The hw mode lists have the main channel
frequencies and flags to indicate the channel topography.

For instance, channel 5805 with VHT80- has the channel center frequency
segment 0 at 5775. This segment is only indicated indirectly in the hw
mode list by the HOSTAPD_CHAN_VHT_50_30 flag. The hw mode list doesn't
have any elements with frequency 5775 to allow the conversion to a
channel number. Thus, we need to use ieee80211_freq_to_chan() instead.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
src/ap/drv_callbacks.c
src/ap/hostapd.c