summaryrefslogtreecommitdiffstats
path: root/bcmdhd/wifi_hal/gscan.cpp
diff options
context:
space:
mode:
authorRicardo Cerqueira <ricardo@cyngn.com>2015-11-05 00:45:10 +0000
committerRicardo Cerqueira <ricardo@cyngn.com>2015-11-05 00:45:10 +0000
commitc39d0144a4f59667f0b06eb18bd91cb3557c4848 (patch)
tree6f1cce6c577e8ead08e20ec622c6059092aaaf90 /bcmdhd/wifi_hal/gscan.cpp
parent3fe02b9f89fc760ad94a82a10e6f4ecb03ac50b1 (diff)
parent25e0325ec11c92eeee422dac842cebafd9f7cb89 (diff)
downloadhardware_broadcom_wlan-c39d0144a4f59667f0b06eb18bd91cb3557c4848.zip
hardware_broadcom_wlan-c39d0144a4f59667f0b06eb18bd91cb3557c4848.tar.gz
hardware_broadcom_wlan-c39d0144a4f59667f0b06eb18bd91cb3557c4848.tar.bz2
Merge tag 'android-6.0.0_r26' into cm-13.0
Android 6.0.0 release 26
Diffstat (limited to 'bcmdhd/wifi_hal/gscan.cpp')
-rw-r--r--bcmdhd/wifi_hal/gscan.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/bcmdhd/wifi_hal/gscan.cpp b/bcmdhd/wifi_hal/gscan.cpp
index 8a21a0d..418537b 100644
--- a/bcmdhd/wifi_hal/gscan.cpp
+++ b/bcmdhd/wifi_hal/gscan.cpp
@@ -19,7 +19,7 @@
#include "sync.h"
#define LOG_TAG "WifiHAL"
-//#define LOG_NDEBUG 1 //uncomment to enable verbose logging
+//#define LOG_NDEBUG 0 //uncomment to enable verbose logging
#include <utils/Log.h>
@@ -923,8 +923,8 @@ public:
mCompleted = it.get_u8();
ALOGV("retrieved mCompleted flag : %d", mCompleted);
} else if (it.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS || it.get_type() == 0) {
+ int scan_id = 0, flags = 0, num = 0;
for (nl_iterator it2(it.get()); it2.has_next(); it2.next()) {
- int scan_id = 0, flags = 0, num = 0;
if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_ID) {
scan_id = it2.get_u32();
ALOGV("retrieved scan_id : 0x%0x", scan_id);
@@ -935,6 +935,10 @@ public:
num = it2.get_u32();
ALOGV("retrieved num_results: %d", num);
} else if (it2.get_type() == GSCAN_ATTRIBUTE_SCAN_RESULTS) {
+ if (mRetrieved >= mMax) {
+ ALOGW("Stored %d scans, ignoring excess results", mRetrieved);
+ break;
+ }
num = it2.get_len() / sizeof(wifi_scan_result);
num = min(MAX_RESULTS - mNextScanResult, num);
num = min((int)MAX_AP_CACHE_PER_SCAN, num);
@@ -952,13 +956,11 @@ public:
mScans[mRetrieved].scan_id = scan_id;
mScans[mRetrieved].flags = flags;
mScans[mRetrieved].num_results = num;
+ ALOGV("Setting result of scan_id : 0x%0x", mScans[mRetrieved].scan_id);
memcpy(mScans[mRetrieved].results,
&(mScanResults[mNextScanResult]), num * sizeof(wifi_scan_result));
mNextScanResult += num;
mRetrieved++;
- if (mRetrieved >= mMax && it.has_next()) {
- ALOGW("Ignoring attributes after this scan");
- }
} else {
ALOGW("Ignoring invalid attribute type = %d, size = %d",
it.get_type(), it.get_len());