]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Pass the known BSSID to the driver to optimize scan time
authorQiwei Cai <quic_qcai@quicinc.com>
Mon, 29 May 2023 05:11:06 +0000 (13:11 +0800)
committerJouni Malinen <j@w1.fi>
Mon, 30 Oct 2023 17:25:42 +0000 (19:25 +0200)
After GO negotiation is completed, the P2P Client needs to scan the GO
before connecting. Only SSID was specified for this and the driver still
might need to scan all channels which wastes time. wpa_supplicant can
pass the known BSSID in the scan request in additional P2P cases and
this allows the driver sto stop the scan once the specific BSSID is
found. This helps reduce some time for P2P connection.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/scan.c

index 0212aab3fd4d064e78f902ef164ee8a347bb7e61..e4883d51860793b8a2fa87d078cd30f89428fa01 100644 (file)
@@ -1184,6 +1184,10 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
                params.ssids[0].ssid = wpa_s->go_params->ssid;
                params.ssids[0].ssid_len = wpa_s->go_params->ssid_len;
                params.num_ssids = 1;
+               params.bssid = wpa_s->go_params->peer_interface_addr;
+               wpa_printf(MSG_DEBUG, "P2P: Use specific BSSID " MACSTR
+                          " (peer interface address) for scan",
+                          MAC2STR(params.bssid));
                goto ssid_list_set;
        }
 
@@ -1194,6 +1198,12 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
                        params.ssids[0].ssid_len =
                                wpa_s->current_ssid->ssid_len;
                        params.num_ssids = 1;
+                       if (wpa_s->current_ssid->bssid_set) {
+                               params.bssid = wpa_s->current_ssid->bssid;
+                               wpa_printf(MSG_DEBUG, "P2P: Use specific BSSID "
+                                          MACSTR " for scan",
+                                          MAC2STR(params.bssid));
+                       }
                } else {
                        wpa_printf(MSG_DEBUG, "P2P: No specific SSID known for scan during invitation");
                }