From 01e8adb925d8f1ceff99b71d71e35163ffbed05b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 3 Feb 2019 10:55:55 -0800 Subject: [PATCH] qcacld-3.0: Replace typedef tSirSmeAssocInd The Linux Coding Style enumerates a few special cases where typedefs are useful, but stresses "NEVER EVER use a typedef unless you can clearly match one of those rules." The tSirSmeAssocInd typedef does not meet any of those criteria, so replace it (and the "tp" variant) with a reference to the underlying struct. Further note the Linux Coding Style frowns upon mixed-case names and so-called Hungarian notation, so in conjunction rename the underlying struct to be in compliance. Change-Id: I7f617c6b2a20f3f5fc62b3a1d0c838b7422cd845 CRs-Fixed: 2394999 --- core/mac/inc/sir_api.h | 4 ++-- core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c | 8 ++++---- core/sme/src/csr/csr_api_roam.c | 11 ++++++----- core/sme/src/csr/csr_inside_api.h | 8 ++++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index faefb3a276..0278a8ee9c 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1078,7 +1078,7 @@ enum sir_sme_phy_mode { /* / Definition for Association indication from peer */ /* / MAC ---> */ -typedef struct sSirSmeAssocInd { +struct assoc_ind { uint16_t messageType; /* eWNI_SME_ASSOC_IND */ uint16_t length; uint8_t sessionId; @@ -1127,7 +1127,7 @@ typedef struct sSirSmeAssocInd { tDot11fIEHTCaps HTCaps; tDot11fIEVHTCaps VHTCaps; tSirMacCapabilityInfo capability_info; -} tSirSmeAssocInd, *tpSirSmeAssocInd; +}; /* / Definition for Association confirm */ /* / ---> MAC */ diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index 5a4e053071..54c05952d7 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -678,10 +678,10 @@ void lim_process_mlm_assoc_cnf(struct mac_context *mac_ctx, static void lim_fill_assoc_ind_params(struct mac_context *mac_ctx, - tpLimMlmAssocInd assoc_ind, tSirSmeAssocInd *sme_assoc_ind, + tpLimMlmAssocInd assoc_ind, struct assoc_ind *sme_assoc_ind, struct pe_session *session_entry) { - sme_assoc_ind->length = sizeof(tSirSmeAssocInd); + sme_assoc_ind->length = sizeof(struct assoc_ind); sme_assoc_ind->sessionId = session_entry->smeSessionId; /* Required for indicating the frames to upper layer */ @@ -781,7 +781,7 @@ void lim_process_mlm_assoc_ind(struct mac_context *mac, uint32_t *pMsgBuf) { uint32_t len; struct scheduler_msg msg = {0}; - tSirSmeAssocInd *pSirSmeAssocInd; + struct assoc_ind *pSirSmeAssocInd; tpDphHashNode sta = 0; struct pe_session *pe_session; @@ -797,7 +797,7 @@ void lim_process_mlm_assoc_ind(struct mac_context *mac, uint32_t *pMsgBuf) return; } /* / Inform Host of STA association */ - len = sizeof(tSirSmeAssocInd); + len = sizeof(struct assoc_ind); pSirSmeAssocInd = qdf_mem_malloc(len); if (NULL == pSirSmeAssocInd) { pe_err("call to AllocateMemory failed for eWNI_SME_ASSOC_IND"); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 43c6663098..d7dc659546 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -10533,12 +10533,12 @@ csr_roam_chk_lnk_assoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr) uint32_t sessionId = CSR_SESSION_ID_INVALID; QDF_STATUS status; struct csr_roam_info *roam_info_ptr = NULL; - tSirSmeAssocInd *pAssocInd; + struct assoc_ind *pAssocInd; struct csr_roam_info roam_info; qdf_mem_zero(&roam_info, sizeof(roam_info)); sme_debug("Receive WNI_SME_ASSOC_IND from SME"); - pAssocInd = (tSirSmeAssocInd *) msg_ptr; + pAssocInd = (struct assoc_ind *) msg_ptr; status = csr_roam_get_session_id_from_bssid(mac_ctx, (struct qdf_mac_addr *) pAssocInd->bssId, &sessionId); @@ -15479,8 +15479,9 @@ QDF_STATUS csr_send_mb_deauth_cnf_msg(struct mac_context *mac, return status; } -QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac, tpSirSmeAssocInd - pAssocInd, QDF_STATUS Halstatus) +QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac, + struct assoc_ind *pAssocInd, + QDF_STATUS Halstatus) { QDF_STATUS status = QDF_STATUS_SUCCESS; tSirSmeAssocCnf *pMsg; @@ -15517,7 +15518,7 @@ QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac, tpSirSmeAssocInd } QDF_STATUS csr_send_assoc_ind_to_upper_layer_cnf_msg(struct mac_context *mac, - tpSirSmeAssocInd pAssocInd, + struct assoc_ind *pAssocInd, QDF_STATUS Halstatus, uint8_t sessionId) { diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index ff68c62a8b..30d4671d39 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -311,15 +311,15 @@ QDF_STATUS csr_send_mb_disassoc_cnf_msg(struct mac_context *mac, tpSirSmeDisassocInd pDisassocInd); QDF_STATUS csr_send_mb_deauth_cnf_msg(struct mac_context *mac, tpSirSmeDeauthInd pDeauthInd); -QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac, tpSirSmeAssocInd - pAssocInd, +QDF_STATUS csr_send_assoc_cnf_msg(struct mac_context *mac, + struct assoc_ind *pAssocInd, QDF_STATUS status); QDF_STATUS csr_send_assoc_ind_to_upper_layer_cnf_msg(struct mac_context *mac, - tpSirSmeAssocInd pAssocInd, + struct assoc_ind *pAssocInd, QDF_STATUS Halstatus, uint8_t sessionId); QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, - uint32_t sessionId, + uint32_t sessionId, eCsrRoamBssType bssType, struct csr_roamstart_bssparams *pParam, tSirBssDescription *pBssDesc);