diff --git a/components/mlme/core/inc/wlan_mlme_main.h b/components/mlme/core/inc/wlan_mlme_main.h index 1f8d2c8528b4..bef091a2baa9 100644 --- a/components/mlme/core/inc/wlan_mlme_main.h +++ b/components/mlme/core/inc/wlan_mlme_main.h @@ -43,16 +43,6 @@ struct wlan_mlme_psoc_ext_obj { struct wlan_mlme_cfg cfg; }; -/** - * struct wlan_ies - Generic WLAN Information Element(s) format - * @len: Total length of the IEs - * @data: IE data - */ -struct wlan_ies { - uint16_t len; - uint8_t *data; -}; - /** * struct wlan_disconnect_info - WLAN Disconnection Information * @self_discon_ies: Disconnect IEs to be sent in deauth/disassoc frames diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 242f48bb6227..832dd01ea055 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2335,4 +2335,13 @@ struct mlme_roam_debug_info { struct wmi_neighbor_report_data data_11kv; }; +/** + * struct wlan_ies - Generic WLAN Information Element(s) format + * @len: Total length of the IEs + * @data: IE data + */ +struct wlan_ies { + uint16_t len; + uint8_t *data; +}; #endif diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 08e4c3f26a65..e5cd8eec0f1d 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1532,6 +1532,13 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter, return; qdf_mem_copy(cache_sta_info, stainfo, sizeof(*cache_sta_info)); + cache_sta_info->assoc_req_ies.data = + qdf_mem_malloc(event->ies_len); + if (cache_sta_info->assoc_req_ies.data) { + qdf_mem_copy(cache_sta_info->assoc_req_ies.data, + event->ies, event->ies_len); + cache_sta_info->assoc_req_ies.len = event->ies_len; + } qdf_mem_zero(&cache_sta_info->sta_node, sizeof(cache_sta_info->sta_node)); diff --git a/core/hdd/src/wlan_hdd_sta_info.c b/core/hdd/src/wlan_hdd_sta_info.c index 2d07a386cd3b..f2e8976f7af0 100644 --- a/core/hdd/src/wlan_hdd_sta_info.c +++ b/core/hdd/src/wlan_hdd_sta_info.c @@ -75,18 +75,26 @@ QDF_STATUS hdd_sta_info_attach(struct hdd_sta_info_obj *sta_info_container, void hdd_sta_info_detach(struct hdd_sta_info_obj *sta_info_container, struct hdd_station_info **sta_info) { + struct hdd_station_info *info; + if (!sta_info_container || !sta_info) { hdd_err("Parameter(s) null"); return; } + info = *sta_info; qdf_spin_lock_bh(&sta_info_container->sta_obj_lock); - qdf_ht_remove(&((*sta_info)->sta_node)); + qdf_ht_remove(&(info->sta_node)); qdf_spin_unlock_bh(&sta_info_container->sta_obj_lock); - qdf_mem_free(*sta_info); + if (info->assoc_req_ies.len) { + qdf_mem_free(info->assoc_req_ies.data); + info->assoc_req_ies.data = NULL; + info->assoc_req_ies.len = 0; + } + qdf_mem_free(info); *sta_info = NULL; } diff --git a/core/hdd/src/wlan_hdd_sta_info.h b/core/hdd/src/wlan_hdd_sta_info.h index 1a356676cc9f..61c72e35967f 100644 --- a/core/hdd/src/wlan_hdd_sta_info.h +++ b/core/hdd/src/wlan_hdd_sta_info.h @@ -32,6 +32,7 @@ #include "cdp_txrx_cmn_struct.h" #include "sir_mac_prot_def.h" #include +#include /* A bucket size of 2^4 = 16 */ #define WLAN_HDD_STA_INFO_SIZE 4 @@ -120,6 +121,7 @@ enum dhcp_nego_status { * feature or not, if first bit is 1 it indicates that FW supports this * feature, if it is 0 it indicates FW doesn't support this feature * @sta_info: The sta_info node for the station info list maintained in adapter + * @assoc_req_ies: Assoc request IEs of the peer station */ struct hdd_station_info { bool in_use; @@ -168,6 +170,7 @@ struct hdd_station_info { uint32_t rx_retry_cnt; uint32_t rx_mc_bc_cnt; struct qdf_ht_entry sta_node; + struct wlan_ies assoc_req_ies; }; /** diff --git a/core/hdd/src/wlan_hdd_station_info.c b/core/hdd/src/wlan_hdd_station_info.c index a5053da0993e..1d10b2439eb0 100644 --- a/core/hdd/src/wlan_hdd_station_info.c +++ b/core/hdd/src/wlan_hdd_station_info.c @@ -108,6 +108,8 @@ QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_DRIVER_DISCONNECT_REASON #define BEACON_IES \ QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_BEACON_IES +#define ASSOC_REQ_IES \ + QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_ASSOC_REQ_IES /* * MSB of rx_mc_bc_cnt indicates whether FW supports rx_mc_bc_cnt @@ -1136,6 +1138,9 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx, NLA_HDRLEN) + (sizeof(stainfo->rx_retry_cnt) + NLA_HDRLEN); + if (stainfo->assoc_req_ies.len) + nl_buf_len += stainfo->assoc_req_ies.len + NLA_HDRLEN; + skb = cfg80211_vendor_cmd_alloc_reply_skb(hdd_ctx->wiphy, nl_buf_len); if (!skb) { hdd_err("cfg80211_vendor_cmd_alloc_reply_skb failed"); @@ -1196,6 +1201,13 @@ static int hdd_get_cached_station_remote(struct hdd_context *hdd_ctx, } } + if (stainfo->assoc_req_ies.len) { + if (nla_put(skb, ASSOC_REQ_IES, stainfo->assoc_req_ies.len, + stainfo->assoc_req_ies.data)) { + hdd_err("Failed to put assoc req IEs"); + goto fail; + } + } hdd_sta_info_detach(&adapter->cache_sta_info_list, &stainfo); qdf_atomic_dec(&adapter->cache_sta_count);