diff options
Diffstat (limited to 'bcmdhd/wifi_hal/wifi_logger.cpp')
-rwxr-xr-x | bcmdhd/wifi_hal/wifi_logger.cpp | 66 |
1 files changed, 62 insertions, 4 deletions
diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp index dbbcf79..694df19 100755 --- a/bcmdhd/wifi_hal/wifi_logger.cpp +++ b/bcmdhd/wifi_hal/wifi_logger.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 2017 The Android Open Source Project * - * Portions copyright (C) 2017 Broadcom Limited + * Portions copyright (C) 2023 Broadcom Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -81,13 +81,15 @@ typedef enum { #define MAX_SKU_NAME_LEN 5 #define OTA_PATH "/data/vendor/firmware/wifi/" #define OTA_CLM_FILE "bcmdhd_clm.blob" +#define OTA_TXCAP_BLOB_FILE "bcmdhd_txcap.blob" #define OTA_NVRAM_FILE "bcmdhd.cal" #define HW_DEV_PROP "ro.revision" #define HW_SKU_PROP "ro.boot.hardware.sku" typedef enum { NVRAM, - CLM_BLOB + CLM_BLOB, + TXCAP_BLOB } OTA_TYPE; char ota_nvram_ext[10]; @@ -96,6 +98,8 @@ typedef struct ota_info_buf { const void *ota_clm_buf[1]; u32 ota_nvram_len; const void *ota_nvram_buf[1]; + u32 ota_txcap_len; + const void *ota_txcap_buf[1]; } ota_info_buf_t; u32 applied_ota_version = 0; @@ -189,6 +193,8 @@ typedef enum { OTA_DOWNLOAD_NVRAM_ATTR = 0x0004, OTA_SET_FORCE_REG_ON = 0x0005, OTA_CUR_NVRAM_EXT_ATTR = 0x0006, + OTA_DOWNLOAD_TXCAP_BLOB_LENGTH_ATTR = 0x0007, + OTA_DOWNLOAD_TXCAP_BLOB_ATTR = 0x0008, } OTA_DOWNLOAD_ATTRIBUTE; #define HAL_START_REQUEST_ID 2 @@ -518,6 +524,7 @@ typedef struct { } sku_info_t; sku_info_t sku_table[] = { + // BCM4389 { {"G9S9B"}, {"MMW"} }, { {"G8V0U"}, {"MMW"} }, { {"GFQM1"}, {"MMW"} }, @@ -536,7 +543,20 @@ sku_info_t sku_table[] = { { {"GB17L"}, {"JPN"} }, { {"GFE4J"}, {"JPN"} }, { {"G03Z5"}, {"JPN"} }, - { {"G1AZG"}, {"EU"} } + // BCM4398 + { {"GKWS6"}, {"MMW"} }, + { {"G1MNW"}, {"MMW"} }, + { {"GPJ41"}, {"ROW"} }, + { {"GC3VE"}, {"ROW"} }, + { {"GE9DP"}, {"JPN"} }, + { {"GZPF0"}, {"JPN"} }, + { {"G1AZG"}, {"EU"} }, + { {"G9BQD"}, {"NA"} }, + // BCM4383 + { {"G8HHN"}, {"MMW"} }, + { {"G6GPR"}, {"ROW"} }, + { {"G576D"}, {"JPN"} }, + { {"GKV4X"}, {"NA"} } }; /////////////////////////////////////////////////////////////////////////////// class DebugCommand : public WifiCommand @@ -1645,6 +1665,7 @@ public: : WifiCommand("RingDump", iface, id), mLargestBuffSize(0), mBuff(NULL), mErrCode(0) { + memset(&mHandle, 0, sizeof(wifi_ring_buffer_data_handler)); } int start() { @@ -1685,6 +1706,7 @@ public: ring_name[i] = NULL; } } + memset(&mHandle, 0, sizeof(wifi_ring_buffer_data_handler)); DUMP_INFO(("Stop Ring Dump Successfully Completed, mErrCode = %d\n", mErrCode)); return WIFI_SUCCESS; @@ -2330,6 +2352,7 @@ public: int createMonitorPktFateRequest(WifiRequest& request) { int result = request.create(GOOGLE_OUI, LOGGER_START_PKT_FATE_MONITORING); if (result < 0) { + ALOGE("Failed to create monitorPktFate result:%d\n", result); return result; } @@ -2341,6 +2364,7 @@ public: int createTxPktFateRequest(WifiRequest& request) { int result = request.create(GOOGLE_OUI, LOGGER_GET_TX_PKT_FATES); if (result < 0) { + ALOGE("Failed to create TxPktFate result:%d\n", result); return result; } @@ -2348,10 +2372,12 @@ public: nlattr *data = request.attr_start(NL80211_ATTR_VENDOR_DATA); result = request.put_u32(LOGGER_ATTRIBUTE_PKT_FATE_NUM, mNoReqFates); if (result < 0) { + ALOGE("Failed to set TxPktFate num result:%d mNoReqFates:%d\n", result, mNoReqFates); return result; } result = request.put_u64(LOGGER_ATTRIBUTE_PKT_FATE_DATA, (uint64_t)mReportBufs); if (result < 0) { + ALOGE("Failed to set TxPktFate buf result:%d\n", result); return result; } request.attr_end(data); @@ -2361,6 +2387,7 @@ public: int createRxPktFateRequest(WifiRequest& request) { int result = request.create(GOOGLE_OUI, LOGGER_GET_RX_PKT_FATES); if (result < 0) { + ALOGE("Failed to create RxPktFate result:%d\n", result); return result; } @@ -2368,10 +2395,12 @@ public: nlattr *data = request.attr_start(NL80211_ATTR_VENDOR_DATA); result = request.put_u32(LOGGER_ATTRIBUTE_PKT_FATE_NUM, mNoReqFates); if (result < 0) { + ALOGE("Failed to set RxPktFate num result:%d mNoReqFates:%d\n", result, mNoReqFates); return result; } result = request.put_u64(LOGGER_ATTRIBUTE_PKT_FATE_DATA, (uint64_t)mReportBufs); if (result < 0) { + ALOGE("Failed to set RxPktFate buf result:%d\n", result); return result; } request.attr_end(data); @@ -2700,11 +2729,24 @@ class OtaUpdateCommand : public WifiCommand return result; } + result = request.put_u32(OTA_DOWNLOAD_TXCAP_BLOB_LENGTH_ATTR, buf->ota_txcap_len); + if (result != WIFI_SUCCESS) { + ALOGE("otaDownload Failed to put data= %d", result); + return result; + } + + result = request.put(OTA_DOWNLOAD_TXCAP_BLOB_ATTR, + buf->ota_txcap_buf, sizeof(*buf->ota_txcap_buf)); + if (result != WIFI_SUCCESS) { + ALOGE("otaDownload Failed to put data= %d", result); + return result; + } + request.attr_end(data); result = requestResponse(request); if (result != WIFI_SUCCESS) { - ALOGE("Failed to register set otaDownload; result = %d", result); + ALOGE("Failed to register set otaDownload; result = %d\n", result); } return result; @@ -2794,6 +2836,10 @@ wifi_error check_multiple_nvram_clm(uint32_t type, char* hw_revision, char* hw_s else if (type == NVRAM) { sprintf(nvram_clmblob_default_file, "%s%s", OTA_PATH, OTA_NVRAM_FILE); } + else if (type == TXCAP_BLOB) { + sprintf(nvram_clmblob_default_file, "%s%s", OTA_PATH, OTA_TXCAP_BLOB_FILE); + } + for (unsigned int i = 0; i < MAX_NV_FILE; i++) { memset(file_name[i], 0, FILE_NAME_LEN); } @@ -2820,6 +2866,7 @@ wifi_error wifi_hal_ota_update(wifi_interface_handle iface, uint32_t ota_version ota_info_buf_t buf; char *buffer_nvram = NULL; char *buffer_clm = NULL; + char *buffer_txcap_blob = NULL; char prop_revision_buf[PROPERTY_VALUE_MAX] = {0,}; char prop_sku_buf[PROPERTY_VALUE_MAX] = {0,}; char sku_name[MAX_SKU_NAME_LEN] = {0,}; @@ -2854,6 +2901,14 @@ wifi_error wifi_hal_ota_update(wifi_interface_handle iface, uint32_t ota_version } buf.ota_clm_buf[0] = buffer_clm; + check_multiple_nvram_clm(TXCAP_BLOB, prop_revision_buf, sku_name, + &buffer_txcap_blob, &buf.ota_txcap_len); + if (buffer_txcap_blob == NULL) { + ALOGE("buffer_txcap_blob is null"); + goto exit; + } + buf.ota_txcap_buf[0] = buffer_txcap_blob; + check_multiple_nvram_clm(NVRAM, prop_revision_buf, sku_name, &buffer_nvram, &buf.ota_nvram_len); if (buffer_nvram == NULL) { @@ -2870,6 +2925,9 @@ exit: if (buffer_nvram != NULL) { free(buffer_nvram); } + if (buffer_txcap_blob != NULL) { + free(buffer_txcap_blob); + } cmd->releaseRef(); |