return result;
}
-
+
return result;
}
if(*mHandler.on_scan_event)
(*mHandler.on_scan_event)(evt_type, evt_type);
} else if(event_id == GSCAN_EVENT_FULL_SCAN_RESULTS) {
- uint32_t bucket_scanned;
+ uint32_t bucket_scanned = 0;
wifi_scan_result *scan_result = NULL;
for (nl_iterator it(vendor_data); it.has_next(); it.next()) {
if (it.get_type() == GSCAN_ATTRIBUTE_SCAN_BUCKET_BIT) {
wifi_cached_scan_results *results, int max, int *num)
: WifiCommand(iface, -1), mScans(results), mMax(max), mNum(num),
mRetrieved(0), mFlush(flush), mCompleted(0)
- { }
+ {
+ memset(mScanResults,0,sizeof(mScanResults));
+ mNextScanResult = 0;
+ }
int createRequest(WifiRequest& request, int num, byte flush) {
int result = request.create(GOOGLE_OUI, SLSI_NL80211_VENDOR_SUBCMD_GET_SCAN_RESULTS);
BssidHotlistCommand(wifi_interface_handle handle, int id,
wifi_bssid_hotlist_params params, wifi_hotlist_ap_found_handler handler)
: WifiCommand(handle, id), mParams(params), mHandler(handler)
- { }
+ {
+ memset(mResults, 0, sizeof(mResults));
+ }
int createSetupRequest(WifiRequest& request) {
int result = request.create(GOOGLE_OUI, SLSI_NL80211_VENDOR_SUBCMD_SET_BSSID_HOTLIST);
return NL_SKIP;
}
- memset(mResults, 0, sizeof(wifi_scan_result) * MAX_RESULTS);
int num = len / sizeof(wifi_scan_result);
num = min(MAX_RESULTS, num);
SignificantWifiChangeCommand(wifi_interface_handle handle, int id,
wifi_significant_change_params params, wifi_significant_change_handler handler)
: WifiCommand(handle, id), mParams(params), mHandler(handler)
- { }
+ {
+ memset(mResultsBuffer,0,sizeof(mResultsBuffer));
+ memset(mResults,0,sizeof(mResults));
+ }
int createSetupRequest(WifiRequest& request) {
int result = request.create(GOOGLE_OUI, SLSI_NL80211_VENDOR_SUBCMD_SET_SIGNIFICANT_CHANGE);
: WifiCommand(handle, id), mHandler(handler)
{
epno_params = params;
+ memset(&mResults,0,sizeof(wifi_scan_result));
}
int createSetupRequest(WifiRequest& request) {
return NL_SKIP;
}
+
mResults = *(wifi_scan_result *) event.get_vendor_data();
if (*mHandler.on_network_found)
(*mHandler.on_network_found)(id(), 1, &mResults);
int num)
: WifiCommand(iface, id), num_hs(num), mNetworks(NULL)
{
+ mHandler.on_passpoint_network_found = NULL;
}
int createRequest(WifiRequest& request, int val) {
public:
LinkLayerStatsCommand(wifi_interface_handle handle, wifi_link_layer_params params)
: WifiCommand(handle, 0), mParams(params)
- { }
+ {
+ mStatsClearReqMask = 0;
+ mStatsClearRspMask = 0;
+ mStopReq = 0 ;
+ mStopRsp = NULL;
+
+ }
LinkLayerStatsCommand(wifi_interface_handle handle,
u32 stats_clear_req_mask, u32 *stats_clear_rsp_mask, u8 stop_req, u8 *stop_rsp)
: WifiCommand(handle, 0), mStatsClearReqMask(stats_clear_req_mask), mStatsClearRspMask(stats_clear_rsp_mask),
mStopReq(stop_req), mStopRsp(stop_rsp)
- { }
+ {
+ memset(&mParams,0,sizeof(wifi_link_layer_params));
+ }
int createSetRequest(WifiRequest& request) {
int result = request.create(GOOGLE_OUI, SLSI_NL80211_VENDOR_SUBCMD_LLS_SET_INFO);
// assuming max peers is 16
wifi_iface_stat *iface_stat = (wifi_iface_stat *) malloc(sizeof(wifi_iface_stat) + sizeof(wifi_peer_info) * 16);
+ if (!iface_stat) {
+ ALOGE("Memory alloc failed for iface_stat in response handler!!!");
+ return NL_SKIP;
+ }
+
// max channel is 38 (14 2.4GHz and 24 5GHz)
wifi_radio_stat *radio_stat = (wifi_radio_stat *) malloc(sizeof(wifi_radio_stat) + sizeof(wifi_channel_stat) * 38);
-
- if (!iface_stat || !radio_stat) {
- ALOGE("Memory alloc failed in response handler!!!");
+ if (!radio_stat) {
+ ALOGE("Memory alloc failed for radio_stat in response handler!!!");
+ free(iface_stat);
return NL_SKIP;
}