From b5e8f06e18446918f6d801566e5709a8c87f1780 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Wed, 8 Aug 2012 10:56:33 -0700 Subject: wpa_supplicant: Update to BRCM version 0.8.0-34 - Remove interface priority - Add action parameter to service discovery functionality Change-Id: Ibc74c4053996e91f2f577b57695c68c86b5603c2 Signed-off-by: Dmitry Shmidt --- src/ap/ap_config.c | 3 --- src/ap/ap_config.h | 3 --- src/p2p/p2p.h | 9 +++++++++ src/p2p/p2p_i.h | 7 ++++++- src/p2p/p2p_sd.c | 24 ++++++++++++++++++++++++ 5 files changed, 39 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 811ffc1..2c633d9 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -474,9 +474,6 @@ static void hostapd_config_free_bss(struct hostapd_bss_config *conf) } #endif /* CONFIG_IEEE80211R */ -#ifdef ANDROID_P2P - os_free(conf->prioritize); -#endif #ifdef CONFIG_WPS os_free(conf->wps_pin_requests); os_free(conf->device_name); diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 13d5549..ca4fe58 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -323,9 +323,6 @@ struct hostapd_bss_config { u8 uuid[16]; char *wps_pin_requests; char *device_name; -#ifdef ANDROID_P2P - char *prioritize; -#endif char *manufacturer; char *model_name; char *model_number; diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 7006707..8274d73 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -53,6 +53,10 @@ enum p2p_wps_method { WPS_NOT_READY, WPS_PIN_DISPLAY, WPS_PIN_KEYPAD, WPS_PBC }; +enum p2p_sd_action { + SRV_UPDATE, SRV_ADD, SRV_DEL, SRV_FLUSH +}; + /** * struct p2p_go_neg_results - P2P Group Owner Negotiation results */ @@ -131,6 +135,7 @@ struct p2p_data; enum p2p_scan_type { P2P_SCAN_SOCIAL, P2P_SCAN_FULL, + P2P_SCAN_SPECIFIC, P2P_SCAN_SOCIAL_PLUS_ONE }; @@ -986,7 +991,11 @@ void p2p_sd_response(struct p2p_data *p2p, int freq, const u8 *dst, * of the local services. This will increment the Service Update Indicator * value which will be used in SD Request and Response frames. */ +#ifdef ANDROID_P2P +void p2p_sd_service_update(struct p2p_data *p2p, int action); +#else void p2p_sd_service_update(struct p2p_data *p2p); +#endif enum p2p_invite_role { diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index 5e21249..b0abff0 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -344,7 +344,12 @@ struct p2p_data { * srv_update_indic - Service Update Indicator for local services */ u16 srv_update_indic; - +#ifdef ANDROID_P2P + /** + * srv_count - Registered services count + */ + u16 srv_count; +#endif struct wpabuf *sd_resp; /* Fragmented SD response */ u8 sd_resp_addr[ETH_ALEN]; u8 sd_resp_dialog_token; diff --git a/src/p2p/p2p_sd.c b/src/p2p/p2p_sd.c index 0509767..7a59f10 100644 --- a/src/p2p/p2p_sd.c +++ b/src/p2p/p2p_sd.c @@ -907,9 +907,33 @@ void * p2p_sd_request(struct p2p_data *p2p, const u8 *dst, } +#ifdef ANDROID_P2P +void p2p_sd_service_update(struct p2p_data *p2p, int action) +#else void p2p_sd_service_update(struct p2p_data *p2p) +#endif { p2p->srv_update_indic++; +#ifdef ANDROID_P2P + if(action == SRV_FLUSH) + p2p->srv_count = 0; + else if (action == SRV_DEL) + p2p->srv_count--; + else if (action == SRV_ADD) + p2p->srv_count++; + + if(p2p->cfg->sd_request) { + if (p2p->srv_count == 1) { + /* First Service Registered. Enable SD capability */ + p2p->dev_capab |= P2P_DEV_CAPAB_SERVICE_DISCOVERY; + } else if (p2p->srv_count == 0 && !p2p->sd_queries) { + /* No services remaining + No queries registered . + * Remove the SD Capability + */ + p2p->dev_capab &= ~P2P_DEV_CAPAB_SERVICE_DISCOVERY; + } + } +#endif } -- cgit v1.1