wifi: iwlwifi: mvm: use BSSID when building probe requests
authorJohannes Berg <johannes.berg@intel.com>
Mon, 17 Apr 2023 08:41:22 +0000 (11:41 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 18 Apr 2023 12:47:54 +0000 (14:47 +0200)
A long time, ago in commit 818965d39177 ("cfg80211: Allow a
scan request for a specific BSSID"), the stack started passing
the BSSID that should be scanned for. Use it in iwlwifi for the
intended optimisation, and to also allow the use of this for an
implementation sending multi-link probe requests.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230417113648.0be90360cad7.If279c28079a1db34280a824cee7c3f6545fd8b9e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index 38b68827a4bd5b35d107ea011176db12b63827a9..1e20f9538640dc400f9d1127409a4ddb48eac7dc 100644 (file)
@@ -98,6 +98,7 @@ struct iwl_mvm_scan_params {
        bool scan_6ghz;
        bool enable_6ghz_passive;
        bool respect_p2p_go, respect_p2p_go_hb;
+       u8 bssid[ETH_ALEN] __aligned(2);
 };
 
 static inline void *iwl_mvm_get_scan_req_umac_data(struct iwl_mvm *mvm)
@@ -760,7 +761,7 @@ iwl_mvm_build_scan_probe(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
        frame->frame_control = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
        eth_broadcast_addr(frame->da);
-       eth_broadcast_addr(frame->bssid);
+       ether_addr_copy(frame->bssid, params->bssid);
        frame->seq_ctrl = 0;
 
        pos = frame->u.probe_req.variable;
@@ -2801,6 +2802,7 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
        params.pass_all = true;
        params.n_match_sets = 0;
        params.match_sets = NULL;
+       ether_addr_copy(params.bssid, req->bssid);
 
        params.scan_plans = &scan_plan;
        params.n_scan_plans = 1;
@@ -2894,6 +2896,7 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
        params.pass_all =  iwl_mvm_scan_pass_all(mvm, req);
        params.n_match_sets = req->n_match_sets;
        params.match_sets = req->match_sets;
+       eth_broadcast_addr(params.bssid);
        if (!req->n_scan_plans)
                return -EINVAL;