From fd9928af958ba351cf20bc75652976cb4e36e7df Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 19 Mar 2018 15:17:29 -0700 Subject: [PATCH] qcacld-3.0: Incorporate hdd_wext_state into hdd_station_ctx None of the data items contained in struct hdd_wext_state is actually unique to wireless extensions(wext) -- cfg80211 also uses these data items. Since all of these data items are now being accessed by accessor functions, rename and relocate them to struct hdd_station_ctx. Change-Id: Icfdde73ed3f01fb1c48105e0728f610fe1d94717 CRs-Fixed: 2208687 --- core/hdd/inc/wlan_hdd_main.h | 28 +++++++++++++++------------- core/hdd/inc/wlan_hdd_wext.h | 15 --------------- core/hdd/src/wlan_hdd_wext.c | 14 +++++++++++--- 3 files changed, 26 insertions(+), 31 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 47f809c34a20..188ad8597685 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -693,7 +693,9 @@ struct hdd_mon_set_ch_info { /** * struct hdd_station_ctx -- STA-specific information - * @wext_state: wireless extensions state + * @roam_profile: current roaming profile + * @security_ie: WPA or RSN IE used by the @roam_profile + * @assoc_additional_ie: association additional IE used by the @roam_profile * @wpa_versions: bitmap of supported WPA versions * @auth_key_mgmt: bitmap of supported auth key mgmt protocols * @requested_bssid: Specific BSSID to which to connect @@ -716,7 +718,9 @@ struct hdd_mon_set_ch_info { * to immediately go into power save? */ struct hdd_station_ctx { - struct hdd_wext_state wext_state; + struct csr_roam_profile roam_profile; + uint8_t security_ie[MAX_WPA_RSN_IE_LEN]; + tSirAddie assoc_additional_ie; enum nl80211_wpa_versions wpa_versions; enum hdd_auth_key_mgmt auth_key_mgmt; struct qdf_mac_addr requested_bssid; @@ -1318,8 +1322,6 @@ struct hdd_adapter { #define WLAN_HDD_GET_STATION_CTX_PTR(adapter) (&(adapter)->session.station) #define WLAN_HDD_GET_AP_CTX_PTR(adapter) (&(adapter)->session.ap) -#define WLAN_HDD_GET_WEXT_STATE_PTR(adapter) \ - (&(adapter)->session.station.wext_state) #define WLAN_HDD_GET_CTX(adapter) ((adapter)->hdd_ctx) #define WLAN_HDD_GET_HAL_CTX(adapter) ((adapter)->hdd_ctx->hHal) #define WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter) \ @@ -2650,11 +2652,11 @@ static inline int wlan_hdd_validate_session_id(u8 session_id) static inline struct csr_roam_profile *hdd_roam_profile(struct hdd_adapter *adapter) { - struct hdd_wext_state *wext_state; + struct hdd_station_ctx *sta_ctx; - wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - return &wext_state->roamProfile; + return &sta_ctx->roam_profile; } /** @@ -2674,11 +2676,11 @@ struct csr_roam_profile *hdd_roam_profile(struct hdd_adapter *adapter) static inline uint8_t *hdd_security_ie(struct hdd_adapter *adapter) { - struct hdd_wext_state *wext_state; + struct hdd_station_ctx *sta_ctx; - wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - return wext_state->WPARSNIE; + return sta_ctx->security_ie; } /** @@ -2698,11 +2700,11 @@ uint8_t *hdd_security_ie(struct hdd_adapter *adapter) static inline tSirAddie *hdd_assoc_additional_ie(struct hdd_adapter *adapter) { - struct hdd_wext_state *wext_state; + struct hdd_station_ctx *sta_ctx; - wext_state = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - return &wext_state->assocAddIE; + return &sta_ctx->assoc_additional_ie; } bool hdd_is_roaming_in_progress(struct hdd_adapter *adapter); diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index c5e696e85a30..eb69b55f9fbf 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -199,21 +199,6 @@ enum hdd_wlan_wmm_ts_info_ack_policy { #define QCN_OUI_TYPE "\x8c\xfd\xf0\x01" #define QCN_OUI_TYPE_SIZE 4 -/* - * This structure contains the interface level (granularity) - * configuration information in support of wireless extensions. - */ -struct hdd_wext_state { - /** The CSR "desired" Profile */ - struct csr_roam_profile roamProfile; - - /**WPA or RSN IE*/ - uint8_t WPARSNIE[MAX_WPA_RSN_IE_LEN]; - - /**Additional IE for assoc */ - tSirAddie assocAddIE; -}; - struct ccp_freq_chan_map { /* List of frequencies */ uint32_t freq; diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index fbdfbe597059..406b061b8068 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -12137,13 +12137,21 @@ static void hdd_initialize_fils_info(struct hdd_adapter *adapter) int hdd_register_wext(struct net_device *dev) { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); - struct hdd_wext_state *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(adapter); + struct csr_roam_profile *roam_profile; + uint8_t *security_ie; + tSirAddie *assoc_additional_ie; QDF_STATUS status; hdd_enter(); - /* Zero the memory. This zeros the profile structure */ - memset(pwextBuf, 0, sizeof(struct hdd_wext_state)); + roam_profile = hdd_roam_profile(adapter); + qdf_mem_zero(roam_profile, sizeof(*roam_profile)); + + security_ie = hdd_security_ie(adapter); + qdf_mem_zero(security_ie, MAX_WPA_RSN_IE_LEN); + + assoc_additional_ie = hdd_assoc_additional_ie(adapter); + qdf_mem_zero(assoc_additional_ie, sizeof(*assoc_additional_ie)); status = hdd_set_wext(adapter);