aboutsummaryrefslogtreecommitdiff
path: root/contrib/wpa/wpa_supplicant/sme.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/wpa/wpa_supplicant/sme.c')
-rw-r--r--contrib/wpa/wpa_supplicant/sme.c54
1 files changed, 25 insertions, 29 deletions
diff --git a/contrib/wpa/wpa_supplicant/sme.c b/contrib/wpa/wpa_supplicant/sme.c
index f2c42ff354e7..1dc7001a7305 100644
--- a/contrib/wpa/wpa_supplicant/sme.c
+++ b/contrib/wpa/wpa_supplicant/sme.c
@@ -13,7 +13,6 @@
#include "common/ieee802_11_defs.h"
#include "common/ieee802_11_common.h"
#include "common/ocv.h"
-#include "common/hw_features_common.h"
#include "eapol_supp/eapol_supp_sm.h"
#include "common/wpa_common.h"
#include "common/sae.h"
@@ -138,6 +137,12 @@ static struct wpabuf * sme_auth_build_sae_commit(struct wpa_supplicant *wpa_s,
}
bss = wpa_bss_get_bssid_latest(wpa_s, bssid);
+ if (!bss) {
+ wpa_printf(MSG_DEBUG,
+ "SAE: BSS not available, update scan result to get BSS");
+ wpa_supplicant_update_scan_results(wpa_s);
+ bss = wpa_bss_get_bssid_latest(wpa_s, bssid);
+ }
if (bss) {
const u8 *rsnxe;
@@ -2380,14 +2385,13 @@ static void sme_send_2040_bss_coex(struct wpa_supplicant *wpa_s,
}
-int sme_proc_obss_scan(struct wpa_supplicant *wpa_s,
- struct wpa_scan_results *scan_res)
+int sme_proc_obss_scan(struct wpa_supplicant *wpa_s)
{
+ struct wpa_bss *bss;
const u8 *ie;
+ u16 ht_cap;
u8 chan_list[P2P_MAX_CHANNELS], channel;
u8 num_channels = 0, num_intol = 0, i;
- size_t j;
- int pri_freq, sec_freq;
if (!wpa_s->sme.sched_obss_scan)
return 0;
@@ -2415,36 +2419,22 @@ int sme_proc_obss_scan(struct wpa_supplicant *wpa_s,
os_memset(chan_list, 0, sizeof(chan_list));
- pri_freq = wpa_s->assoc_freq;
-
- switch (wpa_s->sme.ht_sec_chan) {
- case HT_SEC_CHAN_ABOVE:
- sec_freq = pri_freq + 20;
- break;
- case HT_SEC_CHAN_BELOW:
- sec_freq = pri_freq - 20;
- break;
- case HT_SEC_CHAN_UNKNOWN:
- default:
- wpa_msg(wpa_s, MSG_WARNING,
- "Undefined secondary channel: drop OBSS scan results");
- return 1;
- }
-
- for (j = 0; j < scan_res->num; j++) {
- struct wpa_scan_res *bss = scan_res->res[j];
- enum hostapd_hw_mode mode;
- int res;
-
+ dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) {
/* Skip other band bss */
+ enum hostapd_hw_mode mode;
mode = ieee80211_freq_to_chan(bss->freq, &channel);
if (mode != HOSTAPD_MODE_IEEE80211G &&
mode != HOSTAPD_MODE_IEEE80211B)
continue;
- res = check_bss_coex_40mhz(bss, pri_freq, sec_freq);
- if (res) {
- if (res == 2)
+ ie = wpa_bss_get_ie(bss, WLAN_EID_HT_CAP);
+ ht_cap = (ie && (ie[1] == 26)) ? WPA_GET_LE16(ie + 2) : 0;
+ wpa_printf(MSG_DEBUG, "SME OBSS scan BSS " MACSTR
+ " freq=%u chan=%u ht_cap=0x%x",
+ MAC2STR(bss->bssid), bss->freq, channel, ht_cap);
+
+ if (!ht_cap || (ht_cap & HT_CAP_INFO_40MHZ_INTOLERANT)) {
+ if (ht_cap & HT_CAP_INFO_40MHZ_INTOLERANT)
num_intol++;
/* Check whether the channel is already considered */
@@ -2583,6 +2573,12 @@ void sme_sched_obss_scan(struct wpa_supplicant *wpa_s, int enable)
ssid == NULL || ssid->mode != WPAS_MODE_INFRA)
return;
+#ifdef CONFIG_HT_OVERRIDES
+ /* No need for OBSS scan if HT40 is explicitly disabled */
+ if (ssid->disable_ht40)
+ return;
+#endif /* CONFIG_HT_OVERRIDES */
+
if (!wpa_s->hw.modes)
return;