diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2020-11-23 06:48:37 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2020-11-23 06:48:37 -0800 |
commit | ec52849a9cc633416e32ad7ba0185ad9e8bfe27c (patch) | |
tree | 883d4c8b8fd665a62cade563467a7b5db9f7af56 | |
parent | daa894243d19d93af8a0d205c42cc29893e51e85 (diff) | |
parent | 6a6f988fd12c6e30ffd5727cbe09db879c4e558d (diff) |
Merge 6a6f988fd12c6e30ffd5727cbe09db879c4e558d on remote branch
Change-Id: Ibdb511f757de16cdf03086509c4dcbf17ed32e2d
-rw-r--r-- | qcwcn/wifi_hal/gscan.cpp | 6 | ||||
-rw-r--r-- | qcwcn/wifi_hal/gscancommand.h | 6 | ||||
-rw-r--r-- | qcwcn/wifi_hal/llstats.cpp | 18 | ||||
-rw-r--r-- | qcwcn/wifi_hal/nud_stats.h | 8 | ||||
-rw-r--r-- | qcwcn/wifi_hal/wifi_hal.cpp | 2 | ||||
-rw-r--r-- | qcwcn/wifi_hal/wifilogger_diag.cpp | 6 |
6 files changed, 34 insertions, 12 deletions
diff --git a/qcwcn/wifi_hal/gscan.cpp b/qcwcn/wifi_hal/gscan.cpp index 22910dc..03a5fb4 100644 --- a/qcwcn/wifi_hal/gscan.cpp +++ b/qcwcn/wifi_hal/gscan.cpp @@ -1385,11 +1385,11 @@ wifi_error GScanCommand:: gscan_get_cached_results( wifi_cached_scan_results *cached_results, struct nlattr **tb_vendor) { - u32 j = 0; + int j = 0; struct nlattr *scanResultsInfo, *wifiScanResultsInfo; int rem = 0, remResults = 0; u32 len = 0, numScanResults = 0; - u32 i = mGetCachedResultsRspParams->cachedResultsStartingIndex; + int i = mGetCachedResultsRspParams->cachedResultsStartingIndex; ALOGV("%s: starting counter: %d", __FUNCTION__, i); for (scanResultsInfo = (struct nlattr *) nla_data(tb_vendor[ @@ -1649,7 +1649,7 @@ wifi_error GScanCommand:: gscan_get_cached_results( i++; } /* Increment starting index of filling cached results received */ - if (mGetCachedResultsRspParams->num_cached_results) + if (mGetCachedResultsRspParams->num_cached_results <= 1024) mGetCachedResultsRspParams->cachedResultsStartingIndex = mGetCachedResultsRspParams->num_cached_results - 1; return WIFI_SUCCESS; diff --git a/qcwcn/wifi_hal/gscancommand.h b/qcwcn/wifi_hal/gscancommand.h index dc48ef6..6fbc90b 100644 --- a/qcwcn/wifi_hal/gscancommand.h +++ b/qcwcn/wifi_hal/gscancommand.h @@ -46,10 +46,10 @@ typedef struct{ typedef struct{ u8 more_data; u32 num_cached_results; - u32 cachedResultsStartingIndex; /* Used in filling cached scan results */ + int cachedResultsStartingIndex; /* Used in filling cached scan results */ int lastProcessedScanId; /* Last scan id in gscan cached results block */ - u32 wifiScanResultsStartingIndex; /* For the lastProcessedScanId */ - u32 max; /* max num of cached results specified by caller */ + int wifiScanResultsStartingIndex; /* For the lastProcessedScanId */ + int max; /* max num of cached results specified by caller */ wifi_cached_scan_results *cached_results; } GScanGetCachedResultsRspParams; diff --git a/qcwcn/wifi_hal/llstats.cpp b/qcwcn/wifi_hal/llstats.cpp index d199d8c..b02da62 100644 --- a/qcwcn/wifi_hal/llstats.cpp +++ b/qcwcn/wifi_hal/llstats.cpp @@ -1257,6 +1257,12 @@ wifi_error wifi_set_link_stats(wifi_interface_handle iface, struct nlattr *nl_data; interface_info *iinfo = getIfaceInfo(iface); wifi_handle handle = getWifiHandle(iface); + hal_info *info = getHalInfo(handle); + + if (!(info->supported_feature_set & WIFI_FEATURE_LINK_LAYER_STATS)) { + ALOGI("%s: LLS is not supported by driver", __FUNCTION__); + return WIFI_ERROR_NOT_SUPPORTED; + } ALOGI("mpdu_size_threshold : %u, aggressive_statistics_gathering : %u", params.mpdu_size_threshold, params.aggressive_statistics_gathering); @@ -1311,6 +1317,12 @@ wifi_error wifi_get_link_stats(wifi_request_id id, struct nlattr *nl_data; interface_info *iinfo = getIfaceInfo(iface); wifi_handle handle = getWifiHandle(iface); + hal_info *info = getHalInfo(handle); + + if (!(info->supported_feature_set & WIFI_FEATURE_LINK_LAYER_STATS)) { + ALOGI("%s: LLS is not supported by driver", __FUNCTION__); + return WIFI_ERROR_NOT_SUPPORTED; + } LLCommand = LLStatsCommand::instance(handle); if (LLCommand == NULL) { @@ -1375,6 +1387,12 @@ wifi_error wifi_clear_link_stats(wifi_interface_handle iface, struct nlattr *nl_data; interface_info *iinfo = getIfaceInfo(iface); wifi_handle handle = getWifiHandle(iface); + hal_info *info = getHalInfo(handle); + + if (!(info->supported_feature_set & WIFI_FEATURE_LINK_LAYER_STATS)) { + ALOGI("%s: LLS is not supported by driver", __FUNCTION__); + return WIFI_ERROR_NOT_SUPPORTED; + } ALOGI("clear_req : %x, stop_req : %u", stats_clear_req_mask, stop_req); LLCommand = LLStatsCommand::instance(handle); diff --git a/qcwcn/wifi_hal/nud_stats.h b/qcwcn/wifi_hal/nud_stats.h index c1db343..c88b3a9 100644 --- a/qcwcn/wifi_hal/nud_stats.h +++ b/qcwcn/wifi_hal/nud_stats.h @@ -44,7 +44,13 @@ #include <netlink/netlink.h> #include <netlink/socket.h> #include "wifi_hal.h" -#include <arpa/inet.h> +#include <bits/in_addr.h> + +#define INET6_ADDRSTRLEN 46 + +extern "C" { + const char* inet_ntop(int __af, const void* __src, char* __dst, socklen_t __size); +} typedef struct { uint16_t arp_req_count_from_netdev; diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp index 3367cd4..8d35058 100644 --- a/qcwcn/wifi_hal/wifi_hal.cpp +++ b/qcwcn/wifi_hal/wifi_hal.cpp @@ -580,9 +580,7 @@ wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn) { //fn->wifi_set_qpower = wifi_set_qpower; fn->wifi_virtual_interface_create = wifi_virtual_interface_create; fn->wifi_virtual_interface_delete = wifi_virtual_interface_delete; -#ifdef WCNSS_QTI_AOSP fn->wifi_set_latency_mode = wifi_set_latency_mode; -#endif fn->wifi_set_thermal_mitigation_mode = wifi_set_thermal_mitigation_mode; return WIFI_SUCCESS; diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp index 3de06cb..827e235 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.cpp +++ b/qcwcn/wifi_hal/wifilogger_diag.cpp @@ -2828,17 +2828,17 @@ wifi_error diag_message_handler(hal_info *info, nl_msg *msg) u32 length = 0; slot = (dbglog_slot *)buf; + length = get_le32((u8 *)&slot->length); if (nlh->nlmsg_len < (NLMSG_HDRLEN + sizeof(dbglog_slot) + - slot->length)) { + length)) { ALOGE("Received CNSS_DIAG message with insufficent length: %d:" " expected: %zu, %s:%d", nlh->nlmsg_len, - (NLMSG_HDRLEN + sizeof(dbglog_slot) +slot->length), + (NLMSG_HDRLEN + sizeof(dbglog_slot) +length), __FUNCTION__, __LINE__); return WIFI_ERROR_UNKNOWN; } - length = get_le32((u8 *)&slot->length); process_fw_diag_msg(info, &slot->payload[0], length); } } |