2 * Common stats definitions for clients of dongle
5 * Copyright (C) 1999-2019, Broadcom.
7 * Unless you and Broadcom execute a separate written software license
8 * agreement governing use of this software, this software is licensed to you
9 * under the terms of the GNU General Public License version 2 (the "GPL"),
10 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
11 * following added to such license:
13 * As a special exception, the copyright holders of this software give you
14 * permission to link this software with independent modules, and to copy and
15 * distribute the resulting executable under terms of your choice, provided that
16 * you also meet, for each linked independent module, the terms and conditions of
17 * the license of that module. An independent module is a module which is not
18 * derived from this software. The special exception does not apply to any
19 * modifications of the software.
21 * Notwithstanding the above, under no circumstances may you combine this
22 * software in any way with any other Broadcom software provided under a license
23 * other than the GPL, without Broadcom's express prior written consent.
26 * <<Broadcom-WL-IPTag/Open:>>
28 * $Id: dngl_stats.h 716269 2017-08-17 09:22:46Z $
31 #ifndef _dngl_stats_h_
32 #define _dngl_stats_h_
38 unsigned long rx_packets
; /* total packets received */
39 unsigned long tx_packets
; /* total packets transmitted */
40 unsigned long rx_bytes
; /* total bytes received */
41 unsigned long tx_bytes
; /* total bytes transmitted */
42 unsigned long rx_errors
; /* bad packets received */
43 unsigned long tx_errors
; /* packet transmit problems */
44 unsigned long rx_dropped
; /* packets dropped by dongle */
45 unsigned long tx_dropped
; /* packets dropped by dongle */
46 unsigned long multicast
; /* multicast packets received */
49 typedef int32 wifi_radio
;
50 typedef int32 wifi_channel
;
51 typedef int32 wifi_rssi
;
52 typedef struct { uint16 version
; uint16 length
; } ver_len
;
54 typedef enum wifi_channel_width
{
55 WIFI_CHAN_WIDTH_20
= 0,
56 WIFI_CHAN_WIDTH_40
= 1,
57 WIFI_CHAN_WIDTH_80
= 2,
58 WIFI_CHAN_WIDTH_160
= 3,
59 WIFI_CHAN_WIDTH_80P80
= 4,
60 WIFI_CHAN_WIDTH_5
= 5,
61 WIFI_CHAN_WIDTH_10
= 6,
62 WIFI_CHAN_WIDTH_INVALID
= -1
63 } wifi_channel_width_t
;
66 WIFI_DISCONNECTED
= 0,
67 WIFI_AUTHENTICATING
= 1,
70 WIFI_EAPOL_STARTED
= 4, /* if done by firmware/driver */
71 WIFI_EAPOL_COMPLETED
= 5, /* if done by firmware/driver */
72 } wifi_connection_state
;
75 WIFI_ROAMING_IDLE
= 0,
76 WIFI_ROAMING_ACTIVE
= 1
80 WIFI_INTERFACE_STA
= 0,
81 WIFI_INTERFACE_SOFTAP
= 1,
82 WIFI_INTERFACE_IBSS
= 2,
83 WIFI_INTERFACE_P2P_CLIENT
= 3,
84 WIFI_INTERFACE_P2P_GO
= 4,
85 WIFI_INTERFACE_NAN
= 5,
86 WIFI_INTERFACE_MESH
= 6
87 } wifi_interface_mode
;
89 #define WIFI_CAPABILITY_QOS 0x00000001 /* set for QOS association */
90 #define WIFI_CAPABILITY_PROTECTED 0x00000002 /* set for protected association (802.11
91 * beacon frame control protected bit set)
93 #define WIFI_CAPABILITY_INTERWORKING 0x00000004 /* set if 802.11 Extended Capabilities
94 * element interworking bit is set
96 #define WIFI_CAPABILITY_HS20 0x00000008 /* set for HS20 association */
97 #define WIFI_CAPABILITY_SSID_UTF8 0x00000010 /* set is 802.11 Extended Capabilities
98 * element UTF-8 SSID bit is set
100 #define WIFI_CAPABILITY_COUNTRY 0x00000020 /* set is 802.11 Country Element is present */
101 #define PACK_ATTRIBUTE __attribute__ ((packed))
103 wifi_interface_mode mode
; /* interface mode */
104 uint8 mac_addr
[6]; /* interface mac address (self) */
106 wifi_connection_state state
; /* connection state (valid for STA, CLI only) */
107 wifi_roam_state roaming
; /* roaming state */
108 uint32 capabilities
; /* WIFI_CAPABILITY_XXX (self) */
109 uint8 ssid
[DOT11_MAX_SSID_LEN
+1]; /* null terminated SSID */
110 uint8 bssid
[ETHER_ADDR_LEN
]; /* bssid */
112 uint8 ap_country_str
[3]; /* country string advertised by AP */
113 uint8 country_str
[3]; /* country string for this association */
115 } wifi_interface_info
;
117 typedef wifi_interface_info
*wifi_interface_handle
;
119 /* channel information */
121 wifi_channel_width_t width
; /* channel width (20, 40, 80, 80+80, 160) */
122 wifi_channel center_freq
; /* primary 20 MHz channel */
123 wifi_channel center_freq0
; /* center frequency (MHz) first segment */
124 wifi_channel center_freq1
; /* center frequency (MHz) second segment */
129 uint32 preamble
; /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
130 uint32 nss
; /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
131 uint32 bw
; /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
132 uint32 rateMcsIdx
; /* OFDM/CCK rate code would be as per ieee std
133 * in the units of 0.5mbps
135 /* HT/VHT it would be mcs index */
136 uint32 reserved
; /* reserved */
137 uint32 bitrate
; /* units of 100 Kbps */
141 uint32 preamble
:3; /* 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
142 uint32 nss
:2; /* 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
143 uint32 bw
:3; /* 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz */
144 uint32 rateMcsIdx
:8; /* OFDM/CCK rate code would be as per ieee std
145 * in the units of 0.5mbps HT/VHT it would be
148 uint32 reserved
:16; /* reserved */
149 uint32 bitrate
; /* units of 100 Kbps */
152 /* channel statistics */
154 wifi_channel_info channel
; /* channel */
155 uint32 on_time
; /* msecs the radio is awake (32 bits number
156 * accruing over time)
158 uint32 cca_busy_time
; /* msecs the CCA register is busy (32 bits number
159 * accruing over time)
163 /* radio statistics */
169 wifi_radio radio
; /* wifi radio (if multiple radio supported) */
170 uint32 on_time
; /* msecs the radio is awake (32 bits number
171 * accruing over time)
173 uint32 tx_time
; /* msecs the radio is transmitting (32 bits
174 * number accruing over time)
176 uint32 rx_time
; /* msecs the radio is in active receive (32 bits
177 * number accruing over time)
179 uint32 on_time_scan
; /* msecs the radio is awake due to all scan (32 bits
180 * number accruing over time)
182 uint32 on_time_nbd
; /* msecs the radio is awake due to NAN (32 bits
183 * number accruing over time)
185 uint32 on_time_gscan
; /* msecs the radio is awake due to G?scan (32 bits
186 * number accruing over time)
188 uint32 on_time_roam_scan
; /* msecs the radio is awake due to roam?scan (32 bits
189 * number accruing over time)
191 uint32 on_time_pno_scan
; /* msecs the radio is awake due to PNO scan (32 bits
192 * number accruing over time)
194 uint32 on_time_hs20
; /* msecs the radio is awake due to HS2.0 scans and
195 * GAS exchange (32 bits number accruing over time)
197 uint32 num_channels
; /* number of channels */
198 wifi_channel_stat channels
[1]; /* channel statistics */
208 uint32 on_time_gscan
;
209 uint32 on_time_roam_scan
;
210 uint32 on_time_pno_scan
;
215 /* per rate statistics */
217 wifi_rate_v1 rate
; /* rate information */
218 uint32 tx_mpdu
; /* number of successfully transmitted data pkts (ACK rcvd) */
219 uint32 rx_mpdu
; /* number of received data pkts */
220 uint32 mpdu_lost
; /* number of data packet losses (no ACK) */
221 uint32 retries
; /* total number of data pkt retries */
222 uint32 retries_short
; /* number of short data pkt retries */
223 uint32 retries_long
; /* number of long data pkt retries */
229 uint32 tx_mpdu
; /* number of successfully transmitted data pkts (ACK rcvd) */
230 uint32 rx_mpdu
; /* number of received data pkts */
231 uint32 mpdu_lost
; /* number of data packet losses (no ACK) */
232 uint32 retries
; /* total number of data pkt retries */
233 uint32 retries_short
; /* number of short data pkt retries */
234 uint32 retries_long
; /* number of long data pkt retries */
238 /* access categories */
253 WIFI_PEER_P2P_CLIENT
,
259 /* per peer statistics */
261 wifi_peer_type type
; /* peer type (AP, TDLS, GO etc.) */
262 uint8 peer_mac_address
[6]; /* mac address */
263 uint32 capabilities
; /* peer WIFI_CAPABILITY_XXX */
264 uint32 num_rate
; /* number of rates */
265 wifi_rate_stat rate_stats
[1]; /* per rate statistics, number of entries = num_rate */
268 /* per access category statistics */
270 wifi_traffic_ac ac
; /* access category (VI, VO, BE, BK) */
271 uint32 tx_mpdu
; /* number of successfully transmitted unicast data pkts
274 uint32 rx_mpdu
; /* number of received unicast mpdus */
275 uint32 tx_mcast
; /* number of succesfully transmitted multicast
278 /* STA case: implies ACK received from AP for the
279 * unicast packet in which mcast pkt was sent
281 uint32 rx_mcast
; /* number of received multicast data packets */
282 uint32 rx_ampdu
; /* number of received unicast a-mpdus */
283 uint32 tx_ampdu
; /* number of transmitted unicast a-mpdus */
284 uint32 mpdu_lost
; /* number of data pkt losses (no ACK) */
285 uint32 retries
; /* total number of data pkt retries */
286 uint32 retries_short
; /* number of short data pkt retries */
287 uint32 retries_long
; /* number of long data pkt retries */
288 uint32 contention_time_min
; /* data pkt min contention time (usecs) */
289 uint32 contention_time_max
; /* data pkt max contention time (usecs) */
290 uint32 contention_time_avg
; /* data pkt avg contention time (usecs) */
291 uint32 contention_num_samples
; /* num of data pkts used for contention statistics */
294 /* interface statistics */
296 wifi_interface_handle iface
; /* wifi interface */
297 wifi_interface_info info
; /* current state of the interface */
298 uint32 beacon_rx
; /* access point beacon received count from
301 uint64 average_tsf_offset
; /* average beacon offset encountered (beacon_TSF - TBTT)
302 * The average_tsf_offset field is used so as to calculate
303 * the typical beacon contention time on the channel as well
304 * may be used to debug beacon synchronization and related
305 * power consumption issue
307 uint32 leaky_ap_detected
; /* indicate that this AP
308 * typically leaks packets beyond
309 * the driver guard time.
311 uint32 leaky_ap_avg_num_frames_leaked
; /* average number of frame leaked by AP after
312 * frame with PM bit set was ACK'ed by AP
314 uint32 leaky_ap_guard_time
; /* guard time currently in force
315 * (when implementing IEEE power management
316 * based on frame control PM bit), How long
317 * driver waits before shutting down the radio and after
318 * receiving an ACK for a data frame with PM bit set)
320 uint32 mgmt_rx
; /* access point mgmt frames received count from
321 * connected AP (including Beacon)
323 uint32 mgmt_action_rx
; /* action frames received count */
324 uint32 mgmt_action_tx
; /* action frames transmit count */
325 wifi_rssi rssi_mgmt
; /* access Point Beacon and Management frames RSSI
328 wifi_rssi rssi_data
; /* access Point Data Frames RSSI (averaged) from
331 wifi_rssi rssi_ack
; /* access Point ACK RSSI (averaged) from
334 wifi_wmm_ac_stat ac
[WIFI_AC_MAX
]; /* per ac data packet statistics */
335 uint32 num_peers
; /* number of peers */
336 wifi_peer_info peer_info
[1]; /* per peer statistics */
340 /* interface statistics */
342 compat_uptr_t iface
; /* wifi interface */
343 wifi_interface_info info
; /* current state of the interface */
344 uint32 beacon_rx
; /* access point beacon received count from
347 uint64 average_tsf_offset
; /* average beacon offset encountered (beacon_TSF - TBTT)
348 * The average_tsf_offset field is used so as to calculate
349 * the typical beacon contention time on the channel as well
350 * may be used to debug beacon synchronization and related
351 * power consumption issue
353 uint32 leaky_ap_detected
; /* indicate that this AP
354 * typically leaks packets beyond
355 * the driver guard time.
357 uint32 leaky_ap_avg_num_frames_leaked
; /* average number of frame leaked by AP after
358 * frame with PM bit set was ACK'ed by AP
360 uint32 leaky_ap_guard_time
; /* guard time currently in force
361 * (when implementing IEEE power management
362 * based on frame control PM bit), How long
363 * driver waits before shutting down the radio and after
364 * receiving an ACK for a data frame with PM bit set)
366 uint32 mgmt_rx
; /* access point mgmt frames received count from
367 * connected AP (including Beacon)
369 uint32 mgmt_action_rx
; /* action frames received count */
370 uint32 mgmt_action_tx
; /* action frames transmit count */
371 wifi_rssi rssi_mgmt
; /* access Point Beacon and Management frames RSSI
374 wifi_rssi rssi_data
; /* access Point Data Frames RSSI (averaged) from
377 wifi_rssi rssi_ack
; /* access Point ACK RSSI (averaged) from
380 wifi_wmm_ac_stat ac
[WIFI_AC_MAX
]; /* per ac data packet statistics */
381 uint32 num_peers
; /* number of peers */
382 wifi_peer_info peer_info
[1]; /* per peer statistics */
383 } compat_wifi_iface_stat
;
384 #endif /* CONFIG_COMPAT */
386 #endif /* _dngl_stats_h_ */