dp_rx_mon.h 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132
  1. /*
  2. * Copyright (c) 2016-2020 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. /*
  21. * MON_BUF_MIN_ENTRIES macro defines minimum number of network buffers
  22. * to be refilled in the RXDMA monitor buffer ring at init, remaining
  23. * buffers are replenished at the time of monitor vap creation
  24. */
  25. #define MON_BUF_MIN_ENTRIES 64
  26. /*
  27. * The below macro defines the maximum number of ring entries that would
  28. * be processed in a single instance when processing each of the non-monitoring
  29. * RXDMA2SW ring.
  30. */
  31. #define MON_DROP_REAP_LIMIT 64
  32. /*
  33. * The maximum headroom reserved for monitor destination buffer to
  34. * accomodate radiotap header and protocol flow tag
  35. */
  36. #ifdef DP_RX_MON_MEM_FRAG
  37. /*
  38. * -------------------------------------------------
  39. * | Protocol & Flow TAG | Radiotap header|
  40. * | | Length(128 B) |
  41. * | ((4* QDF_NBUF_MAX_FRAGS) * 2) | |
  42. * -------------------------------------------------
  43. */
  44. #define DP_RX_MON_MAX_RADIO_TAP_HDR (128)
  45. #define DP_RX_MON_PF_TAG_LEN_PER_FRAG (4)
  46. #define DP_RX_MON_TOT_PF_TAG_LEN \
  47. ((DP_RX_MON_PF_TAG_LEN_PER_FRAG) * (QDF_NBUF_MAX_FRAGS))
  48. #define DP_RX_MON_MAX_MONITOR_HEADER \
  49. ((DP_RX_MON_TOT_PF_TAG_LEN * 2) + (DP_RX_MON_MAX_RADIO_TAP_HDR))
  50. #endif
  51. /* The maximum buffer length allocated for radiotap for monitor status buffer */
  52. #define MAX_MONITOR_HEADER (512)
  53. /* l2 header pad byte in case of Raw frame is Zero and 2 in non raw */
  54. #define DP_RX_MON_RAW_L2_HDR_PAD_BYTE (0)
  55. #define DP_RX_MON_NONRAW_L2_HDR_PAD_BYTE (2)
  56. /**
  57. * enum dp_mon_reap_status - monitor status ring ppdu status
  58. *
  59. * @DP_MON_STATUS_NO_DMA - DMA not done for status ring entry
  60. * @DP_MON_STATUS_MATCH - status and dest ppdu id mathes
  61. * @DP_MON_STATUS_LAG - status ppdu id is lagging
  62. * @DP_MON_STATUS_LEAD - status ppdu id is leading
  63. * @DP_MON_STATUS_REPLENISH - status ring entry is NULL
  64. */
  65. enum dp_mon_reap_status {
  66. DP_MON_STATUS_NO_DMA,
  67. DP_MON_STATUS_MATCH,
  68. DP_MON_STATUS_LAG,
  69. DP_MON_STATUS_LEAD,
  70. DP_MON_STATUS_REPLENISH
  71. };
  72. /*
  73. * dp_rx_mon_status_process() - Process monitor status ring and
  74. * TLV in status ring.
  75. *
  76. * @soc: core txrx main context
  77. * @int_ctx: interrupt context
  78. * @mac_id: mac_id which is one of 3 mac_ids
  79. * @quota: No. of ring entry that can be serviced in one shot.
  80. * Return: uint32_t: No. of ring entry that is processed.
  81. */
  82. uint32_t
  83. dp_rx_mon_status_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  84. uint32_t mac_id, uint32_t quota);
  85. /**
  86. * dp_rx_mon_dest_process() - Brain of the Rx processing functionality
  87. * Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
  88. * @soc: core txrx main contex
  89. * @int_ctx: interrupt context
  90. * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
  91. * @quota: No. of units (packets) that can be serviced in one shot.
  92. *
  93. * This function implements the core of Rx functionality. This is
  94. * expected to handle only non-error frames.
  95. *
  96. * Return: none
  97. */
  98. void dp_rx_mon_dest_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  99. uint32_t mac_id, uint32_t quota);
  100. QDF_STATUS dp_rx_pdev_mon_desc_pool_alloc(struct dp_pdev *pdev);
  101. QDF_STATUS dp_rx_pdev_mon_buffers_alloc(struct dp_pdev *pdev);
  102. void dp_rx_pdev_mon_buffers_free(struct dp_pdev *pdev);
  103. void dp_rx_pdev_mon_desc_pool_init(struct dp_pdev *pdev);
  104. void dp_rx_pdev_mon_desc_pool_deinit(struct dp_pdev *pdev);
  105. void dp_rx_pdev_mon_desc_pool_free(struct dp_pdev *pdev);
  106. void dp_rx_pdev_mon_buf_buffers_free(struct dp_pdev *pdev, uint32_t mac_id);
  107. QDF_STATUS dp_rx_pdev_mon_status_buffers_alloc(struct dp_pdev *pdev,
  108. uint32_t mac_id);
  109. QDF_STATUS dp_rx_pdev_mon_status_desc_pool_alloc(struct dp_pdev *pdev,
  110. uint32_t mac_id);
  111. void dp_rx_pdev_mon_status_desc_pool_init(struct dp_pdev *pdev,
  112. uint32_t mac_id);
  113. void dp_rx_pdev_mon_status_desc_pool_deinit(struct dp_pdev *pdev,
  114. uint32_t mac_id);
  115. void dp_rx_pdev_mon_status_desc_pool_free(struct dp_pdev *pdev,
  116. uint32_t mac_id);
  117. void dp_rx_pdev_mon_status_buffers_free(struct dp_pdev *pdev, uint32_t mac_id);
  118. QDF_STATUS
  119. dp_rx_pdev_mon_buf_buffers_alloc(struct dp_pdev *pdev, uint32_t mac_id,
  120. bool delayed_replenish);
  121. /**
  122. * dp_rx_mon_handle_status_buf_done () - Handle DMA not done case for
  123. * monitor status ring
  124. *
  125. * @pdev: DP pdev handle
  126. * @mon_status_srng: Monitor status SRNG
  127. *
  128. * Return: enum dp_mon_reap_status
  129. */
  130. enum dp_mon_reap_status
  131. dp_rx_mon_handle_status_buf_done(struct dp_pdev *pdev,
  132. void *mon_status_srng);
  133. #ifdef QCA_SUPPORT_FULL_MON
  134. /**
  135. * dp_full_mon_attach() - Full monitor mode attach
  136. * This API initilises full monitor mode resources
  137. *
  138. * @pdev: dp pdev object
  139. *
  140. * Return: void
  141. *
  142. */
  143. void dp_full_mon_attach(struct dp_pdev *pdev);
  144. /**
  145. * dp_full_mon_detach() - Full monitor mode attach
  146. * This API deinitilises full monitor mode resources
  147. *
  148. * @pdev: dp pdev object
  149. *
  150. * Return: void
  151. *
  152. */
  153. void dp_full_mon_detach(struct dp_pdev *pdev);
  154. /**
  155. * dp_rx_mon_process ()- API to process monitor destination ring for
  156. * full monitor mode
  157. *
  158. * @soc: dp soc handle
  159. * @int_ctx: interrupt context
  160. * @mac_id: lmac id
  161. * @quota: No. of ring entry that can be serviced in one shot.
  162. */
  163. uint32_t dp_rx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  164. uint32_t mac_id, uint32_t quota);
  165. #else
  166. /**
  167. * dp_full_mon_attach() - attach full monitor mode resources
  168. * @pdev: Datapath PDEV handle
  169. *
  170. * Return: void
  171. */
  172. static inline void dp_full_mon_attach(struct dp_pdev *pdev)
  173. {
  174. }
  175. /**
  176. * dp_full_mon_detach() - detach full monitor mode resources
  177. * @pdev: Datapath PDEV handle
  178. *
  179. * Return: void
  180. *
  181. */
  182. static inline void dp_full_mon_detach(struct dp_pdev *pdev)
  183. {
  184. }
  185. #endif
  186. /**
  187. * dp_reset_monitor_mode() - Disable monitor mode
  188. * @pdev_handle: Datapath PDEV handle
  189. *
  190. * Return: QDF_STATUS
  191. */
  192. QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl,
  193. uint8_t pdev_id,
  194. uint8_t smart_monitor);
  195. /**
  196. * dp_mon_link_free() - free monitor link desc pool
  197. * @pdev: core txrx pdev context
  198. *
  199. * This function will release DP link desc pool for monitor mode from
  200. * main device context.
  201. *
  202. * Return: QDF_STATUS_SUCCESS: success
  203. * QDF_STATUS_E_RESOURCES: Error return
  204. */
  205. QDF_STATUS dp_mon_link_free(struct dp_pdev *pdev);
  206. /**
  207. * dp_mon_process() - Main monitor mode processing roution.
  208. * @soc: core txrx main context
  209. * @int_ctx: interrupt context
  210. * @mac_id: mac_id which is one of 3 mac_ids
  211. * @quota: No. of status ring entry that can be serviced in one shot.
  212. *
  213. * This call monitor status ring process then monitor
  214. * destination ring process.
  215. * Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
  216. *
  217. * Return: uint32_t: No. of ring entry that is processed.
  218. */
  219. uint32_t dp_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  220. uint32_t mac_id, uint32_t quota);
  221. /**
  222. * dp_mon_drop_packets_for_mac() - Drop the mon status ring and
  223. * dest ring packets for a given mac. Packets in status ring and
  224. * dest ring are dropped independently.
  225. * @pdev: DP pdev
  226. * @mac_id: mac id
  227. * @quota: max number of status ring entries that can be processed
  228. *
  229. * Return: work done
  230. */
  231. uint32_t dp_mon_drop_packets_for_mac(struct dp_pdev *pdev, uint32_t mac_id,
  232. uint32_t quota);
  233. QDF_STATUS dp_rx_mon_deliver(struct dp_soc *soc, uint32_t mac_id,
  234. qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu);
  235. /*
  236. * dp_rx_mon_deliver_non_std() - deliver frames for non standard path
  237. * @soc: core txrx main contex
  238. * @mac_id: MAC ID
  239. *
  240. * This function delivers the radio tap and dummy MSDU
  241. * into user layer application for preamble only PPDU.
  242. *
  243. * Return: Operation status
  244. */
  245. QDF_STATUS dp_rx_mon_deliver_non_std(struct dp_soc *soc, uint32_t mac_id);
  246. /**
  247. * dp_rxdma_err_process() - RxDMA error processing functionality
  248. * @soc: core txrx main contex
  249. * @mac_id: mac id which is one of 3 mac_ids
  250. * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
  251. * @quota: No. of units (packets) that can be serviced in one shot.
  252. *
  253. * Return: num of buffers processed
  254. */
  255. uint32_t dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
  256. uint32_t mac_id, uint32_t quota);
  257. /**
  258. * dp_mon_buf_delayed_replenish() - Helper routine to replenish monitor dest buf
  259. * @pdev: DP pdev object
  260. *
  261. * Return: None
  262. */
  263. void dp_mon_buf_delayed_replenish(struct dp_pdev *pdev);
  264. /**
  265. * dp_rx_mon_link_desc_return() - Return a MPDU link descriptor to HW
  266. * (WBM), following error handling
  267. *
  268. * @dp_pdev: core txrx pdev context
  269. * @buf_addr_info: void pointer to monitor link descriptor buf addr info
  270. * Return: QDF_STATUS
  271. */
  272. QDF_STATUS
  273. dp_rx_mon_link_desc_return(struct dp_pdev *dp_pdev,
  274. hal_buff_addrinfo_t buf_addr_info,
  275. int mac_id);
  276. /**
  277. * dp_mon_adjust_frag_len() - MPDU and MSDU may spread across
  278. * multiple nbufs. This function
  279. * is to return data length in
  280. * fragmented buffer
  281. *
  282. * @total_len: pointer to remaining data length.
  283. * @frag_len: pointer to data length in this fragment.
  284. * @l2_hdr_pad: l2 header padding
  285. */
  286. static inline void dp_mon_adjust_frag_len(uint32_t *total_len,
  287. uint32_t *frag_len,
  288. uint16_t l2_hdr_pad)
  289. {
  290. if (*total_len >= (RX_MONITOR_BUFFER_SIZE - RX_PKT_TLVS_LEN)) {
  291. *frag_len = RX_MONITOR_BUFFER_SIZE - RX_PKT_TLVS_LEN -
  292. l2_hdr_pad;
  293. *total_len -= *frag_len;
  294. } else {
  295. *frag_len = *total_len;
  296. *total_len = 0;
  297. }
  298. }
  299. /**
  300. * dp_rx_mon_frag_adjust_frag_len() - MPDU and MSDU may spread across
  301. * multiple nbufs. This function is to return data length in
  302. * fragmented buffer.
  303. * It takes input as max_limit for any buffer(as it changes based
  304. * on decap type and buffer sequence in MSDU.
  305. *
  306. * If MSDU is divided into multiple buffer then below format will
  307. * be max limit.
  308. * Decap type Non-Raw
  309. *--------------------------------
  310. *| 1st | 2nd | ... | Last |
  311. *| 1662 | 1664 | 1664 | <=1664 |
  312. *--------------------------------
  313. * Decap type Raw
  314. *--------------------------------
  315. *| 1st | 2nd | ... | Last |
  316. *| 1664 | 1664 | 1664 | <=1664 |
  317. *--------------------------------
  318. *
  319. * It also calculate if current buffer has placeholder to keep padding byte.
  320. * --------------------------------
  321. * | MAX LIMIT(1662/1664) |
  322. * --------------------------------
  323. * | Actual Data | Pad byte Pholder |
  324. * --------------------------------
  325. *
  326. * @total_len: Remaining data length.
  327. * @frag_len: Data length in this fragment.
  328. * @max_limit: Max limit of current buffer/MSDU.
  329. */
  330. #ifdef DP_RX_MON_MEM_FRAG
  331. static inline
  332. void dp_rx_mon_frag_adjust_frag_len(uint32_t *total_len, uint32_t *frag_len,
  333. uint32_t max_limit)
  334. {
  335. if (*total_len >= max_limit) {
  336. *frag_len = max_limit;
  337. *total_len -= *frag_len;
  338. } else {
  339. *frag_len = *total_len;
  340. *total_len = 0;
  341. }
  342. }
  343. /**
  344. * DP_RX_MON_GET_NBUF_FROM_DESC() - Get nbuf from desc
  345. */
  346. #define DP_RX_MON_GET_NBUF_FROM_DESC(rx_desc) \
  347. NULL
  348. /**
  349. * dp_rx_mon_add_msdu_to_list_failure_handler() - Handler for nbuf buffer
  350. * attach failure
  351. *
  352. * @rx_tlv_hdr: rx_tlv_hdr
  353. * @pdev: struct dp_pdev *
  354. * @last: skb pointing to last skb in chained list at any moment
  355. * @head_msdu: parent skb in the chained list
  356. * @tail_msdu: Last skb in the chained list
  357. * @func_name: caller function name
  358. *
  359. * Return: void
  360. */
  361. static inline void
  362. dp_rx_mon_add_msdu_to_list_failure_handler(void *rx_tlv_hdr,
  363. struct dp_pdev *pdev,
  364. qdf_nbuf_t *last,
  365. qdf_nbuf_t *head_msdu,
  366. qdf_nbuf_t *tail_msdu,
  367. const char *func_name)
  368. {
  369. DP_STATS_INC(pdev, replenish.nbuf_alloc_fail, 1);
  370. qdf_frag_free(rx_tlv_hdr);
  371. if (head_msdu)
  372. qdf_nbuf_list_free(*head_msdu);
  373. dp_err("[%s] failed to allocate subsequent parent buffer to hold all frag\n",
  374. func_name);
  375. if (head_msdu)
  376. *head_msdu = NULL;
  377. if (last)
  378. *last = NULL;
  379. if (tail_msdu)
  380. *tail_msdu = NULL;
  381. }
  382. /**
  383. * dp_rx_mon_get_paddr_from_desc() - Get paddr from desc
  384. */
  385. static inline
  386. qdf_dma_addr_t dp_rx_mon_get_paddr_from_desc(struct dp_rx_desc *rx_desc)
  387. {
  388. return rx_desc->paddr_buf_start;
  389. }
  390. /**
  391. * DP_RX_MON_IS_BUFFER_ADDR_NULL() - Is Buffer received from hw is NULL
  392. */
  393. #define DP_RX_MON_IS_BUFFER_ADDR_NULL(rx_desc) \
  394. (!(rx_desc->rx_buf_start))
  395. #define DP_RX_MON_IS_MSDU_NOT_NULL(msdu) \
  396. true
  397. /**
  398. * dp_rx_mon_buffer_free() - Free nbuf or frag memory
  399. * Free nbuf if feature is disabled, else free frag.
  400. *
  401. * @rx_desc: Rx desc
  402. */
  403. static inline void
  404. dp_rx_mon_buffer_free(struct dp_rx_desc *rx_desc)
  405. {
  406. qdf_frag_free(rx_desc->rx_buf_start);
  407. }
  408. /**
  409. * dp_rx_mon_buffer_unmap() - Unmap nbuf or frag memory
  410. * Unmap nbuf if feature is disabled, else unmap frag.
  411. *
  412. * @soc: struct dp_soc *
  413. * @rx_desc: struct dp_rx_desc *
  414. * @size: Size to be unmapped
  415. */
  416. static inline void
  417. dp_rx_mon_buffer_unmap(struct dp_soc *soc, struct dp_rx_desc *rx_desc,
  418. uint16_t size)
  419. {
  420. qdf_mem_unmap_page(soc->osdev, rx_desc->paddr_buf_start,
  421. size, QDF_DMA_FROM_DEVICE);
  422. }
  423. /**
  424. * dp_rx_mon_alloc_parent_buffer() - Allocate parent buffer to hold
  425. * radiotap header and accommodate all frag memory in nr_frag.
  426. *
  427. * @head_msdu: Ptr to hold allocated Msdu
  428. *
  429. * Return: QDF_STATUS
  430. */
  431. static inline
  432. QDF_STATUS dp_rx_mon_alloc_parent_buffer(qdf_nbuf_t *head_msdu)
  433. {
  434. /*
  435. * Headroom should accommodate radiotap header
  436. * and protocol and flow tag for all frag
  437. * Length reserved to accommodate Radiotap header
  438. * is 128 bytes and length reserved for Protocol
  439. * flow tag will vary based on QDF_NBUF_MAX_FRAGS.
  440. */
  441. /* -------------------------------------------------
  442. * | Protocol & Flow TAG | Radiotap header|
  443. * | | Length(128 B) |
  444. * | ((4* QDF_NBUF_MAX_FRAGS) * 2) | |
  445. * -------------------------------------------------
  446. */
  447. *head_msdu = qdf_nbuf_alloc_no_recycler(DP_RX_MON_MAX_MONITOR_HEADER,
  448. DP_RX_MON_MAX_MONITOR_HEADER, 4);
  449. if (!(*head_msdu))
  450. return QDF_STATUS_E_FAILURE;
  451. qdf_mem_zero(qdf_nbuf_head(*head_msdu), qdf_nbuf_headroom(*head_msdu));
  452. /* Set *head_msdu->next as NULL as all msdus are
  453. * mapped via nr frags
  454. */
  455. qdf_nbuf_set_next(*head_msdu, NULL);
  456. return QDF_STATUS_SUCCESS;
  457. }
  458. /**
  459. * dp_rx_mon_parse_desc_buffer() - Parse desc buffer based.
  460. *
  461. * Below code will parse desc buffer, handle continuation frame,
  462. * adjust frag length and update l2_hdr_padding
  463. *
  464. * @soc : struct dp_soc*
  465. * @msdu_info : struct hal_rx_msdu_desc_info*
  466. * @is_frag_p : is_frag *
  467. * @total_frag_len_p : Remaining frag len to be updated
  468. * @frag_len_p : frag len
  469. * @l2_hdr_offset_p : l2 hdr offset
  470. * @rx_desc_tlv : rx_desc_tlv
  471. * @is_frag_non_raw_p : Non raw frag
  472. * @data : NBUF Data
  473. */
  474. static inline void
  475. dp_rx_mon_parse_desc_buffer(struct dp_soc *dp_soc,
  476. struct hal_rx_msdu_desc_info *msdu_info,
  477. bool *is_frag_p, uint32_t *total_frag_len_p,
  478. uint32_t *frag_len_p, uint16_t *l2_hdr_offset_p,
  479. qdf_frag_t rx_desc_tlv,
  480. bool *is_frag_non_raw_p, void *data)
  481. {
  482. struct hal_rx_mon_dest_buf_info frame_info;
  483. uint16_t tot_payload_len =
  484. RX_MONITOR_BUFFER_SIZE - RX_PKT_TLVS_LEN;
  485. if (msdu_info->msdu_flags & HAL_MSDU_F_MSDU_CONTINUATION) {
  486. /* First buffer of MSDU */
  487. if (!(*is_frag_p)) {
  488. /* Set total frag_len from msdu_len */
  489. *total_frag_len_p = msdu_info->msdu_len;
  490. *is_frag_p = true;
  491. if (HAL_HW_RX_DECAP_FORMAT_RAW ==
  492. HAL_RX_DESC_GET_DECAP_FORMAT(rx_desc_tlv)) {
  493. *l2_hdr_offset_p =
  494. DP_RX_MON_RAW_L2_HDR_PAD_BYTE;
  495. frame_info.is_decap_raw = 1;
  496. } else {
  497. *l2_hdr_offset_p =
  498. DP_RX_MON_NONRAW_L2_HDR_PAD_BYTE;
  499. frame_info.is_decap_raw = 0;
  500. *is_frag_non_raw_p = true;
  501. }
  502. dp_rx_mon_frag_adjust_frag_len(total_frag_len_p,
  503. frag_len_p,
  504. tot_payload_len -
  505. *l2_hdr_offset_p);
  506. frame_info.first_buffer = 1;
  507. frame_info.last_buffer = 0;
  508. hal_rx_mon_dest_set_buffer_info_to_tlv(rx_desc_tlv,
  509. &frame_info);
  510. } else {
  511. /*
  512. * Continuation Middle frame
  513. * Here max limit will be same for Raw and Non raw case.
  514. */
  515. *l2_hdr_offset_p = DP_RX_MON_RAW_L2_HDR_PAD_BYTE;
  516. dp_rx_mon_frag_adjust_frag_len(total_frag_len_p,
  517. frag_len_p,
  518. tot_payload_len);
  519. /* Update frame info if is non raw frame */
  520. if (*is_frag_non_raw_p)
  521. frame_info.is_decap_raw = 0;
  522. else
  523. frame_info.is_decap_raw = 1;
  524. frame_info.first_buffer = 0;
  525. frame_info.last_buffer = 0;
  526. hal_rx_mon_dest_set_buffer_info_to_tlv(rx_desc_tlv,
  527. &frame_info);
  528. }
  529. } else {
  530. /**
  531. * Last buffer of MSDU spread among multiple buffer
  532. * Here max limit will be same for Raw and Non raw case.
  533. */
  534. if (*is_frag_p) {
  535. *l2_hdr_offset_p = DP_RX_MON_RAW_L2_HDR_PAD_BYTE;
  536. dp_rx_mon_frag_adjust_frag_len(total_frag_len_p,
  537. frag_len_p,
  538. tot_payload_len);
  539. /* Update frame info if is non raw frame */
  540. if (*is_frag_non_raw_p)
  541. frame_info.is_decap_raw = 0;
  542. else
  543. frame_info.is_decap_raw = 1;
  544. frame_info.first_buffer = 0;
  545. frame_info.last_buffer = 1;
  546. hal_rx_mon_dest_set_buffer_info_to_tlv(rx_desc_tlv,
  547. &frame_info);
  548. } else {
  549. /* MSDU with single buffer */
  550. *frag_len_p = msdu_info->msdu_len;
  551. if (HAL_HW_RX_DECAP_FORMAT_RAW ==
  552. HAL_RX_DESC_GET_DECAP_FORMAT(rx_desc_tlv)) {
  553. *l2_hdr_offset_p =
  554. DP_RX_MON_RAW_L2_HDR_PAD_BYTE;
  555. frame_info.is_decap_raw = 1;
  556. } else {
  557. *l2_hdr_offset_p =
  558. DP_RX_MON_NONRAW_L2_HDR_PAD_BYTE;
  559. frame_info.is_decap_raw = 0;
  560. }
  561. frame_info.first_buffer = 1;
  562. frame_info.last_buffer = 1;
  563. hal_rx_mon_dest_set_buffer_info_to_tlv(
  564. rx_desc_tlv, &frame_info);
  565. }
  566. /* Reset bool after complete processing of MSDU */
  567. *is_frag_p = false;
  568. *is_frag_non_raw_p = false;
  569. }
  570. }
  571. /**
  572. * dp_rx_mon_buffer_set_pktlen() - set pktlen for buffer
  573. */
  574. static inline void dp_rx_mon_buffer_set_pktlen(qdf_nbuf_t msdu, uint32_t size)
  575. {
  576. }
  577. /**
  578. * dp_rx_mon_add_msdu_to_list()- Add msdu to list and update head_msdu
  579. * It will add reaped buffer frag to nr frag of parent msdu.
  580. *
  581. * @head_msdu: NULL if first time called else &msdu
  582. * @msdu: Msdu where frag address needs to be added via nr_frag
  583. * @last: Used to traverse in list if this feature is disabled.
  584. * @rx_desc_tlv: Frag address
  585. * @frag_len: Frag len
  586. * @l2_hdr_offset: l2 hdr padding
  587. */
  588. static inline
  589. QDF_STATUS dp_rx_mon_add_msdu_to_list(qdf_nbuf_t *head_msdu, qdf_nbuf_t msdu,
  590. qdf_nbuf_t *last, qdf_frag_t rx_desc_tlv,
  591. uint32_t frag_len,
  592. uint32_t l2_hdr_offset)
  593. {
  594. uint32_t num_frags;
  595. qdf_nbuf_t msdu_curr;
  596. /* Here head_msdu and *head_msdu must not be NULL */
  597. /* Dont add frag to skb if frag length is zero. Drop frame */
  598. if (qdf_unlikely(!frag_len || !head_msdu || !(*head_msdu))) {
  599. dp_err("[%s] frag_len[%d] || head_msdu[%pK] || *head_msdu is Null while adding frag to skb\n",
  600. __func__, frag_len, head_msdu);
  601. return QDF_STATUS_E_FAILURE;
  602. }
  603. /* In case of first desc of MPDU, assign curr msdu to *head_msdu */
  604. if (!qdf_nbuf_get_nr_frags(*head_msdu))
  605. msdu_curr = *head_msdu;
  606. else
  607. msdu_curr = *last;
  608. /* Current msdu must not be NULL */
  609. if (qdf_unlikely(!msdu_curr)) {
  610. dp_err("[%s] Current msdu can't be Null while adding frag to skb\n",
  611. __func__);
  612. return QDF_STATUS_E_FAILURE;
  613. }
  614. num_frags = qdf_nbuf_get_nr_frags(msdu_curr);
  615. if (num_frags < QDF_NBUF_MAX_FRAGS) {
  616. qdf_nbuf_add_rx_frag(rx_desc_tlv, msdu_curr,
  617. SIZE_OF_MONITOR_TLV,
  618. frag_len + l2_hdr_offset,
  619. RX_MONITOR_BUFFER_SIZE,
  620. false);
  621. if (*last != msdu_curr)
  622. *last = msdu_curr;
  623. return QDF_STATUS_SUCCESS;
  624. }
  625. /* Execution will reach here only if num_frags == QDF_NBUF_MAX_FRAGS */
  626. msdu_curr = NULL;
  627. if ((dp_rx_mon_alloc_parent_buffer(&msdu_curr))
  628. != QDF_STATUS_SUCCESS)
  629. return QDF_STATUS_E_FAILURE;
  630. qdf_nbuf_add_rx_frag(rx_desc_tlv, msdu_curr, SIZE_OF_MONITOR_TLV,
  631. frag_len + l2_hdr_offset, RX_MONITOR_BUFFER_SIZE,
  632. false);
  633. /* Add allocated nbuf in the chain */
  634. qdf_nbuf_set_next(*last, msdu_curr);
  635. /* Assign current msdu to last to avoid traversal */
  636. *last = msdu_curr;
  637. return QDF_STATUS_SUCCESS;
  638. }
  639. /**
  640. * dp_rx_mon_init_tail_msdu() - Initialize tail msdu
  641. *
  642. * @head_msdu: Parent buffer to hold MPDU data
  643. * @msdu: Msdu to be updated in tail_msdu
  644. * @last: last msdu
  645. * @tail_msdu: Last msdu
  646. */
  647. static inline
  648. void dp_rx_mon_init_tail_msdu(qdf_nbuf_t *head_msdu, qdf_nbuf_t msdu,
  649. qdf_nbuf_t last, qdf_nbuf_t *tail_msdu)
  650. {
  651. if (!head_msdu || !(*head_msdu)) {
  652. *tail_msdu = NULL;
  653. return;
  654. }
  655. if (last)
  656. qdf_nbuf_set_next(last, NULL);
  657. *tail_msdu = last;
  658. }
  659. /**
  660. * dp_rx_mon_remove_raw_frame_fcs_len() - Remove FCS length for Raw Frame
  661. *
  662. * If feature is disabled, then removal happens in restitch logic.
  663. *
  664. * @head_msdu: Head msdu
  665. * @tail_msdu: Tail msdu
  666. */
  667. static inline
  668. void dp_rx_mon_remove_raw_frame_fcs_len(qdf_nbuf_t *head_msdu,
  669. qdf_nbuf_t *tail_msdu)
  670. {
  671. qdf_frag_t addr;
  672. if (qdf_unlikely(!head_msdu || !tail_msdu || !(*head_msdu)))
  673. return;
  674. /* If *head_msdu is valid, then *tail_msdu must be valid */
  675. /* If head_msdu is valid, then it must have nr_frags */
  676. /* If tail_msdu is valid, then it must have nr_frags */
  677. /* Strip FCS_LEN for Raw frame */
  678. addr = qdf_nbuf_get_frag_addr(*head_msdu, 0);
  679. addr -= SIZE_OF_MONITOR_TLV;
  680. if (HAL_RX_DESC_GET_DECAP_FORMAT(addr) ==
  681. HAL_HW_RX_DECAP_FORMAT_RAW) {
  682. qdf_nbuf_trim_add_frag_size(*tail_msdu,
  683. qdf_nbuf_get_nr_frags(*tail_msdu) - 1,
  684. -HAL_RX_FCS_LEN, 0);
  685. }
  686. }
  687. /**
  688. * dp_rx_mon_get_buffer_data()- Get data from desc buffer
  689. * @rx_desc: desc
  690. *
  691. * Return address containing actual tlv content
  692. */
  693. static inline
  694. uint8_t *dp_rx_mon_get_buffer_data(struct dp_rx_desc *rx_desc)
  695. {
  696. return rx_desc->rx_buf_start;
  697. }
  698. /**
  699. * dp_rx_mon_get_nbuf_80211_hdr() - Get 80211 hdr from nbuf
  700. * @nbuf: qdf_nbuf_t
  701. *
  702. * This function must be called after moving radiotap header.
  703. *
  704. * Return: Ptr pointing to 80211 header or NULL.
  705. */
  706. static inline
  707. qdf_frag_t dp_rx_mon_get_nbuf_80211_hdr(qdf_nbuf_t nbuf)
  708. {
  709. /* Return NULL if nr_frag is Zero */
  710. if (!qdf_nbuf_get_nr_frags(nbuf))
  711. return NULL;
  712. return qdf_nbuf_get_frag_addr(nbuf, 0);
  713. }
  714. #else
  715. #define DP_RX_MON_GET_NBUF_FROM_DESC(rx_desc) \
  716. (rx_desc->nbuf)
  717. static inline void
  718. dp_rx_mon_add_msdu_to_list_failure_handler(void *rx_tlv_hdr,
  719. struct dp_pdev *pdev,
  720. qdf_nbuf_t *last,
  721. qdf_nbuf_t *head_msdu,
  722. qdf_nbuf_t *tail_msdu,
  723. const char *func_name)
  724. {
  725. }
  726. static inline
  727. qdf_dma_addr_t dp_rx_mon_get_paddr_from_desc(struct dp_rx_desc *rx_desc)
  728. {
  729. qdf_dma_addr_t paddr = 0;
  730. qdf_nbuf_t msdu = NULL;
  731. msdu = rx_desc->nbuf;
  732. if (msdu)
  733. paddr = qdf_nbuf_get_frag_paddr(msdu, 0);
  734. return paddr;
  735. }
  736. #define DP_RX_MON_IS_BUFFER_ADDR_NULL(rx_desc) \
  737. (!(rx_desc->nbuf))
  738. #define DP_RX_MON_IS_MSDU_NOT_NULL(msdu) \
  739. (msdu)
  740. static inline void
  741. dp_rx_mon_buffer_free(struct dp_rx_desc *rx_desc)
  742. {
  743. qdf_nbuf_free(rx_desc->nbuf);
  744. }
  745. static inline void
  746. dp_rx_mon_buffer_unmap(struct dp_soc *soc, struct dp_rx_desc *rx_desc,
  747. uint16_t size)
  748. {
  749. qdf_nbuf_unmap_nbytes_single(soc->osdev, rx_desc->nbuf,
  750. QDF_DMA_FROM_DEVICE, size);
  751. }
  752. static inline
  753. QDF_STATUS dp_rx_mon_alloc_parent_buffer(qdf_nbuf_t *head_msdu)
  754. {
  755. return QDF_STATUS_SUCCESS;
  756. }
  757. static inline void
  758. dp_rx_mon_parse_desc_buffer(struct dp_soc *dp_soc,
  759. struct hal_rx_msdu_desc_info *msdu_info,
  760. bool *is_frag_p, uint32_t *total_frag_len_p,
  761. uint32_t *frag_len_p, uint16_t *l2_hdr_offset_p,
  762. qdf_frag_t rx_desc_tlv,
  763. bool *is_frag_non_raw_p, void *data)
  764. {
  765. /*
  766. * HW structures call this L3 header padding
  767. * -- even though this is actually the offset
  768. * from the buffer beginning where the L2
  769. * header begins.
  770. */
  771. *l2_hdr_offset_p =
  772. hal_rx_msdu_end_l3_hdr_padding_get(dp_soc->hal_soc, data);
  773. if (msdu_info->msdu_flags & HAL_MSDU_F_MSDU_CONTINUATION) {
  774. if (!*(is_frag_p)) {
  775. *total_frag_len_p = msdu_info->msdu_len;
  776. *is_frag_p = true;
  777. }
  778. dp_mon_adjust_frag_len(total_frag_len_p, frag_len_p,
  779. *l2_hdr_offset_p);
  780. } else {
  781. if (*is_frag_p) {
  782. dp_mon_adjust_frag_len(total_frag_len_p, frag_len_p,
  783. *l2_hdr_offset_p);
  784. } else {
  785. *frag_len_p = msdu_info->msdu_len;
  786. }
  787. *is_frag_p = false;
  788. }
  789. }
  790. static inline void dp_rx_mon_buffer_set_pktlen(qdf_nbuf_t msdu, uint32_t size)
  791. {
  792. qdf_nbuf_set_pktlen(msdu, size);
  793. }
  794. static inline
  795. QDF_STATUS dp_rx_mon_add_msdu_to_list(qdf_nbuf_t *head_msdu, qdf_nbuf_t msdu,
  796. qdf_nbuf_t *last, qdf_frag_t rx_desc_tlv,
  797. uint32_t frag_len,
  798. uint32_t l2_hdr_offset)
  799. {
  800. if (head_msdu && !*head_msdu) {
  801. *head_msdu = msdu;
  802. } else {
  803. if (*last)
  804. qdf_nbuf_set_next(*last, msdu);
  805. }
  806. *last = msdu;
  807. return QDF_STATUS_SUCCESS;
  808. }
  809. static inline
  810. void dp_rx_mon_init_tail_msdu(qdf_nbuf_t *head_msdu, qdf_nbuf_t msdu,
  811. qdf_nbuf_t last, qdf_nbuf_t *tail_msdu)
  812. {
  813. if (last)
  814. qdf_nbuf_set_next(last, NULL);
  815. *tail_msdu = msdu;
  816. }
  817. static inline
  818. void dp_rx_mon_remove_raw_frame_fcs_len(qdf_nbuf_t *head_msdu,
  819. qdf_nbuf_t *tail_msdu)
  820. {
  821. }
  822. static inline
  823. uint8_t *dp_rx_mon_get_buffer_data(struct dp_rx_desc *rx_desc)
  824. {
  825. qdf_nbuf_t msdu = NULL;
  826. uint8_t *data = NULL;
  827. msdu = rx_desc->nbuf;
  828. if (qdf_likely(msdu))
  829. data = qdf_nbuf_data(msdu);
  830. return data;
  831. }
  832. static inline
  833. qdf_frag_t dp_rx_mon_get_nbuf_80211_hdr(qdf_nbuf_t nbuf)
  834. {
  835. return qdf_nbuf_data(nbuf);
  836. }
  837. #endif
  838. /**
  839. * dp_rx_cookie_2_mon_link_desc() - Retrieve Link descriptor based on target
  840. * @pdev: core physical device context
  841. * @hal_buf_info: structure holding the buffer info
  842. * mac_id: mac number
  843. *
  844. * Return: link descriptor address
  845. */
  846. static inline
  847. void *dp_rx_cookie_2_mon_link_desc(struct dp_pdev *pdev,
  848. struct hal_buf_info buf_info,
  849. uint8_t mac_id)
  850. {
  851. if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
  852. return dp_rx_cookie_2_mon_link_desc_va(pdev, &buf_info,
  853. mac_id);
  854. return dp_rx_cookie_2_link_desc_va(pdev->soc, &buf_info);
  855. }
  856. /**
  857. * dp_rx_monitor_link_desc_return() - Return Link descriptor based on target
  858. * @pdev: core physical device context
  859. * @p_last_buf_addr_info: MPDU Link descriptor
  860. * mac_id: mac number
  861. *
  862. * Return: QDF_STATUS
  863. */
  864. static inline
  865. QDF_STATUS dp_rx_monitor_link_desc_return(struct dp_pdev *pdev,
  866. hal_buff_addrinfo_t
  867. p_last_buf_addr_info,
  868. uint8_t mac_id, uint8_t bm_action)
  869. {
  870. if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
  871. return dp_rx_mon_link_desc_return(pdev, p_last_buf_addr_info,
  872. mac_id);
  873. return dp_rx_link_desc_return_by_addr(pdev->soc, p_last_buf_addr_info,
  874. bm_action);
  875. }
  876. /**
  877. * dp_rxdma_get_mon_dst_ring() - Return the pointer to rxdma_err_dst_ring
  878. * or mon_dst_ring based on the target
  879. * @pdev: core physical device context
  880. * @mac_for_pdev: mac_id number
  881. *
  882. * Return: ring address
  883. */
  884. static inline
  885. void *dp_rxdma_get_mon_dst_ring(struct dp_pdev *pdev,
  886. uint8_t mac_for_pdev)
  887. {
  888. if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
  889. return pdev->soc->rxdma_mon_dst_ring[mac_for_pdev].hal_srng;
  890. return pdev->soc->rxdma_err_dst_ring[mac_for_pdev].hal_srng;
  891. }
  892. /**
  893. * dp_rxdma_get_mon_buf_ring() - Return monitor buf ring address
  894. * based on target
  895. * @pdev: core physical device context
  896. * @mac_for_pdev: mac id number
  897. *
  898. * Return: ring address
  899. */
  900. static inline
  901. struct dp_srng *dp_rxdma_get_mon_buf_ring(struct dp_pdev *pdev,
  902. uint8_t mac_for_pdev)
  903. {
  904. if (pdev->soc->wlan_cfg_ctx->rxdma1_enable)
  905. return &pdev->soc->rxdma_mon_buf_ring[mac_for_pdev];
  906. /* For MCL there is only 1 rx refill ring */
  907. return &pdev->soc->rx_refill_buf_ring[0];
  908. }
  909. /**
  910. * dp_rx_get_mon_desc_pool() - Return monitor descriptor pool
  911. * based on target
  912. * @soc: soc handle
  913. * @mac_id: mac id number
  914. * @pdev_id: pdev id number
  915. *
  916. * Return: descriptor pool address
  917. */
  918. static inline
  919. struct rx_desc_pool *dp_rx_get_mon_desc_pool(struct dp_soc *soc,
  920. uint8_t mac_id,
  921. uint8_t pdev_id)
  922. {
  923. if (soc->wlan_cfg_ctx->rxdma1_enable)
  924. return &soc->rx_desc_mon[mac_id];
  925. return &soc->rx_desc_buf[pdev_id];
  926. }
  927. /**
  928. * dp_rx_get_mon_desc() - Return Rx descriptor based on target
  929. * @soc: soc handle
  930. * @cookie: cookie value
  931. *
  932. * Return: Rx descriptor
  933. */
  934. static inline
  935. struct dp_rx_desc *dp_rx_get_mon_desc(struct dp_soc *soc,
  936. uint32_t cookie)
  937. {
  938. if (soc->wlan_cfg_ctx->rxdma1_enable)
  939. return dp_rx_cookie_2_va_mon_buf(soc, cookie);
  940. return dp_rx_cookie_2_va_rxdma_buf(soc, cookie);
  941. }
  942. #ifndef REMOVE_MON_DBG_STATS
  943. /*
  944. * dp_rx_mon_update_dbg_ppdu_stats() - Update status ring TLV count
  945. * @ppdu_info: HAL RX PPDU info retrieved from status ring TLV
  946. * @rx_mon_stats: monitor mode status/destination ring PPDU and MPDU count
  947. *
  948. * Update status ring PPDU start and end count. Keep track TLV state on
  949. * PPDU start and end to find out if start and end is matching. Keep
  950. * track missing PPDU start and end count. Keep track matching PPDU
  951. * start and end count.
  952. *
  953. * Return: None
  954. */
  955. static inline void
  956. dp_rx_mon_update_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  957. struct cdp_pdev_mon_stats *rx_mon_stats)
  958. {
  959. if (ppdu_info->rx_state ==
  960. HAL_RX_MON_PPDU_START) {
  961. rx_mon_stats->status_ppdu_start++;
  962. if (rx_mon_stats->status_ppdu_state
  963. != CDP_MON_PPDU_END)
  964. rx_mon_stats->status_ppdu_end_mis++;
  965. rx_mon_stats->status_ppdu_state
  966. = CDP_MON_PPDU_START;
  967. ppdu_info->rx_state = HAL_RX_MON_PPDU_RESET;
  968. } else if (ppdu_info->rx_state ==
  969. HAL_RX_MON_PPDU_END) {
  970. rx_mon_stats->status_ppdu_end++;
  971. if (rx_mon_stats->status_ppdu_state
  972. != CDP_MON_PPDU_START)
  973. rx_mon_stats->status_ppdu_start_mis++;
  974. else
  975. rx_mon_stats->status_ppdu_compl++;
  976. rx_mon_stats->status_ppdu_state
  977. = CDP_MON_PPDU_END;
  978. ppdu_info->rx_state = HAL_RX_MON_PPDU_RESET;
  979. }
  980. }
  981. /*
  982. * dp_rx_mon_init_dbg_ppdu_stats() - initialization for monitor mode stats
  983. * @ppdu_info: HAL RX PPDU info retrieved from status ring TLV
  984. * @rx_mon_stats: monitor mode status/destination ring PPDU and MPDU count
  985. *
  986. * Return: None
  987. */
  988. static inline void
  989. dp_rx_mon_init_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  990. struct cdp_pdev_mon_stats *rx_mon_stats)
  991. {
  992. ppdu_info->rx_state = HAL_RX_MON_PPDU_END;
  993. rx_mon_stats->status_ppdu_state
  994. = CDP_MON_PPDU_END;
  995. }
  996. #else
  997. static inline void
  998. dp_rx_mon_update_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  999. struct cdp_pdev_mon_stats *rx_mon_stats)
  1000. {
  1001. }
  1002. static inline void
  1003. dp_rx_mon_init_dbg_ppdu_stats(struct hal_rx_ppdu_info *ppdu_info,
  1004. struct cdp_pdev_mon_stats *rx_mon_stats)
  1005. {
  1006. }
  1007. #endif
  1008. #if !defined(DISABLE_MON_CONFIG) && defined(MON_ENABLE_DROP_FOR_MAC)
  1009. /**
  1010. * dp_mon_dest_srng_drop_for_mac() - Drop the mon dest ring packets for
  1011. * a given mac
  1012. * @pdev: DP pdev
  1013. * @mac_id: mac id
  1014. *
  1015. * Return: None
  1016. */
  1017. uint32_t
  1018. dp_mon_dest_srng_drop_for_mac(struct dp_pdev *pdev, uint32_t mac_id);
  1019. #endif
  1020. #endif