summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2024-03-06 09:30:02 -0800
committerXin Li <delphij@google.com>2024-03-06 09:30:02 -0800
commit8e94481ec6e0d788c13a24cc33e73292bd032a2b (patch)
tree7205f4013b41705dfa3190d356b5578097ece0bf
parent37bfb7afefbc3267f2061d755d605cd781fc2992 (diff)
parent0cdfa109e4436b9eadf99c29e9c66b76bd0090f3 (diff)
downloadwlan-8e94481ec6e0d788c13a24cc33e73292bd032a2b.tar.gz
Merge Android 14 QPR2 to AOSP main
Bug: 319669529 Merged-In: I839298b9e4cab291fed3dd0782f54f6c089ef91f Change-Id: I252433f37b3fc022314124183c48c080c7404ced
-rw-r--r--synadhd/wifi_hal/link_layer_stats.cpp27
-rwxr-xr-xsynadhd/wifi_hal/twt.cpp4
2 files changed, 25 insertions, 6 deletions
diff --git a/synadhd/wifi_hal/link_layer_stats.cpp b/synadhd/wifi_hal/link_layer_stats.cpp
index ee7b468..518fc30 100644
--- a/synadhd/wifi_hal/link_layer_stats.cpp
+++ b/synadhd/wifi_hal/link_layer_stats.cpp
@@ -66,6 +66,24 @@ typedef struct {
wifi_channel_stat channels[];
} wifi_radio_stat_internal;
+typedef struct {
+ wifi_radio radio; // wifi radio (if multiple radio supported)
+ u32 on_time; // msecs the radio is awake
+ u32 tx_time; // msecs the radio is transmitting
+ u32 num_tx_levels; // number of radio transmit power levels
+ u64 tx_time_per_levels; // pointer to an array of radio transmit per power levels in
+ // msecs accured over time
+ u32 rx_time; // msecs the radio is in active receive
+ u32 on_time_scan; // msecs the radio is awake due to all scan
+ u32 on_time_nbd; // msecs the radio is awake due to NAN
+ u32 on_time_gscan; // msecs the radio is awake due to G scan
+ u32 on_time_roam_scan; // msecs the radio is awake due to roam scan
+ u32 on_time_pno_scan; // msecs the radio is awake due to PNO scan
+ u32 on_time_hs20; // msecs the radio is awake due to HS2.0 scans and GAS exchange
+ u32 num_channels; // number of channels
+ wifi_channel_stat channels[]; // channel statistics
+} wifi_radio_stat_internal_v2;
+
enum {
LSTATS_SUBCMD_GET_INFO = ANDROID_NL80211_SUBCMD_LSTATS_RANGE_START,
};
@@ -157,7 +175,7 @@ protected:
goto exit;
}
radio_stat_ptr =
- convertToExternalRadioStatStructure((wifi_radio_stat*)data_ptr,
+ convertToExternalRadioStatStructure((wifi_radio_stat_internal_v2*)data_ptr,
&per_radio_size);
if (!radio_stat_ptr || !per_radio_size) {
ALOGE("No data for radio %d\n", i);
@@ -216,14 +234,15 @@ exit:
}
private:
- wifi_radio_stat *convertToExternalRadioStatStructure(wifi_radio_stat *internal_stat_ptr,
- uint32_t *per_radio_size) {
+ wifi_radio_stat *convertToExternalRadioStatStructure(
+ wifi_radio_stat_internal_v2 *internal_stat_ptr,
+ uint32_t *per_radio_size) {
wifi_radio_stat *external_stat_ptr = NULL;
if (!internal_stat_ptr) {
ALOGE("Incoming data is null\n");
} else {
uint32_t channel_size = internal_stat_ptr->num_channels * sizeof(wifi_channel_stat);
- *per_radio_size = offsetof(wifi_radio_stat, channels) + channel_size;
+ *per_radio_size = offsetof(wifi_radio_stat_internal_v2, channels) + channel_size;
external_stat_ptr = (wifi_radio_stat *)malloc(*per_radio_size);
if (external_stat_ptr) {
external_stat_ptr->radio = internal_stat_ptr->radio;
diff --git a/synadhd/wifi_hal/twt.cpp b/synadhd/wifi_hal/twt.cpp
index e3dd5bd..63cd002 100755
--- a/synadhd/wifi_hal/twt.cpp
+++ b/synadhd/wifi_hal/twt.cpp
@@ -367,7 +367,7 @@ protected:
nlattr *data = reply.get_attribute(NL80211_ATTR_VENDOR_DATA);
int len = reply.get_vendor_data_len();
- ALOGD("Id = %0x, subcmd = %d, len = %d, expected len = %d", id, subcmd, len);
+ ALOGD("Id = %0x, subcmd = %d, len = %d", id, subcmd, len);
if (data == NULL || len == 0) {
ALOGE("no vendor data in GetTwtCapabilitiesCommand response; ignoring it\n");
return NL_SKIP;
@@ -463,7 +463,7 @@ protected:
nlattr *data = reply.get_attribute(NL80211_ATTR_VENDOR_DATA);
int len = reply.get_vendor_data_len();
- ALOGD("Id = %0x, subcmd = %d, len = %d, expected len = %d", id, subcmd, len);
+ ALOGD("Id = %0x, subcmd = %d, len = %d", id, subcmd, len);
if (data == NULL || len == 0) {
ALOGE("no vendor data in GetTwtStatsCommand response; ignoring it\n");
return NL_SKIP;