fw-api-stats.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /******************************************************************************
  2. *
  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.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  10. *
  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.
  14. *
  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.
  19. *
  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,
  23. * USA
  24. *
  25. * The full GNU General Public License is included in this distribution
  26. * in the file called COPYING.
  27. *
  28. * Contact Information:
  29. * Intel Linux Wireless <ilw@linux.intel.com>
  30. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  31. *
  32. * BSD LICENSE
  33. *
  34. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  35. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  36. * All rights reserved.
  37. *
  38. * Redistribution and use in source and binary forms, with or without
  39. * modification, are permitted provided that the following conditions
  40. * are met:
  41. *
  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
  47. * distribution.
  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.
  51. *
  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.
  63. *
  64. *****************************************************************************/
  65. #ifndef __fw_api_stats_h__
  66. #define __fw_api_stats_h__
  67. #include "fw-api-mac.h"
  68. struct mvm_statistics_dbg {
  69. __le32 burst_check;
  70. __le32 burst_count;
  71. __le32 wait_for_silence_timeout_cnt;
  72. __le32 reserved[3];
  73. } __packed; /* STATISTICS_DEBUG_API_S_VER_2 */
  74. struct mvm_statistics_div {
  75. __le32 tx_on_a;
  76. __le32 tx_on_b;
  77. __le32 exec_time;
  78. __le32 probe_time;
  79. __le32 rssi_ant;
  80. __le32 reserved2;
  81. } __packed; /* STATISTICS_SLOW_DIV_API_S_VER_2 */
  82. struct mvm_statistics_rx_non_phy {
  83. __le32 bogus_cts; /* CTS received when not expecting CTS */
  84. __le32 bogus_ack; /* ACK received when not expecting ACK */
  85. __le32 non_bssid_frames; /* number of frames with BSSID that
  86. * doesn't belong to the STA BSSID */
  87. __le32 filtered_frames; /* count frames that were dumped in the
  88. * filtering process */
  89. __le32 non_channel_beacons; /* beacons with our bss id but not on
  90. * our serving channel */
  91. __le32 channel_beacons; /* beacons with our bss id and in our
  92. * serving channel */
  93. __le32 num_missed_bcon; /* number of missed beacons */
  94. __le32 adc_rx_saturation_time; /* count in 0.8us units the time the
  95. * ADC was in saturation */
  96. __le32 ina_detection_search_time;/* total time (in 0.8us) searched
  97. * for INA */
  98. __le32 beacon_silence_rssi_a; /* RSSI silence after beacon frame */
  99. __le32 beacon_silence_rssi_b; /* RSSI silence after beacon frame */
  100. __le32 beacon_silence_rssi_c; /* RSSI silence after beacon frame */
  101. __le32 interference_data_flag; /* flag for interference data
  102. * availability. 1 when data is
  103. * available. */
  104. __le32 channel_load; /* counts RX Enable time in uSec */
  105. __le32 dsp_false_alarms; /* DSP false alarm (both OFDM
  106. * and CCK) counter */
  107. __le32 beacon_rssi_a;
  108. __le32 beacon_rssi_b;
  109. __le32 beacon_rssi_c;
  110. __le32 beacon_energy_a;
  111. __le32 beacon_energy_b;
  112. __le32 beacon_energy_c;
  113. __le32 num_bt_kills;
  114. __le32 mac_id;
  115. __le32 directed_data_mpdu;
  116. } __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_3 */
  117. struct mvm_statistics_rx_phy {
  118. __le32 ina_cnt;
  119. __le32 fina_cnt;
  120. __le32 plcp_err;
  121. __le32 crc32_err;
  122. __le32 overrun_err;
  123. __le32 early_overrun_err;
  124. __le32 crc32_good;
  125. __le32 false_alarm_cnt;
  126. __le32 fina_sync_err_cnt;
  127. __le32 sfd_timeout;
  128. __le32 fina_timeout;
  129. __le32 unresponded_rts;
  130. __le32 rxe_frame_lmt_overrun;
  131. __le32 sent_ack_cnt;
  132. __le32 sent_cts_cnt;
  133. __le32 sent_ba_rsp_cnt;
  134. __le32 dsp_self_kill;
  135. __le32 mh_format_err;
  136. __le32 re_acq_main_rssi_sum;
  137. __le32 reserved;
  138. } __packed; /* STATISTICS_RX_PHY_API_S_VER_2 */
  139. struct mvm_statistics_rx_ht_phy {
  140. __le32 plcp_err;
  141. __le32 overrun_err;
  142. __le32 early_overrun_err;
  143. __le32 crc32_good;
  144. __le32 crc32_err;
  145. __le32 mh_format_err;
  146. __le32 agg_crc32_good;
  147. __le32 agg_mpdu_cnt;
  148. __le32 agg_cnt;
  149. __le32 unsupport_mcs;
  150. } __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_1 */
  151. struct mvm_statistics_tx_non_phy {
  152. __le32 preamble_cnt;
  153. __le32 rx_detected_cnt;
  154. __le32 bt_prio_defer_cnt;
  155. __le32 bt_prio_kill_cnt;
  156. __le32 few_bytes_cnt;
  157. __le32 cts_timeout;
  158. __le32 ack_timeout;
  159. __le32 expected_ack_cnt;
  160. __le32 actual_ack_cnt;
  161. __le32 dump_msdu_cnt;
  162. __le32 burst_abort_next_frame_mismatch_cnt;
  163. __le32 burst_abort_missing_next_frame_cnt;
  164. __le32 cts_timeout_collision;
  165. __le32 ack_or_ba_timeout_collision;
  166. } __packed; /* STATISTICS_TX_NON_PHY_API_S_VER_3 */
  167. #define MAX_CHAINS 3
  168. struct mvm_statistics_tx_non_phy_agg {
  169. __le32 ba_timeout;
  170. __le32 ba_reschedule_frames;
  171. __le32 scd_query_agg_frame_cnt;
  172. __le32 scd_query_no_agg;
  173. __le32 scd_query_agg;
  174. __le32 scd_query_mismatch;
  175. __le32 frame_not_ready;
  176. __le32 underrun;
  177. __le32 bt_prio_kill;
  178. __le32 rx_ba_rsp_cnt;
  179. __s8 txpower[MAX_CHAINS];
  180. __s8 reserved;
  181. __le32 reserved2;
  182. } __packed; /* STATISTICS_TX_NON_PHY_AGG_API_S_VER_1 */
  183. struct mvm_statistics_tx_channel_width {
  184. __le32 ext_cca_narrow_ch20[1];
  185. __le32 ext_cca_narrow_ch40[2];
  186. __le32 ext_cca_narrow_ch80[3];
  187. __le32 ext_cca_narrow_ch160[4];
  188. __le32 last_tx_ch_width_indx;
  189. __le32 rx_detected_per_ch_width[4];
  190. __le32 success_per_ch_width[4];
  191. __le32 fail_per_ch_width[4];
  192. }; /* STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
  193. struct mvm_statistics_tx {
  194. struct mvm_statistics_tx_non_phy general;
  195. struct mvm_statistics_tx_non_phy_agg agg;
  196. struct mvm_statistics_tx_channel_width channel_width;
  197. } __packed; /* STATISTICS_TX_API_S_VER_4 */
  198. struct mvm_statistics_bt_activity {
  199. __le32 hi_priority_tx_req_cnt;
  200. __le32 hi_priority_tx_denied_cnt;
  201. __le32 lo_priority_tx_req_cnt;
  202. __le32 lo_priority_tx_denied_cnt;
  203. __le32 hi_priority_rx_req_cnt;
  204. __le32 hi_priority_rx_denied_cnt;
  205. __le32 lo_priority_rx_req_cnt;
  206. __le32 lo_priority_rx_denied_cnt;
  207. } __packed; /* STATISTICS_BT_ACTIVITY_API_S_VER_1 */
  208. struct mvm_statistics_general_v8 {
  209. __le32 radio_temperature;
  210. __le32 radio_voltage;
  211. struct mvm_statistics_dbg dbg;
  212. __le32 sleep_time;
  213. __le32 slots_out;
  214. __le32 slots_idle;
  215. __le32 ttl_timestamp;
  216. struct mvm_statistics_div slow_div;
  217. __le32 rx_enable_counter;
  218. /*
  219. * num_of_sos_states:
  220. * count the number of times we have to re-tune
  221. * in order to get out of bad PHY status
  222. */
  223. __le32 num_of_sos_states;
  224. __le32 beacon_filtered;
  225. __le32 missed_beacons;
  226. u8 beacon_filter_average_energy;
  227. u8 beacon_filter_reason;
  228. u8 beacon_filter_current_energy;
  229. u8 beacon_filter_reserved;
  230. __le32 beacon_filter_delta_time;
  231. struct mvm_statistics_bt_activity bt_activity;
  232. __le64 rx_time;
  233. __le64 on_time_rf;
  234. __le64 on_time_scan;
  235. __le64 tx_time;
  236. __le32 beacon_counter[NUM_MAC_INDEX];
  237. u8 beacon_average_energy[NUM_MAC_INDEX];
  238. u8 reserved[4 - (NUM_MAC_INDEX % 4)];
  239. } __packed; /* STATISTICS_GENERAL_API_S_VER_8 */
  240. struct mvm_statistics_rx {
  241. struct mvm_statistics_rx_phy ofdm;
  242. struct mvm_statistics_rx_phy cck;
  243. struct mvm_statistics_rx_non_phy general;
  244. struct mvm_statistics_rx_ht_phy ofdm_ht;
  245. } __packed; /* STATISTICS_RX_API_S_VER_3 */
  246. /*
  247. * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
  248. *
  249. * By default, uCode issues this notification after receiving a beacon
  250. * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
  251. * STATISTICS_CMD (0x9c), below.
  252. */
  253. struct iwl_notif_statistics_v10 {
  254. __le32 flag;
  255. struct mvm_statistics_rx rx;
  256. struct mvm_statistics_tx tx;
  257. struct mvm_statistics_general_v8 general;
  258. } __packed; /* STATISTICS_NTFY_API_S_VER_10 */
  259. #define IWL_STATISTICS_FLG_CLEAR 0x1
  260. #define IWL_STATISTICS_FLG_DISABLE_NOTIF 0x2
  261. struct iwl_statistics_cmd {
  262. __le32 flags;
  263. } __packed; /* STATISTICS_CMD_API_S_VER_1 */
  264. #endif /* __fw_api_stats_h__ */