ソースを参照

qcacld-3.0: Replace lim_log() with pe_* log levels in lim_admit_control.c

Replace lim_log() with pe_* appropriate log levels in lim_admit_control.c

Change-Id: I8f207e62b75b20b9255a649d04144aac3594c2a9
CRs-Fixed: 1093093
Nishank Aggarwal 8 年 前
コミット
ba7c9c2310
1 ファイル変更46 行追加83 行削除
  1. 46 83
      core/mac/src/pe/lim/lim_admit_control.c

+ 46 - 83
core/mac/src/pe/lim/lim_admit_control.c

@@ -118,7 +118,7 @@ lim_calculate_svc_int(tpAniSirGlobal pMac,
 	else if (pTspec->maxMsduSz != 0)
 		msduSz = pTspec->maxMsduSz;
 	else {
-		lim_log(pMac, LOGE, FL("MsduSize not specified"));
+		pe_err("MsduSize not specified");
 		return eSIR_FAILURE;
 	}
 
@@ -132,7 +132,7 @@ lim_calculate_svc_int(tpAniSirGlobal pMac,
 	else if (pTspec->minDataRate != 0)
 		dataRate = pTspec->minDataRate;
 	else {
-		lim_log(pMac, LOGE, FL("DataRate not specified"));
+		pe_err("DataRate not specified");
 		return eSIR_FAILURE;
 	}
 
@@ -170,16 +170,13 @@ lim_validate_tspec_edca(tpAniSirGlobal mac_ctx,
 	    (tspec->surplusBw == 0) ||
 	    (tspec->minPhyRate == 0) ||
 	    (tspec->minPhyRate > max_phy_rate)) {
-		lim_log(mac_ctx, LOGW,
-			FL
-			("Invalid EDCA Tspec: NomMsdu %d, meanDataRate %d, surplusBw %d, min_phy_rate %d"),
+		pe_warn("Invalid EDCA Tspec: NomMsdu: %d meanDataRate: %d surplusBw: %d min_phy_rate: %d",
 			tspec->nomMsduSz, tspec->meanDataRate,
 			tspec->surplusBw, tspec->minPhyRate);
 		retval = eSIR_FAILURE;
 	}
 
-	lim_log(mac_ctx, ADMIT_CONTROL_LOGLEVEL,
-		FL("return status %d"), retval);
+	pe_debug("return status: %d", retval);
 	return retval;
 }
 
@@ -200,14 +197,14 @@ lim_validate_tspec(tpAniSirGlobal pMac,
 	case SIR_MAC_ACCESSPOLICY_EDCA:
 		retval = lim_validate_tspec_edca(pMac, pTspec, psessionEntry);
 		if (retval != eSIR_SUCCESS)
-			lim_log(pMac, LOGW, FL("EDCA tspec invalid"));
+			pe_warn("EDCA tspec invalid");
 			break;
 
 	case SIR_MAC_ACCESSPOLICY_HCCA:
 	case SIR_MAC_ACCESSPOLICY_BOTH:
 	/* TBD: should we support hybrid tspec as well?? for now, just fall through */
 	default:
-		lim_log(pMac, LOGW, FL("AccessType %d not supported"),
+		pe_warn("AccessType: %d not supported",
 			pTspec->tsinfo.traffic.accessPolicy);
 		retval = eSIR_FAILURE;
 		break;
@@ -243,9 +240,7 @@ lim_compute_mean_bw_used(tpAniSirGlobal pMac,
 						   &psessionEntry->dph.dphHashTable);
 			if (pSta == NULL) {
 				/* maybe we should delete the tspec?? */
-				lim_log(pMac, LOGE,
-					FL
-						("Tspec %d (assocId %d): dphNode not found"),
+				pe_err("Tspec: %d assocId: %d dphNode not found",
 					ctspec, pTspecInfo->assocId);
 				continue;
 			}
@@ -331,9 +326,7 @@ lim_admit_policy_oversubscription(tpAniSirGlobal mac_ctx,
 		return eSIR_FAILURE;
 
 	if ((totalbw - usedbw) < tspec->meanDataRate) {
-		lim_log(mac_ctx, ADMIT_CONTROL_POLICY_LOGLEVEL,
-			FL
-			("Total BW %d, Used %d, Tspec request %d not possible"),
+		pe_warn("Total BW: %d Used: %d Tspec request: %d not possible",
 			totalbw, usedbw, tspec->meanDataRate);
 		return eSIR_FAILURE;
 	}
@@ -367,7 +360,7 @@ static tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac,
 							   &pMac->lim.tspecInfo[0],
 							   psessionEntry);
 		if (retval != eSIR_SUCCESS)
-			lim_log(pMac, LOGE, FL("rejected by BWFactor policy"));
+			pe_err("rejected by BWFactor policy");
 			break;
 
 	case WNI_CFG_ADMIT_POLICY_REJECT_ALL:
@@ -376,8 +369,7 @@ static tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac,
 
 	default:
 		retval = eSIR_SUCCESS;
-		lim_log(pMac, LOGE,
-			FL("Admit Policy %d unknown, admitting all traffic"),
+		pe_warn("Admit Policy: %d unknown, admitting all traffic",
 			pAdmitPolicy->type);
 		break;
 	}
@@ -399,9 +391,7 @@ static void lim_tspec_delete(tpAniSirGlobal pMac, tpLimTspecInfo pInfo)
 	if (pInfo == NULL)
 		return;
 	/* pierre */
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL, FL("tspec entry = %d"),
-		pInfo->idx);
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL, FL("delete tspec %p"), pInfo);
+	pe_debug("tspec entry: %d delete tspec: %p", pInfo->idx, pInfo);
 	pInfo->inuse = 0;
 
 	return;
@@ -466,12 +456,8 @@ lim_tspec_find_by_assoc_id(tpAniSirGlobal pMac,
 
 	*ppInfo = NULL;
 
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-		FL("Trying to find tspec entry for assocId = %d"), assocId);
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-		FL
-			("pTsInfo->traffic.direction = %d, pTsInfo->traffic.tsid = %d"),
-		pTspecIE->tsinfo.traffic.direction,
+	pe_debug("Trying to find tspec entry for assocId: %d pTsInfo->traffic.direction: %d pTsInfo->traffic.tsid: %d",
+		assocId, pTspecIE->tsinfo.traffic.direction,
 		pTspecIE->tsinfo.traffic.tsid);
 
 	for (ctspec = 0; ctspec < LIM_NUM_TSPEC_MAX; ctspec++, pTspecList++) {
@@ -509,12 +495,8 @@ lim_find_tspec(tpAniSirGlobal pMac,
 
 	*ppInfo = NULL;
 
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-		FL("Trying to find tspec entry for assocId = %d"), assocId);
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-		FL
-			("pTsInfo->traffic.direction = %d, pTsInfo->traffic.tsid = %d"),
-		pTsInfo->traffic.direction, pTsInfo->traffic.tsid);
+	pe_debug("Trying to find tspec entry for assocId: %d pTsInfo->traffic.direction: %d pTsInfo->traffic.tsid: %d",
+		assocId, pTsInfo->traffic.direction, pTsInfo->traffic.tsid);
 
 	for (ctspec = 0; ctspec < LIM_NUM_TSPEC_MAX; ctspec++, pTspecList++) {
 		if ((pTspecList->inuse)
@@ -554,7 +536,7 @@ tSirRetStatus lim_tspec_add(tpAniSirGlobal pMac,
 
 	/* validate the assocId */
 	if (assocId >= pMac->lim.maxStation) {
-		lim_log(pMac, LOGE, FL("Invalid assocId 0x%x"), assocId);
+		pe_err("Invalid assocId 0x%x", assocId);
 		return eSIR_FAILURE;
 	}
 	/* decide whether to add/update */
@@ -565,8 +547,7 @@ tSirRetStatus lim_tspec_add(tpAniSirGlobal pMac,
 		    lim_find_tspec(pMac, assocId, &pTspec->tsinfo, pTspecList,
 				   ppInfo)) {
 			/* update this entry. */
-			lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-				FL("updating TSPEC table entry = %d"),
+			pe_debug("updating TSPEC table entry: %d",
 				(*ppInfo)->idx);
 		} else {
 			/* We didn't find one to update. So find a free slot in the
@@ -577,9 +558,7 @@ tSirRetStatus lim_tspec_add(tpAniSirGlobal pMac,
 			     ctspec < LIM_NUM_TSPEC_MAX;
 			     ctspec++, pTspecList++) {
 				if (!pTspecList->inuse) {
-					lim_log(pMac, LOGD,
-						FL
-							("Found free slot in TSPEC list. Add to TSPEC table entry %d"),
+					pe_debug("Found free slot in TSPEC list. Add to TSPEC table entry: %d",
 						ctspec);
 					break;
 				}
@@ -602,8 +581,7 @@ tSirRetStatus lim_tspec_add(tpAniSirGlobal pMac,
 	if (pTspec->tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) {
 		pTspecList->inuse = 1;
 		*ppInfo = pTspecList;
-		lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-			FL("added entry for EDCA AccessPolicy"));
+		pe_debug("added entry for EDCA AccessPolicy");
 		return eSIR_SUCCESS;
 	}
 
@@ -618,8 +596,7 @@ tSirRetStatus lim_tspec_add(tpAniSirGlobal pMac,
 	 */
 	pTspecList->inuse = 1;
 	*ppInfo = pTspecList;
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-		FL("added entry for HCCA AccessPolicy"));
+	pe_debug("added entry for HCCA AccessPolicy");
 	return eSIR_SUCCESS;
 }
 
@@ -642,7 +619,7 @@ lim_validate_access_policy(tpAniSirGlobal pMac,
 		dph_get_hash_entry(pMac, assocId, &psessionEntry->dph.dphHashTable);
 
 	if ((pSta == NULL) || (!pSta->valid)) {
-		lim_log(pMac, LOGE, FL("invalid station address passed"));
+		pe_err("invalid station address passed");
 		return eSIR_FAILURE;
 	}
 
@@ -655,15 +632,13 @@ lim_validate_access_policy(tpAniSirGlobal pMac,
 	case SIR_MAC_ACCESSPOLICY_HCCA:
 	case SIR_MAC_ACCESSPOLICY_BOTH:
 	default:
-		lim_log(pMac, LOGE, FL("Invalid accessPolicy %d"),
+		pe_err("Invalid accessPolicy: %d",
 			       accessPolicy);
 		break;
 	}
 
 	if (retval != eSIR_SUCCESS)
-		lim_log(pMac, LOGW,
-			FL
-				("failed (accPol %d, staId %d, lle %d, wme %d, wsm %d)"),
+		pe_warn("accPol: %d staId: %d lle: %d wme: %d wsm: %d",
 			accessPolicy, pSta->staIndex, pSta->lleEnabled,
 			pSta->wmeEnabled, pSta->wsmEnabled);
 
@@ -701,9 +676,7 @@ tSirRetStatus lim_admit_control_add_ts(tpAniSirGlobal pMac, uint8_t *pAddr,
 	/* EDCA: need to fill in the medium time and the minimum phy rate */
 	/* to be consistent with the desired traffic parameters. */
 
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-		FL
-			("tsid %d, directn %d, start %d, intvl %d, accPolicy %d, up %d"),
+	pe_debug("tsid: %d directn: %d start: %d intvl: %d accPolicy: %d up: %d",
 		pAddts->tspec.tsinfo.traffic.tsid,
 		pAddts->tspec.tsinfo.traffic.direction,
 		pAddts->tspec.svcStartTime, pAddts->tspec.minSvcInterval,
@@ -718,26 +691,24 @@ tSirRetStatus lim_admit_control_add_ts(tpAniSirGlobal pMac, uint8_t *pAddr,
 					      &pMac->lim.tspecInfo[0], &pTspecInfo);
 
 	if (retval == eSIR_SUCCESS) {
-		lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-			FL("duplicate tspec (index %d)!"), pTspecInfo->idx);
+		pe_err("duplicate tspec index: %d", pTspecInfo->idx);
 		return eSIR_FAILURE;
 	}
 	/* check that the tspec's are well formed and acceptable */
 	if (lim_validate_tspec(pMac, &pAddts->tspec, psessionEntry) !=
 	    eSIR_SUCCESS) {
-		lim_log(pMac, LOGW, FL("tspec validation failed"));
+		pe_warn("tspec validation failed");
 		return eSIR_FAILURE;
 	}
 	/* determine a service interval for the tspec */
 	if (lim_calculate_svc_int(pMac, &pAddts->tspec, &svcInterval) !=
 	    eSIR_SUCCESS) {
-		lim_log(pMac, LOGW, FL("SvcInt calculate failed"));
+		pe_warn("SvcInt calculate failed");
 		return eSIR_FAILURE;
 	}
 	/* determine if the tspec can be admitted or not based on current policy */
 	if (lim_admit_policy(pMac, &pAddts->tspec, psessionEntry) != eSIR_SUCCESS) {
-		lim_log(pMac, LOGW,
-			FL("tspec rejected by admit control policy"));
+		pe_warn("tspec rejected by admit control policy");
 		return eSIR_FAILURE;
 	}
 	/* fill in a schedule if requested */
@@ -760,8 +731,7 @@ tSirRetStatus lim_admit_control_add_ts(tpAniSirGlobal pMac, uint8_t *pAddr,
 	if (lim_validate_access_policy
 		    (pMac, (uint8_t) pAddts->tspec.tsinfo.traffic.accessPolicy, assocId,
 		    psessionEntry) != eSIR_SUCCESS) {
-		lim_log(pMac, LOGW,
-			FL("AccessPolicy %d is not valid in current mode"),
+		pe_warn("AccessPolicy: %d is not valid in current mode",
 			pAddts->tspec.tsinfo.traffic.accessPolicy);
 		return eSIR_FAILURE;
 	}
@@ -769,7 +739,7 @@ tSirRetStatus lim_admit_control_add_ts(tpAniSirGlobal pMac, uint8_t *pAddr,
 	if (lim_tspec_add
 		    (pMac, pAddr, assocId, &pAddts->tspec, svcInterval, &pTspecInfo)
 	    != eSIR_SUCCESS) {
-		lim_log(pMac, LOGE, FL("no space in tspec list"));
+		pe_err("no space in tspec list");
 		return eSIR_FAILURE;
 	}
 	/* passing lim tspec table index to the caller */
@@ -804,8 +774,7 @@ lim_admit_control_delete_ts(tpAniSirGlobal pMac,
 		    (pMac, assocId, pTsInfo, &pMac->lim.tspecInfo[0],
 		    &pTspecInfo) == eSIR_SUCCESS) {
 		if (pTspecInfo != NULL) {
-			lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-				FL("Tspec entry %d found"), pTspecInfo->idx);
+			pe_debug("Tspec entry: %d found", pTspecInfo->idx);
 
 			*ptspecIdx = pTspecInfo->idx;
 			lim_tspec_delete(pMac, pTspecInfo);
@@ -831,12 +800,11 @@ tSirRetStatus lim_admit_control_delete_sta(tpAniSirGlobal pMac, uint16_t assocId
 	for (ctspec = 0; ctspec < LIM_NUM_TSPEC_MAX; ctspec++, pTspecInfo++) {
 		if (assocId == pTspecInfo->assocId) {
 			lim_tspec_delete(pMac, pTspecInfo);
-			lim_log(pMac, ADMIT_CONTROL_LOGLEVEL,
-				FL("Deleting TSPEC %d for assocId %d"), ctspec,
+			pe_debug("Deleting TSPEC: %d for assocId: %d", ctspec,
 				assocId);
 		}
 	}
-	lim_log(pMac, ADMIT_CONTROL_LOGLEVEL, FL("assocId %d done"), assocId);
+	pe_debug("assocId: %d done", assocId);
 
 	return eSIR_SUCCESS;
 }
@@ -865,17 +833,17 @@ tSirRetStatus lim_update_admit_policy(tpAniSirGlobal pMac)
 {
 	uint32_t val;
 	if (wlan_cfg_get_int(pMac, WNI_CFG_ADMIT_POLICY, &val) != eSIR_SUCCESS) {
-		lim_log(pMac, LOGE, FL("Unable to get CFG_ADMIT_POLICY"));
+		pe_err("Unable to get CFG_ADMIT_POLICY");
 		return eSIR_FAILURE;
 	}
 	pMac->lim.admitPolicyInfo.type = (uint8_t) val;
 	if (wlan_cfg_get_int(pMac, WNI_CFG_ADMIT_BWFACTOR, &val) != eSIR_SUCCESS) {
-		lim_log(pMac, LOGE, FL("Unable to get CFG_ADMIT_BWFACTOR"));
+		pe_err("Unable to get CFG_ADMIT_BWFACTOR");
 		return eSIR_FAILURE;
 	}
 	pMac->lim.admitPolicyInfo.bw_factor = (uint8_t) val;
 
-	lim_log(pMac, LOGD, FL("LIM: AdmitPolicy %d, bw_factor %d"),
+	pe_debug("LIM: AdmitPolicy: %d bw_factor: %d",
 		       pMac->lim.admitPolicyInfo.type,
 		       pMac->lim.admitPolicyInfo.bw_factor);
 
@@ -913,15 +881,14 @@ lim_send_hal_msg_add_ts(tpAniSirGlobal pMac,
 
 	tpPESession psessionEntry = pe_find_session_by_session_id(pMac, sessionId);
 	if (psessionEntry == NULL) {
-		lim_log(pMac, LOGE,
-			FL("Unable to get Session for session Id %d"),
+		pe_err("Unable to get Session for session Id: %d",
 			sessionId);
 		return eSIR_FAILURE;
 	}
 
 	pAddTsParam = qdf_mem_malloc(sizeof(tAddTsParams));
 	if (NULL == pAddTsParam) {
-		lim_log(pMac, LOGE, FL("AllocateMemory() failed"));
+		pe_err("AllocateMemory() failed");
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
@@ -951,7 +918,7 @@ lim_send_hal_msg_add_ts(tpAniSirGlobal pMac,
 	MTRACE(mac_trace_msg_tx(pMac, sessionId, msg.type));
 
 	if (eSIR_SUCCESS != wma_post_ctrl_msg(pMac, &msg)) {
-		lim_log(pMac, LOGW, FL("wma_post_ctrl_msg() failed"));
+		pe_warn("wma_post_ctrl_msg() failed");
 		SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
 		qdf_mem_free(pAddTsParam);
 		return eSIR_FAILURE;
@@ -981,7 +948,7 @@ lim_send_hal_msg_del_ts(tpAniSirGlobal pMac,
 
 	pDelTsParam = qdf_mem_malloc(sizeof(tDelTsParams));
 	if (NULL == pDelTsParam) {
-		lim_log(pMac, LOGE, FL("AllocateMemory() failed"));
+		pe_err("AllocateMemory() failed");
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
@@ -996,8 +963,7 @@ lim_send_hal_msg_del_ts(tpAniSirGlobal pMac,
 
 	psessionEntry = pe_find_session_by_session_id(pMac, sessionId);
 	if (psessionEntry == NULL) {
-		lim_log(pMac, LOGE,
-			FL("Session does Not exist with given sessionId :%d "),
+		pe_err("Session does Not exist with given sessionId: %d",
 			       sessionId);
 		goto err;
 	}
@@ -1017,7 +983,7 @@ lim_send_hal_msg_del_ts(tpAniSirGlobal pMac,
 	MTRACE(mac_trace_msg_tx(pMac, sessionId, msg.type));
 
 	if (eSIR_SUCCESS != wma_post_ctrl_msg(pMac, &msg)) {
-		lim_log(pMac, LOGW, FL("wma_post_ctrl_msg() failed"));
+		pe_warn("wma_post_ctrl_msg() failed");
 		goto err;
 	}
 	return eSIR_SUCCESS;
@@ -1053,7 +1019,7 @@ void lim_process_hal_add_ts_rsp(tpAniSirGlobal pMac,
 	SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
 
 	if (NULL == limMsg->bodyptr) {
-		lim_log(pMac, LOGE, FL("Received WMA_ADD_TS_RSP with NULL "));
+		pe_err("Received WMA_ADD_TS_RSP with NULL");
 		goto end;
 	}
 
@@ -1064,8 +1030,7 @@ void lim_process_hal_add_ts_rsp(tpAniSirGlobal pMac,
 	psessionEntry = pe_find_session_by_session_id(pMac, pAddTsRspMsg->sessionId);
 
 	if (psessionEntry == NULL) {
-		lim_log(pMac, LOGE,
-			FL("Session does Not exist with given sessionId :%d "),
+		pe_err("Session does Not exist with given sessionId: %d",
 			       pAddTsRspMsg->sessionId);
 		lim_send_sme_addts_rsp(pMac, rspReqd, eSIR_SME_ADDTS_RSP_FAILED,
 				       psessionEntry, pAddTsRspMsg->tspec,
@@ -1075,8 +1040,7 @@ void lim_process_hal_add_ts_rsp(tpAniSirGlobal pMac,
 	}
 
 	if (pAddTsRspMsg->status == QDF_STATUS_SUCCESS) {
-		lim_log(pMac, LOGD,
-			FL("Received successful ADDTS response from HAL "));
+		pe_debug("Received successful ADDTS response from HAL");
 		/* Use the smesessionId and smetransactionId from the PE session context */
 		lim_send_sme_addts_rsp(pMac, rspReqd, eSIR_SME_SUCCESS,
 				       psessionEntry, pAddTsRspMsg->tspec,
@@ -1084,8 +1048,7 @@ void lim_process_hal_add_ts_rsp(tpAniSirGlobal pMac,
 				       psessionEntry->transactionId);
 		goto end;
 	} else {
-		lim_log(pMac, LOGD,
-			FL("Received failure ADDTS response from HAL "));
+		pe_debug("Received failure ADDTS response from HAL");
 		/* Send DELTS action frame to AP */
 		/* 090803: Get peer MAC addr from session */
 		sir_copy_mac_addr(peerMacAddr, psessionEntry->bssId);