diff options
| author | Abhishek Singh <absingh@codeaurora.org> | 2017-09-01 16:08:09 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappara@codeaurora.org> | 2017-09-07 23:08:26 -0700 |
| commit | ad9e7e1d33ff42ad26c1eabed4db12d0a0dc94e0 (patch) | |
| tree | c73afe58b1fdf955a3cacc2823ad5af9d1bea5d9 | |
| parent | ed1d9cff1fa055827dae7d66e9219a636b098d3c (diff) | |
qcacld-3.0: Fix OCE Vendor IE seen twice in beacon
wlan_hdd_add_hostapd_conf_vsie func take care of adding Vendor IE's
other then Whitelist, Blacklist, WPA IEs, so there is no need to
add OCE and other vendor IEs seperately.
To fix it remove the code which adds Vendor IE in
wlan_hdd_cfg80211_update_apies as it will be taken care by
wlan_hdd_add_hostapd_conf_vsie. Also fix the logic in
wlan_hdd_add_hostapd_conf_vsie to add all required vendor IEs.
Change-Id: I4391a02eb593bdc725b3a9da65e8d5c895903b5f
CRs-Fixed: 2099963
| -rw-r--r-- | core/hdd/src/wlan_hdd_hostapd.c | 116 |
1 files changed, 23 insertions, 93 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 1264e7c147c2..ccb7414d749d 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6837,44 +6837,11 @@ static void wlan_hdd_check_11gmode(u8 *pIe, u8 *require_ht, u8 *require_vht, } } -/** - * wlan_hdd_add_ie() - add ie - * @pHostapdAdapter: Pointer to hostapd adapter - * @genie: Pointer to ie to be added - * @total_ielen: Pointer to store total ie length - * @oui: Pointer to oui - * @oui_size: Size of oui - * - * Return: 0 for success non-zero for failure - */ -static int wlan_hdd_add_ie(hdd_adapter_t *pHostapdAdapter, uint8_t *genie, - uint16_t *total_ielen, uint8_t *oui, - uint8_t oui_size) -{ - uint16_t ielen = 0; - uint8_t *pIe = NULL; - beacon_data_t *pBeacon = pHostapdAdapter->sessionCtx.ap.beacon; - - pIe = wlan_hdd_get_vendor_oui_ie_ptr(oui, oui_size, - pBeacon->tail, pBeacon->tail_len); - - if (pIe) { - ielen = pIe[1] + 2; - if ((*total_ielen + ielen) <= MAX_GENIE_LEN) { - qdf_mem_copy(&genie[*total_ielen], pIe, ielen); - } else { - hdd_err("**Ie Length is too big***"); - return -EINVAL; - } - *total_ielen += ielen; - } - return 0; -} /** - * wlan_hdd_add_hostapd_conf_vsie() - configure vsie in sap mode + * wlan_hdd_add_hostapd_conf_vsie() - configure Vendor IE in sap mode * @pHostapdAdapter: Pointer to hostapd adapter - * @genie: Pointer to vsie + * @genie: Pointer to Vendor IE * @total_ielen: Pointer to store total ie length * * Return: none @@ -6888,6 +6855,7 @@ static void wlan_hdd_add_hostapd_conf_vsie(hdd_adapter_t *pHostapdAdapter, uint8_t *ptr = pBeacon->tail; uint8_t elem_id, elem_len; uint16_t ielen = 0; + bool skip_ie; if (NULL == ptr || 0 == left) return; @@ -6901,32 +6869,25 @@ static void wlan_hdd_add_hostapd_conf_vsie(hdd_adapter_t *pHostapdAdapter, elem_id, elem_len, left); return; } - if (IE_EID_VENDOR == elem_id && - (elem_len >= WPS_OUI_TYPE_SIZE)) { - /* skipping the VSIE's which we don't want to include or - * it will be included by existing code + if (IE_EID_VENDOR == elem_id) { + /* + * skipping the Vendor IE's which we don't want to + * include or it will be included by existing code. */ - if ((memcmp(&ptr[2], WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE) != - 0) && -#ifdef WLAN_FEATURE_WFD - (memcmp(&ptr[2], WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE) != - 0) && -#endif - (memcmp - (&ptr[2], WHITELIST_OUI_TYPE, - WPA_OUI_TYPE_SIZE) != 0) - && - (memcmp - (&ptr[2], BLACKLIST_OUI_TYPE, - WPA_OUI_TYPE_SIZE) != 0) - && - (memcmp - (&ptr[2], "\x00\x50\xf2\x02", - WPA_OUI_TYPE_SIZE) != 0) - && (memcmp(&ptr[2], WPA_OUI_TYPE, WPA_OUI_TYPE_SIZE) - != 0) - && (memcmp(&ptr[2], P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE) - != 0)) { + if (elem_len >= WPS_OUI_TYPE_SIZE && + (!qdf_mem_cmp(&ptr[2], WHITELIST_OUI_TYPE, + WPA_OUI_TYPE_SIZE) || + !qdf_mem_cmp(&ptr[2], BLACKLIST_OUI_TYPE, + WPA_OUI_TYPE_SIZE) || + !qdf_mem_cmp(&ptr[2], "\x00\x50\xf2\x02", + WPA_OUI_TYPE_SIZE) || + !qdf_mem_cmp(&ptr[2], WPA_OUI_TYPE, + WPA_OUI_TYPE_SIZE))) + skip_ie = true; + else + skip_ie = false; + + if (!skip_ie) { ielen = ptr[1] + 2; if ((*total_ielen + ielen) <= MAX_GENIE_LEN) { qdf_mem_copy(&genie[*total_ielen], ptr, @@ -7156,21 +7117,6 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) wlan_hdd_add_extra_ie(adapter, genie, &total_ielen, WLAN_EID_INTERWORKING); - if (0 != wlan_hdd_add_ie(adapter, genie, - &total_ielen, WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE)) { - hdd_err("Adding WPS IE failed"); - ret = -EINVAL; - goto done; - } -#ifdef WLAN_FEATURE_WFD - if (0 != wlan_hdd_add_ie(adapter, genie, - &total_ielen, WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE)) { - hdd_err("Adding WFD IE failed"); - ret = -EINVAL; - goto done; - } -#endif - #ifdef FEATURE_WLAN_WAPI if (QDF_SAP_MODE == adapter->device_mode) { wlan_hdd_add_extra_ie(adapter, genie, &total_ielen, @@ -7178,24 +7124,8 @@ int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter) } #endif - if (adapter->device_mode == QDF_SAP_MODE || - adapter->device_mode == QDF_P2P_GO_MODE) - wlan_hdd_add_hostapd_conf_vsie(adapter, genie, - &total_ielen); - - if (wlan_hdd_add_ie(adapter, genie, - &total_ielen, P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE) != 0) { - hdd_err("Adding P2P IE failed"); - ret = -EINVAL; - goto done; - } - - if (wlan_hdd_add_ie(adapter, genie, &total_ielen, - MBO_OUI_TYPE, MBO_OUI_TYPE_SIZE)) { - hdd_err("Adding mbo ie failed"); - ret = -EINVAL; - goto done; - } + wlan_hdd_add_hostapd_conf_vsie(adapter, genie, + &total_ielen); wlan_hdd_add_sap_obss_scan_ie(adapter, genie, &total_ielen); |
