GSCAN_ATTRIBUTE_NUM_AP_PER_SCAN,\r
GSCAN_ATTRIBUTE_REPORT_THRESHOLD,\r
GSCAN_ATTRIBUTE_NUM_SCANS_TO_CACHE,\r
- GSCAN_ATTRIBUTE_DWELL_TIME,\r
- GSCAN_ATTRIBUTE_SCAN_TYPE,\r
GSCAN_ATTRIBUTE_BAND = GSCAN_ATTRIBUTE_BUCKETS_BAND,\r
\r
GSCAN_ATTRIBUTE_ENABLE_FEATURE = 20,\r
GSCAN_ATTRIBUTE_SCAN_RESULTS_COMPLETE, /* indicates no more results */\r
- GSCAN_ENABLE_FULL_SCAN_RESULTS,\r
GSCAN_ATTRIBUTE_REPORT_EVENTS,\r
\r
/* remaining reserved for additional attributes */\r
return createFeatureRequest(request, SLSI_NL80211_VENDOR_SUBCMD_DEL_GSCAN);\r
}\r
\r
- int enableFullScanResultsIfRequired() {\r
- /* temporary workaround till we have full support for per bucket scans */\r
-\r
- ALOGI("enabling full scan results if needed");\r
- int nBuckets = 0;\r
- for (int i = 0; i < mParams->num_buckets; i++) {\r
- if (mParams->buckets[i].report_events == 2) {\r
- nBuckets++;\r
- }\r
- }\r
-\r
- if (mGlobalFullScanBuckets == 0 && nBuckets != 0) {\r
- \r
- ALOGI("full scan results were requested ");\r
- ALOGI("mGlobalFullScanBuckets = %d, nBuckets = %d", mGlobalFullScanBuckets, nBuckets);\r
- mLocalFullScanBuckets = nBuckets;\r
- mGlobalFullScanBuckets += nBuckets;\r
- registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_FULL_SCAN_RESULTS);\r
-\r
- } else {\r
- ALOGI("mGlobalFullScanBuckets = %d, nBuckets = %d", mGlobalFullScanBuckets, nBuckets);\r
-\r
- }\r
-\r
- return WIFI_SUCCESS; \r
- }\r
- int disableFullScanResultsIfRequired() {\r
- /* temporary workaround till we have full support for per bucket scans */\r
-\r
- if (mLocalFullScanBuckets == 0) {\r
- return WIFI_SUCCESS;\r
- }\r
-\r
- mGlobalFullScanBuckets -= mLocalFullScanBuckets;\r
- if (mGlobalFullScanBuckets == 0) {\r
- \r
- unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_FULL_SCAN_RESULTS);\r
- }\r
-\r
- return WIFI_SUCCESS;\r
- }\r
int start() {\r
ALOGD(" sending scan req to driver");\r
WifiRequest request(familyId(), ifaceId());\r
\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SCAN_RESULTS_AVAILABLE);\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_COMPLETE_SCAN);\r
- result = enableFullScanResultsIfRequired();\r
- if ( result == WIFI_SUCCESS)\r
- {\r
- \r
- }\r
\r
+ int nBuckets = 0;\r
+ for (int i = 0; i < mParams->num_buckets; i++) {\r
+ if (mParams->buckets[i].report_events == 2) {\r
+ nBuckets++;\r
+ }\r
+ }\r
+\r
+ if (nBuckets != 0) {\r
+ ALOGI("Full scan requested with nBuckets = %d", nBuckets);\r
+ registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_FULL_SCAN_RESULTS);\r
+ }\r
result = requestResponse(request);\r
if (result != WIFI_SUCCESS) {\r
ALOGE("failed to start scan; result = %d", result);\r
\r
unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_COMPLETE_SCAN);\r
unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SCAN_RESULTS_AVAILABLE);\r
- disableFullScanResultsIfRequired();\r
+ unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_FULL_SCAN_RESULTS);\r
\r
return WIFI_SUCCESS;\r
}\r
nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA);\r
int len = event.get_vendor_data_len();\r
int event_id = event.get_vendor_subcmd();\r
+ ALOGD("handleEvent, event_id = %d", event_id);\r
\r
if(event_id == GSCAN_EVENT_COMPLETE_SCAN) {\r
if (vendor_data == NULL || len != 4) {\r
\r
ALOGD("Id = %0x, subcmd = %d", id, subcmd);\r
\r
- /*\r
- if (subcmd != GSCAN_SUBCMD_SCAN_RESULTS) {\r
- ALOGE("Invalid response to GetScanResultsCommand; ignoring it");\r
- return NL_SKIP;\r
- }\r
- */\r
-\r
nlattr *vendor_data = reply.get_attribute(NL80211_ATTR_VENDOR_DATA);\r
int len = reply.get_vendor_data_len();\r
\r
}\r
\r
ALOGD("Successfully set %d APs in the hotlist", mParams.num_ap);\r
+\r
result = createFeatureRequest(request, SLSI_NL80211_VENDOR_SUBCMD_ADD_GSCAN);\r
if (result < 0) {\r
return result;\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_LOST);\r
\r
result = requestResponse(request);\r
- if (result < 0) {\r
+ if (result != WIFI_SUCCESS) {\r
+ ALOGE("failed to start scan; result = %d", result);\r
unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_FOUND);\r
unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_LOST);\r
return result;\r
}\r
\r
ALOGD("successfully restarted the scan");\r
+\r
return result;\r
}\r
\r