Selaa lähdekoodia

qcacld-3.0: Replace typedef tSirSmeDisassocInd

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 tSirSmeDisassocInd 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: I97b38a01207d9060e1810a5747be2dd80d28de90
CRs-Fixed: 2395989
Jeff Johnson 6 vuotta sitten
vanhempi
sitoutus
318a9883dd

+ 2 - 2
core/mac/inc/sir_api.h

@@ -1245,7 +1245,7 @@ struct disassoc_rsp {
 };
 
 /* / Definition for Disassociation indication from peer */
-typedef struct sSirSmeDisassocInd {
+struct disassoc_ind {
 	uint16_t messageType;   /* eWNI_SME_DISASSOC_IND */
 	uint16_t length;
 	uint8_t sessionId;      /* Session Identifier */
@@ -1255,7 +1255,7 @@ typedef struct sSirSmeDisassocInd {
 	struct qdf_mac_addr peer_macaddr;
 	uint16_t staId;
 	uint32_t reasonCode;
-} tSirSmeDisassocInd, *tpSirSmeDisassocInd;
+};
 
 /* / Definition for Disassociation confirm */
 /* / MAC ---> */

+ 7 - 6
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -736,7 +736,7 @@ lim_send_sme_disassoc_ntf(struct mac_context *mac,
 
 	uint8_t *pBuf;
 	struct disassoc_rsp *pSirSmeDisassocRsp;
-	tSirSmeDisassocInd *pSirSmeDisassocInd;
+	struct disassoc_ind *pSirSmeDisassocInd;
 	uint32_t *pMsg = NULL;
 	bool failure = false;
 	struct pe_session *session = NULL;
@@ -850,7 +850,8 @@ lim_send_sme_disassoc_ntf(struct mac_context *mac,
 		 * frame reception from peer entity or due to
 		 * loss of link with peer entity.
 		 */
-		pSirSmeDisassocInd = qdf_mem_malloc(sizeof(tSirSmeDisassocInd));
+		pSirSmeDisassocInd =
+				qdf_mem_malloc(sizeof(*pSirSmeDisassocInd));
 		if (!pSirSmeDisassocInd) {
 			failure = true;
 			goto error;
@@ -858,7 +859,7 @@ lim_send_sme_disassoc_ntf(struct mac_context *mac,
 		pe_debug("send eWNI_SME_DISASSOC_IND with retCode: %d for " MAC_ADDRESS_STR,
 			reasonCode, MAC_ADDR_ARRAY(peerMacAddr));
 		pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
-		pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
+		pSirSmeDisassocInd->length = sizeof(*pSirSmeDisassocInd);
 
 		/* Update SME session Id and Transaction Id */
 		pSirSmeDisassocInd->sessionId = smesessionId;
@@ -910,14 +911,14 @@ lim_send_sme_disassoc_ind(struct mac_context *mac, tpDphHashNode sta,
 			  struct pe_session *pe_session)
 {
 	struct scheduler_msg mmhMsg = {0};
-	tSirSmeDisassocInd *pSirSmeDisassocInd;
+	struct disassoc_ind *pSirSmeDisassocInd;
 
-	pSirSmeDisassocInd = qdf_mem_malloc(sizeof(tSirSmeDisassocInd));
+	pSirSmeDisassocInd = qdf_mem_malloc(sizeof(*pSirSmeDisassocInd));
 	if (!pSirSmeDisassocInd)
 		return;
 
 	pSirSmeDisassocInd->messageType = eWNI_SME_DISASSOC_IND;
-	pSirSmeDisassocInd->length = sizeof(tSirSmeDisassocInd);
+	pSirSmeDisassocInd->length = sizeof(*pSirSmeDisassocInd);
 
 	pSirSmeDisassocInd->sessionId = pe_session->smeSessionId;
 	pSirSmeDisassocInd->transactionId = pe_session->transactionId;

+ 1 - 1
core/sme/inc/csr_internal.h

@@ -319,7 +319,7 @@ struct wmstatus_changecmd {
 	enum csr_roam_wmstatus_changetypes Type;
 	union {
 		tSirSmeDeauthInd DeauthIndMsg;
-		tSirSmeDisassocInd DisassocIndMsg;
+		struct disassoc_ind DisassocIndMsg;
 	} u;
 
 };

+ 5 - 5
core/sme/src/csr/csr_api_roam.c

@@ -10675,7 +10675,7 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	struct csr_roam_session *session;
 	uint32_t sessionId = CSR_SESSION_ID_INVALID;
 	QDF_STATUS status;
-	tSirSmeDisassocInd *pDisassocInd;
+	struct disassoc_ind *pDisassocInd;
 	tSmeCmd *cmd;
 
 	cmd = qdf_mem_malloc(sizeof(*cmd));
@@ -10687,7 +10687,7 @@ csr_roam_chk_lnk_disassoc_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	 * then we need to take action immediately and not wait till the
 	 * the WmStatusChange requests is pushed and processed
 	 */
-	pDisassocInd = (tSirSmeDisassocInd *) msg_ptr;
+	pDisassocInd = (struct disassoc_ind *)msg_ptr;
 	status = csr_roam_get_session_id_from_bssid(mac_ctx,
 				&pDisassocInd->bssid, &sessionId);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
@@ -12092,7 +12092,7 @@ QDF_STATUS csr_roam_lost_link(struct mac_context *mac, uint32_t sessionId,
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	tSirSmeDeauthInd *pDeauthIndMsg = NULL;
-	tSirSmeDisassocInd *pDisassocIndMsg = NULL;
+	struct disassoc_ind *pDisassocIndMsg = NULL;
 	eCsrRoamResult result = eCSR_ROAM_RESULT_LOSTLINK;
 	struct csr_roam_info roamInfo;
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
@@ -12104,7 +12104,7 @@ QDF_STATUS csr_roam_lost_link(struct mac_context *mac, uint32_t sessionId,
 	qdf_mem_zero(&roamInfo, sizeof(struct csr_roam_info));
 	if (eWNI_SME_DISASSOC_IND == type) {
 		result = eCSR_ROAM_RESULT_DISASSOC_IND;
-		pDisassocIndMsg = (tSirSmeDisassocInd *) pSirMsg;
+		pDisassocIndMsg = (struct disassoc_ind *)pSirMsg;
 		pSession->roamingStatusCode = pDisassocIndMsg->statusCode;
 		pSession->joinFailStatusCode.reasonCode =
 			pDisassocIndMsg->reasonCode;
@@ -15407,7 +15407,7 @@ QDF_STATUS csr_send_mb_deauth_req_msg(struct mac_context *mac, uint32_t sessionI
 }
 
 QDF_STATUS csr_send_mb_disassoc_cnf_msg(struct mac_context *mac,
-					tpSirSmeDisassocInd pDisassocInd)
+					struct disassoc_ind *pDisassocInd)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	tSirSmeDisassocCnf *pMsg;

+ 1 - 1
core/sme/src/csr/csr_inside_api.h

@@ -308,7 +308,7 @@ QDF_STATUS csr_send_mb_disassoc_req_msg(struct mac_context *mac, uint32_t sessio
 QDF_STATUS csr_send_mb_deauth_req_msg(struct mac_context *mac, uint32_t sessionId,
 				      tSirMacAddr bssId, uint16_t reasonCode);
 QDF_STATUS csr_send_mb_disassoc_cnf_msg(struct mac_context *mac,
-					tpSirSmeDisassocInd pDisassocInd);
+					struct disassoc_ind *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,