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