dp_rx_mon.h 31 KB

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