summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahesh KKV <maheshkkv@google.com>2022-11-07 23:13:03 -0800
committerSunil Ravi <sunilravi@google.com>2022-12-15 02:37:50 +0000
commit832ef8ef71eeae787955ca9bc69e390713398b09 (patch)
treebf40f68f6d57460757727bda30278faac6be0393
parent2832940b56f03db12d883536bae7f581e78a3fc8 (diff)
downloadlibhardware_legacy-832ef8ef71eeae787955ca9bc69e390713398b09.tar.gz
wifi: Add multi link stats support to legacy HAL
Multi-link operation (MLO) is considered a key feature in IEEE 802.11be, which allows devices to transmit and receive data using multiple links concurrently, thereby contributing to improving throughput and reducing latency. Currently HAL supports querying stats from single link. Add a callback to get stats from multiple links supported by the Wi-Fi chip. Also keep the callback to get single link layer stats as it is for backward compatibility. Multi link stats callback can be used for legacy case as well with single link. Bug: 246988155 Test: Builds successfully Change-Id: Iea2649b6868e9b153ae31e5c05457c324f5b4e98
-rw-r--r--include/hardware_legacy/link_layer_stats.h62
1 files changed, 58 insertions, 4 deletions
diff --git a/include/hardware_legacy/link_layer_stats.h b/include/hardware_legacy/link_layer_stats.h
index bac84e1..24699a9 100644
--- a/include/hardware_legacy/link_layer_stats.h
+++ b/include/hardware_legacy/link_layer_stats.h
@@ -221,6 +221,53 @@ typedef struct {
wifi_peer_info peer_info[]; // per peer statistics
} wifi_iface_stat;
+/* Per link statistics */
+typedef struct {
+ u8 link_id; // Identifier for the link.
+ u32 beacon_rx; // Beacon received count from connected AP on the link.
+ u64 average_tsf_offset; // Average beacon offset encountered (beacon_TSF -
+ // TBTT). The average_tsf_offset field is used so as
+ // to calculate the typical beacon contention time on
+ // the channel as well may be used to debug beacon
+ // synchronization and related power consumption
+ // issue.
+ u32 leaky_ap_detected; // Indicate that this AP on the link typically leaks
+ // packets beyond the driver guard time.
+ u32 leaky_ap_avg_num_frames_leaked; // Average number of frame leaked by AP
+ // in the link after frame with PM bit
+ // set was ACK'ed by AP.
+ u32 leaky_ap_guard_time; // Guard time currently in force (when implementing
+ // IEEE power management based on frame control PM
+ // bit), How long driver waits before shutting down
+ // the radio and after receiving an ACK for a data
+ // frame with PM bit set).
+ u32 mgmt_rx; // Management frames received count from connected AP on the
+ // link (including Beacon).
+ u32 mgmt_action_rx; // Action frames received count on the link.
+ u32 mgmt_action_tx; // Action frames transmit count on the link.
+ wifi_rssi rssi_mgmt; // Access Point Beacon and Management frames RSSI
+ // (averaged) on the link.
+ wifi_rssi rssi_data; // Access Point Data Frames RSSI (averaged) from
+ // connected AP on the link.
+ wifi_rssi rssi_ack; // Access Point ACK RSSI (averaged) from connected AP on
+ // the links.
+ wifi_wmm_ac_stat ac[WIFI_AC_MAX]; // Per AC data packet statistics for the
+ // link.
+ u8 time_slicing_duty_cycle_percent; // If this link is being served using
+ // time slicing on a radio with one or
+ // more links, then the duty cycle
+ // assigned to this link in %.
+ u32 num_peers; // Number of peers.
+ wifi_peer_info peer_info[]; // Peer statistics for the link.
+} wifi_link_stat;
+
+/* Multi link stats for interface */
+typedef struct {
+ wifi_interface_handle iface; // Wifi interface.
+ wifi_interface_link_layer_info info; // Current state of the interface.
+ int num_links; // Number of links.
+ wifi_link_stat links[]; // Stats per link.
+} wifi_iface_ml_stat;
/* configuration params */
typedef struct {
u32 mpdu_size_threshold; // threshold to classify the pkts as short or long
@@ -234,10 +281,18 @@ typedef struct {
Interface statistics (once started) reset and start afresh after each connection */
wifi_error wifi_set_link_stats(wifi_interface_handle iface, wifi_link_layer_params params);
-/* callback for reporting link layer stats */
+/* Callbacks for reporting link layer stats. Only one of the callbacks needs to
+ * be called. */
typedef struct {
- void (*on_link_stats_results) (wifi_request_id id, wifi_iface_stat *iface_stat,
- int num_radios, wifi_radio_stat *radio_stat);
+ /* Legacy: Single iface/link stats. */
+ void (*on_link_stats_results)(wifi_request_id id,
+ wifi_iface_stat *iface_stat, int num_radios,
+ wifi_radio_stat *radio_stat);
+ /* Multi link stats. */
+ void (*on_multi_link_stats_results)(wifi_request_id id,
+ wifi_iface_ml_stat *iface_ml_stat,
+ int num_radios,
+ wifi_radio_stat *radio_stat);
} wifi_stats_result_handler;
/* api to collect the link layer statistics for a given iface and all the radio stats */
@@ -266,4 +321,3 @@ wifi_error wifi_clear_link_stats(wifi_interface_handle iface,
#endif /* __cplusplus */
#endif /*__WIFI_HAL_STATS_ */
-