aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2013-02-07 14:20:18 (GMT)
committerJouni Malinen <j@w1.fi>2013-02-07 14:20:18 (GMT)
commitff3ad3c5311128f2a82d72cfa2ee47c96628c89c (patch)
tree94f966b8d7c78c87e7f33e1d2a01376be88a890a /wpa_supplicant/events.c
parent3140803b6d004c32c9e1bbb6288d04a14eb75a9b (diff)
downloadhostap-ff3ad3c5311128f2a82d72cfa2ee47c96628c89c.zip
hostap-ff3ad3c5311128f2a82d72cfa2ee47c96628c89c.tar.gz
hostap-ff3ad3c5311128f2a82d72cfa2ee47c96628c89c.tar.bz2
Capability matching for 60 GHz band
On the DMG (60 GHz) band, capability bits defined differently from non-DMG ones. Adjust capability matching to cover both cases. Also, for non-DMG bands, check ESS bit is set. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index c3e54d3..28d80e9 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -636,6 +636,28 @@ static int rate_match(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
}
+static int bss_is_dmg(struct wpa_bss *bss)
+{
+ return bss->freq > 45000;
+}
+
+
+/*
+ * Test whether BSS is in an ESS.
+ * This is done differently in DMG (60 GHz) and non-DMG bands
+ */
+static int bss_is_ess(struct wpa_bss *bss)
+{
+ if (bss_is_dmg(bss)) {
+ return (bss->caps & IEEE80211_CAP_DMG_MASK) ==
+ IEEE80211_CAP_DMG_AP;
+ }
+
+ return ((bss->caps & (IEEE80211_CAP_ESS | IEEE80211_CAP_IBSS)) ==
+ IEEE80211_CAP_ESS);
+}
+
+
static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
int i, struct wpa_bss *bss,
struct wpa_ssid *group)
@@ -769,9 +791,8 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
continue;
}
- if (bss->caps & IEEE80211_CAP_IBSS) {
- wpa_dbg(wpa_s, MSG_DEBUG, " skip - IBSS (adhoc) "
- "network");
+ if (!bss_is_ess(bss)) {
+ wpa_dbg(wpa_s, MSG_DEBUG, " skip - not ESS network");
continue;
}