diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2011-09-29 16:53:55 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-09-29 16:53:55 +0300 |
commit | 303f60d39b29ae6d73e74051dd7db9b460615fad (patch) | |
tree | 2c67650460b1dec9d25269a61be11c3c55e3d0c3 /src/p2p | |
parent | 0c96fd6d03d97bb5371a107600898046d638ca3f (diff) | |
download | external_wpa_supplicant_8_ti-303f60d39b29ae6d73e74051dd7db9b460615fad.zip external_wpa_supplicant_8_ti-303f60d39b29ae6d73e74051dd7db9b460615fad.tar.gz external_wpa_supplicant_8_ti-303f60d39b29ae6d73e74051dd7db9b460615fad.tar.bz2 |
P2P: Do not request station mode scans during P2P operations
The P2P search mechanism depends on the same scan functionality that
is used for station mode scans. If these operations are being used
at the same time, scan result processing is not handled properly.
Avoid unexpected behavior by delaying station mode scan requests
if a P2P operation is in progress.
Among other things, this allows the station mode connection attempt
to be continued after a P2P find or group formation has been completed
if the interface is available (i.e., when the P2P group uses a
separate virtual interface).
Diffstat (limited to 'src/p2p')
-rw-r--r-- | src/p2p/p2p.c | 8 | ||||
-rw-r--r-- | src/p2p/p2p.h | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index c0c59a6..62926b5 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -3681,3 +3681,11 @@ p2p_get_peer_found(struct p2p_data *p2p, const u8 *addr, int next) return &dev->info; } + + +int p2p_in_progress(struct p2p_data *p2p) +{ + if (p2p == NULL) + return 0; + return p2p->state != P2P_IDLE; +} diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index d01f574..4cab3da 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -1509,4 +1509,11 @@ int p2p_add_wps_vendor_extension(struct p2p_data *p2p, int p2p_set_oper_channel(struct p2p_data *p2p, u8 op_reg_class, u8 op_channel, int cfg_op_channel); +/** + * p2p_in_progress - Check whether a P2P operation is progress + * @p2p: P2P module context from p2p_init() + * Returns: 0 if P2P module is idle or 1 if an operation is in progress + */ +int p2p_in_progress(struct p2p_data *p2p); + #endif /* P2P_H */ |