Browse Source

qcacld-3.0: Fix definition of tx_timer_create macro

Add new argument for mac_ctx in definition of tx_timer_create macro
so that its caller can use any local variable name for mac context.
Currently pMac is hardcoded as first param in definition of the macro
which prohibits caller of that function from using any other name.

Change-Id: Id901424ba16846eab62c00a80d48a5c85c73bea6
CRs-Fixed: 824222
Naveen Rawat 9 năm trước cách đây
mục cha
commit
a20cd9f91d

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

@@ -4932,10 +4932,10 @@ void lim_init_pre_auth_timer_table(tpAniSirGlobal pMac,
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 	for (authNodeIdx = 0; authNodeIdx < pPreAuthTimerTable->numEntry;
 	     authNodeIdx++, pAuthNode++) {
-		if (tx_timer_create
-			    (&pAuthNode->timer, "AUTH RESPONSE TIMEOUT",
-			    lim_auth_response_timer_handler, authNodeIdx, cfgValue, 0,
-			    TX_NO_ACTIVATE) != TX_SUCCESS) {
+		if (tx_timer_create(pMac, &pAuthNode->timer,
+			"AUTH RESPONSE TIMEOUT",
+			lim_auth_response_timer_handler, authNodeIdx,
+			cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
 			/* Cannot create timer.  Log error. */
 			lim_log(pMac, LOGP,
 				FL("Cannot create Auth Rsp timer of Index :%d."),

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

@@ -1461,7 +1461,7 @@ sendIndToSme:
 	if (WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STAMIN > retryInterval) {
 		retryInterval = WNI_CFG_PMF_SA_QUERY_RETRY_INTERVAL_STADEF;
 	}
-	if (tx_timer_create(&pStaDs->pmfSaQueryTimer, "PMF SA Query timer",
+	if (tx_timer_create(pMac, &pStaDs->pmfSaQueryTimer, "PMF SA Query timer",
 			    lim_pmf_sa_query_timer_handler, timerId.value,
 			    SYS_MS_TO_TICKS((retryInterval * 1024) / 1000),
 			    0, TX_NO_ACTIVATE) != TX_SUCCESS) {

+ 26 - 24
core/mac/src/pe/lim/lim_timer_utils.c

@@ -60,7 +60,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 {
 	uint32_t cfgValue;
 	/* Create Channel Switch Timer */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimChannelSwitchTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimChannelSwitchTimer,
 			    "CHANNEL SWITCH TIMER",
 			    lim_channel_switch_timer_handler, 0,
 			    LIM_CHANNEL_SWITCH_TIMER_TICKS,
@@ -72,7 +72,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 	 * This is used on the STA to go and shut-off Tx/Rx "after" the
 	 * specified quiteInterval
 	 */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimQuietTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimQuietTimer,
 			    "QUIET TIMER", lim_quiet_timer_handler,
 			    SIR_LIM_QUIET_TIMEOUT, LIM_QUIET_TIMER_TICKS,
 			    0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -84,7 +84,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 	 * timer, gLimQuietBssTimer, trigger and put the STA to sleep for the
 	 * specified gLimQuietDuration
 	 */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimQuietBssTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimQuietBssTimer,
 			    "QUIET BSS TIMER", lim_quiet_bss_timer_handler,
 			    SIR_LIM_QUIET_BSS_TIMEOUT, LIM_QUIET_BSS_TIMER_TICK,
 			    0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -98,7 +98,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 			FL("could not retrieve JoinFailureTimeout value"));
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 	/* Create Join failure timer and activate it later */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimJoinFailureTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimJoinFailureTimer,
 			    "JOIN FAILURE TIMEOUT",
 			    lim_timer_handler, SIR_LIM_JOIN_FAIL_TIMEOUT,
 			    cfgValue, 0,
@@ -110,7 +110,8 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 		return false;
 	}
 	/* Send unicast probe req frame every 200 ms */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
+	if (tx_timer_create(pMac,
+			    &pMac->lim.limTimers.gLimPeriodicJoinProbeReqTimer,
 			    "Periodic Join Probe Request Timer",
 			    lim_timer_handler,
 			    SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
@@ -128,7 +129,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 	/* Create Association failure timer and activate it later */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimAssocFailureTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimAssocFailureTimer,
 			    "ASSOC FAILURE TIMEOUT",
 			    lim_assoc_failure_timer_handler, LIM_ASSOC,
 			    cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -143,8 +144,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 	/* Create Association failure timer and activate it later */
-	if (tx_timer_create
-		    (&pMac->lim.limTimers.gLimReassocFailureTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimReassocFailureTimer,
 		    "REASSOC FAILURE TIMEOUT", lim_assoc_failure_timer_handler,
 		    LIM_REASSOC, cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
 		lim_log(pMac, LOGP,
@@ -160,7 +160,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 
 	/* Create Addts response timer and activate it later */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimAddtsRspTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimAddtsRspTimer,
 			    "ADDTS RSP TIMEOUT",
 			    lim_addts_response_timer_handler,
 			    SIR_LIM_ADDTS_RSP_TIMEOUT,
@@ -177,7 +177,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 	/* Create Auth failure timer and activate it later */
-	if (tx_timer_create(&pMac->lim.limTimers.gLimAuthFailureTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimAuthFailureTimer,
 			    "AUTH FAILURE TIMEOUT",
 			    lim_timer_handler,
 			    SIR_LIM_AUTH_FAIL_TIMEOUT,
@@ -193,7 +193,7 @@ lim_create_non_ap_timers(tpAniSirGlobal pMac)
 
 	/* Change timer to reactivate it in future */
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(&pMac->lim.limTimers.gLimProbeAfterHBTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimProbeAfterHBTimer,
 			    "Probe after Heartbeat TIMEOUT",
 			    lim_timer_handler,
 			    SIR_LIM_PROBE_HB_FAILURE_TIMEOUT,
@@ -238,10 +238,11 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 	cfgValue1 = cfgValue / 2;
 	/* Create periodic probe request timer and activate them later */
 	if (cfgValue1 >= 1
-	    && (tx_timer_create(&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
-		"Periodic Probe Request Timer", lim_timer_handler,
-		SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT, cfgValue1, 0,
-		TX_NO_ACTIVATE) != TX_SUCCESS)) {
+	    && (tx_timer_create(pMac,
+			&pMac->lim.limTimers.gLimPeriodicProbeReqTimer,
+			"Periodic Probe Request Timer", lim_timer_handler,
+			SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT, cfgValue1, 0,
+			TX_NO_ACTIVATE) != TX_SUCCESS)) {
 		lim_log(pMac, LOGP,
 			FL("could not create periodic probe timer"));
 		goto err_timer;
@@ -262,7 +263,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 
 	cfgValue = SYS_MS_TO_TICKS(LIM_HASH_MISS_TIMER_MS);
 
-	if (tx_timer_create(
+	if (tx_timer_create(pMac,
 		&pMac->lim.limTimers.gLimSendDisassocFrameThresholdTimer,
 		"Disassoc throttle TIMEOUT",
 		lim_send_disassoc_frame_threshold_handler,
@@ -282,7 +283,8 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
 	for (i = 0; i < (pMac->lim.maxStation + 1); i++) {
-		if (tx_timer_create(&pMac->lim.limTimers.gpLimCnfWaitTimer[i],
+		if (tx_timer_create(pMac,
+				    &pMac->lim.limTimers.gpLimCnfWaitTimer[i],
 				    "CNF_MISS_TIMEOUT",
 				    lim_cnf_wait_tmer_handler,
 				    (uint32_t) i, cfgValue,
@@ -315,7 +317,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 			FL("could not retrieve OLBD detect timeout value"));
 
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(&pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimUpdateOlbcCacheTimer,
 			    "OLBC UPDATE CACHE TIMEOUT",
 			    lim_update_olbc_cache_timer_handler,
 			    SIR_LIM_UPDATE_OLBC_CACHEL_TIMEOUT, cfgValue,
@@ -330,7 +332,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 	 */
 	cfgValue = 1000;
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(&pMac->lim.limTimers.gLimFTPreAuthRspTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimFTPreAuthRspTimer,
 			    "FT PREAUTH RSP TIMEOUT",
 			    lim_timer_handler, SIR_LIM_FT_PREAUTH_RSP_TIMEOUT,
 			    cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -340,7 +342,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 #endif
 	cfgValue = 1000;
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(&pMac->lim.limTimers.gLimRemainOnChannelTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimRemainOnChannelTimer,
 			    "FT PREAUTH RSP TIMEOUT",
 			    lim_timer_handler, SIR_LIM_REMAIN_CHN_TIMEOUT,
 			    cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -350,7 +352,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 
 	cfgValue = 1000;
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(&pMac->lim.limTimers.gLimDisassocAckTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimDisassocAckTimer,
 			    "DISASSOC ACK TIMEOUT",
 			    lim_timer_handler, SIR_LIM_DISASSOC_ACK_TIMEOUT,
 			    cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -360,7 +362,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 
 	cfgValue = 1000;
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(&pMac->lim.limTimers.gLimDeauthAckTimer,
+	if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimDeauthAckTimer,
 			    "DISASSOC ACK TIMEOUT",
 			    lim_timer_handler, SIR_LIM_DEAUTH_ACK_TIMEOUT,
 			    cfgValue, 0, TX_NO_ACTIVATE) != TX_SUCCESS) {
@@ -375,7 +377,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 	 */
 	cfgValue = LIM_INSERT_SINGLESHOTNOA_TIMEOUT_VALUE;
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(
+	if (tx_timer_create(pMac,
 		&pMac->lim.limTimers.gLimP2pSingleShotNoaInsertTimer,
 		"Single Shot NOA Insert timeout", lim_timer_handler,
 		SIR_LIM_INSERT_SINGLESHOT_NOA_TIMEOUT, cfgValue, 0,
@@ -387,7 +389,7 @@ uint32_t lim_create_timers(tpAniSirGlobal pMac)
 
 	cfgValue = ACTIVE_TO_PASSIVE_CONVERISON_TIMEOUT;
 	cfgValue = SYS_MS_TO_TICKS(cfgValue);
-	if (tx_timer_create(
+	if (tx_timer_create(pMac,
 		&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer,
 		"ACTIVE TO PASSIVE CHANNEL", lim_timer_handler,
 		SIR_LIM_CONVERT_ACTIVE_CHANNEL_TO_PASSIVE, cfgValue, 0,

+ 2 - 2
core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h

@@ -89,9 +89,9 @@ extern "C" {
 #define TX_AIRGO_TMR_SIGNATURE   0xDEADBEEF
 
 #ifdef TIMER_MANAGER
-#define  tx_timer_create(a, b, c, d, e, f, g)   tx_timer_create_intern_debug((void *)pMac, a, b, c, d, e, f, g, __FILE__, __LINE__)
+#define  tx_timer_create(a, b, c, d, e, f, g, h)    tx_timer_create_intern_debug((void *)a, b, c, d, e, f, g, h, __FILE__, __LINE__)
 #else
-#define  tx_timer_create(a, b, c, d, e, f, g)   tx_timer_create_intern((void *)pMac, a, b, c, d, e, f, g)
+#define  tx_timer_create(a, b, c, d, e, f, g, h)    tx_timer_create_intern((void *)a, b, c, d, e, f, g, h)
 #endif
 
 /*--------------------------------------------------------------------*/