浏览代码

qcacld-3.0: Replace typedef tSirSmeStartBssReq

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 tSirSmeStartBssReq 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: I194d3de88ec3b877ca7e77abb42559c330b5ef69
CRs-Fixed: 2393732
Jeff Johnson 6 年之前
父节点
当前提交
704b891933

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

@@ -555,7 +555,7 @@ struct add_ie_params {
  */
 /* ***** NOTE: Please make sure all codes are updated if inserting field into
  * this structure..********** */
-typedef struct sSirSmeStartBssReq {
+struct start_bss_req {
 	uint16_t messageType;   /* eWNI_SME_START_BSS_REQ */
 	uint16_t length;
 	uint8_t sessionId;      /* Added for BT-AMP Support */
@@ -616,7 +616,7 @@ typedef struct sSirSmeStartBssReq {
 	uint32_t cac_duration_ms;
 	uint32_t dfs_regdomain;
 
-} tSirSmeStartBssReq, *tpSirSmeStartBssReq;
+};
 
 #define GET_IE_LEN_IN_BSS(lenInBss) (lenInBss + sizeof(lenInBss) - \
 				    ((uintptr_t)OFFSET_OF(tSirBssDescription,\

+ 1 - 1
core/mac/src/pe/include/lim_session.h

@@ -133,7 +133,7 @@ struct pe_session {
 	tSirBssType bssType;
 	uint8_t operMode;       /* AP - 0; STA - 1 ; */
 	tSirNwType nwType;
-	tpSirSmeStartBssReq pLimStartBssReq;    /* handle to smestart bss req */
+	struct start_bss_req *pLimStartBssReq; /* handle to start bss req */
 	tpSirSmeJoinReq pLimJoinReq;    /* handle to sme join req */
 	tpSirSmeJoinReq pLimReAssocReq; /* handle to sme reassoc req */
 	tpLimMlmJoinReq pLimMlmJoinReq; /* handle to MLM join Req */

+ 6 - 5
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -490,8 +490,9 @@ static bool __lim_process_sme_sys_ready_ind(struct mac_context *mac,
  * Return: None.
  */
 static void
-lim_configure_ap_start_bss_session(struct mac_context *mac_ctx, struct pe_session *session,
-			tpSirSmeStartBssReq sme_start_bss_req)
+lim_configure_ap_start_bss_session(struct mac_context *mac_ctx,
+				   struct pe_session *session,
+				   struct start_bss_req *sme_start_bss_req)
 {
 	session->limSystemRole = eLIM_AP_ROLE;
 	session->privacy = sme_start_bss_req->privacy;
@@ -570,7 +571,7 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu
 	uint32_t val = 0;
 	tSirMacChanNum channel_number;
 	tLimMlmStartReq *mlm_start_req = NULL;
-	tpSirSmeStartBssReq sme_start_bss_req = NULL;
+	struct start_bss_req *sme_start_bss_req = NULL;
 	tSirResultCodes ret_code = eSIR_SME_SUCCESS;
 	/* Flag Used in case of IBSS to Auto generate BSSID. */
 	uint32_t auto_gen_bssid = false;
@@ -593,13 +594,13 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu
 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
 
 	pe_debug("Received START_BSS_REQ");
-	size = sizeof(tSirSmeStartBssReq);
+	size = sizeof(*sme_start_bss_req);
 	sme_start_bss_req = qdf_mem_malloc(size);
 	if (!sme_start_bss_req) {
 		ret_code = eSIR_SME_RESOURCES_UNAVAILABLE;
 		goto free;
 	}
-	qdf_mem_copy(sme_start_bss_req, msg_buf, sizeof(tSirSmeStartBssReq));
+	qdf_mem_copy(sme_start_bss_req, msg_buf, size);
 	sme_session_id = sme_start_bss_req->sessionId;
 	sme_transaction_id = sme_start_bss_req->transactionId;
 

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

@@ -355,22 +355,8 @@ end:
 	return valid;
 } /*** end lim_is_bss_descr_valid_in_sme_req_message() ***/
 
-/**
- * lim_is_sme_start_bss_req_valid() - To validate sme start bss request
- *
- * @mac_ctx: Pointer to Global MAC structure
- * @start_bss_req: Pointer to received SME_START_BSS_REQ message
- *
- * This function is called by lim_process_sme_req_messages() upon
- * receiving SME_START_BSS_REQ message from application.
- *
- * Return: true when received SME_START_BSS_REQ is formatted correctly false
- *         otherwise
- */
-
-uint8_t
-lim_is_sme_start_bss_req_valid(struct mac_context *mac_ctx,
-			       tpSirSmeStartBssReq start_bss_req)
+bool lim_is_sme_start_bss_req_valid(struct mac_context *mac_ctx,
+				    struct start_bss_req *start_bss_req)
 {
 	uint8_t i = 0;
 	tSirMacRateSet *opr_rates = &start_bss_req->operationalRateSet;

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012,2014-2015,2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2012,2014-2015,2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -33,7 +33,21 @@
 #include "lim_types.h"
 
 /* LIM SME request messages related utility functions */
-uint8_t lim_is_sme_start_bss_req_valid(struct mac_context *, tpSirSmeStartBssReq);
+
+/**
+ * lim_is_sme_start_bss_req_valid() - To validate sme start bss request
+ * @mac_ctx: Pointer to Global MAC structure
+ * @start_bss_req: Pointer to received SME_START_BSS_REQ message
+ *
+ * This function is called by lim_process_sme_req_messages() upon
+ * receiving SME_START_BSS_REQ message from application.
+ *
+ * Return: true when received SME_START_BSS_REQ is formatted correctly false
+ *         otherwise
+ */
+bool lim_is_sme_start_bss_req_valid(struct mac_context *mac_ctx,
+				    struct start_bss_req *start_bss_req);
+
 uint8_t lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(struct mac_context *,
 							    tpSirRSNie, struct pe_session *);
 uint8_t lim_is_sme_join_req_valid(struct mac_context *, tpSirSmeJoinReq);

+ 1 - 1
core/mac/src/pe/lim/lim_utils.c

@@ -6985,7 +6985,7 @@ void lim_decide_he_op(struct mac_context *mac_ctx, tpAddBssParams add_bss,
 }
 
 void lim_copy_bss_he_cap(struct pe_session *session,
-			 tpSirSmeStartBssReq sme_start_bss_req)
+			 struct start_bss_req *sme_start_bss_req)
 {
 	qdf_mem_copy(&(session->he_config), &(sme_start_bss_req->he_config),
 		     sizeof(session->he_config));

+ 4 - 3
core/mac/src/pe/lim/lim_utils.h

@@ -946,7 +946,7 @@ void lim_add_bss_he_cfg(tpAddBssParams add_bss, struct pe_session *session);
  * Return: None
  */
 void lim_copy_bss_he_cap(struct pe_session *session,
-		tpSirSmeStartBssReq sme_start_bss_req);
+			 struct start_bss_req *sme_start_bss_req);
 
 /**
  * lim_copy_join_req_he_cap() - Copy HE capability to PE session from Join req
@@ -1193,8 +1193,9 @@ static inline void lim_decide_he_op(struct mac_context *mac_ctx,
 {
 }
 
-static inline void lim_copy_bss_he_cap(struct pe_session *session,
-				tpSirSmeStartBssReq sme_start_bss_req)
+static inline
+void lim_copy_bss_he_cap(struct pe_session *session,
+			 struct start_bss_req *sme_start_bss_req)
 {
 }
 

+ 12 - 10
core/sme/src/csr/csr_api_roam.c

@@ -2310,15 +2310,15 @@ static void csr_join_req_copy_he_cap(tSirSmeJoinReq *csr_join_req,
  *
  * Return: None
  */
-static void csr_start_bss_copy_he_cap(tSirSmeStartBssReq *req,
-			struct csr_roam_session *session)
+static void csr_start_bss_copy_he_cap(struct start_bss_req *req,
+				      struct csr_roam_session *session)
 {
 	qdf_mem_copy(&req->he_config, &session->he_config,
 		     sizeof(session->he_config));
 }
 
 void csr_update_session_he_cap(struct mac_context *mac_ctx,
-			struct csr_roam_session *session)
+			       struct csr_roam_session *session)
 {
 	tDot11fIEhe_cap *he_cap = &session->he_config;
 	he_cap->present = true;
@@ -2344,13 +2344,15 @@ void csr_update_session_he_cap(struct mac_context *mac_ctx,
 #else
 #define CSR_REVISE_REQ_HE_CAP_PER_BAND(_req, _pmac, _channelid)   /* no op */
 
-static inline void csr_join_req_copy_he_cap(tSirSmeJoinReq *csr_join_req,
-			struct csr_roam_session *session)
+static inline
+void csr_join_req_copy_he_cap(tSirSmeJoinReq *csr_join_req,
+			      struct csr_roam_session *session)
 {
 }
 
-static inline void csr_start_bss_copy_he_cap(tSirSmeStartBssReq *req,
-			struct csr_roam_session *session)
+static inline
+void csr_start_bss_copy_he_cap(struct start_bss_req *req,
+			       struct csr_roam_session *session)
 {
 }
 
@@ -15713,7 +15715,7 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t
 					 struct csr_roamstart_bssparams *pParam,
 					 tSirBssDescription *pBssDesc)
 {
-	tSirSmeStartBssReq *pMsg;
+	struct start_bss_req *pMsg;
 	uint16_t wTmp;
 	uint32_t value = 0;
 	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
@@ -15725,13 +15727,13 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(struct mac_context *mac, uint32_t
 
 	pSession->joinFailStatusCode.statusCode = eSIR_SME_SUCCESS;
 	pSession->joinFailStatusCode.reasonCode = 0;
-	pMsg = qdf_mem_malloc(sizeof(tSirSmeStartBssReq));
+	pMsg = qdf_mem_malloc(sizeof(*pMsg));
 	if (NULL == pMsg)
 		return QDF_STATUS_E_NOMEM;
 
 	pMsg->messageType = eWNI_SME_START_BSS_REQ;
 	pMsg->sessionId = sessionId;
-	pMsg->length = sizeof(tSirSmeStartBssReq);
+	pMsg->length = sizeof(*pMsg);
 	pMsg->transactionId = 0;
 	qdf_copy_macaddr(&pMsg->bssid, &pParam->bssid);
 	/* selfMacAddr */