dp_rx.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  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_H
  19. #define _DP_RX_H
  20. #include "hal_rx.h"
  21. #include "dp_tx.h"
  22. #include "dp_peer.h"
  23. #include "dp_internal.h"
  24. #ifdef RXDMA_OPTIMIZATION
  25. #ifdef NO_RX_PKT_HDR_TLV
  26. #define RX_BUFFER_ALIGNMENT 0
  27. #else
  28. #define RX_BUFFER_ALIGNMENT 128
  29. #endif /* NO_RX_PKT_HDR_TLV */
  30. #else /* RXDMA_OPTIMIZATION */
  31. #define RX_BUFFER_ALIGNMENT 4
  32. #endif /* RXDMA_OPTIMIZATION */
  33. #ifdef QCA_HOST2FW_RXBUF_RING
  34. #define DP_WBM2SW_RBM HAL_RX_BUF_RBM_SW1_BM
  35. /* RBM value used for re-injecting defragmented packets into REO */
  36. #define DP_DEFRAG_RBM HAL_RX_BUF_RBM_SW3_BM
  37. #else
  38. #define DP_WBM2SW_RBM HAL_RX_BUF_RBM_SW3_BM
  39. #define DP_DEFRAG_RBM DP_WBM2SW_RBM
  40. #endif /* QCA_HOST2FW_RXBUF_RING */
  41. #define RX_BUFFER_RESERVATION 0
  42. #define DP_PEER_METADATA_PEER_ID_MASK 0x0000ffff
  43. #define DP_PEER_METADATA_PEER_ID_SHIFT 0
  44. #define DP_PEER_METADATA_VDEV_ID_MASK 0x003f0000
  45. #define DP_PEER_METADATA_VDEV_ID_SHIFT 16
  46. #define DP_PEER_METADATA_PEER_ID_GET(_peer_metadata) \
  47. (((_peer_metadata) & DP_PEER_METADATA_PEER_ID_MASK) \
  48. >> DP_PEER_METADATA_PEER_ID_SHIFT)
  49. #define DP_PEER_METADATA_VDEV_ID_GET(_peer_metadata) \
  50. (((_peer_metadata) & DP_PEER_METADATA_VDEV_ID_MASK) \
  51. >> DP_PEER_METADATA_VDEV_ID_SHIFT)
  52. #define DP_RX_DESC_MAGIC 0xdec0de
  53. /**
  54. * struct dp_rx_desc
  55. *
  56. * @nbuf : VA of the "skb" posted
  57. * @rx_buf_start : VA of the original Rx buffer, before
  58. * movement of any skb->data pointer
  59. * @cookie : index into the sw array which holds
  60. * the sw Rx descriptors
  61. * Cookie space is 21 bits:
  62. * lower 18 bits -- index
  63. * upper 3 bits -- pool_id
  64. * @pool_id : pool Id for which this allocated.
  65. * Can only be used if there is no flow
  66. * steering
  67. * @in_use rx_desc is in use
  68. * @unmapped used to mark rx_desc an unmapped if the corresponding
  69. * nbuf is already unmapped
  70. */
  71. struct dp_rx_desc {
  72. qdf_nbuf_t nbuf;
  73. uint8_t *rx_buf_start;
  74. uint32_t cookie;
  75. uint8_t pool_id;
  76. #ifdef RX_DESC_DEBUG_CHECK
  77. uint32_t magic;
  78. #endif
  79. uint8_t in_use:1,
  80. unmapped:1;
  81. };
  82. /* RX Descriptor Multi Page memory alloc related */
  83. #define DP_RX_DESC_OFFSET_NUM_BITS 8
  84. #define DP_RX_DESC_PAGE_ID_NUM_BITS 8
  85. #define DP_RX_DESC_POOL_ID_NUM_BITS 4
  86. #define DP_RX_DESC_PAGE_ID_SHIFT DP_RX_DESC_OFFSET_NUM_BITS
  87. #define DP_RX_DESC_POOL_ID_SHIFT \
  88. (DP_RX_DESC_OFFSET_NUM_BITS + DP_RX_DESC_PAGE_ID_NUM_BITS)
  89. #define RX_DESC_MULTI_PAGE_COOKIE_POOL_ID_MASK \
  90. (((1 << DP_RX_DESC_POOL_ID_NUM_BITS) - 1) << DP_RX_DESC_POOL_ID_SHIFT)
  91. #define RX_DESC_MULTI_PAGE_COOKIE_PAGE_ID_MASK \
  92. (((1 << DP_RX_DESC_PAGE_ID_NUM_BITS) - 1) << \
  93. DP_RX_DESC_PAGE_ID_SHIFT)
  94. #define RX_DESC_MULTI_PAGE_COOKIE_OFFSET_MASK \
  95. ((1 << DP_RX_DESC_OFFSET_NUM_BITS) - 1)
  96. #define DP_RX_DESC_MULTI_PAGE_COOKIE_GET_POOL_ID(_cookie) \
  97. (((_cookie) & RX_DESC_MULTI_PAGE_COOKIE_POOL_ID_MASK) >> \
  98. DP_RX_DESC_POOL_ID_SHIFT)
  99. #define DP_RX_DESC_MULTI_PAGE_COOKIE_GET_PAGE_ID(_cookie) \
  100. (((_cookie) & RX_DESC_MULTI_PAGE_COOKIE_PAGE_ID_MASK) >> \
  101. DP_RX_DESC_PAGE_ID_SHIFT)
  102. #define DP_RX_DESC_MULTI_PAGE_COOKIE_GET_OFFSET(_cookie) \
  103. ((_cookie) & RX_DESC_MULTI_PAGE_COOKIE_OFFSET_MASK)
  104. #define RX_DESC_COOKIE_INDEX_SHIFT 0
  105. #define RX_DESC_COOKIE_INDEX_MASK 0x3ffff /* 18 bits */
  106. #define RX_DESC_COOKIE_POOL_ID_SHIFT 18
  107. #define RX_DESC_COOKIE_POOL_ID_MASK 0x1c0000
  108. #define DP_RX_DESC_COOKIE_MAX \
  109. (RX_DESC_COOKIE_INDEX_MASK | RX_DESC_COOKIE_POOL_ID_MASK)
  110. #define DP_RX_DESC_COOKIE_POOL_ID_GET(_cookie) \
  111. (((_cookie) & RX_DESC_COOKIE_POOL_ID_MASK) >> \
  112. RX_DESC_COOKIE_POOL_ID_SHIFT)
  113. #define DP_RX_DESC_COOKIE_INDEX_GET(_cookie) \
  114. (((_cookie) & RX_DESC_COOKIE_INDEX_MASK) >> \
  115. RX_DESC_COOKIE_INDEX_SHIFT)
  116. /* DOC: Offset to obtain LLC hdr
  117. *
  118. * In the case of Wifi parse error
  119. * to reach LLC header from beginning
  120. * of VLAN tag we need to skip 8 bytes.
  121. * Vlan_tag(4)+length(2)+length added
  122. * by HW(2) = 8 bytes.
  123. */
  124. #define DP_SKIP_VLAN 8
  125. /**
  126. * struct dp_rx_cached_buf - rx cached buffer
  127. * @list: linked list node
  128. * @buf: skb buffer
  129. */
  130. struct dp_rx_cached_buf {
  131. qdf_list_node_t node;
  132. qdf_nbuf_t buf;
  133. };
  134. /*
  135. *dp_rx_xor_block() - xor block of data
  136. *@b: destination data block
  137. *@a: source data block
  138. *@len: length of the data to process
  139. *
  140. *Returns: None
  141. */
  142. static inline void dp_rx_xor_block(uint8_t *b, const uint8_t *a, qdf_size_t len)
  143. {
  144. qdf_size_t i;
  145. for (i = 0; i < len; i++)
  146. b[i] ^= a[i];
  147. }
  148. /*
  149. *dp_rx_rotl() - rotate the bits left
  150. *@val: unsigned integer input value
  151. *@bits: number of bits
  152. *
  153. *Returns: Integer with left rotated by number of 'bits'
  154. */
  155. static inline uint32_t dp_rx_rotl(uint32_t val, int bits)
  156. {
  157. return (val << bits) | (val >> (32 - bits));
  158. }
  159. /*
  160. *dp_rx_rotr() - rotate the bits right
  161. *@val: unsigned integer input value
  162. *@bits: number of bits
  163. *
  164. *Returns: Integer with right rotated by number of 'bits'
  165. */
  166. static inline uint32_t dp_rx_rotr(uint32_t val, int bits)
  167. {
  168. return (val >> bits) | (val << (32 - bits));
  169. }
  170. /*
  171. * dp_set_rx_queue() - set queue_mapping in skb
  172. * @nbuf: skb
  173. * @queue_id: rx queue_id
  174. *
  175. * Return: void
  176. */
  177. #ifdef QCA_OL_RX_MULTIQ_SUPPORT
  178. static inline void dp_set_rx_queue(qdf_nbuf_t nbuf, uint8_t queue_id)
  179. {
  180. qdf_nbuf_record_rx_queue(nbuf, queue_id);
  181. return;
  182. }
  183. #else
  184. static inline void dp_set_rx_queue(qdf_nbuf_t nbuf, uint8_t queue_id)
  185. {
  186. }
  187. #endif
  188. /*
  189. *dp_rx_xswap() - swap the bits left
  190. *@val: unsigned integer input value
  191. *
  192. *Returns: Integer with bits swapped
  193. */
  194. static inline uint32_t dp_rx_xswap(uint32_t val)
  195. {
  196. return ((val & 0x00ff00ff) << 8) | ((val & 0xff00ff00) >> 8);
  197. }
  198. /*
  199. *dp_rx_get_le32_split() - get little endian 32 bits split
  200. *@b0: byte 0
  201. *@b1: byte 1
  202. *@b2: byte 2
  203. *@b3: byte 3
  204. *
  205. *Returns: Integer with split little endian 32 bits
  206. */
  207. static inline uint32_t dp_rx_get_le32_split(uint8_t b0, uint8_t b1, uint8_t b2,
  208. uint8_t b3)
  209. {
  210. return b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
  211. }
  212. /*
  213. *dp_rx_get_le32() - get little endian 32 bits
  214. *@b0: byte 0
  215. *@b1: byte 1
  216. *@b2: byte 2
  217. *@b3: byte 3
  218. *
  219. *Returns: Integer with little endian 32 bits
  220. */
  221. static inline uint32_t dp_rx_get_le32(const uint8_t *p)
  222. {
  223. return dp_rx_get_le32_split(p[0], p[1], p[2], p[3]);
  224. }
  225. /*
  226. * dp_rx_put_le32() - put little endian 32 bits
  227. * @p: destination char array
  228. * @v: source 32-bit integer
  229. *
  230. * Returns: None
  231. */
  232. static inline void dp_rx_put_le32(uint8_t *p, uint32_t v)
  233. {
  234. p[0] = (v) & 0xff;
  235. p[1] = (v >> 8) & 0xff;
  236. p[2] = (v >> 16) & 0xff;
  237. p[3] = (v >> 24) & 0xff;
  238. }
  239. /* Extract michal mic block of data */
  240. #define dp_rx_michael_block(l, r) \
  241. do { \
  242. r ^= dp_rx_rotl(l, 17); \
  243. l += r; \
  244. r ^= dp_rx_xswap(l); \
  245. l += r; \
  246. r ^= dp_rx_rotl(l, 3); \
  247. l += r; \
  248. r ^= dp_rx_rotr(l, 2); \
  249. l += r; \
  250. } while (0)
  251. /**
  252. * struct dp_rx_desc_list_elem_t
  253. *
  254. * @next : Next pointer to form free list
  255. * @rx_desc : DP Rx descriptor
  256. */
  257. union dp_rx_desc_list_elem_t {
  258. union dp_rx_desc_list_elem_t *next;
  259. struct dp_rx_desc rx_desc;
  260. };
  261. #ifdef RX_DESC_MULTI_PAGE_ALLOC
  262. /**
  263. * dp_rx_desc_find() - find dp rx descriptor from page ID and offset
  264. * @page_id: Page ID
  265. * @offset: Offset of the descriptor element
  266. *
  267. * Return: RX descriptor element
  268. */
  269. union dp_rx_desc_list_elem_t *dp_rx_desc_find(uint16_t page_id, uint16_t offset,
  270. struct rx_desc_pool *rx_pool);
  271. static inline
  272. struct dp_rx_desc *dp_get_rx_desc_from_cookie(struct dp_soc *soc,
  273. struct rx_desc_pool *pool,
  274. uint32_t cookie)
  275. {
  276. uint8_t pool_id = DP_RX_DESC_MULTI_PAGE_COOKIE_GET_POOL_ID(cookie);
  277. uint16_t page_id = DP_RX_DESC_MULTI_PAGE_COOKIE_GET_PAGE_ID(cookie);
  278. uint8_t offset = DP_RX_DESC_MULTI_PAGE_COOKIE_GET_OFFSET(cookie);
  279. struct rx_desc_pool *rx_desc_pool;
  280. union dp_rx_desc_list_elem_t *rx_desc_elem;
  281. if (qdf_unlikely(pool_id >= MAX_RXDESC_POOLS))
  282. return NULL;
  283. rx_desc_pool = &pool[pool_id];
  284. rx_desc_elem = (union dp_rx_desc_list_elem_t *)
  285. (rx_desc_pool->desc_pages.cacheable_pages[page_id] +
  286. rx_desc_pool->elem_size * offset);
  287. return &rx_desc_elem->rx_desc;
  288. }
  289. /**
  290. * dp_rx_cookie_2_va_rxdma_buf() - Converts cookie to a virtual address of
  291. * the Rx descriptor on Rx DMA source ring buffer
  292. * @soc: core txrx main context
  293. * @cookie: cookie used to lookup virtual address
  294. *
  295. * Return: Pointer to the Rx descriptor
  296. */
  297. static inline
  298. struct dp_rx_desc *dp_rx_cookie_2_va_rxdma_buf(struct dp_soc *soc,
  299. uint32_t cookie)
  300. {
  301. return dp_get_rx_desc_from_cookie(soc, &soc->rx_desc_buf[0], cookie);
  302. }
  303. /**
  304. * dp_rx_cookie_2_va_mon_buf() - Converts cookie to a virtual address of
  305. * the Rx descriptor on monitor ring buffer
  306. * @soc: core txrx main context
  307. * @cookie: cookie used to lookup virtual address
  308. *
  309. * Return: Pointer to the Rx descriptor
  310. */
  311. static inline
  312. struct dp_rx_desc *dp_rx_cookie_2_va_mon_buf(struct dp_soc *soc,
  313. uint32_t cookie)
  314. {
  315. return dp_get_rx_desc_from_cookie(soc, &soc->rx_desc_mon[0], cookie);
  316. }
  317. /**
  318. * dp_rx_cookie_2_va_mon_status() - Converts cookie to a virtual address of
  319. * the Rx descriptor on monitor status ring buffer
  320. * @soc: core txrx main context
  321. * @cookie: cookie used to lookup virtual address
  322. *
  323. * Return: Pointer to the Rx descriptor
  324. */
  325. static inline
  326. struct dp_rx_desc *dp_rx_cookie_2_va_mon_status(struct dp_soc *soc,
  327. uint32_t cookie)
  328. {
  329. return dp_get_rx_desc_from_cookie(soc, &soc->rx_desc_status[0], cookie);
  330. }
  331. #else
  332. /**
  333. * dp_rx_cookie_2_va_rxdma_buf() - Converts cookie to a virtual address of
  334. * the Rx descriptor on Rx DMA source ring buffer
  335. * @soc: core txrx main context
  336. * @cookie: cookie used to lookup virtual address
  337. *
  338. * Return: void *: Virtual Address of the Rx descriptor
  339. */
  340. static inline
  341. void *dp_rx_cookie_2_va_rxdma_buf(struct dp_soc *soc, uint32_t cookie)
  342. {
  343. uint8_t pool_id = DP_RX_DESC_COOKIE_POOL_ID_GET(cookie);
  344. uint16_t index = DP_RX_DESC_COOKIE_INDEX_GET(cookie);
  345. struct rx_desc_pool *rx_desc_pool;
  346. if (qdf_unlikely(pool_id >= MAX_RXDESC_POOLS))
  347. return NULL;
  348. rx_desc_pool = &soc->rx_desc_buf[pool_id];
  349. if (qdf_unlikely(index >= rx_desc_pool->pool_size))
  350. return NULL;
  351. return &(soc->rx_desc_buf[pool_id].array[index].rx_desc);
  352. }
  353. /**
  354. * dp_rx_cookie_2_va_mon_buf() - Converts cookie to a virtual address of
  355. * the Rx descriptor on monitor ring buffer
  356. * @soc: core txrx main context
  357. * @cookie: cookie used to lookup virtual address
  358. *
  359. * Return: void *: Virtual Address of the Rx descriptor
  360. */
  361. static inline
  362. void *dp_rx_cookie_2_va_mon_buf(struct dp_soc *soc, uint32_t cookie)
  363. {
  364. uint8_t pool_id = DP_RX_DESC_COOKIE_POOL_ID_GET(cookie);
  365. uint16_t index = DP_RX_DESC_COOKIE_INDEX_GET(cookie);
  366. /* TODO */
  367. /* Add sanity for pool_id & index */
  368. return &(soc->rx_desc_mon[pool_id].array[index].rx_desc);
  369. }
  370. /**
  371. * dp_rx_cookie_2_va_mon_status() - Converts cookie to a virtual address of
  372. * the Rx descriptor on monitor status ring buffer
  373. * @soc: core txrx main context
  374. * @cookie: cookie used to lookup virtual address
  375. *
  376. * Return: void *: Virtual Address of the Rx descriptor
  377. */
  378. static inline
  379. void *dp_rx_cookie_2_va_mon_status(struct dp_soc *soc, uint32_t cookie)
  380. {
  381. uint8_t pool_id = DP_RX_DESC_COOKIE_POOL_ID_GET(cookie);
  382. uint16_t index = DP_RX_DESC_COOKIE_INDEX_GET(cookie);
  383. /* TODO */
  384. /* Add sanity for pool_id & index */
  385. return &(soc->rx_desc_status[pool_id].array[index].rx_desc);
  386. }
  387. #endif /* RX_DESC_MULTI_PAGE_ALLOC */
  388. void dp_rx_add_desc_list_to_free_list(struct dp_soc *soc,
  389. union dp_rx_desc_list_elem_t **local_desc_list,
  390. union dp_rx_desc_list_elem_t **tail,
  391. uint16_t pool_id,
  392. struct rx_desc_pool *rx_desc_pool);
  393. uint16_t dp_rx_get_free_desc_list(struct dp_soc *soc, uint32_t pool_id,
  394. struct rx_desc_pool *rx_desc_pool,
  395. uint16_t num_descs,
  396. union dp_rx_desc_list_elem_t **desc_list,
  397. union dp_rx_desc_list_elem_t **tail);
  398. QDF_STATUS dp_rx_pdev_attach(struct dp_pdev *pdev);
  399. void dp_rx_pdev_detach(struct dp_pdev *pdev);
  400. void dp_print_napi_stats(struct dp_soc *soc);
  401. /**
  402. * dp_rx_vdev_detach() - detach vdev from dp rx
  403. * @vdev: virtual device instance
  404. *
  405. * Return: QDF_STATUS_SUCCESS: success
  406. * QDF_STATUS_E_RESOURCES: Error return
  407. */
  408. QDF_STATUS dp_rx_vdev_detach(struct dp_vdev *vdev);
  409. uint32_t
  410. dp_rx_process(struct dp_intr *int_ctx, hal_ring_handle_t hal_ring_hdl,
  411. uint8_t reo_ring_num,
  412. uint32_t quota);
  413. /**
  414. * dp_rx_err_process() - Processes error frames routed to REO error ring
  415. * @int_ctx: pointer to DP interrupt context
  416. * @soc: core txrx main context
  417. * @hal_ring: opaque pointer to the HAL Rx Error Ring, which will be serviced
  418. * @quota: No. of units (packets) that can be serviced in one shot.
  419. *
  420. * This function implements error processing and top level demultiplexer
  421. * for all the frames routed to REO error ring.
  422. *
  423. * Return: uint32_t: No. of elements processed
  424. */
  425. uint32_t dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
  426. hal_ring_handle_t hal_ring_hdl, uint32_t quota);
  427. /**
  428. * dp_rx_wbm_err_process() - Processes error frames routed to WBM release ring
  429. * @int_ctx: pointer to DP interrupt context
  430. * @soc: core txrx main context
  431. * @hal_ring: opaque pointer to the HAL Rx Error Ring, which will be serviced
  432. * @quota: No. of units (packets) that can be serviced in one shot.
  433. *
  434. * This function implements error processing and top level demultiplexer
  435. * for all the frames routed to WBM2HOST sw release ring.
  436. *
  437. * Return: uint32_t: No. of elements processed
  438. */
  439. uint32_t
  440. dp_rx_wbm_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
  441. hal_ring_handle_t hal_ring_hdl, uint32_t quota);
  442. /**
  443. * dp_rx_sg_create() - create a frag_list for MSDUs which are spread across
  444. * multiple nbufs.
  445. * @nbuf: pointer to the first msdu of an amsdu.
  446. *
  447. * This function implements the creation of RX frag_list for cases
  448. * where an MSDU is spread across multiple nbufs.
  449. *
  450. * Return: returns the head nbuf which contains complete frag_list.
  451. */
  452. qdf_nbuf_t dp_rx_sg_create(qdf_nbuf_t nbuf);
  453. /*
  454. * dp_rx_desc_pool_alloc() - create a pool of software rx_descs
  455. * at the time of dp rx initialization
  456. *
  457. * @soc: core txrx main context
  458. * @pool_id: pool_id which is one of 3 mac_ids
  459. * @pool_size: number of Rx descriptor in the pool
  460. * @rx_desc_pool: rx descriptor pool pointer
  461. *
  462. * Return: QDF status
  463. */
  464. QDF_STATUS dp_rx_desc_pool_alloc(struct dp_soc *soc, uint32_t pool_id,
  465. uint32_t pool_size, struct rx_desc_pool *pool);
  466. /*
  467. * dp_rx_desc_nbuf_and_pool_free() - free the sw rx desc pool called during
  468. * de-initialization of wifi module.
  469. *
  470. * @soc: core txrx main context
  471. * @pool_id: pool_id which is one of 3 mac_ids
  472. * @rx_desc_pool: rx descriptor pool pointer
  473. *
  474. * Return: None
  475. */
  476. void dp_rx_desc_nbuf_and_pool_free(struct dp_soc *soc, uint32_t pool_id,
  477. struct rx_desc_pool *rx_desc_pool);
  478. /*
  479. * dp_rx_desc_nbuf_free() - free the sw rx desc nbufs called during
  480. * de-initialization of wifi module.
  481. *
  482. * @soc: core txrx main context
  483. * @pool_id: pool_id which is one of 3 mac_ids
  484. * @rx_desc_pool: rx descriptor pool pointer
  485. *
  486. * Return: None
  487. */
  488. void dp_rx_desc_nbuf_free(struct dp_soc *soc,
  489. struct rx_desc_pool *rx_desc_pool);
  490. /*
  491. * dp_rx_desc_pool_free() - free the sw rx desc array called during
  492. * de-initialization of wifi module.
  493. *
  494. * @soc: core txrx main context
  495. * @rx_desc_pool: rx descriptor pool pointer
  496. *
  497. * Return: None
  498. */
  499. void dp_rx_desc_pool_free(struct dp_soc *soc,
  500. struct rx_desc_pool *rx_desc_pool);
  501. void dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list,
  502. struct dp_peer *peer);
  503. /**
  504. * dp_rx_add_to_free_desc_list() - Adds to a local free descriptor list
  505. *
  506. * @head: pointer to the head of local free list
  507. * @tail: pointer to the tail of local free list
  508. * @new: new descriptor that is added to the free list
  509. *
  510. * Return: void:
  511. */
  512. static inline
  513. void dp_rx_add_to_free_desc_list(union dp_rx_desc_list_elem_t **head,
  514. union dp_rx_desc_list_elem_t **tail,
  515. struct dp_rx_desc *new)
  516. {
  517. qdf_assert(head && new);
  518. new->nbuf = NULL;
  519. new->in_use = 0;
  520. ((union dp_rx_desc_list_elem_t *)new)->next = *head;
  521. *head = (union dp_rx_desc_list_elem_t *)new;
  522. /* reset tail if head->next is NULL */
  523. if (!*tail || !(*head)->next)
  524. *tail = *head;
  525. }
  526. uint8_t dp_rx_process_invalid_peer(struct dp_soc *soc, qdf_nbuf_t nbuf,
  527. uint8_t mac_id);
  528. void dp_rx_process_invalid_peer_wrapper(struct dp_soc *soc,
  529. qdf_nbuf_t mpdu, bool mpdu_done, uint8_t mac_id);
  530. void dp_rx_process_mic_error(struct dp_soc *soc, qdf_nbuf_t nbuf,
  531. uint8_t *rx_tlv_hdr, struct dp_peer *peer);
  532. void dp_2k_jump_handle(struct dp_soc *soc, qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
  533. uint16_t peer_id, uint8_t tid);
  534. #define DP_RX_LIST_APPEND(head, tail, elem) \
  535. do { \
  536. if (!(head)) { \
  537. (head) = (elem); \
  538. QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(head) = 1;\
  539. } else { \
  540. qdf_nbuf_set_next((tail), (elem)); \
  541. QDF_NBUF_CB_RX_NUM_ELEMENTS_IN_LIST(head)++; \
  542. } \
  543. (tail) = (elem); \
  544. qdf_nbuf_set_next((tail), NULL); \
  545. } while (0)
  546. /*for qcn9000 emulation the pcie is complete phy and no address restrictions*/
  547. #if !defined(BUILD_X86) || defined(QCA_WIFI_QCN9000)
  548. static inline int check_x86_paddr(struct dp_soc *dp_soc, qdf_nbuf_t *rx_netbuf,
  549. qdf_dma_addr_t *paddr, struct dp_pdev *pdev)
  550. {
  551. return QDF_STATUS_SUCCESS;
  552. }
  553. #else
  554. #define MAX_RETRY 100
  555. static inline int check_x86_paddr(struct dp_soc *dp_soc, qdf_nbuf_t *rx_netbuf,
  556. qdf_dma_addr_t *paddr, struct dp_pdev *pdev)
  557. {
  558. uint32_t nbuf_retry = 0;
  559. int32_t ret;
  560. const uint32_t x86_phy_addr = 0x50000000;
  561. /*
  562. * in M2M emulation platforms (x86) the memory below 0x50000000
  563. * is reserved for target use, so any memory allocated in this
  564. * region should not be used by host
  565. */
  566. do {
  567. if (qdf_likely(*paddr > x86_phy_addr))
  568. return QDF_STATUS_SUCCESS;
  569. else {
  570. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
  571. "phy addr %pK exceeded 0x50000000 trying again",
  572. paddr);
  573. nbuf_retry++;
  574. if ((*rx_netbuf)) {
  575. qdf_nbuf_unmap_single(dp_soc->osdev, *rx_netbuf,
  576. QDF_DMA_FROM_DEVICE);
  577. /* Not freeing buffer intentionally.
  578. * Observed that same buffer is getting
  579. * re-allocated resulting in longer load time
  580. * WMI init timeout.
  581. * This buffer is anyway not useful so skip it.
  582. **/
  583. }
  584. *rx_netbuf = qdf_nbuf_alloc(dp_soc->osdev,
  585. RX_BUFFER_SIZE,
  586. RX_BUFFER_RESERVATION,
  587. RX_BUFFER_ALIGNMENT,
  588. FALSE);
  589. if (qdf_unlikely(!(*rx_netbuf)))
  590. return QDF_STATUS_E_FAILURE;
  591. ret = qdf_nbuf_map_single(dp_soc->osdev, *rx_netbuf,
  592. QDF_DMA_FROM_DEVICE);
  593. if (qdf_unlikely(ret == QDF_STATUS_E_FAILURE)) {
  594. qdf_nbuf_free(*rx_netbuf);
  595. *rx_netbuf = NULL;
  596. continue;
  597. }
  598. *paddr = qdf_nbuf_get_frag_paddr(*rx_netbuf, 0);
  599. }
  600. } while (nbuf_retry < MAX_RETRY);
  601. if ((*rx_netbuf)) {
  602. qdf_nbuf_unmap_single(dp_soc->osdev, *rx_netbuf,
  603. QDF_DMA_FROM_DEVICE);
  604. qdf_nbuf_free(*rx_netbuf);
  605. }
  606. return QDF_STATUS_E_FAILURE;
  607. }
  608. #endif
  609. /**
  610. * dp_rx_cookie_2_link_desc_va() - Converts cookie to a virtual address of
  611. * the MSDU Link Descriptor
  612. * @soc: core txrx main context
  613. * @buf_info: buf_info include cookie that used to lookup virtual address of
  614. * link descriptor Normally this is just an index into a per SOC array.
  615. *
  616. * This is the VA of the link descriptor, that HAL layer later uses to
  617. * retrieve the list of MSDU's for a given MPDU.
  618. *
  619. * Return: void *: Virtual Address of the Rx descriptor
  620. */
  621. static inline
  622. void *dp_rx_cookie_2_link_desc_va(struct dp_soc *soc,
  623. struct hal_buf_info *buf_info)
  624. {
  625. void *link_desc_va;
  626. uint32_t bank_id = LINK_DESC_COOKIE_BANK_ID(buf_info->sw_cookie);
  627. /* TODO */
  628. /* Add sanity for cookie */
  629. link_desc_va = soc->link_desc_banks[bank_id].base_vaddr +
  630. (buf_info->paddr -
  631. soc->link_desc_banks[bank_id].base_paddr);
  632. return link_desc_va;
  633. }
  634. /**
  635. * dp_rx_cookie_2_mon_link_desc_va() - Converts cookie to a virtual address of
  636. * the MSDU Link Descriptor
  637. * @pdev: core txrx pdev context
  638. * @buf_info: buf_info includes cookie that used to lookup virtual address of
  639. * link descriptor. Normally this is just an index into a per pdev array.
  640. *
  641. * This is the VA of the link descriptor in monitor mode destination ring,
  642. * that HAL layer later uses to retrieve the list of MSDU's for a given MPDU.
  643. *
  644. * Return: void *: Virtual Address of the Rx descriptor
  645. */
  646. static inline
  647. void *dp_rx_cookie_2_mon_link_desc_va(struct dp_pdev *pdev,
  648. struct hal_buf_info *buf_info,
  649. int mac_id)
  650. {
  651. void *link_desc_va;
  652. /* TODO */
  653. /* Add sanity for cookie */
  654. link_desc_va =
  655. pdev->soc->mon_link_desc_banks[mac_id][buf_info->sw_cookie]
  656. .base_vaddr +
  657. (buf_info->paddr -
  658. pdev->soc->mon_link_desc_banks[mac_id][buf_info->sw_cookie]
  659. .base_paddr);
  660. return link_desc_va;
  661. }
  662. /**
  663. * dp_rx_defrag_concat() - Concatenate the fragments
  664. *
  665. * @dst: destination pointer to the buffer
  666. * @src: source pointer from where the fragment payload is to be copied
  667. *
  668. * Return: QDF_STATUS
  669. */
  670. static inline QDF_STATUS dp_rx_defrag_concat(qdf_nbuf_t dst, qdf_nbuf_t src)
  671. {
  672. /*
  673. * Inside qdf_nbuf_cat, if it is necessary to reallocate dst
  674. * to provide space for src, the headroom portion is copied from
  675. * the original dst buffer to the larger new dst buffer.
  676. * (This is needed, because the headroom of the dst buffer
  677. * contains the rx desc.)
  678. */
  679. if (!qdf_nbuf_cat(dst, src)) {
  680. /*
  681. * qdf_nbuf_cat does not free the src memory.
  682. * Free src nbuf before returning
  683. * For failure case the caller takes of freeing the nbuf
  684. */
  685. qdf_nbuf_free(src);
  686. return QDF_STATUS_SUCCESS;
  687. }
  688. return QDF_STATUS_E_DEFRAG_ERROR;
  689. }
  690. #ifndef FEATURE_WDS
  691. static inline QDF_STATUS dp_rx_ast_set_active(struct dp_soc *soc, uint16_t sa_idx, bool is_active)
  692. {
  693. return QDF_STATUS_SUCCESS;
  694. }
  695. static inline void
  696. dp_rx_wds_srcport_learn(struct dp_soc *soc,
  697. uint8_t *rx_tlv_hdr,
  698. struct dp_peer *ta_peer,
  699. qdf_nbuf_t nbuf)
  700. {
  701. }
  702. #endif
  703. /*
  704. * dp_rx_desc_dump() - dump the sw rx descriptor
  705. *
  706. * @rx_desc: sw rx descriptor
  707. */
  708. static inline void dp_rx_desc_dump(struct dp_rx_desc *rx_desc)
  709. {
  710. dp_info("rx_desc->nbuf: %pK, rx_desc->cookie: %d, rx_desc->pool_id: %d, rx_desc->in_use: %d, rx_desc->unmapped: %d",
  711. rx_desc->nbuf, rx_desc->cookie, rx_desc->pool_id,
  712. rx_desc->in_use, rx_desc->unmapped);
  713. }
  714. /*
  715. * check_qwrap_multicast_loopback() - Check if rx packet is a loopback packet.
  716. * In qwrap mode, packets originated from
  717. * any vdev should not loopback and
  718. * should be dropped.
  719. * @vdev: vdev on which rx packet is received
  720. * @nbuf: rx pkt
  721. *
  722. */
  723. #if ATH_SUPPORT_WRAP
  724. static inline bool check_qwrap_multicast_loopback(struct dp_vdev *vdev,
  725. qdf_nbuf_t nbuf)
  726. {
  727. struct dp_vdev *psta_vdev;
  728. struct dp_pdev *pdev = vdev->pdev;
  729. uint8_t *data = qdf_nbuf_data(nbuf);
  730. if (qdf_unlikely(vdev->proxysta_vdev)) {
  731. /* In qwrap isolation mode, allow loopback packets as all
  732. * packets go to RootAP and Loopback on the mpsta.
  733. */
  734. if (vdev->isolation_vdev)
  735. return false;
  736. TAILQ_FOREACH(psta_vdev, &pdev->vdev_list, vdev_list_elem) {
  737. if (qdf_unlikely(psta_vdev->proxysta_vdev &&
  738. !qdf_mem_cmp(psta_vdev->mac_addr.raw,
  739. &data[QDF_MAC_ADDR_SIZE],
  740. QDF_MAC_ADDR_SIZE))) {
  741. /* Drop packet if source address is equal to
  742. * any of the vdev addresses.
  743. */
  744. return true;
  745. }
  746. }
  747. }
  748. return false;
  749. }
  750. #else
  751. static inline bool check_qwrap_multicast_loopback(struct dp_vdev *vdev,
  752. qdf_nbuf_t nbuf)
  753. {
  754. return false;
  755. }
  756. #endif
  757. #if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\
  758. defined(WLAN_SUPPORT_RX_TAG_STATISTICS) ||\
  759. defined(WLAN_SUPPORT_RX_FLOW_TAG)
  760. #include "dp_rx_tag.h"
  761. #endif
  762. #ifndef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  763. /**
  764. * dp_rx_update_protocol_tag() - Reads CCE metadata from the RX MSDU end TLV
  765. * and set the corresponding tag in QDF packet
  766. * @soc: core txrx main context
  767. * @vdev: vdev on which the packet is received
  768. * @nbuf: QDF pkt buffer on which the protocol tag should be set
  769. * @rx_tlv_hdr: rBbase address where the RX TLVs starts
  770. * @ring_index: REO ring number, not used for error & monitor ring
  771. * @is_reo_exception: flag to indicate if rx from REO ring or exception ring
  772. * @is_update_stats: flag to indicate whether to update stats or not
  773. * Return: void
  774. */
  775. static inline void
  776. dp_rx_update_protocol_tag(struct dp_soc *soc, struct dp_vdev *vdev,
  777. qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
  778. uint16_t ring_index,
  779. bool is_reo_exception, bool is_update_stats)
  780. {
  781. }
  782. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  783. #ifndef WLAN_SUPPORT_RX_FLOW_TAG
  784. /**
  785. * dp_rx_update_flow_tag() - Reads FSE metadata from the RX MSDU end TLV
  786. * and set the corresponding tag in QDF packet
  787. * @soc: core txrx main context
  788. * @vdev: vdev on which the packet is received
  789. * @nbuf: QDF pkt buffer on which the protocol tag should be set
  790. * @rx_tlv_hdr: base address where the RX TLVs starts
  791. * @is_update_stats: flag to indicate whether to update stats or not
  792. *
  793. * Return: void
  794. */
  795. static inline void
  796. dp_rx_update_flow_tag(struct dp_soc *soc, struct dp_vdev *vdev,
  797. qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr, bool update_stats)
  798. {
  799. }
  800. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  801. #if !defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\
  802. !defined(WLAN_SUPPORT_RX_FLOW_TAG)
  803. /**
  804. * dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
  805. * mode and then tags appropriate packets
  806. * @soc: core txrx main context
  807. * @vdev: pdev on which packet is received
  808. * @msdu: QDF packet buffer on which the protocol tag should be set
  809. * @rx_desc: base address where the RX TLVs start
  810. * Return: void
  811. */
  812. static inline
  813. void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
  814. struct dp_pdev *dp_pdev,
  815. qdf_nbuf_t msdu, void *rx_desc)
  816. {
  817. }
  818. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
  819. /*
  820. * dp_rx_buffers_replenish() - replenish rxdma ring with rx nbufs
  821. * called during dp rx initialization
  822. * and at the end of dp_rx_process.
  823. *
  824. * @soc: core txrx main context
  825. * @mac_id: mac_id which is one of 3 mac_ids
  826. * @dp_rxdma_srng: dp rxdma circular ring
  827. * @rx_desc_pool: Pointer to free Rx descriptor pool
  828. * @num_req_buffers: number of buffer to be replenished
  829. * @desc_list: list of descs if called from dp_rx_process
  830. * or NULL during dp rx initialization or out of buffer
  831. * interrupt.
  832. * @tail: tail of descs list
  833. * Return: return success or failure
  834. */
  835. QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
  836. struct dp_srng *dp_rxdma_srng,
  837. struct rx_desc_pool *rx_desc_pool,
  838. uint32_t num_req_buffers,
  839. union dp_rx_desc_list_elem_t **desc_list,
  840. union dp_rx_desc_list_elem_t **tail);
  841. /*
  842. * dp_pdev_rx_buffers_attach() - replenish rxdma ring with rx nbufs
  843. * called during dp rx initialization
  844. *
  845. * @soc: core txrx main context
  846. * @mac_id: mac_id which is one of 3 mac_ids
  847. * @dp_rxdma_srng: dp rxdma circular ring
  848. * @rx_desc_pool: Pointer to free Rx descriptor pool
  849. * @num_req_buffers: number of buffer to be replenished
  850. *
  851. * Return: return success or failure
  852. */
  853. QDF_STATUS
  854. dp_pdev_rx_buffers_attach(struct dp_soc *dp_soc, uint32_t mac_id,
  855. struct dp_srng *dp_rxdma_srng,
  856. struct rx_desc_pool *rx_desc_pool,
  857. uint32_t num_req_buffers);
  858. /**
  859. * dp_rx_link_desc_return() - Return a MPDU link descriptor to HW
  860. * (WBM), following error handling
  861. *
  862. * @soc: core DP main context
  863. * @buf_addr_info: opaque pointer to the REO error ring descriptor
  864. * @buf_addr_info: void pointer to the buffer_addr_info
  865. * @bm_action: put to idle_list or release to msdu_list
  866. *
  867. * Return: QDF_STATUS_E_FAILURE for failure else QDF_STATUS_SUCCESS
  868. */
  869. QDF_STATUS
  870. dp_rx_link_desc_return(struct dp_soc *soc, hal_ring_desc_t ring_desc,
  871. uint8_t bm_action);
  872. /**
  873. * dp_rx_link_desc_return_by_addr - Return a MPDU link descriptor to
  874. * (WBM) by address
  875. *
  876. * @soc: core DP main context
  877. * @link_desc_addr: link descriptor addr
  878. *
  879. * Return: QDF_STATUS_E_FAILURE for failure else QDF_STATUS_SUCCESS
  880. */
  881. QDF_STATUS
  882. dp_rx_link_desc_return_by_addr(struct dp_soc *soc,
  883. hal_buff_addrinfo_t link_desc_addr,
  884. uint8_t bm_action);
  885. /**
  886. * dp_rxdma_err_process() - RxDMA error processing functionality
  887. * @soc: core txrx main contex
  888. * @mac_id: mac id which is one of 3 mac_ids
  889. * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
  890. * @quota: No. of units (packets) that can be serviced in one shot.
  891. *
  892. * Return: num of buffers processed
  893. */
  894. uint32_t
  895. dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
  896. uint32_t mac_id, uint32_t quota);
  897. void dp_rx_fill_mesh_stats(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  898. uint8_t *rx_tlv_hdr, struct dp_peer *peer);
  899. QDF_STATUS dp_rx_filter_mesh_packets(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  900. uint8_t *rx_tlv_hdr);
  901. int dp_wds_rx_policy_check(uint8_t *rx_tlv_hdr, struct dp_vdev *vdev,
  902. struct dp_peer *peer);
  903. qdf_nbuf_t
  904. dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev);
  905. /*
  906. * dp_rx_dump_info_and_assert() - dump RX Ring info and Rx Desc info
  907. *
  908. * @soc: core txrx main context
  909. * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
  910. * @ring_desc: opaque pointer to the RX ring descriptor
  911. * @rx_desc: host rs descriptor
  912. *
  913. * Return: void
  914. */
  915. void dp_rx_dump_info_and_assert(struct dp_soc *soc,
  916. hal_ring_handle_t hal_ring_hdl,
  917. hal_ring_desc_t ring_desc,
  918. struct dp_rx_desc *rx_desc);
  919. void dp_rx_compute_delay(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  920. #ifdef RX_DESC_DEBUG_CHECK
  921. /**
  922. * dp_rx_desc_check_magic() - check the magic value in dp_rx_desc
  923. * @rx_desc: rx descriptor pointer
  924. *
  925. * Return: true, if magic is correct, else false.
  926. */
  927. static inline bool dp_rx_desc_check_magic(struct dp_rx_desc *rx_desc)
  928. {
  929. if (qdf_unlikely(rx_desc->magic != DP_RX_DESC_MAGIC))
  930. return false;
  931. rx_desc->magic = 0;
  932. return true;
  933. }
  934. /**
  935. * dp_rx_desc_prep() - prepare rx desc
  936. * @rx_desc: rx descriptor pointer to be prepared
  937. * @nbuf: nbuf to be associated with rx_desc
  938. *
  939. * Note: assumption is that we are associating a nbuf which is mapped
  940. *
  941. * Return: none
  942. */
  943. static inline void dp_rx_desc_prep(struct dp_rx_desc *rx_desc, qdf_nbuf_t nbuf)
  944. {
  945. rx_desc->magic = DP_RX_DESC_MAGIC;
  946. rx_desc->nbuf = nbuf;
  947. rx_desc->unmapped = 0;
  948. }
  949. #else
  950. static inline bool dp_rx_desc_check_magic(struct dp_rx_desc *rx_desc)
  951. {
  952. return true;
  953. }
  954. static inline void dp_rx_desc_prep(struct dp_rx_desc *rx_desc, qdf_nbuf_t nbuf)
  955. {
  956. rx_desc->nbuf = nbuf;
  957. rx_desc->unmapped = 0;
  958. }
  959. #endif /* RX_DESC_DEBUG_CHECK */
  960. void dp_rx_process_rxdma_err(struct dp_soc *soc, qdf_nbuf_t nbuf,
  961. uint8_t *rx_tlv_hdr, struct dp_peer *peer,
  962. uint8_t err_code, uint8_t mac_id);
  963. #ifdef PEER_CACHE_RX_PKTS
  964. /**
  965. * dp_rx_flush_rx_cached() - flush cached rx frames
  966. * @peer: peer
  967. * @drop: set flag to drop frames
  968. *
  969. * Return: None
  970. */
  971. void dp_rx_flush_rx_cached(struct dp_peer *peer, bool drop);
  972. #else
  973. static inline void dp_rx_flush_rx_cached(struct dp_peer *peer, bool drop)
  974. {
  975. }
  976. #endif
  977. #ifndef QCA_MULTIPASS_SUPPORT
  978. static inline
  979. bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf, uint8_t tid)
  980. {
  981. return false;
  982. }
  983. #else
  984. bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf,
  985. uint8_t tid);
  986. #endif
  987. #ifndef WLAN_RX_PKT_CAPTURE_ENH
  988. static inline
  989. void dp_peer_set_rx_capture_enabled(struct dp_peer *peer_handle, bool value)
  990. {
  991. }
  992. #endif
  993. #endif /* _DP_RX_H */