소스 검색

qcacld-3.0: Avoid ROC duration to exceed maximum ROC duration

While extending the duration for ROC, the driver updates the
new duration value with the 2 or 5 times of the current duration
value, that leads to exceed the maximum ROC duration value.

The change is to check the current duration value and increase
it accordingly to avoid exceeding the maximum ROC duration value.

Change-Id: I05658adfdeae32eecdfff939d132484c584c0aa8
CRs-Fixed: 2008441
Nitesh Shah 8 년 전
부모
커밋
8523472ac8
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      core/hdd/src/wlan_hdd_p2p.c

+ 6 - 4
core/hdd/src/wlan_hdd_p2p.c

@@ -591,10 +591,12 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter,
 
 	/* Extending duration for proactive extension logic for RoC */
 	duration = pRemainChanCtx->duration;
-	if (isGoPresent == true)
-		duration = P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT * duration;
-	else
-		duration = P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT * duration;
+	if (duration < HDD_P2P_MAX_ROC_DURATION) {
+		if (isGoPresent == true)
+			duration *= P2P_ROC_DURATION_MULTIPLIER_GO_PRESENT;
+		else
+			duration *= P2P_ROC_DURATION_MULTIPLIER_GO_ABSENT;
+	}
 
 	hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC);
 	qdf_runtime_pm_prevent_suspend(pHddCtx->runtime_context.roc);