P2P: Use common function for re-starting P2P scan after station scan
Make the implementation more consistent and cleaner by using a single function for addressing all the cases where completion of a station mode scan operation allows a P2P operation (search) to be re-started. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
565110cd55
commit
f85f545e71
4 changed files with 38 additions and 43 deletions
|
@ -2505,18 +2505,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||||
#ifndef CONFIG_NO_SCAN_PROCESSING
|
#ifndef CONFIG_NO_SCAN_PROCESSING
|
||||||
case EVENT_SCAN_RESULTS:
|
case EVENT_SCAN_RESULTS:
|
||||||
wpa_supplicant_event_scan_results(wpa_s, data);
|
wpa_supplicant_event_scan_results(wpa_s, data);
|
||||||
#ifdef CONFIG_P2P
|
if (wpa_s->wpa_state != WPA_AUTHENTICATING &&
|
||||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
wpa_s->wpa_state != WPA_ASSOCIATING)
|
||||||
wpa_s->global->p2p != NULL &&
|
wpas_p2p_continue_after_scan(wpa_s);
|
||||||
wpa_s->wpa_state != WPA_AUTHENTICATING &&
|
|
||||||
wpa_s->wpa_state != WPA_ASSOCIATING) {
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_P2P */
|
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_NO_SCAN_PROCESSING */
|
#endif /* CONFIG_NO_SCAN_PROCESSING */
|
||||||
case EVENT_ASSOCINFO:
|
case EVENT_ASSOCINFO:
|
||||||
|
|
|
@ -4964,17 +4964,7 @@ void wpas_p2p_completed(struct wpa_supplicant *wpa_s)
|
||||||
wpas_notify_p2p_group_started(wpa_s, ssid, network_id, 1);
|
wpas_notify_p2p_group_started(wpa_s, ssid, network_id, 1);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
wpas_p2p_continue_after_scan(wpa_s);
|
||||||
wpa_s->global->p2p != NULL) {
|
|
||||||
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");
|
|
||||||
p2p_increase_search_delay(
|
|
||||||
wpa_s->global->p2p,
|
|
||||||
wpas_p2p_search_delay(wpa_s));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5748,3 +5738,27 @@ unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wpas_p2p_continue_after_scan(struct wpa_supplicant *wpa_s)
|
||||||
|
{
|
||||||
|
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Station mode scan operation not "
|
||||||
|
"pending anymore (sta_scan_pending=%d "
|
||||||
|
"p2p_cb_on_scan_complete=%d)", wpa_s->sta_scan_pending,
|
||||||
|
wpa_s->global->p2p_cb_on_scan_complete);
|
||||||
|
wpa_s->sta_scan_pending = 0;
|
||||||
|
|
||||||
|
if (!wpa_s->global->p2p_cb_on_scan_complete)
|
||||||
|
return;
|
||||||
|
wpa_s->global->p2p_cb_on_scan_complete = 0;
|
||||||
|
|
||||||
|
if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (p2p_other_scan_completed(wpa_s->global->p2p) == 1) {
|
||||||
|
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Pending P2P operation "
|
||||||
|
"continued after successful connection");
|
||||||
|
p2p_increase_search_delay(wpa_s->global->p2p,
|
||||||
|
wpas_p2p_search_delay(wpa_s));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -150,4 +150,12 @@ int wpas_p2p_get_ht40_mode(struct wpa_supplicant *wpa_s,
|
||||||
struct hostapd_hw_modes *mode, u8 channel);
|
struct hostapd_hw_modes *mode, u8 channel);
|
||||||
unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s);
|
unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s);
|
||||||
|
|
||||||
|
#ifdef CONFIG_P2P
|
||||||
|
void wpas_p2p_continue_after_scan(struct wpa_supplicant *wpa_s);
|
||||||
|
#else /* CONFIG_P2P */
|
||||||
|
static inline void wpas_p2p_continue_after_scan(struct wpa_supplicant *wpa_s)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_P2P */
|
||||||
|
|
||||||
#endif /* P2P_SUPPLICANT_H */
|
#endif /* P2P_SUPPLICANT_H */
|
||||||
|
|
|
@ -199,16 +199,7 @@ static void wpa_supplicant_timeout(void *eloop_ctx, void *timeout_ctx)
|
||||||
*/
|
*/
|
||||||
wpa_supplicant_req_scan(wpa_s, 1, 0);
|
wpa_supplicant_req_scan(wpa_s, 1, 0);
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
wpas_p2p_continue_after_scan(wpa_s);
|
||||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
|
||||||
wpa_s->global->p2p != NULL) {
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_P2P */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3554,16 +3545,7 @@ void wpas_connection_failed(struct wpa_supplicant *wpa_s, const u8 *bssid)
|
||||||
wpa_supplicant_req_scan(wpa_s, timeout / 1000,
|
wpa_supplicant_req_scan(wpa_s, timeout / 1000,
|
||||||
1000 * (timeout % 1000));
|
1000 * (timeout % 1000));
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
wpas_p2p_continue_after_scan(wpa_s);
|
||||||
if (wpa_s->global->p2p_cb_on_scan_complete && !wpa_s->global->p2p_disabled &&
|
|
||||||
wpa_s->global->p2p != NULL) {
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_P2P */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue