return result;\r
}\r
\r
- result = request.put_u32(GSCAN_ATTRIBUTE_REPORT_THRESHOLD, mParams->report_threshold);\r
+ result = request.put_u32(GSCAN_ATTRIBUTE_REPORT_THRESHOLD, mParams->report_threshold_percent);\r
if (result < 0) {\r
return result;\r
}\r
event.log();\r
\r
nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA);\r
- int len = event.get_vendor_data_len();\r
+ unsigned 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
}\r
\r
class GetScanResultsCommand : public WifiCommand {\r
- wifi_scan_result *mResults;\r
+ wifi_cached_scan_results *mResults;\r
int mMax;\r
int *mNum;\r
int mRetrieved;\r
int mCompleted;\r
public:\r
GetScanResultsCommand(wifi_interface_handle iface, byte flush,\r
- wifi_scan_result *results, int max, int *num)\r
+ wifi_cached_scan_results *results, int max, int *num)\r
: WifiCommand(iface, -1), mResults(results), mMax(max), mNum(num),\r
mRetrieved(0), mFlush(flush), mCompleted(0)\r
{ }\r
};\r
\r
wifi_error wifi_get_cached_gscan_results(wifi_interface_handle iface, byte flush,\r
- int max, wifi_scan_result *results, int *num) {\r
-\r
+ int max, wifi_cached_scan_results *results, int *num) {\r
ALOGD("Getting cached scan results, iface handle = %p, num = %d", iface, *num);\r
\r
GetScanResultsCommand *cmd = new GetScanResultsCommand(iface, flush, results, max, num);\r
}\r
\r
struct nlattr * attr = request.attr_start(GSCAN_ATTRIBUTE_HOTLIST_BSSIDS);\r
- for (int i = 0; i < mParams.num_ap; i++) {\r
+ for (int i = 0; i < mParams.num_bssid; i++) {\r
nlattr *attr2 = request.attr_start(GSCAN_ATTRIBUTE_HOTLIST_ELEM);\r
if (attr2 == NULL) {\r
return WIFI_ERROR_OUT_OF_MEMORY;\r
if (result < 0) {\r
return result;\r
}\r
- result = request.put_u16(GSCAN_ATTRIBUTE_CHANNEL_NUMBER, mParams.ap[i].channel);\r
- if (result < 0) {\r
- return result;\r
- }\r
request.attr_end(attr2);\r
}\r
\r
}\r
\r
int start() {\r
- ALOGD("Executing hotlist setup request, num = %d", mParams.num_ap);\r
+ ALOGD("Executing hotlist setup request, num = %d", mParams.num_bssid);\r
WifiRequest request(familyId(), ifaceId());\r
int result = createSetupRequest(request);\r
if (result < 0) {\r
return result;\r
}\r
\r
- ALOGD("Successfully set %d APs in the hotlist", mParams.num_ap);\r
+ ALOGD("Successfully set %d APs in the hotlist", mParams.num_bssid);\r
\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_FOUND);\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_LOST);\r
\r
struct nlattr * attr = request.attr_start(GSCAN_ATTRIBUTE_SIGNIFICANT_CHANGE_BSSIDS);\r
\r
- for (int i = 0; i < mParams.num_ap; i++) {\r
+ for (int i = 0; i < mParams.num_bssid; i++) {\r
\r
nlattr *attr2 = request.attr_start(i);\r
if (attr2 == NULL) {\r
if (result < 0) {\r
return result;\r
}\r
- result = request.put_u16(GSCAN_ATTRIBUTE_CHANNEL, mParams.ap[i].channel);\r
- if (result < 0) {\r
- return result;\r
- }\r
request.attr_end(attr2);\r
}\r
\r
typedef struct {\r
uint16_t channel;\r
mac_addr bssid;\r
- s16 rssi_history[8];\r
+ int16_t rssi_history[8];\r
} ChangeInfo;\r
\r
int num = min(len / sizeof(ChangeInfo), MAX_RESULTS);\r
return sock;\r
}\r
\r
+/*initialize function pointer table with Broadcom HHAL API*/\r
+wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)\r
+{\r
+ if (fn == NULL) {\r
+ return WIFI_ERROR_UNKNOWN;\r
+ }\r
+ fn->wifi_initialize = wifi_initialize;\r
+ fn->wifi_cleanup = wifi_cleanup;\r
+ fn->wifi_event_loop = wifi_event_loop;\r
+ fn->wifi_get_supported_feature_set = wifi_get_supported_feature_set;\r
+ fn->wifi_get_concurrency_matrix = wifi_get_concurrency_matrix;\r
+ fn->wifi_set_scanning_mac_oui = wifi_set_scanning_mac_oui;\r
+ fn->wifi_get_ifaces = wifi_get_ifaces;\r
+ fn->wifi_get_iface_name = wifi_get_iface_name;\r
+ fn->wifi_start_gscan = wifi_start_gscan;\r
+ fn->wifi_stop_gscan = wifi_stop_gscan;\r
+ fn->wifi_get_cached_gscan_results = wifi_get_cached_gscan_results;\r
+ fn->wifi_set_bssid_hotlist = wifi_set_bssid_hotlist;\r
+ fn->wifi_reset_bssid_hotlist = wifi_reset_bssid_hotlist;\r
+ fn->wifi_set_significant_change_handler = wifi_set_significant_change_handler;\r
+ fn->wifi_reset_significant_change_handler = wifi_reset_significant_change_handler;\r
+ fn->wifi_get_gscan_capabilities = wifi_get_gscan_capabilities;\r
+ fn->wifi_get_link_stats = wifi_get_link_stats;\r
+ fn->wifi_get_valid_channels = wifi_get_valid_channels;\r
+ fn->wifi_rtt_range_request = wifi_rtt_range_request;\r
+ fn->wifi_rtt_range_cancel = wifi_rtt_range_cancel;\r
+ fn->wifi_get_rtt_capabilities = wifi_get_rtt_capabilities;\r
+ fn->wifi_set_nodfs_flag = wifi_set_nodfs_flag;\r
+ return WIFI_SUCCESS;\r
+}\r
+\r
wifi_error wifi_initialize(wifi_handle *handle)\r
{\r
srand(getpid());\r