Add bssid/freq hint for driver-based BSS selection
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>
This commit is contained in:
parent
92484e2d79
commit
7ac7fd43aa
3 changed files with 35 additions and 0 deletions
|
@ -403,6 +403,16 @@ struct wpa_driver_associate_params {
|
||||||
* responsible for selecting with which BSS to associate. */
|
* responsible for selecting with which BSS to associate. */
|
||||||
const u8 *bssid;
|
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
|
* ssid - The selected SSID
|
||||||
*/
|
*/
|
||||||
|
@ -420,6 +430,16 @@ struct wpa_driver_associate_params {
|
||||||
*/
|
*/
|
||||||
int freq;
|
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
|
* bg_scan_period - Background scan period in seconds, 0 to disable
|
||||||
* background scan, or -1 to indicate no change to default driver
|
* background scan, or -1 to indicate no change to default driver
|
||||||
|
|
|
@ -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);
|
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) {
|
if (params->freq) {
|
||||||
wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
|
wpa_printf(MSG_DEBUG, " * freq=%d", params->freq);
|
||||||
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, 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
|
} else
|
||||||
drv->assoc_freq = 0;
|
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) {
|
if (params->bg_scan_period >= 0) {
|
||||||
wpa_printf(MSG_DEBUG, " * bg scan period=%d",
|
wpa_printf(MSG_DEBUG, " * bg scan period=%d",
|
||||||
params->bg_scan_period);
|
params->bg_scan_period);
|
||||||
|
|
|
@ -1656,6 +1656,8 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
|
||||||
params.bssid = bss->bssid;
|
params.bssid = bss->bssid;
|
||||||
params.freq = bss->freq;
|
params.freq = bss->freq;
|
||||||
}
|
}
|
||||||
|
params.bssid_hint = bss->bssid;
|
||||||
|
params.freq_hint = bss->freq;
|
||||||
} else {
|
} else {
|
||||||
params.ssid = ssid->ssid;
|
params.ssid = ssid->ssid;
|
||||||
params.ssid_len = ssid->ssid_len;
|
params.ssid_len = ssid->ssid_len;
|
||||||
|
|
Loading…
Reference in a new issue