Parcourir la source

nl80211: Add driver flag for firmware-based BSS selection

This new flag can be used to change wpa_supplicant behavior in the
default ap_scan=1 mode to move BSS selection into the driver (likely
firmware). This commit is only adding the flag; separate commits
will be used to change the actual connection/roaming behavior.
Vivek Natarajan il y a 13 ans
Parent
commit
004ba773ce
2 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. 2 0
      src/drivers/driver.h
  2. 9 0
      src/drivers/driver_nl80211.c

+ 2 - 0
src/drivers/driver.h

@@ -689,6 +689,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS_EAPOL_TX_STATUS		0x00010000
 /* Driver indicates TX status events for Deauth/Disassoc frames */
 #define WPA_DRIVER_FLAGS_DEAUTH_TX_STATUS		0x00020000
+/* Driver supports roaming (BSS selection) in firmware */
+#define WPA_DRIVER_FLAGS_BSS_SELECTION			0x00040000
 	unsigned int flags;
 
 	int max_scan_ssids;

+ 9 - 0
src/drivers/driver_nl80211.c

@@ -1688,6 +1688,7 @@ struct wiphy_info_data {
 	int connect_supported;
 	int offchan_tx_supported;
 	int max_remain_on_chan;
+	int firmware_roam;
 };
 
 
@@ -1811,6 +1812,9 @@ broken_combination:
 	if (tb[NL80211_ATTR_OFFCHANNEL_TX_OK])
 		info->offchan_tx_supported = 1;
 
+	if (tb[NL80211_ATTR_ROAM_SUPPORT])
+		info->firmware_roam = 1;
+
 	if (tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION])
 		info->max_remain_on_chan =
 			nla_get_u32(tb[NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION]);
@@ -1884,6 +1888,11 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
 		drv->capa.flags |= WPA_DRIVER_FLAGS_OFFCHANNEL_TX;
 	}
 
+	if (info.firmware_roam) {
+		wpa_printf(MSG_DEBUG, "nl80211: Using driver-based roaming");
+		drv->capa.flags |= WPA_DRIVER_FLAGS_BSS_SELECTION;
+	}
+
 	drv->capa.flags |= WPA_DRIVER_FLAGS_SANE_ERROR_CODES;
 	drv->capa.flags |= WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE;
 	if (info.p2p_supported)