Parcourir la source

qcacld-3.0: Replace typedef tAniSirLimIbss

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 tAniSirLimIbss typedef does not
meet any of those criteria, so replace it 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 struct and
underlying fields to be in compliance.

Change-Id: I92eeb5206e89e5682c928f8d4a5baabe77ea3d89
CRs-Fixed: 2410940
Jeff Johnson il y a 6 ans
Parent
commit
d7a7181e70
2 fichiers modifiés avec 21 ajouts et 28 suppressions
  1. 5 5
      core/mac/inc/ani_global.h
  2. 16 23
      core/mac/src/pe/lim/lim_ibss_peer_mgmt.c

+ 5 - 5
core/mac/inc/ani_global.h

@@ -243,10 +243,10 @@ typedef void (*CHANGE_CHANNEL_CALLBACK)(struct mac_context *mac, QDF_STATUS stat
 					struct pe_session *pe_session);
 
 /* / LIM global definitions */
-typedef struct sAniSirLimIbss {
-	void *pHdr;
-	void *pBeacon;
-} tAniSirLimIbss;
+struct lim_ibss_info {
+	void *mac_hdr;
+	void *beacon;
+};
 
 typedef struct sDialogueToken {
 	/* bytes 0-3 */
@@ -357,7 +357,7 @@ typedef struct sAniSirLim {
 	uint32_t ibss_retry_cnt;
 
 	/* ibss info - params for which ibss to join while coalescing */
-	tAniSirLimIbss ibssInfo;
+	struct lim_ibss_info ibss_info;
 
 	/* ////////////////////////////////////////     IBSS RELATED END /////////////////////////////////////////// */
 

+ 16 - 23
core/mac/src/pe/lim/lim_ibss_peer_mgmt.c

@@ -359,13 +359,10 @@ ibss_sta_info_update(struct mac_context *mac,
 
 static void ibss_coalesce_free(struct mac_context *mac)
 {
-	if (mac->lim.ibssInfo.pHdr != NULL)
-		qdf_mem_free(mac->lim.ibssInfo.pHdr);
-	if (mac->lim.ibssInfo.pBeacon != NULL)
-		qdf_mem_free(mac->lim.ibssInfo.pBeacon);
-
-	mac->lim.ibssInfo.pHdr = NULL;
-	mac->lim.ibssInfo.pBeacon = NULL;
+	qdf_mem_free(mac->lim.ibss_info.mac_hdr);
+	mac->lim.ibss_info.mac_hdr = NULL;
+	qdf_mem_free(mac->lim.ibss_info.beacon);
+	mac->lim.ibss_info.beacon = NULL;
 }
 
 /*
@@ -378,18 +375,18 @@ ibss_coalesce_save(struct mac_context *mac,
 	/* get rid of any saved info */
 	ibss_coalesce_free(mac);
 
-	mac->lim.ibssInfo.pHdr = qdf_mem_malloc(sizeof(*pHdr));
-	if (!mac->lim.ibssInfo.pHdr)
+	mac->lim.ibss_info.mac_hdr = qdf_mem_malloc(sizeof(*pHdr));
+	if (!mac->lim.ibss_info.mac_hdr)
 		return;
 
-	mac->lim.ibssInfo.pBeacon = qdf_mem_malloc(sizeof(*pBeacon));
-	if (!mac->lim.ibssInfo.pBeacon) {
+	mac->lim.ibss_info.beacon = qdf_mem_malloc(sizeof(*pBeacon));
+	if (!mac->lim.ibss_info.beacon) {
 		ibss_coalesce_free(mac);
 		return;
 	}
 
-	qdf_mem_copy(mac->lim.ibssInfo.pHdr, pHdr, sizeof(*pHdr));
-	qdf_mem_copy(mac->lim.ibssInfo.pBeacon, pBeacon, sizeof(*pBeacon));
+	qdf_mem_copy(mac->lim.ibss_info.mac_hdr, pHdr, sizeof(*pHdr));
+	qdf_mem_copy(mac->lim.ibss_info.beacon, pBeacon, sizeof(*pBeacon));
 }
 
 #ifdef CONFIG_VDEV_SM
@@ -540,9 +537,8 @@ void ibss_bss_add(struct mac_context *mac, struct pe_session *pe_session)
 {
 	tLimMlmStartReq mlmStartReq;
 	uint32_t cfg;
-	tpSirMacMgmtHdr pHdr = (tpSirMacMgmtHdr) mac->lim.ibssInfo.pHdr;
-	tpSchBeaconStruct pBeacon =
-		(tpSchBeaconStruct) mac->lim.ibssInfo.pBeacon;
+	tpSirMacMgmtHdr pHdr = mac->lim.ibss_info.mac_hdr;
+	tpSchBeaconStruct pBeacon = mac->lim.ibss_info.beacon;
 	qdf_size_t num_ext_rates = 0;
 	QDF_STATUS status;
 
@@ -683,7 +679,7 @@ void lim_ibss_init(struct mac_context *mac)
 	mac->lim.gLimNumIbssPeers = 0;
 
 	/* ibss info - params for which ibss to join while coalescing */
-	qdf_mem_zero(&mac->lim.ibssInfo, sizeof(tAniSirLimIbss));
+	qdf_mem_zero(&mac->lim.ibss_info, sizeof(mac->lim.ibss_info));
 } /*** end lim_ibss_init() ***/
 
 /**
@@ -1287,12 +1283,9 @@ void lim_ibss_add_bss_rsp_when_coalescing(struct mac_context *mac, void *msg,
 {
 	uint8_t infoLen;
 	struct new_bss_info newBssInfo;
-
-	tpAddBssParams pAddBss = (tpAddBssParams) msg;
-
-	tpSirMacMgmtHdr pHdr = (tpSirMacMgmtHdr) mac->lim.ibssInfo.pHdr;
-	tpSchBeaconStruct pBeacon =
-		(tpSchBeaconStruct) mac->lim.ibssInfo.pBeacon;
+	tpAddBssParams pAddBss = msg;
+	tpSirMacMgmtHdr pHdr = mac->lim.ibss_info.mac_hdr;
+	tpSchBeaconStruct pBeacon = mac->lim.ibss_info.beacon;
 
 	if ((pHdr == NULL) || (pBeacon == NULL)) {
 		pe_err("Unable to handle AddBssRspWhenCoalescing (no cached BSS info)");