summaryrefslogtreecommitdiff
path: root/qcwcn/wifi_hal/wifi_hal.cpp
diff options
context:
space:
mode:
authorSrinivas Girigowda <quic_sgirigow@quicinc.com>2019-03-28 16:37:13 -0700
committerSunil Ravi <sunilravi@google.com>2019-04-02 21:08:41 +0000
commitd9e4d7c698fda8db6f2532f370185eaeac3ca910 (patch)
treede3a73d4e08f71626f636dbe6786a310f56f543b /qcwcn/wifi_hal/wifi_hal.cpp
parent275cf8ba9ecf957cc18c302c3555ddeb43b66c75 (diff)
downloadwlan-d9e4d7c698fda8db6f2532f370185eaeac3ca910.tar.gz
Revert "Revert "Wifi-hal: TX Per Packet stats for V2 version.""
This reverts commit 41d7798f68a93664a836c8b86c23addd3db9d17f. Bug: 129272032 Bug: 118484168 Test: Connect STA to AP and play youtube. Change-Id: If86b053c4e083cf1c01e7d7293d79706c6bb093e
Diffstat (limited to 'qcwcn/wifi_hal/wifi_hal.cpp')
-rw-r--r--qcwcn/wifi_hal/wifi_hal.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/qcwcn/wifi_hal/wifi_hal.cpp b/qcwcn/wifi_hal/wifi_hal.cpp
index 8834bba..0881c0b 100644
--- a/qcwcn/wifi_hal/wifi_hal.cpp
+++ b/qcwcn/wifi_hal/wifi_hal.cpp
@@ -65,6 +65,7 @@
#define WIFI_HAL_CMD_SOCK_PORT 644
#define WIFI_HAL_EVENT_SOCK_PORT 645
+#define MAX_HW_VER_LENGTH 100
/*
* Defines for wifi_wait_for_driver_ready()
* Specify durations between polls and max wait time
@@ -494,6 +495,8 @@ wifi_error wifi_initialize(wifi_handle *handle)
struct nl_cb *cb = NULL;
int status = 0;
int index;
+ char hw_ver_type[MAX_HW_VER_LENGTH];
+ char *hw_name = NULL;
ALOGI("Initializing wifi");
hal_info *info = (hal_info *)malloc(sizeof(hal_info));
@@ -670,6 +673,24 @@ wifi_error wifi_initialize(wifi_handle *handle)
if (ret != WIFI_SUCCESS)
ALOGE("Failed to get supported logger feature set: %d", ret);
+ ret = wifi_get_firmware_version(iface_handle, hw_ver_type,
+ MAX_HW_VER_LENGTH);
+ if (ret == WIFI_SUCCESS) {
+ hw_name = strstr(hw_ver_type, "HW:");
+ if (hw_name) {
+ hw_name += strlen("HW:");
+ if (strncmp(hw_name, "QCA6174", 7) == 0)
+ info->pkt_log_ver = PKT_LOG_V1;
+ else
+ info->pkt_log_ver = PKT_LOG_V2;
+ } else {
+ info->pkt_log_ver = PKT_LOG_V0;
+ }
+ ALOGV("%s: hardware version type %d", __func__, info->pkt_log_ver);
+ } else {
+ ALOGE("Failed to get supported logger feature set: %d", ret);
+ }
+
ret = get_firmware_bus_max_size_supported(iface_handle);
if (ret != WIFI_SUCCESS) {
ALOGE("Failed to get supported bus size, error : %d", ret);