]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Capability matching for 60 GHz band
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Thu, 7 Feb 2013 14:20:18 +0000 (16:20 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 7 Feb 2013 14:20:18 +0000 (16:20 +0200)
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>
src/drivers/driver.h
wpa_supplicant/events.c

index b57ea7551afdd435b7e9bcd02c27234fbc6ab174..6a5b5ae88d28ad7e8149c6feac9c7b2b0d2d0432 100644 (file)
@@ -122,6 +122,13 @@ struct hostapd_hw_modes {
 #define IEEE80211_CAP_IBSS     0x0002
 #define IEEE80211_CAP_PRIVACY  0x0010
 
+/* DMG (60 GHz) IEEE 802.11ad */
+/* type - bits 0..1 */
+#define IEEE80211_CAP_DMG_MASK 0x0003
+#define IEEE80211_CAP_DMG_IBSS 0x0001 /* Tx by: STA */
+#define IEEE80211_CAP_DMG_PBSS 0x0002 /* Tx by: PCP */
+#define IEEE80211_CAP_DMG_AP   0x0003 /* Tx by: AP */
+
 #define WPA_SCAN_QUAL_INVALID          BIT(0)
 #define WPA_SCAN_NOISE_INVALID         BIT(1)
 #define WPA_SCAN_LEVEL_INVALID         BIT(2)
index c3e54d32eec6b09cd097c90654ba94f9a25b47fb..28d80e99776fd615eeb8b921cbf538e1b4f77f05 100644 (file)
@@ -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;
                }