diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2014-05-16 10:40:13 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2014-05-16 10:40:13 -0700 |
commit | 6dc03bd757d3befd2c03a543a402338db03914d6 (patch) | |
tree | d6869b8285bb77f73f9df06f44af2b90d3e656f7 /src/ap/hw_features.c | |
parent | 684785c7f4e58498603a9a5ce26f933cc2557ebd (diff) | |
download | android_external_wpa_supplicant_8-6dc03bd757d3befd2c03a543a402338db03914d6.tar.gz android_external_wpa_supplicant_8-6dc03bd757d3befd2c03a543a402338db03914d6.tar.bz2 android_external_wpa_supplicant_8-6dc03bd757d3befd2c03a543a402338db03914d6.zip |
Cumulative patch from commit b19c098e75d1dfa681960d9656d36001464a746e
b19c098 Send authentication failure reason in wpas_auth_failed()
5cd0e22 P2P: Iterate through full pref_chan list in search of a valid channel
f41d55d hostapd: Check for overlapping 20 MHz BSS before starting 20/40 MHz BSS
5516ed3 WPS: Deinit before wpas_p2p_disconnect()
c70c375 SCARD: Fix GSM authentication on USIM
c78c6b7 WPS: Fix return value when context is not valid
388444e P2P: Modify the timeout for GO Negotiation on no concurrent session
7e68be3 P2P: Refrain from performing extended listen during PD
e9eb648 P2P: Reject P2P_FIND and P2P_LISTEN on disabled interface
c71c241 P2P: Clear P2P state if active interface is disabled
ad12f2f Add DRIVER_EVENT ctrl_iface command for testing purposes
3e66f78 P2P: Make sure GO start does not miss connect_without_scan
c7caac5 nl80211: Fix send_frame freq for IBSS
28fa4eb P2P: Fix scan optimization for GO during persistent group invocation
Change-Id: I5b4d46322641de1a2d87e50a7f5fdc97f2f30c38
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/ap/hw_features.c')
-rw-r--r-- | src/ap/hw_features.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index b3618345..4e66d1b7 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -395,6 +395,36 @@ static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface, } +static int ieee80211n_check_20mhz_bss(struct wpa_scan_res *bss, int pri_freq, + int start, int end) +{ + struct ieee802_11_elems elems; + struct ieee80211_ht_operation *oper; + + if (bss->freq < start || bss->freq > end || bss->freq == pri_freq) + return 0; + + ieee802_11_parse_elems((u8 *) (bss + 1), bss->ie_len, &elems, 0); + if (!elems.ht_capabilities) { + wpa_printf(MSG_DEBUG, "Found overlapping legacy BSS: " + MACSTR " freq=%d", MAC2STR(bss->bssid), bss->freq); + return 1; + } + + if (elems.ht_operation && + elems.ht_operation_len >= sizeof(*oper)) { + oper = (struct ieee80211_ht_operation *) elems.ht_operation; + if (oper->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK) + return 0; + + wpa_printf(MSG_DEBUG, "Found overlapping 20 MHz HT BSS: " + MACSTR " freq=%d", MAC2STR(bss->bssid), bss->freq); + return 1; + } + return 0; +} + + static int ieee80211n_check_40mhz_2g4(struct hostapd_iface *iface, struct wpa_scan_results *scan_res) { @@ -418,6 +448,14 @@ static int ieee80211n_check_40mhz_2g4(struct hostapd_iface *iface, int sec_chan, pri_chan; struct ieee802_11_elems elems; + /* Check for overlapping 20 MHz BSS */ + if (ieee80211n_check_20mhz_bss(bss, pri_freq, affected_start, + affected_end)) { + wpa_printf(MSG_DEBUG, + "Overlapping 20 MHz BSS is found"); + return 0; + } + ieee80211n_get_pri_sec_chan(bss, &pri_chan, &sec_chan); if (sec_chan) { |