Bläddra i källkod

qcacld-3.0: Replace typedef tSirSmeDisassocReq

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 tSirSmeDisassocReq 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: I711def1243f3e8112a2acb438408d46ce77d3ca3
CRs-Fixed: 2395987
Jeff Johnson 6 år sedan
förälder
incheckning
ca523f38b1

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

@@ -1219,7 +1219,7 @@ struct wm_status_change_ntf {
 };
 
 /* Definition for Disassociation request */
-typedef struct sSirSmeDisassocReq {
+struct disassoc_req {
 	uint16_t messageType;   /* eWNI_SME_DISASSOC_REQ */
 	uint16_t length;
 	uint8_t sessionId;      /* Session ID */
@@ -1231,7 +1231,7 @@ typedef struct sSirSmeDisassocReq {
 	/* This will be set in while handing off from one AP to other */
 	uint8_t doNotSendOverTheAir;
 	bool process_ho_fail;
-} qdf_packed tSirSmeDisassocReq, *tpSirSmeDisassocReq;
+};
 
 /* / Definition for Disassociation response */
 typedef struct sSirSmeDisassocRsp {

+ 4 - 4
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2062,7 +2062,7 @@ static void __lim_process_sme_disassoc_req(struct mac_context *mac, uint32_t *pM
 	uint16_t disassocTrigger, reasonCode;
 	tLimMlmDisassocReq *pMlmDisassocReq;
 	tSirResultCodes retCode = eSIR_SME_SUCCESS;
-	tSirSmeDisassocReq smeDisassocReq;
+	struct disassoc_req smeDisassocReq;
 	struct pe_session *pe_session = NULL;
 	uint8_t sessionId;
 	uint8_t smesessionId;
@@ -2073,7 +2073,7 @@ static void __lim_process_sme_disassoc_req(struct mac_context *mac, uint32_t *pM
 		return;
 	}
 
-	qdf_mem_copy(&smeDisassocReq, pMsgBuf, sizeof(tSirSmeDisassocReq));
+	qdf_mem_copy(&smeDisassocReq, pMsgBuf, sizeof(struct disassoc_req));
 	smesessionId = smeDisassocReq.sessionId;
 	smetransactionId = smeDisassocReq.transactionId;
 	if (!lim_is_sme_disassoc_req_valid(mac,
@@ -4766,11 +4766,11 @@ static void lim_process_sme_disassoc_cnf(struct mac_context *mac_ctx,
 static void lim_process_sme_disassoc_req(struct mac_context *mac_ctx,
 					 struct scheduler_msg *msg)
 {
-	tSirSmeDisassocReq disassoc_req;
+	struct disassoc_req disassoc_req;
 	struct pe_session *session;
 	uint8_t session_id;
 
-	qdf_mem_copy(&disassoc_req, msg->bodyptr, sizeof(tSirSmeDisassocReq));
+	qdf_mem_copy(&disassoc_req, msg->bodyptr, sizeof(struct disassoc_req));
 
 	session = pe_find_session_by_bssid(mac_ctx,
 					   disassoc_req.bssid.bytes,

+ 5 - 27
core/mac/src/pe/lim/lim_sme_req_utils.c

@@ -509,34 +509,12 @@ end:
 	return valid;
 } /*** end lim_is_sme_join_req_valid() ***/
 
-/**
- * lim_is_sme_disassoc_req_valid()
- *
- ***FUNCTION:
- * This function is called by lim_process_sme_req_messages() upon
- * receiving SME_DISASSOC_REQ message from application.
- *
- ***LOGIC:
- * Message validity checks are performed in this function
- *
- ***ASSUMPTIONS:
- *
- ***NOTE:
- *
- * @param  mac         Pointer to Global MAC structure
- * @param  pDisassocReq Pointer to received SME_DISASSOC_REQ message
- * @return true         When received SME_DISASSOC_REQ is formatted
- *                      correctly
- *         false        otherwise
- */
-
-uint8_t
-lim_is_sme_disassoc_req_valid(struct mac_context *mac,
-			      tpSirSmeDisassocReq pDisassocReq,
-			      struct pe_session *pe_session)
+bool lim_is_sme_disassoc_req_valid(struct mac_context *mac,
+				   struct disassoc_req *disassoc_req,
+				   struct pe_session *pe_session)
 {
-	if (qdf_is_macaddr_group(&pDisassocReq->peer_macaddr) &&
-	    !qdf_is_macaddr_broadcast(&pDisassocReq->peer_macaddr))
+	if (qdf_is_macaddr_group(&disassoc_req->peer_macaddr) &&
+	    !qdf_is_macaddr_broadcast(&disassoc_req->peer_macaddr))
 		return false;
 
 	return true;

+ 16 - 2
core/mac/src/pe/lim/lim_sme_req_utils.h

@@ -65,8 +65,22 @@ uint8_t lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(struct mac_context *
 uint8_t lim_is_sme_join_req_valid(struct mac_context *mac,
 				  struct join_req *pJoinReq);
 
-uint8_t lim_is_sme_disassoc_req_valid(struct mac_context *, tpSirSmeDisassocReq,
-				      struct pe_session *);
+/**
+ * lim_is_sme_disassoc_req_valid() - Validate disassoc req message
+ * @mac: Pointer to Global MAC structure
+ * @disassoc_req: Pointer to received SME_DISASSOC_REQ message
+ * @pe_session: Pointer to the PE session
+ *
+ * This function is called by lim_process_sme_req_messages() upon
+ * receiving SME_DISASSOC_REQ message from application.
+ *
+ * Return: true  When received SME_DISASSOC_REQ is formatted correctly
+ *         false otherwise
+ */
+bool lim_is_sme_disassoc_req_valid(struct mac_context *mac,
+				   struct disassoc_req *disassoc_req,
+				   struct pe_session *pe_session);
+
 uint8_t lim_is_sme_deauth_req_valid(struct mac_context *, tpSirSmeDeauthReq, struct pe_session *);
 uint8_t lim_is_sme_set_context_req_valid(struct mac_context *, tpSirSmeSetContextReq);
 uint8_t lim_is_sme_stop_bss_req_valid(uint32_t *);

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

@@ -15223,21 +15223,22 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 }
 
 /* */
-QDF_STATUS csr_send_mb_disassoc_req_msg(struct mac_context *mac, uint32_t sessionId,
+QDF_STATUS csr_send_mb_disassoc_req_msg(struct mac_context *mac,
+					uint32_t sessionId,
 					tSirMacAddr bssId, uint16_t reasonCode)
 {
-	tSirSmeDisassocReq *pMsg;
+	struct disassoc_req *pMsg;
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
 
 	if (!CSR_IS_SESSION_VALID(mac, sessionId))
 		return QDF_STATUS_E_FAILURE;
 
-	pMsg = qdf_mem_malloc(sizeof(tSirSmeDisassocReq));
+	pMsg = qdf_mem_malloc(sizeof(*pMsg));
 	if (NULL == pMsg)
 		return QDF_STATUS_E_NOMEM;
 
 	pMsg->messageType = eWNI_SME_DISASSOC_REQ;
-	pMsg->length = sizeof(tSirSmeDisassocReq);
+	pMsg->length = sizeof(*pMsg);
 	pMsg->sessionId = sessionId;
 	pMsg->transactionId = 0;
 	if ((pSession->pCurRoamProfile != NULL)