]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Add support for minimal probe request content
authorIlan Peer <ilan.peer@intel.com>
Mon, 12 Jun 2023 19:59:48 +0000 (22:59 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 29 Oct 2023 09:01:03 +0000 (11:01 +0200)
Extend 'struct wpa_driver_scan_params' to allow higher layer to indicate
if minimal probe request content should be included by the driver as part
of the scan logic.

Implement this with driver_nl80211, by setting
NL80211_SCAN_FLAG_MIN_PREQ_CONTENT.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
src/drivers/driver.h
src/drivers/driver_nl80211_capa.c
src/drivers/driver_nl80211_scan.c
wpa_supplicant/scan.c

index dbe2ad5e413660d00fc25a2b8f1309f4cca3ec36..10cbb4f93420ba93659a41b5260367ee5b7b4703 100644 (file)
@@ -685,6 +685,13 @@ struct wpa_driver_scan_params {
         */
        unsigned int non_coloc_6ghz:1;
 
+       /**
+        * min_probe_req_content - Minimize probe request content to only have
+        * minimal requirement elements, e.g., supported rates etc., and no
+        * additional elements other then those provided by user space.
+        */
+       unsigned int min_probe_req_content:1;
+
        /*
         * NOTE: Whenever adding new parameters here, please make sure
         * wpa_scan_clone_params() and wpa_scan_free_params() get updated with
@@ -2253,6 +2260,8 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA   0x0000000000002000ULL
 /** Driver supports MLO in station/AP mode */
 #define WPA_DRIVER_FLAGS2_MLO                  0x0000000000004000ULL
+/** Driver supports minimal scan request probe content  */
+#define WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ         0x0000000000008000ULL
        u64 flags2;
 
 #define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
index 5e64068852105c8b77781f7737412e96c9a80a62..8ec01c866a19619f4959f8c4da9b647651489fef 100644 (file)
@@ -697,6 +697,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
                capa->flags2 |= WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA;
                capa->flags2 |= WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP;
        }
+
+       if (ext_feature_isset(ext_features, len,
+                             NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT))
+               capa->flags2 |= WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ;
 }
 
 
index 461d688a4f01bcc012b7a89b82cf2663e86b4a95..5bd3e3b46ed4d1a8af06ce6cbe4b055b93d26ba9 100644 (file)
@@ -315,6 +315,14 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd,
                        NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION;
        }
 
+       if (params->min_probe_req_content) {
+               if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_SCAN_MIN_PREQ)
+                       scan_flags |= NL80211_SCAN_FLAG_MIN_PREQ_CONTENT;
+               else
+                       wpa_printf(MSG_DEBUG,
+                                  "nl80211: NL80211_SCAN_FLAG_MIN_PREQ_CONTENT not supported");
+       }
+
        if (scan_flags &&
            nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, scan_flags))
                goto fail;
index c3984a40c94c0d25294d6e91234a13edd6500a9b..166751a1f2a1a651bdf92bdc4c9e9877870bdc70 100644 (file)
@@ -3045,6 +3045,7 @@ wpa_scan_clone_params(const struct wpa_driver_scan_params *src)
        params->relative_adjust_rssi = src->relative_adjust_rssi;
        params->p2p_include_6ghz = src->p2p_include_6ghz;
        params->non_coloc_6ghz = src->non_coloc_6ghz;
+       params->min_probe_req_content = src->min_probe_req_content;
        return params;
 
 failed: