diff options
author | Eyal Shapira <eyal@wizery.com> | 2012-08-13 14:49:56 +0300 |
---|---|---|
committer | Arik Nemtsov <arik@wizery.com> | 2012-08-13 14:58:44 +0300 |
commit | a56f6df6f8e5dcd650893e8beb4a16a633c179d1 (patch) | |
tree | 0fec7a2fd48f3caf4f8788f4954ee4918837c1df /src | |
parent | b8302f1894435388480719008e1b52903c7ab797 (diff) | |
download | external_wpa_supplicant_8_ti-a56f6df6f8e5dcd650893e8beb4a16a633c179d1.zip external_wpa_supplicant_8_ti-a56f6df6f8e5dcd650893e8beb4a16a633c179d1.tar.gz external_wpa_supplicant_8_ti-a56f6df6f8e5dcd650893e8beb4a16a633c179d1.tar.bz2 |
Add P2P IEs to probe requests only when in P2P (UPSTREAM)
The current code caused P2P and consquently WPS IEs to be added
to any probe as the check was for non null global->p2p.
global->p2p gets set whenever P2P is initialized globally
and that occurs on the first interface init.
Fix this by indicating wps is in use only when in active P2P
discovery or connection establishement.
(i.e. not P2P_IDLE - either doing search, neg or provisioning)
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/p2p/p2p.c | 7 | ||||
-rw-r--r-- | src/p2p/p2p.h | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 664addf..30042b0 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -4098,3 +4098,10 @@ int p2p_in_progress(struct p2p_data *p2p) return 0; return p2p->state != P2P_IDLE && p2p->state != P2P_PROVISIONING; } + +int p2p_non_idle(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 9be5b84..70ea654 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -1688,6 +1688,16 @@ int p2p_set_pref_chan(struct p2p_data *p2p, unsigned int num_pref_chan, */ int p2p_in_progress(struct p2p_data *p2p); +/** + * p2p_non_idle - Check whether P2P is not in P2P_IDLE. That + * means we're in either search, GO neg or provisioing. Once connected + * it's back to idle. p2p_in_progress excludes provisioing. + * @p2p: P2P module context from p2p_init() + * Returns: 0 if P2P module is idle or 1 if an operation is in progress + */ +int p2p_non_idle(struct p2p_data *p2p); + + #ifdef ANDROID_P2P /** * p2p_search_in_progress - Check whether a P2P SEARCH is in progress |