P2P: Move p2p_cb_on_scan_complete to global context
Since we have a global P2P module, the flag to trigger scan completion events to it needs to be in similar context. The previous design maintained this separately for each virtual interface and if P2P module did not run its scan operation on the virtual interface that completed the scan, P2P module would not be allowed to restart operations properly. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
762b99db7a
commit
e665ca9a8d
5 changed files with 16 additions and 15 deletions
|
@ -1049,9 +1049,10 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
|
|||
wpa_supplicant_notify_scanning(wpa_s, 0);
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
if (wpa_s->global->p2p_cb_on_scan_complete &&
|
||||
!wpa_s->global->p2p_disabled &&
|
||||
wpa_s->global->p2p != NULL && !wpa_s->sta_scan_pending) {
|
||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
|
||||
"stopped scan processing");
|
||||
|
@ -2412,11 +2413,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
|||
case EVENT_SCAN_RESULTS:
|
||||
wpa_supplicant_event_scan_results(wpa_s, data);
|
||||
#ifdef CONFIG_P2P
|
||||
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
wpa_s->global->p2p != NULL &&
|
||||
wpa_s->wpa_state != WPA_AUTHENTICATING &&
|
||||
wpa_s->wpa_state != WPA_ASSOCIATING) {
|
||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
|
||||
"continued after scan result processing");
|
||||
|
|
|
@ -137,7 +137,7 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
|
|||
wpa_printf(MSG_DEBUG, "Delaying P2P scan to allow "
|
||||
"pending station mode scan to be "
|
||||
"completed on interface %s", ifs->ifname);
|
||||
wpa_s->p2p_cb_on_scan_complete = 1;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 1;
|
||||
wpa_supplicant_req_scan(ifs, 0, 0);
|
||||
return 1;
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
|
|||
if (ret) {
|
||||
if (wpa_s->scanning ||
|
||||
wpa_s->scan_res_handler == wpas_p2p_scan_res_handler) {
|
||||
wpa_s->p2p_cb_on_scan_complete = 1;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 1;
|
||||
ret = 1;
|
||||
}
|
||||
} else
|
||||
|
@ -4166,7 +4166,7 @@ void wpas_p2p_stop_find(struct wpa_supplicant *wpa_s)
|
|||
wpa_s->p2p_long_listen = 0;
|
||||
eloop_cancel_timeout(wpas_p2p_long_listen_timeout, wpa_s, NULL);
|
||||
eloop_cancel_timeout(wpas_p2p_join_scan, wpa_s, NULL);
|
||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||
|
||||
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_MGMT) {
|
||||
wpa_drv_p2p_stop_find(wpa_s);
|
||||
|
@ -4499,9 +4499,9 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s)
|
|||
wpas_notify_p2p_group_started(wpa_s, ssid, network_id, 1);
|
||||
|
||||
done:
|
||||
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
wpa_s->global->p2p != NULL) {
|
||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
|
||||
"continued after successful connection");
|
||||
|
|
|
@ -473,7 +473,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
|
|||
if (wpas_p2p_in_progress(wpa_s)) {
|
||||
if (wpa_s->sta_scan_pending &&
|
||||
wpas_p2p_in_progress(wpa_s) == 2 &&
|
||||
wpa_s->p2p_cb_on_scan_complete) {
|
||||
wpa_s->global->p2p_cb_on_scan_complete) {
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "Process pending station "
|
||||
"mode scan during P2P search");
|
||||
} else {
|
||||
|
|
|
@ -200,9 +200,9 @@ static void wpa_supplicant_timeout(void *eloop_ctx, void *timeout_ctx)
|
|||
wpa_supplicant_req_scan(wpa_s, 1, 0);
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
wpa_s->global->p2p != NULL) {
|
||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
|
||||
"continued after timed out authentication");
|
||||
|
@ -3442,9 +3442,9 @@ void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid)
|
|||
1000 * (timeout % 1000));
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (wpa_s->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
||||
wpa_s->global->p2p != NULL) {
|
||||
wpa_s->p2p_cb_on_scan_complete = 0;
|
||||
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
|
||||
"continued after failed association");
|
||||
|
|
|
@ -239,6 +239,7 @@ struct wpa_global {
|
|||
WPA_CONC_PREF_STA,
|
||||
WPA_CONC_PREF_P2P
|
||||
} conc_pref;
|
||||
unsigned int p2p_cb_on_scan_complete:1;
|
||||
|
||||
#ifdef CONFIG_WIFI_DISPLAY
|
||||
int wifi_display;
|
||||
|
@ -541,7 +542,6 @@ struct wpa_supplicant {
|
|||
*/
|
||||
char cross_connect_uplink[100];
|
||||
|
||||
unsigned int p2p_cb_on_scan_complete:1;
|
||||
unsigned int sta_scan_pending:1;
|
||||
unsigned int p2p_auto_join:1;
|
||||
unsigned int p2p_auto_pd:1;
|
||||
|
|
Loading…
Reference in a new issue