mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
wifi: send P2P_FIND on each p2p_scan() request
wpa_supplicant is horrible in notifying us about p2p-scans. During failed connection attempts or other timeouts, we usually are not notified about scan-stops. Therefore, a following p2p-scan will simply be ignored as we think it's still running. Avoid that problem by always forwarding the P2P_FIND command. wpa_supplicant can deal with redundant requests so we're fine. Note that this requires the caller to issue these calls in intervals or/and after any issues wifi request. Once wpas fixes this issue, we can add this guard again and the redundant requests will be suppressed. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
b5f4870edc
commit
63a0580695
1 changed files with 6 additions and 4 deletions
|
@ -1864,12 +1864,14 @@ int supplicant_p2p_start_scan(struct supplicant *s)
|
|||
*
|
||||
* Note that we could make this synchronous, but there's no real gain.
|
||||
* You still don't get any meaningful errors from wpa_supplicant, so
|
||||
* there's really no use to it.
|
||||
* there's really no use to it. Moreover, wpas' state tracking is quite
|
||||
* unreliable so we can never know whether we're really still scanning.
|
||||
* Therefore, we send the P2P_FIND on _each_ start_scan() request. It's
|
||||
* the callers responsibility to send it in proper intervals or after
|
||||
* they issues other wpas calls. Yes, this is ugly but currently the
|
||||
* only way to make this work reliably.
|
||||
*/
|
||||
|
||||
if (s->p2p_scanning)
|
||||
return 0;
|
||||
|
||||
r = wpas_message_new_request(s->bus_global,
|
||||
"P2P_FIND",
|
||||
&m);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue