dbus: Emit ScanInProgress6GHz property

Expose whether a 6 GHz scan is in progress with the ScanInProgress6GHz
property and flush properties as soon as the property is updated, so
that platforms can choose not to disconnect while a 6 GHz scan is in
progress. Once the 6 GHz scan has completed and scan results have been
received, the ScanInProgress6GHz property is reset to false.

Signed-off-by: Ruth Mekonnen <rmekonnen@chromium.org>
This commit is contained in:
Ruth Mekonnen 2024-06-12 20:09:43 +00:00 committed by Jouni Malinen
parent b53d7a6a86
commit 9c0a6d64d0
9 changed files with 60 additions and 0 deletions

View file

@ -883,6 +883,11 @@ fi.w1.wpa_supplicant1.CreateInterface.
<p>The most recent roam success or failure.</p> <p>The most recent roam success or failure.</p>
</li> </li>
<li>
<h3>ScanInProgress6GHz - b - (read)</h3>
<p>Whether a 6GHz scan is currently in progress.</p>
</li>
<li> <li>
<h3>SessionLength - u - (read)</h3> <h3>SessionLength - u - (read)</h3>
<p>The most recent BSS session length in milliseconds.</p> <p>The most recent BSS session length in milliseconds.</p>

View file

@ -2396,6 +2396,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
case WPAS_DBUS_PROP_ROAM_COMPLETE: case WPAS_DBUS_PROP_ROAM_COMPLETE:
prop = "RoamComplete"; prop = "RoamComplete";
break; break;
case WPAS_DBUS_PROP_SCAN_IN_PROGRESS_6GHZ:
prop = "ScanInProgress6GHz";
flush = TRUE;
break;
case WPAS_DBUS_PROP_SESSION_LENGTH: case WPAS_DBUS_PROP_SESSION_LENGTH:
prop = "SessionLength"; prop = "SessionLength";
break; break;
@ -3983,6 +3987,12 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
NULL, NULL,
NULL NULL
}, },
{
"ScanInProgress6GHz", WPAS_DBUS_NEW_IFACE_INTERFACE, "b",
wpas_dbus_getter_scan_in_progress_6ghz,
NULL,
NULL
},
{ {
"SessionLength", WPAS_DBUS_NEW_IFACE_INTERFACE, "u", "SessionLength", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
wpas_dbus_getter_session_length, wpas_dbus_getter_session_length,

View file

@ -36,6 +36,7 @@ enum wpas_dbus_prop {
WPAS_DBUS_PROP_ASSOC_STATUS_CODE, WPAS_DBUS_PROP_ASSOC_STATUS_CODE,
WPAS_DBUS_PROP_ROAM_TIME, WPAS_DBUS_PROP_ROAM_TIME,
WPAS_DBUS_PROP_ROAM_COMPLETE, WPAS_DBUS_PROP_ROAM_COMPLETE,
WPAS_DBUS_PROP_SCAN_IN_PROGRESS_6GHZ,
WPAS_DBUS_PROP_SESSION_LENGTH, WPAS_DBUS_PROP_SESSION_LENGTH,
WPAS_DBUS_PROP_BSS_TM_STATUS, WPAS_DBUS_PROP_BSS_TM_STATUS,
WPAS_DBUS_PROP_MAC_ADDRESS, WPAS_DBUS_PROP_MAC_ADDRESS,

View file

@ -3835,6 +3835,29 @@ dbus_bool_t wpas_dbus_getter_roam_complete(
} }
/**
* wpas_dbus_getter_scan_in_progress_6ghz - Get whether a 6 GHz scan is in
* progress
* @iter: Pointer to incoming dbus message iter
* @error: Location to store error on failure
* @user_data: Function specific data
* Returns: TRUE on success, FALSE on failure
*
* Getter function for "ScanInProgress6GHz" property.
*/
dbus_bool_t wpas_dbus_getter_scan_in_progress_6ghz(
const struct wpa_dbus_property_desc *property_desc,
DBusMessageIter *iter, DBusError *error, void *user_data)
{
struct wpa_supplicant *wpa_s = user_data;
dbus_bool_t scan_in_progress_6ghz = wpa_s->scan_in_progress_6ghz ?
TRUE : FALSE;
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_BOOLEAN,
&scan_in_progress_6ghz, error);
}
/** /**
* wpas_dbus_getter_session_length - Get most recent BSS session length * wpas_dbus_getter_session_length - Get most recent BSS session length
* @iter: Pointer to incoming dbus message iter * @iter: Pointer to incoming dbus message iter

View file

@ -173,6 +173,7 @@ DECLARE_ACCESSOR(wpas_dbus_getter_auth_status_code);
DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code); DECLARE_ACCESSOR(wpas_dbus_getter_assoc_status_code);
DECLARE_ACCESSOR(wpas_dbus_getter_roam_time); DECLARE_ACCESSOR(wpas_dbus_getter_roam_time);
DECLARE_ACCESSOR(wpas_dbus_getter_roam_complete); DECLARE_ACCESSOR(wpas_dbus_getter_roam_complete);
DECLARE_ACCESSOR(wpas_dbus_getter_scan_in_progress_6ghz);
DECLARE_ACCESSOR(wpas_dbus_getter_session_length); DECLARE_ACCESSOR(wpas_dbus_getter_session_length);
DECLARE_ACCESSOR(wpas_dbus_getter_bss_tm_status); DECLARE_ACCESSOR(wpas_dbus_getter_bss_tm_status);
DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age); DECLARE_ACCESSOR(wpas_dbus_getter_bss_expire_age);

View file

@ -2433,6 +2433,12 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
scan_res = wpa_supplicant_get_scan_results(wpa_s, scan_res = wpa_supplicant_get_scan_results(wpa_s,
data ? &data->scan_info : data ? &data->scan_info :
NULL, 1, NULL); NULL, 1, NULL);
if (wpa_s->scan_in_progress_6ghz) {
wpa_s->scan_in_progress_6ghz = false;
wpas_notify_scan_in_progress_6ghz(wpa_s);
}
if (scan_res == NULL) { if (scan_res == NULL) {
if (wpa_s->conf->ap_scan == 2 || ap || if (wpa_s->conf->ap_scan == 2 || ap ||
wpa_s->scan_res_handler == scan_only_handler) wpa_s->scan_res_handler == scan_only_handler)
@ -2614,6 +2620,8 @@ static int wpas_trigger_6ghz_scan(struct wpa_supplicant *wpa_s,
wpa_add_scan_freqs_list(wpa_s, HOSTAPD_MODE_IEEE80211A, &params, wpa_add_scan_freqs_list(wpa_s, HOSTAPD_MODE_IEEE80211A, &params,
true, false, false); true, false, false);
if (!wpa_supplicant_trigger_scan(wpa_s, &params, true, true)) { if (!wpa_supplicant_trigger_scan(wpa_s, &params, true, true)) {
wpa_s->scan_in_progress_6ghz = true;
wpas_notify_scan_in_progress_6ghz(wpa_s);
os_free(params.freqs); os_free(params.freqs);
return 1; return 1;
} }

View file

@ -168,6 +168,16 @@ void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s)
} }
void wpas_notify_scan_in_progress_6ghz(struct wpa_supplicant *wpa_s)
{
if (wpa_s->p2p_mgmt)
return;
wpas_dbus_signal_prop_changed(wpa_s,
WPAS_DBUS_PROP_SCAN_IN_PROGRESS_6GHZ);
}
void wpas_notify_session_length(struct wpa_supplicant *wpa_s) void wpas_notify_session_length(struct wpa_supplicant *wpa_s)
{ {
if (wpa_s->p2p_mgmt) if (wpa_s->p2p_mgmt)

View file

@ -30,6 +30,7 @@ void wpas_notify_auth_status_code(struct wpa_supplicant *wpa_s);
void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s); void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s);
void wpas_notify_roam_time(struct wpa_supplicant *wpa_s); void wpas_notify_roam_time(struct wpa_supplicant *wpa_s);
void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s); void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s);
void wpas_notify_scan_in_progress_6ghz(struct wpa_supplicant *wpa_s);
void wpas_notify_session_length(struct wpa_supplicant *wpa_s); void wpas_notify_session_length(struct wpa_supplicant *wpa_s);
void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s); void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s);
void wpas_notify_network_changed(struct wpa_supplicant *wpa_s); void wpas_notify_network_changed(struct wpa_supplicant *wpa_s);

View file

@ -1583,6 +1583,7 @@ struct wpa_supplicant {
bool wps_scan_done; /* Set upon receiving scan results event */ bool wps_scan_done; /* Set upon receiving scan results event */
bool supp_pbc_active; /* Set for interface when PBC is triggered */ bool supp_pbc_active; /* Set for interface when PBC is triggered */
bool wps_overlap; bool wps_overlap;
bool scan_in_progress_6ghz; /* Set upon a 6 GHz scan being triggered */
#ifdef CONFIG_PASN #ifdef CONFIG_PASN
struct pasn_data pasn; struct pasn_data pasn;