From b5ff47a32ac35323bb4c18041256feb9a2f70dc1 Mon Sep 17 00:00:00 2001 From: Surya Prakash Raajen Date: Fri, 10 May 2019 17:30:39 +0530 Subject: [PATCH] qcacmn: Clean up of CONFIG_MCL and memory optimisation Clean up of CONFIG_MCL and optimise memory of peer_assoc_param structure by use of bit fields instead of bool type Change-Id: I4b06af69b7fd9af981a250c881d163ddb1f68fa7 CRs-Fixed: 2450763 --- wmi/inc/wmi_unified_param.h | 45 +++++++++++++++++-------------------- wmi/src/wmi_unified_tlv.c | 11 ++------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 158bdcd95a..ac12793989 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -1223,7 +1223,6 @@ typedef struct { * @vdev_id: vdev id * @peer_new_assoc: peer association type * @peer_associd: peer association id - * @peer_flags: peer flags * @peer_caps: peer capabalities * @peer_listen_intval: peer listen interval * @peer_ht_caps: HT capabalities @@ -1279,7 +1278,6 @@ struct peer_assoc_params { uint32_t vdev_id; uint32_t peer_new_assoc; uint32_t peer_associd; - uint32_t peer_flags; uint32_t peer_caps; uint32_t peer_listen_intval; uint32_t peer_ht_caps; @@ -1298,30 +1296,29 @@ struct peer_assoc_params { uint32_t tx_mcs_set; uint8_t vht_capable; uint32_t peer_bw_rxnss_override; -#ifndef CONFIG_MCL uint32_t tx_max_mcs_nss; - bool is_pmf_enabled; - bool is_wme_set; - bool qos_flag; - bool apsd_flag; - bool ht_flag; - bool bw_40; - bool bw_80; - bool bw_160; - bool stbc_flag; - bool ldpc_flag; - bool static_mimops_flag; - bool dynamic_mimops_flag; - bool spatial_mux_flag; - bool vht_flag; - bool vht_ng_flag; - bool need_ptk_4_way; - bool need_gtk_2_way; - bool auth_flag; - bool safe_mode_enabled; - bool amsdu_disable; + uint32_t is_pmf_enabled:1, + is_wme_set:1, + qos_flag:1, + apsd_flag:1, + ht_flag:1, + bw_40:1, + bw_80:1, + bw_160:1, + stbc_flag:1, + ldpc_flag:1, + static_mimops_flag:1, + dynamic_mimops_flag:1, + spatial_mux_flag:1, + vht_flag:1, + vht_ng_flag:1, + need_ptk_4_way:1, + need_gtk_2_way:1, + auth_flag:1, + safe_mode_enabled:1, + amsdu_disable:1, + p2p_capable_sta:1; /* Use common structure */ -#endif uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; bool he_flag; bool twt_requester; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 16dfd7ccaa..925873c7b0 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -2325,14 +2325,6 @@ static QDF_STATUS send_beacon_tmpl_send_cmd_tlv(wmi_unified_t wmi_handle, return 0; } -#ifdef CONFIG_MCL -static inline void copy_peer_flags_tlv( - wmi_peer_assoc_complete_cmd_fixed_param * cmd, - struct peer_assoc_params *param) -{ - cmd->peer_flags = param->peer_flags; -} -#else static inline void copy_peer_flags_tlv( wmi_peer_assoc_complete_cmd_fixed_param * cmd, struct peer_assoc_params *param) @@ -2383,6 +2375,8 @@ static inline void copy_peer_flags_tlv( cmd->peer_flags |= WMI_PEER_VHT; if (param->he_flag) cmd->peer_flags |= WMI_PEER_HE; + if (param->p2p_capable_sta) + cmd->peer_flags |= WMI_PEER_IS_P2P_CAPABLE; } if (param->is_pmf_enabled) @@ -2423,7 +2417,6 @@ static inline void copy_peer_flags_tlv( if (param->twt_responder) cmd->peer_flags |= WMI_PEER_TWT_RESP; } -#endif static inline void copy_peer_mac_addr_tlv( wmi_peer_assoc_complete_cmd_fixed_param * cmd,