1 /******************************************************************************
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
25 * The full GNU General Public License is included in this distribution
26 * in the file called COPYING.
28 * Contact Information:
29 * Intel Linux Wireless <ilw@linux.intel.com>
30 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
42 * * Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
46 * the documentation and/or other materials provided with the
48 * * Neither the name Intel Corporation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64 *****************************************************************************/
66 #ifndef __fw_api_stats_h__
67 #define __fw_api_stats_h__
68 #include "fw-api-mac.h"
70 struct mvm_statistics_dbg {
73 __le32 wait_for_silence_timeout_cnt;
75 } __packed; /* STATISTICS_DEBUG_API_S_VER_2 */
77 struct mvm_statistics_div {
84 } __packed; /* STATISTICS_SLOW_DIV_API_S_VER_2 */
86 struct mvm_statistics_rx_non_phy {
87 __le32 bogus_cts; /* CTS received when not expecting CTS */
88 __le32 bogus_ack; /* ACK received when not expecting ACK */
89 __le32 non_bssid_frames; /* number of frames with BSSID that
90 * doesn't belong to the STA BSSID */
91 __le32 filtered_frames; /* count frames that were dumped in the
92 * filtering process */
93 __le32 non_channel_beacons; /* beacons with our bss id but not on
94 * our serving channel */
95 __le32 channel_beacons; /* beacons with our bss id and in our
97 __le32 num_missed_bcon; /* number of missed beacons */
98 __le32 adc_rx_saturation_time; /* count in 0.8us units the time the
99 * ADC was in saturation */
100 __le32 ina_detection_search_time;/* total time (in 0.8us) searched
102 __le32 beacon_silence_rssi_a; /* RSSI silence after beacon frame */
103 __le32 beacon_silence_rssi_b; /* RSSI silence after beacon frame */
104 __le32 beacon_silence_rssi_c; /* RSSI silence after beacon frame */
105 __le32 interference_data_flag; /* flag for interference data
106 * availability. 1 when data is
108 __le32 channel_load; /* counts RX Enable time in uSec */
109 __le32 dsp_false_alarms; /* DSP false alarm (both OFDM
110 * and CCK) counter */
111 __le32 beacon_rssi_a;
112 __le32 beacon_rssi_b;
113 __le32 beacon_rssi_c;
114 __le32 beacon_energy_a;
115 __le32 beacon_energy_b;
116 __le32 beacon_energy_c;
119 __le32 directed_data_mpdu;
120 } __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_3 */
122 struct mvm_statistics_rx_phy {
128 __le32 early_overrun_err;
130 __le32 false_alarm_cnt;
131 __le32 fina_sync_err_cnt;
134 __le32 unresponded_rts;
135 __le32 rxe_frame_lmt_overrun;
138 __le32 sent_ba_rsp_cnt;
139 __le32 dsp_self_kill;
140 __le32 mh_format_err;
141 __le32 re_acq_main_rssi_sum;
143 } __packed; /* STATISTICS_RX_PHY_API_S_VER_2 */
145 struct mvm_statistics_rx_ht_phy {
148 __le32 early_overrun_err;
151 __le32 mh_format_err;
152 __le32 agg_crc32_good;
155 __le32 unsupport_mcs;
156 } __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_1 */
158 struct mvm_statistics_tx_non_phy {
160 __le32 rx_detected_cnt;
161 __le32 bt_prio_defer_cnt;
162 __le32 bt_prio_kill_cnt;
163 __le32 few_bytes_cnt;
166 __le32 expected_ack_cnt;
167 __le32 actual_ack_cnt;
168 __le32 dump_msdu_cnt;
169 __le32 burst_abort_next_frame_mismatch_cnt;
170 __le32 burst_abort_missing_next_frame_cnt;
171 __le32 cts_timeout_collision;
172 __le32 ack_or_ba_timeout_collision;
173 } __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_3 */
177 struct mvm_statistics_tx_non_phy_agg {
179 __le32 ba_reschedule_frames;
180 __le32 scd_query_agg_frame_cnt;
181 __le32 scd_query_no_agg;
182 __le32 scd_query_agg;
183 __le32 scd_query_mismatch;
184 __le32 frame_not_ready;
187 __le32 rx_ba_rsp_cnt;
188 __s8 txpower[MAX_CHAINS];
191 } __packed; /* STATISTICS_TX_NON_PHY_AGG_API_S_VER_1 */
193 struct mvm_statistics_tx_channel_width {
194 __le32 ext_cca_narrow_ch20[1];
195 __le32 ext_cca_narrow_ch40[2];
196 __le32 ext_cca_narrow_ch80[3];
197 __le32 ext_cca_narrow_ch160[4];
198 __le32 last_tx_ch_width_indx;
199 __le32 rx_detected_per_ch_width[4];
200 __le32 success_per_ch_width[4];
201 __le32 fail_per_ch_width[4];
202 }; /* STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
204 struct mvm_statistics_tx {
205 struct mvm_statistics_tx_non_phy general;
206 struct mvm_statistics_tx_non_phy_agg agg;
207 struct mvm_statistics_tx_channel_width channel_width;
208 } __packed; /* STATISTICS_TX_API_S_VER_4 */
211 struct mvm_statistics_bt_activity {
212 __le32 hi_priority_tx_req_cnt;
213 __le32 hi_priority_tx_denied_cnt;
214 __le32 lo_priority_tx_req_cnt;
215 __le32 lo_priority_tx_denied_cnt;
216 __le32 hi_priority_rx_req_cnt;
217 __le32 hi_priority_rx_denied_cnt;
218 __le32 lo_priority_rx_req_cnt;
219 __le32 lo_priority_rx_denied_cnt;
220 } __packed; /* STATISTICS_BT_ACTIVITY_API_S_VER_1 */
222 struct mvm_statistics_general_v5 {
223 __le32 radio_temperature;
224 __le32 radio_voltage;
225 struct mvm_statistics_dbg dbg;
229 __le32 ttl_timestamp;
230 struct mvm_statistics_div slow_div;
231 __le32 rx_enable_counter;
234 * count the number of times we have to re-tune
235 * in order to get out of bad PHY status
237 __le32 num_of_sos_states;
238 __le32 beacon_filtered;
239 __le32 missed_beacons;
240 __s8 beacon_filter_average_energy;
241 __s8 beacon_filter_reason;
242 __s8 beacon_filter_current_energy;
243 __s8 beacon_filter_reserved;
244 __le32 beacon_filter_delta_time;
245 struct mvm_statistics_bt_activity bt_activity;
246 } __packed; /* STATISTICS_GENERAL_API_S_VER_5 */
248 struct mvm_statistics_general_v8 {
249 __le32 radio_temperature;
250 __le32 radio_voltage;
251 struct mvm_statistics_dbg dbg;
255 __le32 ttl_timestamp;
256 struct mvm_statistics_div slow_div;
257 __le32 rx_enable_counter;
260 * count the number of times we have to re-tune
261 * in order to get out of bad PHY status
263 __le32 num_of_sos_states;
264 __le32 beacon_filtered;
265 __le32 missed_beacons;
266 __s8 beacon_filter_average_energy;
267 __s8 beacon_filter_reason;
268 __s8 beacon_filter_current_energy;
269 __s8 beacon_filter_reserved;
270 __le32 beacon_filter_delta_time;
271 struct mvm_statistics_bt_activity bt_activity;
276 __le32 beacon_counter[NUM_MAC_INDEX];
277 u8 beacon_average_energy[NUM_MAC_INDEX];
278 u8 reserved[4 - (NUM_MAC_INDEX % 4)];
279 } __packed; /* STATISTICS_GENERAL_API_S_VER_8 */
281 struct mvm_statistics_rx {
282 struct mvm_statistics_rx_phy ofdm;
283 struct mvm_statistics_rx_phy cck;
284 struct mvm_statistics_rx_non_phy general;
285 struct mvm_statistics_rx_ht_phy ofdm_ht;
286 } __packed; /* STATISTICS_RX_API_S_VER_3 */
289 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
291 * By default, uCode issues this notification after receiving a beacon
292 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
293 * STATISTICS_CMD (0x9c), below.
296 struct iwl_notif_statistics_v8 {
298 struct mvm_statistics_rx rx;
299 struct mvm_statistics_tx tx;
300 struct mvm_statistics_general_v5 general;
301 } __packed; /* STATISTICS_NTFY_API_S_VER_8 */
303 struct iwl_notif_statistics_v10 {
305 struct mvm_statistics_rx rx;
306 struct mvm_statistics_tx tx;
307 struct mvm_statistics_general_v8 general;
308 } __packed; /* STATISTICS_NTFY_API_S_VER_10 */
310 #define IWL_STATISTICS_FLG_CLEAR 0x1
311 #define IWL_STATISTICS_FLG_DISABLE_NOTIF 0x2
313 struct iwl_statistics_cmd {
315 } __packed; /* STATISTICS_CMD_API_S_VER_1 */
317 #endif /* __fw_api_stats_h__ */