]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add bssid/freq hint for driver-based BSS selection
authorDmitry Shmidt <dimitrysh@google.com>
Thu, 13 Feb 2014 13:14:18 +0000 (15:14 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 13 Feb 2014 13:14:18 +0000 (15:14 +0200)
This uses the new nl80211 attributes to allow the connect command to
provide bssid and freq hints to the driver without limiting roaming to
the specific BSS/frequency. This can be used by drivers that perform
internal BSS selection (WPA_DRIVER_FLAGS_BSS_SELECTION) as a candidate
for initial association.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c
wpa_supplicant/wpa_supplicant.c

index 7ad857616c805b8d0e03f1c7f1397f6e72e31926..d4136d7f867deae28c7c2bb6c9539e3a91a6f93c 100644 (file)
@@ -403,6 +403,16 @@ struct wpa_driver_associate_params {
         * responsible for selecting with which BSS to associate. */
        const u8 *bssid;
 
+       /**
+        * bssid_hint - BSSID of a proposed AP
+        *
+        * This indicates which BSS has been found a suitable candidate for
+        * initial association for drivers that use driver/firmwate-based BSS
+        * selection. Unlike the @bssid parameter, @bssid_hint does not limit
+        * the driver from selecting other BSSes in the ESS.
+        */
+       const u8 *bssid_hint;
+
        /**
         * ssid - The selected SSID
         */
@@ -420,6 +430,16 @@ struct wpa_driver_associate_params {
         */
        int freq;
 
+       /**
+        * freq_hint - Frequency of the channel the proposed AP is using
+        *
+        * This provides a channel on which a suitable BSS has been found as a
+        * hint for the driver. Unlike the @freq parameter, @freq_hint does not
+        * limit the driver from selecting other channels for
+        * driver/firmware-based BSS selection.
+        */
+       int freq_hint;
+
        /**
         * bg_scan_period - Background scan period in seconds, 0 to disable
         * background scan, or -1 to indicate no change to default driver
index 59785681af9f39fc980a19c5f255b29aa9eceabf..f4bb31c6b74ed1093a0685db93dcf2fcf9cfe5f1 100644 (file)
@@ -8391,6 +8391,13 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv,
                NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, params->bssid);
        }
 
+       if (params->bssid_hint) {
+               wpa_printf(MSG_DEBUG, "  * bssid_hint=" MACSTR,
+                          MAC2STR(params->bssid_hint));
+               NLA_PUT(msg, NL80211_ATTR_MAC_HINT, ETH_ALEN,
+                       params->bssid_hint);
+       }
+
        if (params->freq) {
                wpa_printf(MSG_DEBUG, "  * freq=%d", params->freq);
                NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
@@ -8398,6 +8405,12 @@ static int nl80211_connect_common(struct wpa_driver_nl80211_data *drv,
        } else
                drv->assoc_freq = 0;
 
+       if (params->freq_hint) {
+               wpa_printf(MSG_DEBUG, "  * freq_hint=%d", params->freq_hint);
+               NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ_HINT,
+                           params->freq_hint);
+       }
+
        if (params->bg_scan_period >= 0) {
                wpa_printf(MSG_DEBUG, "  * bg scan period=%d",
                           params->bg_scan_period);
index 455b15828bd9f39ef95dfb91b4da7399a18e4b6e..e21c653a7411f37ce74b17ed044cec585efe8a84 100644 (file)
@@ -1656,6 +1656,8 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
                        params.bssid = bss->bssid;
                        params.freq = bss->freq;
                }
+               params.bssid_hint = bss->bssid;
+               params.freq_hint = bss->freq;
        } else {
                params.ssid = ssid->ssid;
                params.ssid_len = ssid->ssid_len;