wlan: Logging enhancements for Scan.
In some case, mScanPending should be error log but that can lead
to continous logging. So we use a counter which will allow max
5 times for this error log to get printed.
Also the counter is re-set everytime the scan is completed successfully.
Change-Id: I65a4c13607713e6feba323606659b1004ffc1045
CRs-Fixed: 565305
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 7d89d45..c8f02e5 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -700,6 +700,10 @@
/* The scan pending */
v_U32_t mScanPending;
+ /* Counter for mScanPending so that the scan pending
+ error log is not printed for more than 5 times */
+ v_U32_t mScanPendingCounter;
+
/* Client Wait Scan Result */
v_U32_t waitScanResult;
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index f1be3ff..86de15b 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -94,6 +94,7 @@
#define FREQ_BASE_80211G (2407)
#define FREQ_BAND_DIFF_80211G (5)
#define MAX_SCAN_SSID 9
+#define MAX_PENDING_LOG 5
#define GET_IE_LEN_IN_BSS_DESC(lenInBss) ( lenInBss + sizeof(lenInBss) - \
((int) OFFSET_OF( tSirBssDescription, ieFields)))
@@ -4567,6 +4568,8 @@
"scanID = %d, returned status = %d\n",
__func__, halHandle, pContext, (int) scanId, (int) status);
+ pScanInfo->mScanPendingCounter = 0;
+
//Block on scan req completion variable. Can't wait forever though.
ret = wait_for_completion_interruptible_timeout(
&pScanInfo->scan_req_completion_event,
@@ -4813,7 +4816,10 @@
if (TRUE == pScanInfo->mScanPending)
{
- hddLog(VOS_TRACE_LEVEL_INFO, "%s: mScanPending is TRUE", __func__);
+ if ( MAX_PENDING_LOG > pScanInfo->mScanPendingCounter++ )
+ {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: mScanPending is TRUE", __func__);
+ }
return -EBUSY;
}
@@ -4823,7 +4829,7 @@
//If no action frame pending
if (0 != wlan_hdd_check_remain_on_channel(pAdapter))
{
- hddLog(VOS_TRACE_LEVEL_INFO, "%s: Remain On Channel Pending", __func__);
+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Remain On Channel Pending", __func__);
return -EBUSY;
}
#ifdef FEATURE_WLAN_TDLS