wlan: make sure at least one PNO timer is configured
If the PNO command specifies a timer count of 0 then configure a
default timer (the same as we would do if a timer count was not
specified at all).
Change-Id: Ic442d943b2b36889830ed42d174829de13899df5
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 50ce53c..3278dcb 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -5788,7 +5788,7 @@
<scan_timers> <scan_time> <scan_repeat> <scan_time> <scan_repeat>
e.g:
- 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 2 5 2 300 0
+ 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 2 5 2 300 0
this translates into:
-----------------------------
@@ -5804,7 +5804,7 @@
bcast type is non-bcast (directed probe will be sent)
and must not meet any RSSI threshold
- scan every 5 seconds 2 times, scan every 300 seconds until stopped
+ scan every 5 seconds 2 times, scan every 300 seconds until stopped
-----------------------------------------------------------------------*/
ptr = (char*)(wrqu->data.pointer + nOffset);
@@ -5860,7 +5860,7 @@
/*Advance to SSID*/
ptr += nOffset;
- memcpy(pnoRequest.aNetworks[i].ssId.ssId, ptr,
+ memcpy(pnoRequest.aNetworks[i].ssId.ssId, ptr,
pnoRequest.aNetworks[i].ssId.length);
ptr += pnoRequest.aNetworks[i].ssId.length;
@@ -5941,18 +5941,18 @@
&(pnoRequest.scanTimers.ucScanTimersCount), &nOffset);
/*Read the scan timers*/
- if (( 1 == ucParams )&&( pnoRequest.scanTimers.ucScanTimersCount >= 0 ))
+ if (( 1 == ucParams ) && ( pnoRequest.scanTimers.ucScanTimersCount > 0 ))
{
ptr += nOffset;
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
- "Scan timer count %d offset %d",
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "Scan timer count %d offset %d",
pnoRequest.scanTimers.ucScanTimersCount,
nOffset );
if ( SIR_PNO_MAX_SCAN_TIMERS < pnoRequest.scanTimers.ucScanTimersCount )
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"Incorrect cmd - too many scan timers");
return VOS_STATUS_E_FAILURE;
}
@@ -5964,15 +5964,15 @@
&( pnoRequest.scanTimers.aTimerValues[i].uTimerRepeat),
&nOffset);
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
- "PNO Timer value %d Timer repeat %d offset %d",
- pnoRequest.scanTimers.aTimerValues[i].uTimerValue,
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "PNO Timer value %d Timer repeat %d offset %d",
+ pnoRequest.scanTimers.aTimerValues[i].uTimerValue,
pnoRequest.scanTimers.aTimerValues[i].uTimerRepeat,
nOffset );
if ( 2 != ucParams )
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"Incorrect cmd - diff params then expected %d", ucParams);
return VOS_STATUS_E_FAILURE;
}
@@ -5983,8 +5983,8 @@
}
else
{
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
- "No scan timers provided param count %d scan timers %d",
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+ "No scan timers provided param count %d scan timers %d",
ucParams, pnoRequest.scanTimers.ucScanTimersCount );
/*Scan timers defaults to 5 minutes*/