dp_rx_mon.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. /*
  2. * Copyright (c) 2016-2021 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. #ifndef _DP_RX_MON_H_
  19. #define _DP_RX_MON_H_
  20. #define dp_rx_mon_status_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_RX_MON_STATUS, params)
  21. #define dp_rx_mon_status_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_RX_MON_STATUS, params)
  22. #define dp_rx_mon_status_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_RX_MON_STATUS, params)
  23. #define dp_rx_mon_status_info(params...) \
  24. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_RX_MON_STATUS, ## params)
  25. #define dp_rx_mon_status_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_RX_MON_STATUS, params)
  26. #define dp_rx_mon_dest_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_RX_MON_DEST, params)
  27. #define dp_rx_mon_dest_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_RX_MON_DEST, params)
  28. #define dp_rx_mon_dest_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_RX_MON_DEST, params)
  29. #define dp_rx_mon_dest_info(params...) \
  30. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_RX_MON_DEST, ## params)
  31. #define dp_rx_mon_dest_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_RX_MON_DEST, params)
  32. /* The maximum buffer length allocated for radiotap for monitor status buffer */
  33. #define MAX_MONITOR_HEADER (512)
  34. /**
  35. * enum dp_mon_reap_status - monitor status ring ppdu status
  36. *
  37. * @DP_MON_STATUS_NO_DMA - DMA not done for status ring entry
  38. * @DP_MON_STATUS_MATCH - status and dest ppdu id mathes
  39. * @DP_MON_STATUS_LAG - status ppdu id is lagging
  40. * @DP_MON_STATUS_LEAD - status ppdu id is leading
  41. * @DP_MON_STATUS_REPLENISH - status ring entry is NULL
  42. */
  43. enum dp_mon_reap_status {
  44. DP_MON_STATUS_NO_DMA,
  45. DP_MON_STATUS_MATCH,
  46. DP_MON_STATUS_LAG,
  47. DP_MON_STATUS_LEAD,
  48. DP_MON_STATUS_REPLENISH
  49. };
  50. /*
  51. * dp_rx_mon_status_process() - Process monitor status ring and
  52. * TLV in status ring.
  53. *
  54. * @soc: core txrx main context
  55. * @int_ctx: interrupt context
  56. * @mac_id: mac_id which is one of 3 mac_ids
  57. * @quota: No. of ring entry that can be serviced in one shot.
  58. * Return: uint32_t: No. of ring entry that is processed.
  59. */
  60. uint32_t
  61. dp_rx_mon_status_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  62. uint32_t mac_id, uint32_t quota);
  63. /*
  64. * dp_rx_populate_cbf_hdr - Send CBF frame with htt header
  65. * @soc: Datapath soc handle
  66. * @mac_id: Datapath mac id
  67. * @event: WDI event
  68. * @mpdu: mpdu buffer
  69. * @msdu_timesstamp: time stamp
  70. *
  71. * Return: QDF_STATUS
  72. */
  73. QDF_STATUS dp_rx_populate_cbf_hdr(struct dp_soc *soc,
  74. uint32_t mac_id, uint32_t event,
  75. qdf_nbuf_t data, uint32_t msdu_timestamp);
  76. /**
  77. * dp_rx_mon_handle_status_buf_done () - Handle DMA not done case for
  78. * monitor status ring
  79. *
  80. * @pdev: DP pdev handle
  81. * @mon_status_srng: Monitor status SRNG
  82. *
  83. * Return: enum dp_mon_reap_status
  84. */
  85. enum dp_mon_reap_status
  86. dp_rx_mon_handle_status_buf_done(struct dp_pdev *pdev,
  87. void *mon_status_srng);
  88. #ifdef QCA_SUPPORT_FULL_MON
  89. /**
  90. * dp_full_mon_attach() - Full monitor mode attach
  91. * This API initilises full monitor mode resources
  92. *
  93. * @pdev: dp pdev object
  94. *
  95. * Return: void
  96. *
  97. */
  98. void dp_full_mon_attach(struct dp_pdev *pdev);
  99. /**
  100. * dp_full_mon_detach() - Full monitor mode attach
  101. * This API deinitilises full monitor mode resources
  102. *
  103. * @pdev: dp pdev object
  104. *
  105. * Return: void
  106. *
  107. */
  108. void dp_full_mon_detach(struct dp_pdev *pdev);
  109. /**
  110. * dp_rx_mon_process ()- API to process monitor destination ring for
  111. * full monitor mode
  112. *
  113. * @soc: dp soc handle
  114. * @int_ctx: interrupt context
  115. * @mac_id: lmac id
  116. * @quota: No. of ring entry that can be serviced in one shot.
  117. */
  118. uint32_t dp_rx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  119. uint32_t mac_id, uint32_t quota);
  120. #else
  121. /**
  122. * dp_full_mon_attach() - attach full monitor mode resources
  123. * @pdev: Datapath PDEV handle
  124. *
  125. * Return: void
  126. */
  127. static inline void dp_full_mon_attach(struct dp_pdev *pdev)
  128. {
  129. }
  130. /**
  131. * dp_full_mon_detach() - detach full monitor mode resources
  132. * @pdev: Datapath PDEV handle
  133. *
  134. * Return: void
  135. *
  136. */
  137. static inline void dp_full_mon_detach(struct dp_pdev *pdev)
  138. {
  139. }
  140. #endif
  141. /**
  142. * dp_mon_link_free() - free monitor link desc pool
  143. * @pdev: core txrx pdev context
  144. *
  145. * This function will release DP link desc pool for monitor mode from
  146. * main device context.
  147. *
  148. * Return: QDF_STATUS_SUCCESS: success
  149. * QDF_STATUS_E_RESOURCES: Error return
  150. */
  151. QDF_STATUS dp_mon_link_free(struct dp_pdev *pdev);
  152. /**
  153. * dp_mon_process() - Main monitor mode processing roution.
  154. * @soc: core txrx main context
  155. * @int_ctx: interrupt context
  156. * @mac_id: mac_id which is one of 3 mac_ids
  157. * @quota: No. of status ring entry that can be serviced in one shot.
  158. *
  159. * This call monitor status ring process then monitor
  160. * destination ring process.
  161. * Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
  162. *
  163. * Return: uint32_t: No. of ring entry that is processed.
  164. */
  165. uint32_t dp_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  166. uint32_t mac_id, uint32_t quota);
  167. QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id,
  168. qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu);
  169. /*
  170. * dp_rx_mon_deliver_non_std() - deliver frames for non standard path
  171. * @soc: core txrx main contex
  172. * @mac_id: MAC ID
  173. *
  174. * This function delivers the radio tap and dummy MSDU
  175. * into user layer application for preamble only PPDU.
  176. *
  177. * Return: Operation status
  178. */
  179. QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc, uint32_t mac_id);
  180. #ifndef REMOVE_MON_DBG_STATS
  181. /*
  182. * dp_rx_mon_update_dbg_ppdu_stats() - Update status ring TLV count
  183. * @ppdu_info: HAL RX PPDU info retrieved from status ring TLV
  184. * @rx_mon_stats: monitor mode status/destination ring PPDU and MPDU count
  185. *
  186. * Update status ring PPDU start and end count. Keep track TLV state on
  187. * PPDU start and end to find out if start and end is matching. Keep
  188. * track missing PPDU start and end count. Keep track matching PPDU
  189. * start and end count.
  190. *
  191. * Return: None
  192. */
  193. static inline void
  194. dp_rx_mon_update_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  195. struct cdp_pdev_mon_stats *rx_mon_stats)
  196. {
  197. if (ppdu_info->rx_state ==
  198. HAL_RX_MON_PPDU_START) {
  199. rx_mon_stats->status_ppdu_start++;
  200. if (rx_mon_stats->status_ppdu_state
  201. != CDP_MON_PPDU_END)
  202. rx_mon_stats->status_ppdu_end_mis++;
  203. rx_mon_stats->status_ppdu_state
  204. = CDP_MON_PPDU_START;
  205. ppdu_info->rx_state = HAL_RX_MON_PPDU_RESET;
  206. } else if (ppdu_info->rx_state ==
  207. HAL_RX_MON_PPDU_END) {
  208. rx_mon_stats->status_ppdu_end++;
  209. if (rx_mon_stats->status_ppdu_state
  210. != CDP_MON_PPDU_START)
  211. rx_mon_stats->status_ppdu_start_mis++;
  212. else
  213. rx_mon_stats->status_ppdu_compl++;
  214. rx_mon_stats->status_ppdu_state
  215. = CDP_MON_PPDU_END;
  216. ppdu_info->rx_state = HAL_RX_MON_PPDU_RESET;
  217. }
  218. }
  219. /*
  220. * dp_rx_mon_init_dbg_ppdu_stats() - initialization for monitor mode stats
  221. * @ppdu_info: HAL RX PPDU info retrieved from status ring TLV
  222. * @rx_mon_stats: monitor mode status/destination ring PPDU and MPDU count
  223. *
  224. * Return: None
  225. */
  226. static inline void
  227. dp_rx_mon_init_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  228. struct cdp_pdev_mon_stats *rx_mon_stats)
  229. {
  230. ppdu_info->rx_state = HAL_RX_MON_PPDU_END;
  231. rx_mon_stats->status_ppdu_state
  232. = CDP_MON_PPDU_END;
  233. }
  234. #else
  235. static inline void
  236. dp_rx_mon_update_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  237. struct cdp_pdev_mon_stats *rx_mon_stats)
  238. {
  239. }
  240. static inline void
  241. dp_rx_mon_init_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  242. struct cdp_pdev_mon_stats *rx_mon_stats)
  243. {
  244. }
  245. #endif
  246. #ifdef QCA_ENHANCED_STATS_SUPPORT
  247. void
  248. dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info,
  249. struct cdp_rx_indication_ppdu *cdp_rx_ppdu);
  250. /*
  251. * dp_rx_populate_su_evm_details() - Populate su evm info
  252. * @ppdu_info: ppdu info structure from ppdu ring
  253. * @cdp_rx_ppdu: rx ppdu indication structure
  254. */
  255. void
  256. dp_rx_populate_su_evm_details(struct hal_rx_ppdu_info *ppdu_info,
  257. struct cdp_rx_indication_ppdu *cdp_rx_ppdu);
  258. /**
  259. * dp_rx_handle_ppdu_stats() - Allocate and deliver ppdu stats to cdp layer
  260. * @soc: core txrx main context
  261. * @pdev: pdev strcuture
  262. * @ppdu_info: structure for rx ppdu ring
  263. *
  264. * Return: none
  265. */
  266. void
  267. dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
  268. struct hal_rx_ppdu_info *ppdu_info);
  269. #else
  270. static inline void
  271. dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info,
  272. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  273. {
  274. }
  275. static inline void
  276. dp_rx_populate_su_evm_details(struct hal_rx_ppdu_info *ppdu_info,
  277. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  278. {
  279. }
  280. static inline void
  281. dp_rx_populate_cdp_indication_ppdu_user(struct dp_pdev *pdev,
  282. struct hal_rx_ppdu_info *ppdu_info,
  283. struct cdp_rx_indication_ppdu
  284. *cdp_rx_ppdu)
  285. {
  286. }
  287. static inline void
  288. dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
  289. struct hal_rx_ppdu_info *ppdu_info,
  290. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  291. {
  292. }
  293. static inline void dp_rx_rate_stats_update(struct dp_peer *peer,
  294. struct cdp_rx_indication_ppdu *ppdu,
  295. uint32_t user)
  296. {
  297. }
  298. static inline void
  299. dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
  300. struct hal_rx_ppdu_info *ppdu_info)
  301. {
  302. }
  303. #endif /* QCA_ENHANCED_STATS_SUPPORT */
  304. #ifdef QCA_MCOPY_SUPPORT
  305. /**
  306. * dp_rx_handle_mcopy_mode() - Allocate and deliver first MSDU payload
  307. * @soc: core txrx main context
  308. * @pdev: pdev structure
  309. * @ppdu_info: structure for rx ppdu ring
  310. * @nbuf: QDF nbuf
  311. * @fcs_ok_mpdu_cnt: fcs passsed mpdu index
  312. * @deliver_frame: flag to deliver wdi event
  313. *
  314. * Return: QDF_STATUS_SUCCESS - If nbuf to be freed by caller
  315. * QDF_STATUS_E_ALREADY - If nbuf not to be freed by caller
  316. */
  317. QDF_STATUS
  318. dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  319. struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf,
  320. uint8_t fcs_ok_mpdu_cnt, bool deliver_frame);
  321. /**
  322. * dp_rx_mcopy_handle_last_mpdu() - cache and delive last MPDU header in a
  323. * status buffer if MPDU end tlv is received in different buffer
  324. * @soc: core txrx main context
  325. * @pdev: pdev structure
  326. * @ppdu_info: structure for rx ppdu ring
  327. * @status_nbuf: QDF nbuf
  328. *
  329. * Return: void
  330. */
  331. void
  332. dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev,
  333. struct hal_rx_ppdu_info *ppdu_info,
  334. qdf_nbuf_t status_nbuf);
  335. /**
  336. * dp_rx_mcopy_process_ppdu_info() - update mcopy ppdu info
  337. * @ppdu_info: structure for rx ppdu ring
  338. * @tlv_status: processed TLV status
  339. *
  340. * Return: void
  341. */
  342. void
  343. dp_rx_mcopy_process_ppdu_info(struct dp_pdev *pdev,
  344. struct hal_rx_ppdu_info *ppdu_info,
  345. uint32_t tlv_status);
  346. void
  347. dp_rx_process_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  348. struct hal_rx_ppdu_info *ppdu_info,
  349. uint32_t tlv_status,
  350. qdf_nbuf_t status_nbuf);
  351. #else
  352. static inline QDF_STATUS
  353. dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  354. struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf,
  355. uint8_t fcs_ok_cnt, bool deliver_frame)
  356. {
  357. return QDF_STATUS_SUCCESS;
  358. }
  359. static inline void
  360. dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev,
  361. struct hal_rx_ppdu_info *ppdu_info,
  362. qdf_nbuf_t status_nbuf)
  363. {
  364. }
  365. static inline void
  366. dp_rx_mcopy_process_ppdu_info(struct dp_pdev *pdev,
  367. struct hal_rx_ppdu_info *ppdu_info,
  368. uint32_t tlv_status)
  369. {
  370. }
  371. static inline void
  372. dp_rx_process_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  373. struct hal_rx_ppdu_info *ppdu_info,
  374. uint32_t tlv_status,
  375. qdf_nbuf_t status_nbuf)
  376. {
  377. }
  378. #endif /* QCA_MCOPY_SUPPORT */
  379. /**
  380. * dp_rx_handle_smart_mesh_mode() - Deliver header for smart mesh
  381. * @soc: Datapath SOC handle
  382. * @pdev: Datapath PDEV handle
  383. * @ppdu_info: Structure for rx ppdu info
  384. * @nbuf: Qdf nbuf abstraction for linux skb
  385. *
  386. * Return: 0 on success, 1 on failure
  387. */
  388. int
  389. dp_rx_handle_smart_mesh_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  390. struct hal_rx_ppdu_info *ppdu_info,
  391. qdf_nbuf_t nbuf);
  392. /*
  393. * dp_rx_nbuf_prepare() - prepare RX nbuf
  394. * @soc: core txrx main context
  395. * @pdev: core txrx pdev context
  396. *
  397. * This function alloc & map nbuf for RX dma usage, retry it if failed
  398. * until retry times reaches max threshold or succeeded.
  399. *
  400. * Return: qdf_nbuf_t pointer if succeeded, NULL if failed.
  401. */
  402. qdf_nbuf_t
  403. dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev);
  404. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  405. /*
  406. * dp_rx_mon_handle_cfr_mu_info() - Gather macaddr and ast_index of peer(s) in
  407. * the PPDU received, this will be used for correlation of CFR data captured
  408. * for an UL-MU-PPDU
  409. * @pdev: pdev ctx
  410. * @ppdu_info: pointer to ppdu info structure populated from ppdu status TLVs
  411. * @cdp_rx_ppdu: Rx PPDU indication structure
  412. *
  413. * Return: none
  414. */
  415. void
  416. dp_rx_mon_handle_cfr_mu_info(struct dp_pdev *pdev,
  417. struct hal_rx_ppdu_info *ppdu_info,
  418. struct cdp_rx_indication_ppdu *cdp_rx_ppdu);
  419. /*
  420. * dp_rx_mon_populate_cfr_ppdu_info() - Populate cdp ppdu info from hal ppdu
  421. * info
  422. * @pdev: pdev ctx
  423. * @ppdu_info: ppdu info structure from ppdu ring
  424. * @cdp_rx_ppdu : Rx PPDU indication structure
  425. *
  426. * Return: none
  427. */
  428. void
  429. dp_rx_mon_populate_cfr_ppdu_info(struct dp_pdev *pdev,
  430. struct hal_rx_ppdu_info *ppdu_info,
  431. struct cdp_rx_indication_ppdu *cdp_rx_ppdu);
  432. /**
  433. * dp_cfr_rcc_mode_status() - Return status of cfr rcc mode
  434. * @pdev: pdev ctx
  435. *
  436. * Return: True or False
  437. */
  438. bool
  439. dp_cfr_rcc_mode_status(struct dp_pdev *pdev);
  440. /*
  441. * dp_rx_mon_populate_cfr_info() - Populate cdp ppdu info from hal cfr info
  442. * @pdev: pdev ctx
  443. * @ppdu_info: ppdu info structure from ppdu ring
  444. * @cdp_rx_ppdu: Rx PPDU indication structure
  445. *
  446. * Return: none
  447. */
  448. void
  449. dp_rx_mon_populate_cfr_info(struct dp_pdev *pdev,
  450. struct hal_rx_ppdu_info *ppdu_info,
  451. struct cdp_rx_indication_ppdu *cdp_rx_ppdu);
  452. /**
  453. * dp_update_cfr_dbg_stats() - Increment RCC debug statistics
  454. * @pdev: pdev structure
  455. * @ppdu_info: structure for rx ppdu ring
  456. *
  457. * Return: none
  458. */
  459. void
  460. dp_update_cfr_dbg_stats(struct dp_pdev *pdev,
  461. struct hal_rx_ppdu_info *ppdu_info);
  462. /*
  463. * dp_rx_handle_cfr() - Gather cfr info from hal ppdu info
  464. * @soc: core txrx main context
  465. * @pdev: pdev ctx
  466. * @ppdu_info: ppdu info structure from ppdu ring
  467. *
  468. * Return: none
  469. */
  470. void
  471. dp_rx_handle_cfr(struct dp_soc *soc, struct dp_pdev *pdev,
  472. struct hal_rx_ppdu_info *ppdu_info);
  473. /**
  474. * dp_rx_populate_cfr_non_assoc_sta() - Populate cfr ppdu info for PPDUs from
  475. * non-associated stations
  476. * @pdev: pdev ctx
  477. * @ppdu_info: ppdu info structure from ppdu ring
  478. * @cdp_rx_ppdu: Rx PPDU indication structure
  479. *
  480. * Return: none
  481. */
  482. void
  483. dp_rx_populate_cfr_non_assoc_sta(struct dp_pdev *pdev,
  484. struct hal_rx_ppdu_info *ppdu_info,
  485. struct cdp_rx_indication_ppdu *cdp_rx_ppdu);
  486. #else
  487. static inline void
  488. dp_rx_mon_handle_cfr_mu_info(struct dp_pdev *pdev,
  489. struct hal_rx_ppdu_info *ppdu_info,
  490. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  491. {
  492. }
  493. static inline void
  494. dp_rx_mon_populate_cfr_ppdu_info(struct dp_pdev *pdev,
  495. struct hal_rx_ppdu_info *ppdu_info,
  496. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  497. {
  498. }
  499. static inline void
  500. dp_rx_mon_populate_cfr_info(struct dp_pdev *pdev,
  501. struct hal_rx_ppdu_info *ppdu_info,
  502. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  503. {
  504. }
  505. static inline void
  506. dp_rx_handle_cfr(struct dp_soc *soc, struct dp_pdev *pdev,
  507. struct hal_rx_ppdu_info *ppdu_info)
  508. {
  509. }
  510. static inline void
  511. dp_rx_populate_cfr_non_assoc_sta(struct dp_pdev *pdev,
  512. struct hal_rx_ppdu_info *ppdu_info,
  513. struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
  514. {
  515. }
  516. static inline void
  517. dp_update_cfr_dbg_stats(struct dp_pdev *pdev,
  518. struct hal_rx_ppdu_info *ppdu_info)
  519. {
  520. }
  521. static inline bool
  522. dp_cfr_rcc_mode_status(struct dp_pdev *pdev)
  523. {
  524. return false;
  525. }
  526. #endif /* WLAN_CFR_ENABLE && WLAN_ENH_CFR_ENABLE */
  527. /*
  528. * dp_rx_mon_deliver(): function to deliver packets to stack
  529. * @soc: DP soc
  530. * @mac_id: MAC ID
  531. * @head_msdu: head of msdu list
  532. * @tail_msdu: tail of msdu list
  533. *
  534. * Return: status: 0 - Success, non-zero: Failure
  535. */
  536. QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc,
  537. uint32_t mac_id,
  538. qdf_nbuf_t head_msdu,
  539. qdf_nbuf_t tail_msdu);
  540. /**
  541. * dp_rx_mon_deliver_non_std()
  542. * @soc: core txrx main contex
  543. * @mac_id: MAC ID
  544. *
  545. * This function delivers the radio tap and dummy MSDU
  546. * into user layer application for preamble only PPDU.
  547. *
  548. * Return: QDF_STATUS
  549. */
  550. QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc,
  551. uint32_t mac_id);
  552. #ifdef DP_RX_MON_MEM_FRAG
  553. #if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\
  554. defined(WLAN_SUPPORT_RX_FLOW_TAG)
  555. void dp_rx_mon_update_pf_tag_to_buf_headroom(struct dp_soc *soc,
  556. qdf_nbuf_t nbuf);
  557. #else
  558. static inline
  559. void dp_rx_mon_update_pf_tag_to_buf_headroom(struct dp_soc *soc,
  560. qdf_nbuf_t nbuf)
  561. {
  562. }
  563. #endif
  564. #else
  565. static inline
  566. void dp_rx_mon_update_pf_tag_to_buf_headroom(struct dp_soc *soc,
  567. qdf_nbuf_t nbuf)
  568. {
  569. }
  570. #endif
  571. qdf_nbuf_t dp_rx_mon_restitch_mpdu(struct dp_soc *soc, uint32_t mac_id,
  572. qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu,
  573. struct cdp_mon_status *rs);
  574. #ifdef DP_RX_MON_MEM_FRAG
  575. /**
  576. * dp_rx_mon_get_nbuf_80211_hdr() - Get 80211 hdr from nbuf
  577. * @nbuf: qdf_nbuf_t
  578. *
  579. * This function must be called after moving radiotap header.
  580. *
  581. * Return: Ptr pointing to 80211 header or NULL.
  582. */
  583. static inline
  584. qdf_frag_t dp_rx_mon_get_nbuf_80211_hdr(qdf_nbuf_t nbuf)
  585. {
  586. /* Return NULL if nr_frag is Zero */
  587. if (!qdf_nbuf_get_nr_frags(nbuf))
  588. return NULL;
  589. return qdf_nbuf_get_frag_addr(nbuf, 0);
  590. }
  591. #else
  592. static inline
  593. qdf_frag_t dp_rx_mon_get_nbuf_80211_hdr(qdf_nbuf_t nbuf)
  594. {
  595. return qdf_nbuf_data(nbuf);
  596. }
  597. #endif
  598. /*
  599. * dp_rx_mon_process_dest_pktlog(): function to log packet contents to
  600. * pktlog buffer and send to pktlog module
  601. * @soc: DP soc
  602. * @mac_id: MAC ID
  603. * @mpdu: MPDU buf
  604. * Return: status: 0 - Success, non-zero: Failure
  605. */
  606. QDF_STATUS dp_rx_mon_process_dest_pktlog(struct dp_soc *soc,
  607. uint32_t mac_id,
  608. qdf_nbuf_t mpdu);
  609. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  610. void
  611. dp_handle_tx_capture(struct dp_soc *soc, struct dp_pdev *pdev,
  612. qdf_nbuf_t mon_mpdu);
  613. #else
  614. static inline void
  615. dp_handle_tx_capture(struct dp_soc *soc, struct dp_pdev *pdev,
  616. qdf_nbuf_t mon_mpdu)
  617. {
  618. }
  619. #endif
  620. /**
  621. * dp_rx_get_mon_desc_pool() - Return monitor descriptor pool
  622. * based on target
  623. * @soc: soc handle
  624. * @mac_id: mac id number
  625. * @pdev_id: pdev id number
  626. *
  627. * Return: descriptor pool address
  628. */
  629. static inline
  630. struct rx_desc_pool *dp_rx_get_mon_desc_pool(struct dp_soc *soc,
  631. uint8_t mac_id,
  632. uint8_t pdev_id)
  633. {
  634. if (soc->wlan_cfg_ctx->rxdma1_enable)
  635. return &soc->rx_desc_mon[mac_id];
  636. return &soc->rx_desc_buf[pdev_id];
  637. }
  638. /**
  639. * dp_rx_process_peer_based_pktlog() - Process Rx pktlog if peer based
  640. * filtering enabled
  641. * @soc: core txrx main context
  642. * @ppdu_info: Structure for rx ppdu info
  643. * @status_nbuf: Qdf nbuf abstraction for linux skb
  644. * @pdev_id: mac_id/pdev_id correspondinggly for MCL and WIN
  645. *
  646. * Return: none
  647. */
  648. void
  649. dp_rx_process_peer_based_pktlog(struct dp_soc *soc,
  650. struct hal_rx_ppdu_info *ppdu_info,
  651. qdf_nbuf_t status_nbuf, uint32_t pdev_id);
  652. #endif /* _DP_RX_MON_H_ */