wlan: Allow single PNO scan at a time.
Its possible that, PNO scan is enabled either through wext or
through supplicant.
Changes have been made to allow only one PNO scan at a given time
by adding new variable, isPnoEnable.
Change-Id: Ifee337d5bb6175acdd5f6997942125e5306e89e0
CRs-Fixed: 622466
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 8d8c299..3f3b3a9 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -8396,11 +8396,20 @@
return -EBUSY;
}
+ if (TRUE == pHddCtx->isPnoEnable)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
+ FL("already PNO is enabled"));
+ return -EBUSY;
+ }
+ pHddCtx->isPnoEnable = TRUE;
+
pPnoRequest = (tpSirPNOScanReq) vos_mem_malloc(sizeof (tSirPNOScanReq));
if (NULL == pPnoRequest)
{
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
"%s: vos_mem_malloc failed", __func__);
+ pHddCtx->isPnoEnable = FALSE;
return -ENOMEM;
}
@@ -8570,11 +8579,13 @@
}
ret = pAdapter->pno_req_status;
+ return ret;
error:
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
FL("PNO scanRequest offloaded ret = %d"), ret);
vos_mem_free(pPnoRequest);
+ pHddCtx->isPnoEnable = FALSE;
return ret;
}
@@ -8663,6 +8674,7 @@
ret = -EINVAL;
goto error;
}
+ pHddCtx->isPnoEnable = FALSE;
error:
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,