cdp_txrx_mon_struct.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. /*
  2. * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_mon_struct.h
  21. * Define the monitor mode API structure
  22. * shared by data path and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_MON_STRUCT_H_
  25. #define _CDP_TXRX_MON_STRUCT_H_
  26. #ifdef QCA_SUPPORT_LITE_MONITOR
  27. #define CDP_LITE_MON_PEER_MAX 16
  28. #define CDP_MON_FRM_TYPE_MAX 3
  29. #define CDP_MON_FRM_FILTER_MODE_MAX 4
  30. #define CDP_LITE_MON_LEN_64B 0x40
  31. #define CDP_LITE_MON_LEN_128B 0x80
  32. #define CDP_LITE_MON_LEN_256B 0x100
  33. #define CDP_LITE_MON_LEN_FULL 0xFFFF
  34. #define CDP_LITE_MON_FILTER_ALL 0xFFFF
  35. /* This should align with nac mac type enumerations in ieee80211_ioctl.h */
  36. #define CDP_LITE_MON_PEER_MAC_TYPE_CLIENT 2
  37. /**
  38. * enum cdp_lite_mon_legacy_filter - legacy filters for tx/rx
  39. * @LEGACY_FILTER_DISABLED: No filter / filter disabled
  40. * @LEGACY_FILTER_MCOPY: M_Copy filter
  41. * @LEGACY_FILTER_TX_CAPTURE: Tx_Capture filter
  42. * @LEGACY_FILTER_RX_ENH_CAPTURE: Rx Enhance capture filter
  43. * @LEGACY_FILTER_ADV_MON_FILTER: Advance Monitor filter
  44. *
  45. * Use to identify which filter is currently enabled using lite mon
  46. */
  47. enum cdp_lite_mon_legacy_filter {
  48. LEGACY_FILTER_DISABLED = 0,
  49. LEGACY_FILTER_MCOPY = 1,
  50. LEGACY_FILTER_TX_CAPTURE = 2,
  51. LEGACY_FILTER_RX_ENH_CAPTURE = 3,
  52. LEGACY_FILTER_ADV_MON_FILTER = 4,
  53. };
  54. /**
  55. * enum cdp_lite_mon_level- lite mon frame levels
  56. * @CDP_LITE_MON_LEVEL_INVALID: level invalid
  57. * @CDP_LITE_MON_LEVEL_MSDU: level msdu
  58. * @CDP_LITE_MON_LEVEL_MPDU: level mpdu
  59. * @CDP_LITE_MON_LEVEL_PPDU: level ppdu
  60. */
  61. enum cdp_lite_mon_level {
  62. CDP_LITE_MON_LEVEL_INVALID = 0,
  63. CDP_LITE_MON_LEVEL_MSDU = 1,
  64. CDP_LITE_MON_LEVEL_MPDU = 2,
  65. CDP_LITE_MON_LEVEL_PPDU = 3,
  66. };
  67. /**
  68. * enum cdp_lite_mon_peer_action- lite mon peer action
  69. * @CDP_LITE_MON_PEER_ADD: peer add
  70. * @CDP_LITE_MON_PEER_REMOVE: peer remove
  71. */
  72. enum cdp_lite_mon_peer_action {
  73. CDP_LITE_MON_PEER_ADD = 0,
  74. CDP_LITE_MON_PEER_REMOVE = 1,
  75. };
  76. /**
  77. * enum cdp_lite_mon_direction - lite mon config direction
  78. * @CDP_LITE_MON_DIRECTION_RX: lite mon config direction rx
  79. * @CDP_LITE_MON_DIRECTION_TX: lite mon config direction tx
  80. */
  81. enum cdp_lite_mon_direction {
  82. CDP_LITE_MON_DIRECTION_RX = 1,
  83. CDP_LITE_MON_DIRECTION_TX = 2,
  84. };
  85. #endif
  86. /* MU max user to sniff */
  87. #define CDP_MU_SNIF_USER_MAX 4
  88. /* EHT max type and compression mode */
  89. #define CDP_EHT_TYPE_MODE_MAX 3
  90. /* Same as MAX_20MHZ_SEGMENTS */
  91. #define CDP_MAX_20MHZ_SEGS 16
  92. /* Same as MAX_ANTENNA_EIGHT */
  93. #define CDP_MAX_NUM_ANTENNA 8
  94. /* XXX not really a mode; there are really multiple PHY's */
  95. enum cdp_mon_phymode {
  96. /* autoselect */
  97. CDP_IEEE80211_MODE_AUTO = 0,
  98. /* 5GHz, OFDM */
  99. CDP_IEEE80211_MODE_11A = 1,
  100. /* 2GHz, CCK */
  101. CDP_IEEE80211_MODE_11B = 2,
  102. /* 2GHz, OFDM */
  103. CDP_IEEE80211_MODE_11G = 3,
  104. /* 2GHz, GFSK */
  105. CDP_IEEE80211_MODE_FH = 4,
  106. /* 5GHz, OFDM, 2x clock dynamic turbo */
  107. CDP_IEEE80211_MODE_TURBO_A = 5,
  108. /* 2GHz, OFDM, 2x clock dynamic turbo */
  109. CDP_IEEE80211_MODE_TURBO_G = 6,
  110. /* 5Ghz, HT20 */
  111. CDP_IEEE80211_MODE_11NA_HT20 = 7,
  112. /* 2Ghz, HT20 */
  113. CDP_IEEE80211_MODE_11NG_HT20 = 8,
  114. /* 5Ghz, HT40 (ext ch +1) */
  115. CDP_IEEE80211_MODE_11NA_HT40PLUS = 9,
  116. /* 5Ghz, HT40 (ext ch -1) */
  117. CDP_IEEE80211_MODE_11NA_HT40MINUS = 10,
  118. /* 2Ghz, HT40 (ext ch +1) */
  119. CDP_IEEE80211_MODE_11NG_HT40PLUS = 11,
  120. /* 2Ghz, HT40 (ext ch -1) */
  121. CDP_IEEE80211_MODE_11NG_HT40MINUS = 12,
  122. /* 2Ghz, Auto HT40 */
  123. CDP_IEEE80211_MODE_11NG_HT40 = 13,
  124. /* 5Ghz, Auto HT40 */
  125. CDP_IEEE80211_MODE_11NA_HT40 = 14,
  126. /* 5Ghz, VHT20 */
  127. CDP_IEEE80211_MODE_11AC_VHT20 = 15,
  128. /* 5Ghz, VHT40 (Ext ch +1) */
  129. CDP_IEEE80211_MODE_11AC_VHT40PLUS = 16,
  130. /* 5Ghz VHT40 (Ext ch -1) */
  131. CDP_IEEE80211_MODE_11AC_VHT40MINUS = 17,
  132. /* 5Ghz, VHT40 */
  133. CDP_IEEE80211_MODE_11AC_VHT40 = 18,
  134. /* 5Ghz, VHT80 */
  135. CDP_IEEE80211_MODE_11AC_VHT80 = 19,
  136. /* 5Ghz, VHT160 */
  137. CDP_IEEE80211_MODE_11AC_VHT160 = 20,
  138. /* 5Ghz, VHT80_80 */
  139. CDP_IEEE80211_MODE_11AC_VHT80_80 = 21,
  140. };
  141. enum {
  142. CDP_PKT_TYPE_OFDM = 0,
  143. CDP_PKT_TYPE_CCK,
  144. CDP_PKT_TYPE_HT,
  145. CDP_PKT_TYPE_VHT,
  146. CDP_PKT_TYPE_HE,
  147. CDP_PKT_TYPE_EHT,
  148. CDP_PKT_TYPE_NO_SUP,
  149. CDP_PKT_TYPE_MAX,
  150. };
  151. enum {
  152. CDP_SGI_0_8_US = 0,
  153. CDP_SGI_0_4_US,
  154. CDP_SGI_1_6_US,
  155. CDP_SGI_3_2_US,
  156. };
  157. enum {
  158. CDP_RX_TYPE_SU = 0,
  159. CDP_RX_TYPE_MU_MIMO,
  160. CDP_RX_TYPE_MU_OFDMA,
  161. CDP_RX_TYPE_MU_OFDMA_MIMO,
  162. CDP_RX_TYPE_MAX,
  163. };
  164. enum {
  165. CDP_MU_TYPE_DL = 0,
  166. CDP_MU_TYPE_UL,
  167. CDP_MU_TYPE_MAX,
  168. };
  169. /*
  170. *Band Width Types
  171. */
  172. enum CMN_BW_TYPES {
  173. CMN_BW_20MHZ,
  174. CMN_BW_40MHZ,
  175. CMN_BW_80MHZ,
  176. CMN_BW_160MHZ,
  177. CMN_BW_80_80MHZ,
  178. #ifdef WLAN_FEATURE_11BE
  179. CMN_BW_320MHZ,
  180. #endif
  181. CMN_BW_CNT,
  182. CMN_BW_IDLE = 0xFF, /*default BW state */
  183. };
  184. enum cdp_punctured_modes {
  185. NO_PUNCTURE,
  186. #ifdef WLAN_FEATURE_11BE
  187. PUNCTURED_20MHZ,
  188. PUNCTURED_40MHZ,
  189. PUNCTURED_80MHZ,
  190. PUNCTURED_120MHZ,
  191. #endif
  192. PUNCTURED_MODE_CNT,
  193. };
  194. struct cdp_mon_status {
  195. /* bss color value 1-63 used for update on ppdu_desc bsscolor */
  196. uint8_t bsscolor;
  197. int rs_numchains;
  198. int rs_flags;
  199. #define IEEE80211_RX_FCS_ERROR 0x01
  200. #define IEEE80211_RX_MIC_ERROR 0x02
  201. #define IEEE80211_RX_DECRYPT_ERROR 0x04
  202. /* holes in flags here between, ATH_RX_XXXX to IEEE80211_RX_XXX */
  203. #define IEEE80211_RX_KEYMISS 0x200
  204. #define IEEE80211_RX_PN_ERROR 0x400
  205. int rs_rssi; /* RSSI (noise floor adjusted) */
  206. int rs_abs_rssi; /* absolute RSSI */
  207. int rs_datarate; /* data rate received */
  208. int rs_rateieee;
  209. int rs_ratephy1;
  210. int rs_ratephy2;
  211. int rs_ratephy3;
  212. /* Keep the same as ATH_MAX_ANTENNA */
  213. #define IEEE80211_MAX_ANTENNA 3
  214. /* RSSI (noise floor adjusted) */
  215. u_int8_t rs_rssictl[IEEE80211_MAX_ANTENNA];
  216. /* RSSI (noise floor adjusted) */
  217. u_int8_t rs_rssiextn[IEEE80211_MAX_ANTENNA];
  218. /* rs_rssi is valid or not */
  219. u_int8_t rs_isvalidrssi;
  220. enum cdp_mon_phymode rs_phymode;
  221. int rs_freq;
  222. union {
  223. u_int8_t data[8];
  224. u_int64_t tsf;
  225. } rs_tstamp;
  226. /*
  227. * Detail channel structure of recv frame.
  228. * It could be NULL if not available
  229. */
  230. #ifdef ATH_SUPPORT_AOW
  231. u_int16_t rs_rxseq; /* WLAN Sequence number */
  232. #endif
  233. #ifdef ATH_VOW_EXT_STATS
  234. /* Lower 16 bits holds the udp checksum offset in the data pkt */
  235. u_int32_t vow_extstats_offset;
  236. /* Higher 16 bits contains offset in the data pkt at which vow
  237. * ext stats are embedded
  238. */
  239. #endif
  240. u_int8_t rs_isaggr;
  241. u_int8_t rs_isapsd;
  242. int16_t rs_noisefloor;
  243. u_int16_t rs_channel;
  244. #ifdef ATH_SUPPORT_TxBF
  245. u_int32_t rs_rpttstamp; /* txbf report time stamp*/
  246. #endif
  247. /* The following counts are meant to assist in stats calculation.
  248. * These variables are incremented only in specific situations, and
  249. * should not be relied upon for any purpose other than the original
  250. * stats related purpose they have been introduced for.
  251. */
  252. u_int16_t rs_cryptodecapcount; /* Crypto bytes decapped/demic'ed. */
  253. u_int8_t rs_padspace; /* No. of padding bytes present after
  254. header in wbuf. */
  255. u_int8_t rs_qosdecapcount; /* QoS/HTC bytes decapped. */
  256. /* End of stats calculation related counts. */
  257. /*
  258. * uint8_t rs_lsig[IEEE80211_LSIG_LEN];
  259. * uint8_t rs_htsig[IEEE80211_HTSIG_LEN];
  260. * uint8_t rs_servicebytes[IEEE80211_SB_LEN];
  261. * uint8_t rs_fcs_error;
  262. */
  263. /* cdp convergence monitor mode status */
  264. union {
  265. u_int8_t cdp_data[8];
  266. u_int64_t cdp_tsf;
  267. } cdp_rs_tstamp;
  268. uint8_t cdp_rs_pream_type;
  269. uint32_t cdp_rs_user_rssi;
  270. uint8_t cdp_rs_stbc;
  271. uint8_t cdp_rs_sgi;
  272. uint32_t cdf_rs_rate_mcs;
  273. uint32_t cdp_rs_reception_type;
  274. uint32_t cdp_rs_bw;
  275. uint32_t cdp_rs_nss;
  276. uint8_t cdp_rs_fcs_err;
  277. bool cdp_rs_rxdma_err;
  278. };
  279. enum {
  280. CDP_MON_PPDU_START = 0,
  281. CDP_MON_PPDU_END,
  282. };
  283. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  284. /*
  285. * enum cdp_mon_phyrx_abort_reason_code: Phy err code to store the reason
  286. * why PHY generated an abort request.
  287. */
  288. enum cdp_mon_phyrx_abort_reason_code {
  289. CDP_PHYRX_ERR_PHY_OFF = 0,
  290. CDP_PHYRX_ERR_SYNTH_OFF,
  291. CDP_PHYRX_ERR_OFDMA_TIMING,
  292. CDP_PHYRX_ERR_OFDMA_SIGNAL_PARITY,
  293. CDP_PHYRX_ERR_OFDMA_RATE_ILLEGAL,
  294. CDP_PHYRX_ERR_OFDMA_LENGTH_ILLEGAL,
  295. CDP_PHYRX_ERR_OFDMA_RESTART,
  296. CDP_PHYRX_ERR_OFDMA_SERVICE,
  297. CDP_PHYRX_ERR_PPDU_OFDMA_POWER_DROP,
  298. CDP_PHYRX_ERR_CCK_BLOKKER,
  299. CDP_PHYRX_ERR_CCK_TIMING = 10,
  300. CDP_PHYRX_ERR_CCK_HEADER_CRC,
  301. CDP_PHYRX_ERR_CCK_RATE_ILLEGAL,
  302. CDP_PHYRX_ERR_CCK_LENGTH_ILLEGAL,
  303. CDP_PHYRX_ERR_CCK_RESTART,
  304. CDP_PHYRX_ERR_CCK_SERVICE,
  305. CDP_PHYRX_ERR_CCK_POWER_DROP,
  306. CDP_PHYRX_ERR_HT_CRC_ERR,
  307. CDP_PHYRX_ERR_HT_LENGTH_ILLEGAL,
  308. CDP_PHYRX_ERR_HT_RATE_ILLEGAL,
  309. CDP_PHYRX_ERR_HT_ZLF = 20,
  310. CDP_PHYRX_ERR_FALSE_RADAR_EXT,
  311. CDP_PHYRX_ERR_GREEN_FIELD,
  312. CDP_PHYRX_ERR_BW_GT_DYN_BW,
  313. CDP_PHYRX_ERR_HT_LSIG_RATE_MISMATCH,
  314. CDP_PHYRX_ERR_VHT_CRC_ERROR,
  315. CDP_PHYRX_ERR_VHT_SIGA_UNSUPPORTED,
  316. CDP_PHYRX_ERR_VHT_LSIG_LEN_INVALID,
  317. CDP_PHYRX_ERR_VHT_NDP_OR_ZLF,
  318. CDP_PHYRX_ERR_VHT_NSYM_LT_ZERO,
  319. CDP_PHYRX_ERR_VHT_RX_EXTRA_SYMBOL_MISMATCH = 30,
  320. CDP_PHYRX_ERR_VHT_RX_SKIP_GROUP_ID0,
  321. CDP_PHYRX_ERR_VHT_RX_SKIP_GROUP_ID1TO62,
  322. CDP_PHYRX_ERR_VHT_RX_SKIP_GROUP_ID63,
  323. CDP_PHYRX_ERR_OFDM_LDPC_DECODER_DISABLED,
  324. CDP_PHYRX_ERR_DEFER_NAP,
  325. CDP_PHYRX_ERR_FDOMAIN_TIMEOUT,
  326. CDP_PHYRX_ERR_LSIG_REL_CHECK,
  327. CDP_PHYRX_ERR_BT_COLLISION,
  328. CDP_PHYRX_ERR_UNSUPPORTED_MU_FEEDBACK,
  329. CDP_PHYRX_ERR_PPDU_TX_INTERRUPT_RX = 40,
  330. CDP_PHYRX_ERR_UNSUPPORTED_CBF,
  331. CDP_PHYRX_ERR_OTHER,
  332. CDP_PHYRX_ERR_HE_SIGA_UNSUPPORTED,
  333. CDP_PHYRX_ERR_HE_SIGA_CRC_ERROR,
  334. CDP_PHYRX_ERR_HE_SIGB_UNSUPPORTED,
  335. CDP_PHYRX_ERR_HE_SIGB_CRC_ERROR,
  336. CDP_PHYRX_ERR_HE_MU_MODE_UNSUPPORTED,
  337. CDP_PHYRX_ERR_HE_NDP_OR_ZLF,
  338. CDP_PHYRX_ERR_HE_NSYM_LT_ZERO,
  339. CDP_PHYRX_ERR_HE_RU_PARAMS_UNSUPPORTED = 50,
  340. CDP_PHYRX_ERR_HE_NUM_USERS_UNSUPPORTED,
  341. CDP_PHYRX_ERR_HE_SOUNDING_PARAMS_UNSUPPORTED,
  342. CDP_PHYRX_ERR_HE_EXT_SU_UNSUPPORTED,
  343. CDP_PHYRX_ERR_HE_TRIG_UNSUPPORTED,
  344. CDP_PHYRX_ERR_HE_LSIG_LEN_INVALID = 55,
  345. CDP_PHYRX_ERR_HE_LSIG_RATE_MISMATCH,
  346. CDP_PHYRX_ERR_OFDMA_SIGNAL_RELIABILITY,
  347. CDP_PHYRX_ERR_HT_NSYM_LT_ZERO,
  348. CDP_PHYRX_ERR_VHT_LSIG_RATE_MISMATCH,
  349. CDP_PHYRX_ERR_VHT_PAID_GID_MISMATCH = 60,
  350. CDP_PHYRX_ERR_VHT_UNSUPPORTED_BW,
  351. CDP_PHYRX_ERR_VHT_GI_DISAM_MISMATCH,
  352. CDP_PHYRX_ERR_RX_WDG_TIMEOUT = 63,
  353. CDP_PHYRX_ERR_MAX
  354. };
  355. #endif
  356. #define MAX_PPDU_ID_HIST 128
  357. /**
  358. * struct cdp_pdev_mon_stats
  359. * @status_ppdu_state: state on PPDU start and end
  360. * @status_ppdu_start: status ring PPDU start TLV count
  361. * @status_ppdu_end: status ring PPDU end TLV count
  362. * @status_ppdu_compl: status ring matching start and end count on PPDU
  363. * @status_ppdu_start_mis: status ring missing start TLV count on PPDU
  364. * @status_ppdu_end_mis: status ring missing end TLV count on PPDU
  365. * @mpdu_cnt_fcs_ok: MPDU ok count per pkt and reception type DL-UL and user
  366. * @mpdu_cnt_fcs_err: MPDU err count per pkt and reception type DL-UL and user
  367. * @ppdu_eht_type_mode: PPDU count per type compression mode and DL-UL
  368. * @end_user_stats_cnt: PPDU end user TLV count
  369. * @start_user_info_cnt: PPDU start user info TLV count
  370. * @status_ppdu_done: status ring PPDU done TLV count
  371. * @dest_ppdu_done: destination ring PPDU count
  372. * @dest_mpdu_done: destination ring MPDU count
  373. * @dest_mpdu_drop:
  374. * @dup_mon_linkdesc_cnt: duplicate link descriptor indications from HW
  375. * @dup_mon_buf_cnt: duplicate buffer indications from HW
  376. * @dup_mon_sw_desc: Duplicate sw desc from HW
  377. * @stat_ring_ppdu_id_hist:
  378. * @dest_ring_ppdu_id_hist:
  379. * @ppdu_id_hist_idx:
  380. * @mon_rx_dest_stuck:
  381. * @tlv_tag_status_err: status not correct in the tlv tag
  382. * @status_buf_done_war: Number of status ring buffers for which DMA not done
  383. * WAR is applied.
  384. * @mon_rx_bufs_replenished_dest: Rx buffers replenish count
  385. * @mon_rx_bufs_reaped_dest: Rx buffer reap count
  386. * @ppdu_id_mismatch: counter to track ppdu id mismatch in
  387. * mointor status and monitor destination ring
  388. * @ppdu_id_match: counter to track ppdu id match in
  389. * mointor status and monitor destination ring
  390. * @status_ppdu_drop: Number of ppdu dropped from monitor status ring
  391. * @dest_ppdu_drop: Number of ppdu dropped from monitor destination ring
  392. * @mon_link_desc_invalid: msdu link desc invalid count
  393. * @mon_rx_desc_invalid: rx_desc invalid count
  394. * @mon_nbuf_sanity_err:
  395. * @mpdu_ppdu_id_mismatch_drop: mpdu's ppdu id did not match destination
  396. * ring ppdu id
  397. * @mpdu_decap_type_invalid: mpdu decap type invalid count
  398. * @rx_undecoded_count: Received undecoded frame count
  399. * @rx_undecoded_error: Rx undecoded errors
  400. * @rx_hdr_not_received: Rx HDR not received for MPDU
  401. * @invalid_dma_length: Invalid length received for packet buffer
  402. * @parent_buf_alloc: Numder of parent nbuf allocated for MPDU
  403. * @parent_buf_free: Number of parent nbuf freed
  404. * @pkt_buf_count: Number of packet buffers received
  405. * @mpdus_buf_to_stack: Number of MPDUs delivered to stack
  406. * @status_buf_count: Number of status buffer received
  407. * @empty_desc_ppdu: Number of empty desc received
  408. * @total_ppdu_info_enq: Number of PPDUs enqueued to wq
  409. * @total_ppdu_info_drop: Number of PPDUs dropped
  410. * @total_ppdu_info_alloc: Number of PPDU info allocated
  411. * @total_ppdu_info_free: Number of PPDU info freed
  412. * @ppdu_drop_cnt: Total PPDU drop count
  413. * @mpdu_drop_cnt: Total MPDU drop count
  414. * @end_of_ppdu_drop_cnt: Total end of ppdu drop count
  415. * @tlv_drop_cnt: TLV drop count
  416. * @rx_hdr_invalid_cnt: Rx header invalid count
  417. * @null_status_desc: NULL packet desc count
  418. * @null_pkt_desc: NULL packet desc count
  419. * @desc_magic_mismatch: desc magic number mismatch count;
  420. * @null_pkt_addr: NULL packet address count;
  421. * @pending_desc_count: Pending desc_count during pdev deinit
  422. */
  423. struct cdp_pdev_mon_stats {
  424. #ifndef REMOVE_MON_DBG_STATS
  425. uint32_t status_ppdu_state;
  426. uint32_t status_ppdu_start;
  427. uint32_t status_ppdu_end;
  428. uint32_t status_ppdu_compl;
  429. uint32_t status_ppdu_start_mis;
  430. uint32_t status_ppdu_end_mis;
  431. #endif
  432. uint32_t mpdu_cnt_fcs_ok[CDP_PKT_TYPE_MAX][CDP_RX_TYPE_MAX]
  433. [CDP_MU_TYPE_MAX][CDP_MU_SNIF_USER_MAX];
  434. uint32_t mpdu_cnt_fcs_err[CDP_PKT_TYPE_MAX][CDP_RX_TYPE_MAX]
  435. [CDP_MU_TYPE_MAX][CDP_MU_SNIF_USER_MAX];
  436. uint32_t ppdu_eht_type_mode[CDP_EHT_TYPE_MODE_MAX][CDP_MU_TYPE_MAX];
  437. uint32_t end_user_stats_cnt;
  438. uint32_t start_user_info_cnt;
  439. uint32_t status_ppdu_done;
  440. uint32_t dest_ppdu_done;
  441. uint32_t dest_mpdu_done;
  442. uint32_t dest_mpdu_drop;
  443. uint32_t dup_mon_linkdesc_cnt;
  444. uint32_t dup_mon_buf_cnt;
  445. uint32_t dup_mon_sw_desc;
  446. uint32_t stat_ring_ppdu_id_hist[MAX_PPDU_ID_HIST];
  447. uint32_t dest_ring_ppdu_id_hist[MAX_PPDU_ID_HIST];
  448. uint32_t ppdu_id_hist_idx;
  449. uint32_t mon_rx_dest_stuck;
  450. uint32_t tlv_tag_status_err;
  451. uint32_t status_buf_done_war;
  452. uint32_t mon_rx_bufs_replenished_dest;
  453. uint32_t mon_rx_bufs_reaped_dest;
  454. uint32_t ppdu_id_mismatch;
  455. uint32_t ppdu_id_match;
  456. uint32_t status_ppdu_drop;
  457. uint32_t dest_ppdu_drop;
  458. uint32_t mon_link_desc_invalid;
  459. uint32_t mon_rx_desc_invalid;
  460. uint32_t mon_nbuf_sanity_err;
  461. uint32_t mpdu_ppdu_id_mismatch_drop;
  462. uint32_t mpdu_decap_type_invalid;
  463. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  464. uint32_t rx_undecoded_count;
  465. uint32_t rx_undecoded_error[CDP_PHYRX_ERR_MAX];
  466. #endif
  467. uint32_t rx_hdr_not_received;
  468. uint32_t invalid_dma_length;
  469. uint32_t parent_buf_alloc;
  470. uint32_t parent_buf_free;
  471. uint32_t pkt_buf_count;
  472. uint32_t mpdus_buf_to_stack;
  473. uint32_t status_buf_count;
  474. uint32_t empty_desc_ppdu;
  475. uint32_t total_ppdu_info_enq;
  476. uint32_t total_ppdu_info_drop;
  477. uint32_t total_ppdu_info_alloc;
  478. uint32_t total_ppdu_info_free;
  479. uint32_t ppdu_drop_cnt;
  480. uint32_t mpdu_drop_cnt;
  481. uint32_t end_of_ppdu_drop_cnt;
  482. uint32_t tlv_drop_cnt;
  483. uint32_t rx_hdr_invalid_cnt;
  484. uint32_t null_status_desc;
  485. uint32_t null_pkt_desc;
  486. uint32_t desc_magic_mismatch;
  487. uint32_t null_pkt_addr;
  488. uint32_t pending_desc_count;
  489. };
  490. #ifdef QCA_SUPPORT_LITE_MONITOR
  491. /**
  492. * struct cdp_lite_mon_filter_config - lite mon set/get filter config
  493. * @direction: direction tx/rx
  494. * @disable: disables lite mon
  495. * @level: MSDU/MPDU/PPDU levels
  496. * @metadata: meta information to be added
  497. * @mgmt_filter: mgmt filter for modes fp,md,mo
  498. * @ctrl_filter: ctrl filter for modes fp,md,mo
  499. * @data_filter: data filter for modes fp,md,mo
  500. * @len: mgmt/ctrl/data frame lens
  501. * @debug: debug options
  502. * @vdev_id: output vdev id
  503. * @legacy_filter_enabled: legacy filter currently enabled
  504. */
  505. struct cdp_lite_mon_filter_config {
  506. uint8_t direction;
  507. uint8_t disable;
  508. uint8_t level;
  509. uint8_t metadata;
  510. uint16_t mgmt_filter[CDP_MON_FRM_FILTER_MODE_MAX];
  511. uint16_t ctrl_filter[CDP_MON_FRM_FILTER_MODE_MAX];
  512. uint16_t data_filter[CDP_MON_FRM_FILTER_MODE_MAX];
  513. uint16_t len[CDP_MON_FRM_TYPE_MAX];
  514. uint8_t debug;
  515. uint8_t vdev_id;
  516. uint8_t legacy_filter_enabled;
  517. };
  518. /**
  519. * struct cdp_lite_mon_peer_config - lite mon set peer config
  520. * @direction: direction tx/rx
  521. * @action: add/del
  522. * @vdev_id: peer vdev id
  523. * @mac: peer mac
  524. */
  525. struct cdp_lite_mon_peer_config {
  526. uint8_t direction;
  527. uint8_t action;
  528. uint8_t vdev_id;
  529. uint8_t mac[QDF_MAC_ADDR_SIZE];
  530. };
  531. /**
  532. * struct cdp_lite_mon_peer_info - lite mon get peer config
  533. * @direction: direction tx/rx
  534. * @count: no of peers
  535. * @mac: peer macs
  536. */
  537. struct cdp_lite_mon_peer_info {
  538. uint8_t direction;
  539. uint8_t count;
  540. uint8_t mac[CDP_LITE_MON_PEER_MAX][QDF_MAC_ADDR_SIZE];
  541. };
  542. #endif
  543. /* channel operating width */
  544. enum cdp_channel_width {
  545. CHAN_WIDTH_20 = 0,
  546. CHAN_WIDTH_40,
  547. CHAN_WIDTH_80,
  548. CHAN_WIDTH_160,
  549. CHAN_WIDTH_80P80,
  550. CHAN_WIDTH_5,
  551. CHAN_WIDTH_10,
  552. CHAN_WIDTH_165,
  553. CHAN_WIDTH_160P160,
  554. CHAN_WIDTH_320,
  555. CHAN_WIDTH_MAX,
  556. };
  557. /**
  558. * struct cdp_rssi_temp_off_param_dp
  559. * @rssi_temp_offset: Temperature based rssi offset , send every 30 secs
  560. */
  561. struct cdp_rssi_temp_off_param_dp {
  562. int32_t rssi_temp_offset;
  563. };
  564. /**
  565. * struct cdp_rssi_dbm_conv_param_dp
  566. * @curr_bw: Current bandwidth
  567. * @curr_rx_chainmask: Current rx chainmask
  568. * @xbar_config: 4 bytes, used for BB to RF Chain mapping
  569. * @xlna_bypass_offset: Low noise amplifier bypass offset
  570. * @xlna_bypass_threshold: Low noise amplifier bypass threshold
  571. * @nf_hw_dbm: HW noise floor in dBm per chain, per 20MHz subband
  572. */
  573. struct cdp_rssi_dbm_conv_param_dp {
  574. uint32_t curr_bw;
  575. uint32_t curr_rx_chainmask;
  576. uint32_t xbar_config;
  577. int32_t xlna_bypass_offset;
  578. int32_t xlna_bypass_threshold;
  579. int8_t nf_hw_dbm[CDP_MAX_NUM_ANTENNA][CDP_MAX_20MHZ_SEGS];
  580. };
  581. /**
  582. * struct cdp_rssi_db2dbm_param_dp
  583. * @pdev_id: pdev_id
  584. * @rssi_temp_off_present: to check temp offset values present or not
  585. * @rssi_dbm_info_present: to check rssi dbm conversion parameters
  586. * present or not
  587. * @temp_off_param: cdp_rssi_temp_off_param_dp structure value
  588. * @rssi_dbm_param: cdp_rssi_dbm_conv_param_dp staructure value
  589. */
  590. struct cdp_rssi_db2dbm_param_dp {
  591. uint32_t pdev_id;
  592. bool rssi_temp_off_present;
  593. bool rssi_dbm_info_present;
  594. struct cdp_rssi_temp_off_param_dp temp_off_param;
  595. struct cdp_rssi_dbm_conv_param_dp rssi_dbm_param;
  596. };
  597. /**
  598. * enum cdp_mon_reap_source - trigger source of the reap timer of
  599. * monitor status ring
  600. * @CDP_MON_REAP_SOURCE_PKTLOG: pktlog
  601. * @CDP_MON_REAP_SOURCE_CFR: CFR
  602. * @CDP_MON_REAP_SOURCE_EMESH: easy mesh
  603. * @CDP_MON_REAP_SOURCE_NUM: total number of the sources
  604. * @CDP_MON_REAP_SOURCE_ANY: any of the sources
  605. */
  606. enum cdp_mon_reap_source {
  607. CDP_MON_REAP_SOURCE_PKTLOG,
  608. CDP_MON_REAP_SOURCE_CFR,
  609. CDP_MON_REAP_SOURCE_EMESH,
  610. /* keep last */
  611. CDP_MON_REAP_SOURCE_NUM,
  612. CDP_MON_REAP_SOURCE_ANY,
  613. };
  614. #endif