diff options
| author | Ahmad Kholaif <akholaif@qca.qualcomm.com> | 2015-07-24 00:39:45 +0000 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-01 16:45:21 +0530 |
| commit | 9fe2590f82a6e74d8f4502ba562e339caebdd288 (patch) | |
| tree | f356b0d1d86ed1161622eeb2a349a97801da736e /src | |
| parent | fa36f79488af4aac63c1851c944ea3a41e9d7985 (diff) | |
| download | android_external_wpa_supplicant_8-9fe2590f82a6e74d8f4502ba562e339caebdd288.tar.gz android_external_wpa_supplicant_8-9fe2590f82a6e74d8f4502ba562e339caebdd288.tar.bz2 android_external_wpa_supplicant_8-9fe2590f82a6e74d8f4502ba562e339caebdd288.zip | |
P2P: Use preferred frequency list from the local driver
If the driver supports the preferred frequency list extension, use this
information from the driver when no explicitly configured preference
list (p2p_pref_chan) is present for P2P operating channel selection.
This commit adds this for GO Negotiation and Invitation use cases.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Git-commit: 370017d968e071522357ea88c0c6aaed02853222
Git-repo : git://w1.fi/srv/git/hostap.git
Change-Id: Idd39a8276daaf450b8d720a9fdf617f6427f5e48
CRs-fixed: 842468
Diffstat (limited to 'src')
| -rw-r--r-- | src/p2p/p2p.c | 17 | ||||
| -rw-r--r-- | src/p2p/p2p.h | 9 | ||||
| -rw-r--r-- | src/p2p/p2p_i.h | 3 |
3 files changed, 29 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 99bd402a..fb4c0aec 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -5390,3 +5390,20 @@ void p2p_go_neg_wait_timeout(void *eloop_ctx, void *timeout_ctx) "Timeout on waiting peer to become ready for GO Negotiation"); p2p_go_neg_failed(p2p, -1); } + + +void p2p_set_own_pref_freq_list(struct p2p_data *p2p, + const unsigned int *pref_freq_list, + unsigned int size) +{ + unsigned int i; + + if (size > P2P_MAX_PREF_CHANNELS) + size = P2P_MAX_PREF_CHANNELS; + p2p->num_pref_freq = size; + for (i = 0; i < size; i++) { + p2p->pref_freq_list[i] = pref_freq_list[i]; + p2p_dbg(p2p, "Own preferred frequency list[%u]=%u MHz", + i, p2p->pref_freq_list[i]); + } +} diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 67b8bdb6..f12419fb 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -23,6 +23,11 @@ #define P2P_MAX_QUERY_HASH 6 /** + * P2P_MAX_PREF_CHANNELS - Maximum number of preferred channels + */ +#define P2P_MAX_PREF_CHANNELS 100 + +/** * P2P_MAX_REG_CLASSES - Maximum number of regulatory classes */ #define P2P_MAX_REG_CLASSES 10 @@ -2253,4 +2258,8 @@ int p2p_service_del_asp(struct p2p_data *p2p, u32 adv_id); void p2p_service_flush_asp(struct p2p_data *p2p); struct p2ps_advertisement * p2p_get_p2ps_adv_list(struct p2p_data *p2p); +void p2p_set_own_pref_freq_list(struct p2p_data *p2p, + const unsigned int *pref_freq_list, + unsigned int size); + #endif /* P2P_H */ diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index 78e52c93..407316fc 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -535,6 +535,9 @@ struct p2p_data { u16 authorized_oob_dev_pw_id; struct wpabuf **vendor_elem; + + unsigned int pref_freq_list[P2P_MAX_PREF_CHANNELS]; + unsigned int num_pref_freq; }; /** |
