cdp_txrx_mon_struct.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /*
  2. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file cdp_txrx_mon_struct.h
  20. * @brief Define the monitor mode API structure
  21. * shared by data path and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_MON_STRUCT_H_
  24. #define _CDP_TXRX_MON_STRUCT_H_
  25. /* XXX not really a mode; there are really multiple PHY's */
  26. enum cdp_mon_phymode {
  27. /* autoselect */
  28. CDP_IEEE80211_MODE_AUTO = 0,
  29. /* 5GHz, OFDM */
  30. CDP_IEEE80211_MODE_11A = 1,
  31. /* 2GHz, CCK */
  32. CDP_IEEE80211_MODE_11B = 2,
  33. /* 2GHz, OFDM */
  34. CDP_IEEE80211_MODE_11G = 3,
  35. /* 2GHz, GFSK */
  36. CDP_IEEE80211_MODE_FH = 4,
  37. /* 5GHz, OFDM, 2x clock dynamic turbo */
  38. CDP_IEEE80211_MODE_TURBO_A = 5,
  39. /* 2GHz, OFDM, 2x clock dynamic turbo */
  40. CDP_IEEE80211_MODE_TURBO_G = 6,
  41. /* 5Ghz, HT20 */
  42. CDP_IEEE80211_MODE_11NA_HT20 = 7,
  43. /* 2Ghz, HT20 */
  44. CDP_IEEE80211_MODE_11NG_HT20 = 8,
  45. /* 5Ghz, HT40 (ext ch +1) */
  46. CDP_IEEE80211_MODE_11NA_HT40PLUS = 9,
  47. /* 5Ghz, HT40 (ext ch -1) */
  48. CDP_IEEE80211_MODE_11NA_HT40MINUS = 10,
  49. /* 2Ghz, HT40 (ext ch +1) */
  50. CDP_IEEE80211_MODE_11NG_HT40PLUS = 11,
  51. /* 2Ghz, HT40 (ext ch -1) */
  52. CDP_IEEE80211_MODE_11NG_HT40MINUS = 12,
  53. /* 2Ghz, Auto HT40 */
  54. CDP_IEEE80211_MODE_11NG_HT40 = 13,
  55. /* 5Ghz, Auto HT40 */
  56. CDP_IEEE80211_MODE_11NA_HT40 = 14,
  57. /* 5Ghz, VHT20 */
  58. CDP_IEEE80211_MODE_11AC_VHT20 = 15,
  59. /* 5Ghz, VHT40 (Ext ch +1) */
  60. CDP_IEEE80211_MODE_11AC_VHT40PLUS = 16,
  61. /* 5Ghz VHT40 (Ext ch -1) */
  62. CDP_IEEE80211_MODE_11AC_VHT40MINUS = 17,
  63. /* 5Ghz, VHT40 */
  64. CDP_IEEE80211_MODE_11AC_VHT40 = 18,
  65. /* 5Ghz, VHT80 */
  66. CDP_IEEE80211_MODE_11AC_VHT80 = 19,
  67. /* 5Ghz, VHT160 */
  68. CDP_IEEE80211_MODE_11AC_VHT160 = 20,
  69. /* 5Ghz, VHT80_80 */
  70. CDP_IEEE80211_MODE_11AC_VHT80_80 = 21,
  71. };
  72. enum {
  73. CDP_PKT_TYPE_OFDM = 0,
  74. CDP_PKT_TYPE_CCK,
  75. CDP_PKT_TYPE_HT,
  76. CDP_PKT_TYPE_VHT,
  77. CDP_PKT_TYPE_HE,
  78. };
  79. enum {
  80. CDP_SGI_0_8_US = 0,
  81. CDP_SGI_0_4_US,
  82. CDP_SGI_1_6_US,
  83. CDP_SGI_3_2_US,
  84. };
  85. enum {
  86. CDP_RX_TYPE_SU = 0,
  87. CDP_RX_TYPE_MU_MIMO,
  88. CDP_RX_TYPE_MU_OFDMA,
  89. CDP_RX_TYPE_MU_OFDMA_MIMO,
  90. };
  91. enum {
  92. CDP_FULL_RX_BW_20 = 0,
  93. CDP_FULL_RX_BW_40,
  94. CDP_FULL_RX_BW_80,
  95. CDP_FULL_RX_BW_160,
  96. };
  97. struct cdp_mon_status {
  98. int rs_numchains;
  99. int rs_flags;
  100. #define IEEE80211_RX_FCS_ERROR 0x01
  101. #define IEEE80211_RX_MIC_ERROR 0x02
  102. #define IEEE80211_RX_DECRYPT_ERROR 0x04
  103. /* holes in flags here between, ATH_RX_XXXX to IEEE80211_RX_XXX */
  104. #define IEEE80211_RX_KEYMISS 0x200
  105. int rs_rssi; /* RSSI (noise floor ajusted) */
  106. int rs_abs_rssi; /* absolute RSSI */
  107. int rs_datarate; /* data rate received */
  108. int rs_rateieee;
  109. int rs_ratephy1;
  110. int rs_ratephy2;
  111. int rs_ratephy3;
  112. /* Keep the same as ATH_MAX_ANTENNA */
  113. #define IEEE80211_MAX_ANTENNA 3
  114. /* RSSI (noise floor ajusted) */
  115. u_int8_t rs_rssictl[IEEE80211_MAX_ANTENNA];
  116. /* RSSI (noise floor ajusted) */
  117. u_int8_t rs_rssiextn[IEEE80211_MAX_ANTENNA];
  118. /* rs_rssi is valid or not */
  119. u_int8_t rs_isvalidrssi;
  120. enum cdp_mon_phymode rs_phymode;
  121. int rs_freq;
  122. union {
  123. u_int8_t data[8];
  124. u_int64_t tsf;
  125. } rs_tstamp;
  126. /*
  127. * Detail channel structure of recv frame.
  128. * It could be NULL if not available
  129. */
  130. #ifdef ATH_SUPPORT_AOW
  131. u_int16_t rs_rxseq; /* WLAN Sequence number */
  132. #endif
  133. #ifdef ATH_VOW_EXT_STATS
  134. /* Lower 16 bits holds the udp checksum offset in the data pkt */
  135. u_int32_t vow_extstats_offset;
  136. /* Higher 16 bits contains offset in the data pkt at which vow
  137. * ext stats are embedded
  138. */
  139. #endif
  140. u_int8_t rs_isaggr;
  141. u_int8_t rs_isapsd;
  142. int16_t rs_noisefloor;
  143. u_int16_t rs_channel;
  144. #ifdef ATH_SUPPORT_TxBF
  145. u_int32_t rs_rpttstamp; /* txbf report time stamp*/
  146. #endif
  147. /* The following counts are meant to assist in stats calculation.
  148. * These variables are incremented only in specific situations, and
  149. * should not be relied upon for any purpose other than the original
  150. * stats related purpose they have been introduced for.
  151. */
  152. u_int16_t rs_cryptodecapcount; /* Crypto bytes decapped/demic'ed. */
  153. u_int8_t rs_padspace; /* No. of padding bytes present after
  154. header in wbuf. */
  155. u_int8_t rs_qosdecapcount; /* QoS/HTC bytes decapped. */
  156. /* End of stats calculation related counts. */
  157. /*
  158. * uint8_t rs_lsig[IEEE80211_LSIG_LEN];
  159. * uint8_t rs_htsig[IEEE80211_HTSIG_LEN];
  160. * uint8_t rs_servicebytes[IEEE80211_SB_LEN];
  161. * uint8_t rs_fcs_error;
  162. */
  163. /* cdp convergence monitor mode status */
  164. union {
  165. u_int8_t cdp_data[8];
  166. u_int64_t cdp_tsf;
  167. } cdp_rs_tstamp;
  168. uint8_t cdp_rs_pream_type;
  169. uint32_t cdp_rs_user_rssi;
  170. uint8_t cdp_rs_stbc;
  171. uint8_t cdp_rs_sgi;
  172. uint32_t cdf_rs_rate_mcs;
  173. uint32_t cdp_rs_reception_type;
  174. uint32_t cdp_rs_bw;
  175. uint32_t cdp_rs_nss;
  176. uint8_t cdp_rs_fcs_err;
  177. };
  178. enum {
  179. CDP_MON_PPDU_START = 0,
  180. CDP_MON_PPDU_END,
  181. };
  182. /**
  183. * struct cdp_pdev_mon_stats
  184. * @status_ppdu_state: state on PPDU start and end
  185. * @status_ppdu_start: status ring PPDU start TLV count
  186. * @status_ppdu_end: status ring PPDU end TLV count
  187. * @status_ppdu_compl: status ring matching start and end count on PPDU
  188. * @status_ppdu_start_mis: status ring missing start TLV count on PPDU
  189. * @status_ppdu_end_mis: status ring missing end TLV count on PPDU
  190. * @status_ppdu_done: status ring PPDU done TLV count
  191. * @dest_ppdu_done: destination ring PPDU count
  192. * @dest_mpdu_done: destination ring MPDU count
  193. */
  194. struct cdp_pdev_mon_stats {
  195. #ifndef REMOVE_MON_DBG_STATS
  196. uint32_t status_ppdu_state;
  197. uint32_t status_ppdu_start;
  198. uint32_t status_ppdu_end;
  199. uint32_t status_ppdu_compl;
  200. uint32_t status_ppdu_start_mis;
  201. uint32_t status_ppdu_end_mis;
  202. #endif
  203. uint32_t status_ppdu_done;
  204. uint32_t dest_ppdu_done;
  205. uint32_t dest_mpdu_done;
  206. uint32_t dest_mpdu_drop;
  207. };
  208. #endif