1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * Common stats definitions for clients of dongle 3*4882a593Smuzhiyun * ports 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Copyright (C) 2020, Broadcom. 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * Unless you and Broadcom execute a separate written software license 8*4882a593Smuzhiyun * agreement governing use of this software, this software is licensed to you 9*4882a593Smuzhiyun * under the terms of the GNU General Public License version 2 (the "GPL"), 10*4882a593Smuzhiyun * available at http://www.broadcom.com/licenses/GPLv2.php, with the 11*4882a593Smuzhiyun * following added to such license: 12*4882a593Smuzhiyun * 13*4882a593Smuzhiyun * As a special exception, the copyright holders of this software give you 14*4882a593Smuzhiyun * permission to link this software with independent modules, and to copy and 15*4882a593Smuzhiyun * distribute the resulting executable under terms of your choice, provided that 16*4882a593Smuzhiyun * you also meet, for each linked independent module, the terms and conditions of 17*4882a593Smuzhiyun * the license of that module. An independent module is a module which is not 18*4882a593Smuzhiyun * derived from this software. The special exception does not apply to any 19*4882a593Smuzhiyun * modifications of the software. 20*4882a593Smuzhiyun * 21*4882a593Smuzhiyun * 22*4882a593Smuzhiyun * <<Broadcom-WL-IPTag/Open:>> 23*4882a593Smuzhiyun * 24*4882a593Smuzhiyun * $Id$ 25*4882a593Smuzhiyun */ 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun #ifndef _dngl_stats_h_ 28*4882a593Smuzhiyun #define _dngl_stats_h_ 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun #include <ethernet.h> 31*4882a593Smuzhiyun #include <802.11.h> 32*4882a593Smuzhiyun #include <linux/compat.h> 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun /* XXX happens to mirror a section of linux's net_device_stats struct */ 35*4882a593Smuzhiyun typedef struct { 36*4882a593Smuzhiyun unsigned long rx_packets; /* total packets received */ 37*4882a593Smuzhiyun unsigned long tx_packets; /* total packets transmitted */ 38*4882a593Smuzhiyun unsigned long rx_bytes; /* total bytes received */ 39*4882a593Smuzhiyun unsigned long tx_bytes; /* total bytes transmitted */ 40*4882a593Smuzhiyun unsigned long rx_errors; /* bad packets received */ 41*4882a593Smuzhiyun unsigned long tx_errors; /* packet transmit problems */ 42*4882a593Smuzhiyun unsigned long rx_dropped; /* packets dropped by dongle */ 43*4882a593Smuzhiyun unsigned long tx_dropped; /* packets dropped by dongle */ 44*4882a593Smuzhiyun unsigned long multicast; /* multicast packets received */ 45*4882a593Smuzhiyun } dngl_stats_t; 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun typedef int32 wifi_radio; 48*4882a593Smuzhiyun typedef int32 wifi_channel; 49*4882a593Smuzhiyun typedef int32 wifi_rssi; 50*4882a593Smuzhiyun typedef struct { uint16 version; uint16 length; } ver_len; 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun typedef enum wifi_channel_width { 53*4882a593Smuzhiyun WIFI_CHAN_WIDTH_20 = 0, 54*4882a593Smuzhiyun WIFI_CHAN_WIDTH_40 = 1, 55*4882a593Smuzhiyun WIFI_CHAN_WIDTH_80 = 2, 56*4882a593Smuzhiyun WIFI_CHAN_WIDTH_160 = 3, 57*4882a593Smuzhiyun WIFI_CHAN_WIDTH_80P80 = 4, 58*4882a593Smuzhiyun WIFI_CHAN_WIDTH_5 = 5, 59*4882a593Smuzhiyun WIFI_CHAN_WIDTH_10 = 6, 60*4882a593Smuzhiyun WIFI_CHAN_WIDTH_INVALID = -1 61*4882a593Smuzhiyun } wifi_channel_width_t; 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun typedef enum { 64*4882a593Smuzhiyun WIFI_DISCONNECTED = 0, 65*4882a593Smuzhiyun WIFI_AUTHENTICATING = 1, 66*4882a593Smuzhiyun WIFI_ASSOCIATING = 2, 67*4882a593Smuzhiyun WIFI_ASSOCIATED = 3, 68*4882a593Smuzhiyun WIFI_EAPOL_STARTED = 4, /* if done by firmware/driver */ 69*4882a593Smuzhiyun WIFI_EAPOL_COMPLETED = 5, /* if done by firmware/driver */ 70*4882a593Smuzhiyun } wifi_connection_state; 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun typedef enum { 73*4882a593Smuzhiyun WIFI_ROAMING_IDLE = 0, 74*4882a593Smuzhiyun WIFI_ROAMING_ACTIVE = 1 75*4882a593Smuzhiyun } wifi_roam_state; 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun typedef enum { 78*4882a593Smuzhiyun WIFI_INTERFACE_STA = 0, 79*4882a593Smuzhiyun WIFI_INTERFACE_SOFTAP = 1, 80*4882a593Smuzhiyun WIFI_INTERFACE_IBSS = 2, 81*4882a593Smuzhiyun WIFI_INTERFACE_P2P_CLIENT = 3, 82*4882a593Smuzhiyun WIFI_INTERFACE_P2P_GO = 4, 83*4882a593Smuzhiyun WIFI_INTERFACE_NAN = 5, 84*4882a593Smuzhiyun WIFI_INTERFACE_MESH = 6 85*4882a593Smuzhiyun } wifi_interface_mode; 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun #define WIFI_CAPABILITY_QOS 0x00000001 /* set for QOS association */ 88*4882a593Smuzhiyun #define WIFI_CAPABILITY_PROTECTED 0x00000002 /* set for protected association (802.11 89*4882a593Smuzhiyun * beacon frame control protected bit set) 90*4882a593Smuzhiyun */ 91*4882a593Smuzhiyun #define WIFI_CAPABILITY_INTERWORKING 0x00000004 /* set if 802.11 Extended Capabilities 92*4882a593Smuzhiyun * element interworking bit is set 93*4882a593Smuzhiyun */ 94*4882a593Smuzhiyun #define WIFI_CAPABILITY_HS20 0x00000008 /* set for HS20 association */ 95*4882a593Smuzhiyun #define WIFI_CAPABILITY_SSID_UTF8 0x00000010 /* set is 802.11 Extended Capabilities 96*4882a593Smuzhiyun * element UTF-8 SSID bit is set 97*4882a593Smuzhiyun */ 98*4882a593Smuzhiyun #define WIFI_CAPABILITY_COUNTRY 0x00000020 /* set is 802.11 Country Element is present */ 99*4882a593Smuzhiyun #ifdef LINUX 100*4882a593Smuzhiyun #define PACK_ATTRIBUTE __attribute__ ((packed)) 101*4882a593Smuzhiyun #else 102*4882a593Smuzhiyun #define PACK_ATTRIBUTE 103*4882a593Smuzhiyun #endif 104*4882a593Smuzhiyun typedef struct { 105*4882a593Smuzhiyun wifi_interface_mode mode; /* interface mode */ 106*4882a593Smuzhiyun uint8 mac_addr[6]; /* interface mac address (self) */ 107*4882a593Smuzhiyun uint8 PAD[2]; 108*4882a593Smuzhiyun wifi_connection_state state; /* connection state (valid for STA, CLI only) */ 109*4882a593Smuzhiyun wifi_roam_state roaming; /* roaming state */ 110*4882a593Smuzhiyun uint32 capabilities; /* WIFI_CAPABILITY_XXX (self) */ 111*4882a593Smuzhiyun uint8 ssid[DOT11_MAX_SSID_LEN+1]; /* null terminated SSID */ 112*4882a593Smuzhiyun uint8 bssid[ETHER_ADDR_LEN]; /* bssid */ 113*4882a593Smuzhiyun uint8 PAD[1]; 114*4882a593Smuzhiyun uint8 ap_country_str[3]; /* country string advertised by AP */ 115*4882a593Smuzhiyun uint8 country_str[3]; /* country string for this association */ 116*4882a593Smuzhiyun uint8 PAD[2]; 117*4882a593Smuzhiyun } wifi_interface_info; 118*4882a593Smuzhiyun 119*4882a593Smuzhiyun typedef wifi_interface_info *wifi_interface_handle; 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun /* channel information */ 122*4882a593Smuzhiyun typedef struct { 123*4882a593Smuzhiyun wifi_channel_width_t width; /* channel width (20, 40, 80, 80+80, 160) */ 124*4882a593Smuzhiyun wifi_channel center_freq; /* primary 20 MHz channel */ 125*4882a593Smuzhiyun wifi_channel center_freq0; /* center frequency (MHz) first segment */ 126*4882a593Smuzhiyun wifi_channel center_freq1; /* center frequency (MHz) second segment */ 127*4882a593Smuzhiyun } wifi_channel_info; 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun /* wifi rate */ 130*4882a593Smuzhiyun typedef struct { 131*4882a593Smuzhiyun uint32 preamble; /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */ 132*4882a593Smuzhiyun uint32 nss; /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */ 133*4882a593Smuzhiyun uint32 bw; /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */ 134*4882a593Smuzhiyun uint32 rateMcsIdx; /* OFDM/CCK rate code would be as per ieee std 135*4882a593Smuzhiyun * in the units of 0.5mbps 136*4882a593Smuzhiyun */ 137*4882a593Smuzhiyun /* HT/VHT it would be mcs index */ 138*4882a593Smuzhiyun uint32 reserved; /* reserved */ 139*4882a593Smuzhiyun uint32 bitrate; /* units of 100 Kbps */ 140*4882a593Smuzhiyun } wifi_rate; 141*4882a593Smuzhiyun 142*4882a593Smuzhiyun typedef struct { 143*4882a593Smuzhiyun uint32 preamble :3; /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */ 144*4882a593Smuzhiyun uint32 nss :2; /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */ 145*4882a593Smuzhiyun uint32 bw :3; /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */ 146*4882a593Smuzhiyun uint32 rateMcsIdx :8; /* OFDM/CCK rate code would be as per ieee std 147*4882a593Smuzhiyun * in the units of 0.5mbps HT/VHT it would be 148*4882a593Smuzhiyun * mcs index 149*4882a593Smuzhiyun */ 150*4882a593Smuzhiyun uint32 reserved :16; /* reserved */ 151*4882a593Smuzhiyun uint32 bitrate; /* units of 100 Kbps */ 152*4882a593Smuzhiyun } wifi_rate_v1; 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun /* channel statistics */ 155*4882a593Smuzhiyun typedef struct { 156*4882a593Smuzhiyun wifi_channel_info channel; /* channel */ 157*4882a593Smuzhiyun uint32 on_time; /* msecs the radio is awake (32 bits number 158*4882a593Smuzhiyun * accruing over time) 159*4882a593Smuzhiyun */ 160*4882a593Smuzhiyun uint32 cca_busy_time; /* msecs the CCA register is busy (32 bits number 161*4882a593Smuzhiyun * accruing over time) 162*4882a593Smuzhiyun */ 163*4882a593Smuzhiyun } wifi_channel_stat; 164*4882a593Smuzhiyun 165*4882a593Smuzhiyun /* radio statistics */ 166*4882a593Smuzhiyun typedef struct { 167*4882a593Smuzhiyun struct { 168*4882a593Smuzhiyun uint16 version; 169*4882a593Smuzhiyun uint16 length; 170*4882a593Smuzhiyun }; 171*4882a593Smuzhiyun wifi_radio radio; /* wifi radio (if multiple radio supported) */ 172*4882a593Smuzhiyun uint32 on_time; /* msecs the radio is awake (32 bits number 173*4882a593Smuzhiyun * accruing over time) 174*4882a593Smuzhiyun */ 175*4882a593Smuzhiyun uint32 tx_time; /* msecs the radio is transmitting (32 bits 176*4882a593Smuzhiyun * number accruing over time) 177*4882a593Smuzhiyun */ 178*4882a593Smuzhiyun uint32 rx_time; /* msecs the radio is in active receive (32 bits 179*4882a593Smuzhiyun * number accruing over time) 180*4882a593Smuzhiyun */ 181*4882a593Smuzhiyun uint32 on_time_scan; /* msecs the radio is awake due to all scan (32 bits 182*4882a593Smuzhiyun * number accruing over time) 183*4882a593Smuzhiyun */ 184*4882a593Smuzhiyun uint32 on_time_nbd; /* msecs the radio is awake due to NAN (32 bits 185*4882a593Smuzhiyun * number accruing over time) 186*4882a593Smuzhiyun */ 187*4882a593Smuzhiyun uint32 on_time_gscan; /* msecs the radio is awake due to G?scan (32 bits 188*4882a593Smuzhiyun * number accruing over time) 189*4882a593Smuzhiyun */ 190*4882a593Smuzhiyun uint32 on_time_roam_scan; /* msecs the radio is awake due to roam?scan (32 bits 191*4882a593Smuzhiyun * number accruing over time) 192*4882a593Smuzhiyun */ 193*4882a593Smuzhiyun uint32 on_time_pno_scan; /* msecs the radio is awake due to PNO scan (32 bits 194*4882a593Smuzhiyun * number accruing over time) 195*4882a593Smuzhiyun */ 196*4882a593Smuzhiyun uint32 on_time_hs20; /* msecs the radio is awake due to HS2.0 scans and 197*4882a593Smuzhiyun * GAS exchange (32 bits number accruing over time) 198*4882a593Smuzhiyun */ 199*4882a593Smuzhiyun uint32 num_channels; /* number of channels */ 200*4882a593Smuzhiyun wifi_channel_stat channels[1]; /* channel statistics */ 201*4882a593Smuzhiyun } wifi_radio_stat; 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun typedef struct { 204*4882a593Smuzhiyun wifi_radio radio; 205*4882a593Smuzhiyun uint32 on_time; 206*4882a593Smuzhiyun uint32 tx_time; 207*4882a593Smuzhiyun uint32 rx_time; 208*4882a593Smuzhiyun uint32 on_time_scan; 209*4882a593Smuzhiyun uint32 on_time_nbd; 210*4882a593Smuzhiyun uint32 on_time_gscan; 211*4882a593Smuzhiyun uint32 on_time_roam_scan; 212*4882a593Smuzhiyun uint32 on_time_pno_scan; 213*4882a593Smuzhiyun uint32 on_time_hs20; 214*4882a593Smuzhiyun uint32 num_channels; 215*4882a593Smuzhiyun } wifi_radio_stat_h; 216*4882a593Smuzhiyun 217*4882a593Smuzhiyun /* per rate statistics */ 218*4882a593Smuzhiyun typedef struct { 219*4882a593Smuzhiyun wifi_rate_v1 rate; /* rate information */ 220*4882a593Smuzhiyun uint32 tx_mpdu; /* number of successfully transmitted data pkts (ACK rcvd) */ 221*4882a593Smuzhiyun uint32 rx_mpdu; /* number of received data pkts */ 222*4882a593Smuzhiyun uint32 mpdu_lost; /* number of data packet losses (no ACK) */ 223*4882a593Smuzhiyun uint32 retries; /* total number of data pkt retries */ 224*4882a593Smuzhiyun uint32 retries_short; /* number of short data pkt retries */ 225*4882a593Smuzhiyun uint32 retries_long; /* number of long data pkt retries */ 226*4882a593Smuzhiyun } wifi_rate_stat_v1; 227*4882a593Smuzhiyun 228*4882a593Smuzhiyun typedef struct { 229*4882a593Smuzhiyun uint16 version; 230*4882a593Smuzhiyun uint16 length; 231*4882a593Smuzhiyun uint32 tx_mpdu; /* number of successfully transmitted data pkts (ACK rcvd) */ 232*4882a593Smuzhiyun uint32 rx_mpdu; /* number of received data pkts */ 233*4882a593Smuzhiyun uint32 mpdu_lost; /* number of data packet losses (no ACK) */ 234*4882a593Smuzhiyun uint32 retries; /* total number of data pkt retries */ 235*4882a593Smuzhiyun uint32 retries_short; /* number of short data pkt retries */ 236*4882a593Smuzhiyun uint32 retries_long; /* number of long data pkt retries */ 237*4882a593Smuzhiyun wifi_rate rate; 238*4882a593Smuzhiyun } wifi_rate_stat; 239*4882a593Smuzhiyun 240*4882a593Smuzhiyun /* access categories */ 241*4882a593Smuzhiyun typedef enum { 242*4882a593Smuzhiyun WIFI_AC_VO = 0, 243*4882a593Smuzhiyun WIFI_AC_VI = 1, 244*4882a593Smuzhiyun WIFI_AC_BE = 2, 245*4882a593Smuzhiyun WIFI_AC_BK = 3, 246*4882a593Smuzhiyun WIFI_AC_MAX = 4 247*4882a593Smuzhiyun } wifi_traffic_ac; 248*4882a593Smuzhiyun 249*4882a593Smuzhiyun /* wifi peer type */ 250*4882a593Smuzhiyun typedef enum 251*4882a593Smuzhiyun { 252*4882a593Smuzhiyun WIFI_PEER_STA, 253*4882a593Smuzhiyun WIFI_PEER_AP, 254*4882a593Smuzhiyun WIFI_PEER_P2P_GO, 255*4882a593Smuzhiyun WIFI_PEER_P2P_CLIENT, 256*4882a593Smuzhiyun WIFI_PEER_NAN, 257*4882a593Smuzhiyun WIFI_PEER_TDLS, 258*4882a593Smuzhiyun WIFI_PEER_INVALID 259*4882a593Smuzhiyun } wifi_peer_type; 260*4882a593Smuzhiyun 261*4882a593Smuzhiyun /* per peer statistics */ 262*4882a593Smuzhiyun typedef struct { 263*4882a593Smuzhiyun wifi_peer_type type; /* peer type (AP, TDLS, GO etc.) */ 264*4882a593Smuzhiyun uint8 peer_mac_address[6]; /* mac address */ 265*4882a593Smuzhiyun uint32 capabilities; /* peer WIFI_CAPABILITY_XXX */ 266*4882a593Smuzhiyun uint32 num_rate; /* number of rates */ 267*4882a593Smuzhiyun wifi_rate_stat rate_stats[1]; /* per rate statistics, number of entries = num_rate */ 268*4882a593Smuzhiyun } wifi_peer_info; 269*4882a593Smuzhiyun 270*4882a593Smuzhiyun /* per access category statistics */ 271*4882a593Smuzhiyun typedef struct { 272*4882a593Smuzhiyun wifi_traffic_ac ac; /* access category (VI, VO, BE, BK) */ 273*4882a593Smuzhiyun uint32 tx_mpdu; /* number of successfully transmitted unicast data pkts 274*4882a593Smuzhiyun * (ACK rcvd) 275*4882a593Smuzhiyun */ 276*4882a593Smuzhiyun uint32 rx_mpdu; /* number of received unicast mpdus */ 277*4882a593Smuzhiyun uint32 tx_mcast; /* number of succesfully transmitted multicast 278*4882a593Smuzhiyun * data packets 279*4882a593Smuzhiyun */ 280*4882a593Smuzhiyun /* STA case: implies ACK received from AP for the 281*4882a593Smuzhiyun * unicast packet in which mcast pkt was sent 282*4882a593Smuzhiyun */ 283*4882a593Smuzhiyun uint32 rx_mcast; /* number of received multicast data packets */ 284*4882a593Smuzhiyun uint32 rx_ampdu; /* number of received unicast a-mpdus */ 285*4882a593Smuzhiyun uint32 tx_ampdu; /* number of transmitted unicast a-mpdus */ 286*4882a593Smuzhiyun uint32 mpdu_lost; /* number of data pkt losses (no ACK) */ 287*4882a593Smuzhiyun uint32 retries; /* total number of data pkt retries */ 288*4882a593Smuzhiyun uint32 retries_short; /* number of short data pkt retries */ 289*4882a593Smuzhiyun uint32 retries_long; /* number of long data pkt retries */ 290*4882a593Smuzhiyun uint32 contention_time_min; /* data pkt min contention time (usecs) */ 291*4882a593Smuzhiyun uint32 contention_time_max; /* data pkt max contention time (usecs) */ 292*4882a593Smuzhiyun uint32 contention_time_avg; /* data pkt avg contention time (usecs) */ 293*4882a593Smuzhiyun uint32 contention_num_samples; /* num of data pkts used for contention statistics */ 294*4882a593Smuzhiyun } wifi_wmm_ac_stat; 295*4882a593Smuzhiyun 296*4882a593Smuzhiyun /* interface statistics */ 297*4882a593Smuzhiyun typedef struct { 298*4882a593Smuzhiyun wifi_interface_handle iface; /* wifi interface */ 299*4882a593Smuzhiyun wifi_interface_info info; /* current state of the interface */ 300*4882a593Smuzhiyun uint32 beacon_rx; /* access point beacon received count from 301*4882a593Smuzhiyun * connected AP 302*4882a593Smuzhiyun */ 303*4882a593Smuzhiyun uint64 average_tsf_offset; /* average beacon offset encountered (beacon_TSF - TBTT) 304*4882a593Smuzhiyun * The average_tsf_offset field is used so as to calculate 305*4882a593Smuzhiyun * the typical beacon contention time on the channel as well 306*4882a593Smuzhiyun * may be used to debug beacon synchronization and related 307*4882a593Smuzhiyun * power consumption issue 308*4882a593Smuzhiyun */ 309*4882a593Smuzhiyun uint32 leaky_ap_detected; /* indicate that this AP 310*4882a593Smuzhiyun * typically leaks packets beyond 311*4882a593Smuzhiyun * the driver guard time. 312*4882a593Smuzhiyun */ 313*4882a593Smuzhiyun uint32 leaky_ap_avg_num_frames_leaked; /* average number of frame leaked by AP after 314*4882a593Smuzhiyun * frame with PM bit set was ACK'ed by AP 315*4882a593Smuzhiyun */ 316*4882a593Smuzhiyun uint32 leaky_ap_guard_time; /* guard time currently in force 317*4882a593Smuzhiyun * (when implementing IEEE power management 318*4882a593Smuzhiyun * based on frame control PM bit), How long 319*4882a593Smuzhiyun * driver waits before shutting down the radio and after 320*4882a593Smuzhiyun * receiving an ACK for a data frame with PM bit set) 321*4882a593Smuzhiyun */ 322*4882a593Smuzhiyun uint32 mgmt_rx; /* access point mgmt frames received count from 323*4882a593Smuzhiyun * connected AP (including Beacon) 324*4882a593Smuzhiyun */ 325*4882a593Smuzhiyun uint32 mgmt_action_rx; /* action frames received count */ 326*4882a593Smuzhiyun uint32 mgmt_action_tx; /* action frames transmit count */ 327*4882a593Smuzhiyun wifi_rssi rssi_mgmt; /* access Point Beacon and Management frames RSSI 328*4882a593Smuzhiyun * (averaged) 329*4882a593Smuzhiyun */ 330*4882a593Smuzhiyun wifi_rssi rssi_data; /* access Point Data Frames RSSI (averaged) from 331*4882a593Smuzhiyun * connected AP 332*4882a593Smuzhiyun */ 333*4882a593Smuzhiyun wifi_rssi rssi_ack; /* access Point ACK RSSI (averaged) from 334*4882a593Smuzhiyun * connected AP 335*4882a593Smuzhiyun */ 336*4882a593Smuzhiyun wifi_wmm_ac_stat ac[WIFI_AC_MAX]; /* per ac data packet statistics */ 337*4882a593Smuzhiyun uint32 num_peers; /* number of peers */ 338*4882a593Smuzhiyun wifi_peer_info peer_info[1]; /* per peer statistics */ 339*4882a593Smuzhiyun } wifi_iface_stat; 340*4882a593Smuzhiyun 341*4882a593Smuzhiyun #ifdef CONFIG_COMPAT 342*4882a593Smuzhiyun /* interface statistics */ 343*4882a593Smuzhiyun typedef struct { 344*4882a593Smuzhiyun compat_uptr_t iface; /* wifi interface */ 345*4882a593Smuzhiyun wifi_interface_info info; /* current state of the interface */ 346*4882a593Smuzhiyun uint32 beacon_rx; /* access point beacon received count from 347*4882a593Smuzhiyun * connected AP 348*4882a593Smuzhiyun */ 349*4882a593Smuzhiyun uint64 average_tsf_offset; /* average beacon offset encountered (beacon_TSF - TBTT) 350*4882a593Smuzhiyun * The average_tsf_offset field is used so as to calculate 351*4882a593Smuzhiyun * the typical beacon contention time on the channel as well 352*4882a593Smuzhiyun * may be used to debug beacon synchronization and related 353*4882a593Smuzhiyun * power consumption issue 354*4882a593Smuzhiyun */ 355*4882a593Smuzhiyun uint32 leaky_ap_detected; /* indicate that this AP 356*4882a593Smuzhiyun * typically leaks packets beyond 357*4882a593Smuzhiyun * the driver guard time. 358*4882a593Smuzhiyun */ 359*4882a593Smuzhiyun uint32 leaky_ap_avg_num_frames_leaked; /* average number of frame leaked by AP after 360*4882a593Smuzhiyun * frame with PM bit set was ACK'ed by AP 361*4882a593Smuzhiyun */ 362*4882a593Smuzhiyun uint32 leaky_ap_guard_time; /* guard time currently in force 363*4882a593Smuzhiyun * (when implementing IEEE power management 364*4882a593Smuzhiyun * based on frame control PM bit), How long 365*4882a593Smuzhiyun * driver waits before shutting down the radio and after 366*4882a593Smuzhiyun * receiving an ACK for a data frame with PM bit set) 367*4882a593Smuzhiyun */ 368*4882a593Smuzhiyun uint32 mgmt_rx; /* access point mgmt frames received count from 369*4882a593Smuzhiyun * connected AP (including Beacon) 370*4882a593Smuzhiyun */ 371*4882a593Smuzhiyun uint32 mgmt_action_rx; /* action frames received count */ 372*4882a593Smuzhiyun uint32 mgmt_action_tx; /* action frames transmit count */ 373*4882a593Smuzhiyun wifi_rssi rssi_mgmt; /* access Point Beacon and Management frames RSSI 374*4882a593Smuzhiyun * (averaged) 375*4882a593Smuzhiyun */ 376*4882a593Smuzhiyun wifi_rssi rssi_data; /* access Point Data Frames RSSI (averaged) from 377*4882a593Smuzhiyun * connected AP 378*4882a593Smuzhiyun */ 379*4882a593Smuzhiyun wifi_rssi rssi_ack; /* access Point ACK RSSI (averaged) from 380*4882a593Smuzhiyun * connected AP 381*4882a593Smuzhiyun */ 382*4882a593Smuzhiyun wifi_wmm_ac_stat ac[WIFI_AC_MAX]; /* per ac data packet statistics */ 383*4882a593Smuzhiyun uint32 num_peers; /* number of peers */ 384*4882a593Smuzhiyun wifi_peer_info peer_info[1]; /* per peer statistics */ 385*4882a593Smuzhiyun } compat_wifi_iface_stat; 386*4882a593Smuzhiyun #endif /* CONFIG_COMPAT */ 387*4882a593Smuzhiyun 388*4882a593Smuzhiyun #endif /* _dngl_stats_h_ */ 389