Эх сурвалжийг харах

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 жил өмнө
parent
commit
8523472ac8

+ 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);