P2P: Optimize join scan frequency

Allow clients to specify the BSSID of an auto GO. If the auto GO has been
discovered on another interface, optimize scan frequency by performing
a single channel scan first. Android and ChromeOS use this to streamline
auto GO discovery.

Signed-off-by: Matthew Wang <matthewmwang@chromium.org>
This commit is contained in:
Matthew Wang 2023-02-21 16:46:16 -08:00 committed by Jouni Malinen
parent b3921db426
commit 0430756e65
8 changed files with 69 additions and 17 deletions

View file

@ -359,6 +359,7 @@ DBusMessage * wpas_dbus_handler_p2p_group_add(DBusMessage *message,
char *iface = NULL;
unsigned int group_id = 0;
struct wpa_ssid *ssid;
u8 go_bssid_buf[ETH_ALEN], *go_bssid = NULL;
dbus_message_iter_init(message, &iter);
@ -384,10 +385,16 @@ DBusMessage * wpas_dbus_handler_p2p_group_add(DBusMessage *message,
goto inv_args_clear;
} else if (os_strcmp(entry.key, "persistent_group_object") ==
0 &&
entry.type == DBUS_TYPE_OBJECT_PATH)
entry.type == DBUS_TYPE_OBJECT_PATH) {
pg_object_path = os_strdup(entry.str_value);
else
} else if (os_strcmp(entry.key, "go_bssid") == 0 &&
entry.type == DBUS_TYPE_STRING) {
if (hwaddr_aton(entry.str_value, go_bssid_buf))
goto inv_args_clear;
go_bssid = go_bssid_buf;
} else {
goto inv_args_clear;
}
wpa_dbus_dict_entry_clear(&entry);
}
@ -432,7 +439,8 @@ DBusMessage * wpas_dbus_handler_p2p_group_add(DBusMessage *message,
if (wpas_p2p_group_add_persistent(wpa_s, ssid, 0, freq, 0, 0, 0,
0, 0, 0, 0, NULL, 0, 0,
false, retry_limit)) {
false, retry_limit,
go_bssid)) {
reply = wpas_dbus_error_unknown_error(
message,
"Failed to reinvoke a persistent group");