Kaynağa Gözat

qcacld-3.0: Replace typedef tSirSmeSetContextRsp

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 tSirSmeSetContextRsp 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: Ib6b400be8e1ce84f3791dd428ca11ef32cd08ff9
CRs-Fixed: 2396052
Jeff Johnson 6 yıl önce
ebeveyn
işleme
924ae6124c

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

@@ -1392,14 +1392,14 @@ struct set_context_req {
 
 /* / Definition for Set Context response */
 /* / MAC ---> */
-typedef struct sSirSmeSetContextRsp {
+struct set_context_rsp {
 	uint16_t messageType;   /* eWNI_SME_SET_CONTEXT_RSP */
 	uint16_t length;
 	uint8_t sessionId;      /* Session ID */
 	uint16_t transactionId; /* Transaction ID for cmd */
 	tSirResultCodes statusCode;
 	struct qdf_mac_addr peer_macaddr;
-} tSirSmeSetContextRsp, *tpSirSmeSetContextRsp;
+};
 
 /*******************PE Statistics*************************/
 

+ 12 - 11
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -1377,28 +1377,29 @@ void
 lim_send_sme_set_context_rsp(struct mac_context *mac,
 			     struct qdf_mac_addr peer_macaddr, uint16_t aid,
 			     tSirResultCodes resultCode,
-			     struct pe_session *pe_session, uint8_t smesessionId,
+			     struct pe_session *pe_session,
+			     uint8_t smesessionId,
 			     uint16_t smetransactionId)
 {
 	struct scheduler_msg mmhMsg = {0};
-	tSirSmeSetContextRsp *pSirSmeSetContextRsp;
+	struct set_context_rsp *set_context_rsp;
 
-	pSirSmeSetContextRsp = qdf_mem_malloc(sizeof(tSirSmeSetContextRsp));
-	if (!pSirSmeSetContextRsp)
+	set_context_rsp = qdf_mem_malloc(sizeof(*set_context_rsp));
+	if (!set_context_rsp)
 		return;
 
-	pSirSmeSetContextRsp->messageType = eWNI_SME_SETCONTEXT_RSP;
-	pSirSmeSetContextRsp->length = sizeof(tSirSmeSetContextRsp);
-	pSirSmeSetContextRsp->statusCode = resultCode;
+	set_context_rsp->messageType = eWNI_SME_SETCONTEXT_RSP;
+	set_context_rsp->length = sizeof(*set_context_rsp);
+	set_context_rsp->statusCode = resultCode;
 
-	qdf_copy_macaddr(&pSirSmeSetContextRsp->peer_macaddr, &peer_macaddr);
+	qdf_copy_macaddr(&set_context_rsp->peer_macaddr, &peer_macaddr);
 
 	/* Update SME session and transaction Id */
-	pSirSmeSetContextRsp->sessionId = smesessionId;
-	pSirSmeSetContextRsp->transactionId = smetransactionId;
+	set_context_rsp->sessionId = smesessionId;
+	set_context_rsp->transactionId = smetransactionId;
 
 	mmhMsg.type = eWNI_SME_SETCONTEXT_RSP;
-	mmhMsg.bodyptr = pSirSmeSetContextRsp;
+	mmhMsg.bodyptr = set_context_rsp;
 	mmhMsg.bodyval = 0;
 	if (NULL == pe_session) {
 		MTRACE(mac_trace(mac, TRACE_CODE_TX_SME_MSG,

+ 11 - 4
core/sme/src/csr/csr_api_roam.c

@@ -11450,7 +11450,7 @@ csr_roam_chk_lnk_ibss_peer_departed_ind(struct mac_context *mac_ctx,
 static void
 csr_roam_diag_set_ctx_rsp(struct mac_context *mac_ctx,
 			  struct csr_roam_session *session,
-			  tSirSmeSetContextRsp *pRsp)
+			  struct set_context_rsp *pRsp)
 {
 	WLAN_HOST_DIAG_EVENT_DEF(setKeyEvent,
 				 host_event_wlan_security_payload_type);
@@ -11480,6 +11480,13 @@ csr_roam_diag_set_ctx_rsp(struct mac_context *mac_ctx,
 		setKeyEvent.status = WLAN_SECURITY_STATUS_FAILURE;
 	WLAN_HOST_DIAG_EVENT_REPORT(&setKeyEvent, EVENT_WLAN_SECURITY);
 }
+#else /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
+static void
+csr_roam_diag_set_ctx_rsp(struct mac_context *mac_ctx,
+			  struct csr_roam_session *session,
+			  struct set_context_rsp *pRsp)
+{
+}
 #endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
 
 static void
@@ -11491,7 +11498,7 @@ csr_roam_chk_lnk_set_ctx_rsp(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	struct csr_roam_info *roam_info_ptr = NULL;
 	struct csr_roam_info roam_info;
 	eCsrRoamResult result = eCSR_ROAM_RESULT_NONE;
-	tSirSmeSetContextRsp *pRsp = (tSirSmeSetContextRsp *) msg_ptr;
+	struct set_context_rsp *pRsp = (struct set_context_rsp *)msg_ptr;
 
 
 	if (!pRsp) {
@@ -11506,9 +11513,9 @@ csr_roam_chk_lnk_set_ctx_rsp(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 		sme_err("session %d not found", sessionId);
 		return;
 	}
-#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
+
 	csr_roam_diag_set_ctx_rsp(mac_ctx, session, pRsp);
-#endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
+
 	if (CSR_IS_WAIT_FOR_KEY(mac_ctx, sessionId)) {
 		csr_roam_stop_wait_for_key_timer(mac_ctx);
 		/* We are done with authentication, whethere succeed or not */