dp_rx.h 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100
  1. /*
  2. * Copyright (c) 2016-2019 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. * @rx_tlv_hdr: pointer to the start of RX TLV headers.
  447. *
  448. * This function implements the creation of RX frag_list for cases
  449. * where an MSDU is spread across multiple nbufs.
  450. *
  451. * Return: returns the head nbuf which contains complete frag_list.
  452. */
  453. qdf_nbuf_t dp_rx_sg_create(qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr);
  454. /*
  455. * dp_rx_desc_pool_alloc() - create a pool of software rx_descs
  456. * at the time of dp rx initialization
  457. *
  458. * @soc: core txrx main context
  459. * @pool_id: pool_id which is one of 3 mac_ids
  460. * @pool_size: number of Rx descriptor in the pool
  461. * @rx_desc_pool: rx descriptor pool pointer
  462. *
  463. * Return: QDF status
  464. */
  465. QDF_STATUS dp_rx_desc_pool_alloc(struct dp_soc *soc, uint32_t pool_id,
  466. uint32_t pool_size, struct rx_desc_pool *pool);
  467. /*
  468. * dp_rx_desc_nbuf_and_pool_free() - free the sw rx desc pool called during
  469. * de-initialization of wifi module.
  470. *
  471. * @soc: core txrx main context
  472. * @pool_id: pool_id which is one of 3 mac_ids
  473. * @rx_desc_pool: rx descriptor pool pointer
  474. *
  475. * Return: None
  476. */
  477. void dp_rx_desc_nbuf_and_pool_free(struct dp_soc *soc, uint32_t pool_id,
  478. struct rx_desc_pool *rx_desc_pool);
  479. /*
  480. * dp_rx_desc_nbuf_free() - free the sw rx desc nbufs called during
  481. * de-initialization of wifi module.
  482. *
  483. * @soc: core txrx main context
  484. * @pool_id: pool_id which is one of 3 mac_ids
  485. * @rx_desc_pool: rx descriptor pool pointer
  486. *
  487. * Return: None
  488. */
  489. void dp_rx_desc_nbuf_free(struct dp_soc *soc,
  490. struct rx_desc_pool *rx_desc_pool);
  491. /*
  492. * dp_rx_desc_pool_free() - free the sw rx desc array called during
  493. * de-initialization of wifi module.
  494. *
  495. * @soc: core txrx main context
  496. * @rx_desc_pool: rx descriptor pool pointer
  497. *
  498. * Return: None
  499. */
  500. void dp_rx_desc_pool_free(struct dp_soc *soc,
  501. struct rx_desc_pool *rx_desc_pool);
  502. void dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list,
  503. struct dp_peer *peer);
  504. /**
  505. * dp_rx_add_to_free_desc_list() - Adds to a local free descriptor list
  506. *
  507. * @head: pointer to the head of local free list
  508. * @tail: pointer to the tail of local free list
  509. * @new: new descriptor that is added to the free list
  510. *
  511. * Return: void:
  512. */
  513. static inline
  514. void dp_rx_add_to_free_desc_list(union dp_rx_desc_list_elem_t **head,
  515. union dp_rx_desc_list_elem_t **tail,
  516. struct dp_rx_desc *new)
  517. {
  518. qdf_assert(head && new);
  519. new->nbuf = NULL;
  520. new->in_use = 0;
  521. ((union dp_rx_desc_list_elem_t *)new)->next = *head;
  522. *head = (union dp_rx_desc_list_elem_t *)new;
  523. if (!*tail)
  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. int mac_for_pdev = dp_get_mac_id_for_mac(pdev->soc, mac_id);
  653. /* TODO */
  654. /* Add sanity for cookie */
  655. link_desc_va =
  656. pdev->link_desc_banks[mac_for_pdev][buf_info->sw_cookie].base_vaddr +
  657. (buf_info->paddr -
  658. pdev->link_desc_banks[mac_for_pdev][buf_info->sw_cookie].base_paddr);
  659. return link_desc_va;
  660. }
  661. /**
  662. * dp_rx_defrag_concat() - Concatenate the fragments
  663. *
  664. * @dst: destination pointer to the buffer
  665. * @src: source pointer from where the fragment payload is to be copied
  666. *
  667. * Return: QDF_STATUS
  668. */
  669. static inline QDF_STATUS dp_rx_defrag_concat(qdf_nbuf_t dst, qdf_nbuf_t src)
  670. {
  671. /*
  672. * Inside qdf_nbuf_cat, if it is necessary to reallocate dst
  673. * to provide space for src, the headroom portion is copied from
  674. * the original dst buffer to the larger new dst buffer.
  675. * (This is needed, because the headroom of the dst buffer
  676. * contains the rx desc.)
  677. */
  678. if (!qdf_nbuf_cat(dst, src)) {
  679. /*
  680. * qdf_nbuf_cat does not free the src memory.
  681. * Free src nbuf before returning
  682. * For failure case the caller takes of freeing the nbuf
  683. */
  684. qdf_nbuf_free(src);
  685. return QDF_STATUS_SUCCESS;
  686. }
  687. return QDF_STATUS_E_DEFRAG_ERROR;
  688. }
  689. #ifndef FEATURE_WDS
  690. static inline QDF_STATUS dp_rx_ast_set_active(struct dp_soc *soc, uint16_t sa_idx, bool is_active)
  691. {
  692. return QDF_STATUS_SUCCESS;
  693. }
  694. static inline void
  695. dp_rx_wds_srcport_learn(struct dp_soc *soc,
  696. uint8_t *rx_tlv_hdr,
  697. struct dp_peer *ta_peer,
  698. qdf_nbuf_t nbuf)
  699. {
  700. }
  701. #endif
  702. /*
  703. * dp_rx_desc_dump() - dump the sw rx descriptor
  704. *
  705. * @rx_desc: sw rx descriptor
  706. */
  707. static inline void dp_rx_desc_dump(struct dp_rx_desc *rx_desc)
  708. {
  709. dp_info("rx_desc->nbuf: %pK, rx_desc->cookie: %d, rx_desc->pool_id: %d, rx_desc->in_use: %d, rx_desc->unmapped: %d",
  710. rx_desc->nbuf, rx_desc->cookie, rx_desc->pool_id,
  711. rx_desc->in_use, rx_desc->unmapped);
  712. }
  713. /*
  714. * check_qwrap_multicast_loopback() - Check if rx packet is a loopback packet.
  715. * In qwrap mode, packets originated from
  716. * any vdev should not loopback and
  717. * should be dropped.
  718. * @vdev: vdev on which rx packet is received
  719. * @nbuf: rx pkt
  720. *
  721. */
  722. #if ATH_SUPPORT_WRAP
  723. static inline bool check_qwrap_multicast_loopback(struct dp_vdev *vdev,
  724. qdf_nbuf_t nbuf)
  725. {
  726. struct dp_vdev *psta_vdev;
  727. struct dp_pdev *pdev = vdev->pdev;
  728. uint8_t *data = qdf_nbuf_data(nbuf);
  729. if (qdf_unlikely(vdev->proxysta_vdev)) {
  730. /* In qwrap isolation mode, allow loopback packets as all
  731. * packets go to RootAP and Loopback on the mpsta.
  732. */
  733. if (vdev->isolation_vdev)
  734. return false;
  735. TAILQ_FOREACH(psta_vdev, &pdev->vdev_list, vdev_list_elem) {
  736. if (qdf_unlikely(psta_vdev->proxysta_vdev &&
  737. !qdf_mem_cmp(psta_vdev->mac_addr.raw,
  738. &data[QDF_MAC_ADDR_SIZE],
  739. QDF_MAC_ADDR_SIZE))) {
  740. /* Drop packet if source address is equal to
  741. * any of the vdev addresses.
  742. */
  743. return true;
  744. }
  745. }
  746. }
  747. return false;
  748. }
  749. #else
  750. static inline bool check_qwrap_multicast_loopback(struct dp_vdev *vdev,
  751. qdf_nbuf_t nbuf)
  752. {
  753. return false;
  754. }
  755. #endif
  756. #if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\
  757. defined(WLAN_SUPPORT_RX_TAG_STATISTICS) ||\
  758. defined(WLAN_SUPPORT_RX_FLOW_TAG)
  759. #include "dp_rx_tag.h"
  760. #endif
  761. #ifndef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  762. /**
  763. * dp_rx_update_protocol_tag() - Reads CCE metadata from the RX MSDU end TLV
  764. * and set the corresponding tag in QDF packet
  765. * @soc: core txrx main context
  766. * @vdev: vdev on which the packet is received
  767. * @nbuf: QDF pkt buffer on which the protocol tag should be set
  768. * @rx_tlv_hdr: rBbase address where the RX TLVs starts
  769. * @ring_index: REO ring number, not used for error & monitor ring
  770. * @is_reo_exception: flag to indicate if rx from REO ring or exception ring
  771. * @is_update_stats: flag to indicate whether to update stats or not
  772. * Return: void
  773. */
  774. static inline void
  775. dp_rx_update_protocol_tag(struct dp_soc *soc, struct dp_vdev *vdev,
  776. qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr,
  777. uint16_t ring_index,
  778. bool is_reo_exception, bool is_update_stats)
  779. {
  780. }
  781. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  782. #ifndef WLAN_SUPPORT_RX_FLOW_TAG
  783. /**
  784. * dp_rx_update_flow_tag() - Reads FSE metadata from the RX MSDU end TLV
  785. * and set the corresponding tag in QDF packet
  786. * @soc: core txrx main context
  787. * @vdev: vdev on which the packet is received
  788. * @nbuf: QDF pkt buffer on which the protocol tag should be set
  789. * @rx_tlv_hdr: base address where the RX TLVs starts
  790. * @is_update_stats: flag to indicate whether to update stats or not
  791. *
  792. * Return: void
  793. */
  794. static inline void
  795. dp_rx_update_flow_tag(struct dp_soc *soc, struct dp_vdev *vdev,
  796. qdf_nbuf_t nbuf, uint8_t *rx_tlv_hdr, bool update_stats)
  797. {
  798. }
  799. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  800. #if !defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\
  801. !defined(WLAN_SUPPORT_RX_FLOW_TAG)
  802. /**
  803. * dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
  804. * mode and then tags appropriate packets
  805. * @soc: core txrx main context
  806. * @vdev: pdev on which packet is received
  807. * @msdu: QDF packet buffer on which the protocol tag should be set
  808. * @rx_desc: base address where the RX TLVs start
  809. * Return: void
  810. */
  811. static inline
  812. void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
  813. struct dp_pdev *dp_pdev,
  814. qdf_nbuf_t msdu, void *rx_desc)
  815. {
  816. }
  817. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
  818. /*
  819. * dp_rx_buffers_replenish() - replenish rxdma ring with rx nbufs
  820. * called during dp rx initialization
  821. * and at the end of dp_rx_process.
  822. *
  823. * @soc: core txrx main context
  824. * @mac_id: mac_id which is one of 3 mac_ids
  825. * @dp_rxdma_srng: dp rxdma circular ring
  826. * @rx_desc_pool: Pointer to free Rx descriptor pool
  827. * @num_req_buffers: number of buffer to be replenished
  828. * @desc_list: list of descs if called from dp_rx_process
  829. * or NULL during dp rx initialization or out of buffer
  830. * interrupt.
  831. * @tail: tail of descs list
  832. * Return: return success or failure
  833. */
  834. QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
  835. struct dp_srng *dp_rxdma_srng,
  836. struct rx_desc_pool *rx_desc_pool,
  837. uint32_t num_req_buffers,
  838. union dp_rx_desc_list_elem_t **desc_list,
  839. union dp_rx_desc_list_elem_t **tail);
  840. /*
  841. * dp_pdev_rx_buffers_attach() - replenish rxdma ring with rx nbufs
  842. * called during dp rx initialization
  843. *
  844. * @soc: core txrx main context
  845. * @mac_id: mac_id which is one of 3 mac_ids
  846. * @dp_rxdma_srng: dp rxdma circular ring
  847. * @rx_desc_pool: Pointer to free Rx descriptor pool
  848. * @num_req_buffers: number of buffer to be replenished
  849. *
  850. * Return: return success or failure
  851. */
  852. QDF_STATUS
  853. dp_pdev_rx_buffers_attach(struct dp_soc *dp_soc, uint32_t mac_id,
  854. struct dp_srng *dp_rxdma_srng,
  855. struct rx_desc_pool *rx_desc_pool,
  856. uint32_t num_req_buffers);
  857. /**
  858. * dp_rx_link_desc_return() - Return a MPDU link descriptor to HW
  859. * (WBM), following error handling
  860. *
  861. * @soc: core DP main context
  862. * @buf_addr_info: opaque pointer to the REO error ring descriptor
  863. * @buf_addr_info: void pointer to the buffer_addr_info
  864. * @bm_action: put to idle_list or release to msdu_list
  865. *
  866. * Return: QDF_STATUS_E_FAILURE for failure else QDF_STATUS_SUCCESS
  867. */
  868. QDF_STATUS
  869. dp_rx_link_desc_return(struct dp_soc *soc, hal_ring_desc_t ring_desc,
  870. uint8_t bm_action);
  871. /**
  872. * dp_rx_link_desc_return_by_addr - Return a MPDU link descriptor to
  873. * (WBM) by address
  874. *
  875. * @soc: core DP main context
  876. * @link_desc_addr: link descriptor addr
  877. *
  878. * Return: QDF_STATUS_E_FAILURE for failure else QDF_STATUS_SUCCESS
  879. */
  880. QDF_STATUS
  881. dp_rx_link_desc_return_by_addr(struct dp_soc *soc,
  882. hal_buff_addrinfo_t link_desc_addr,
  883. uint8_t bm_action);
  884. /**
  885. * dp_rxdma_err_process() - RxDMA error processing functionality
  886. * @soc: core txrx main contex
  887. * @mac_id: mac id which is one of 3 mac_ids
  888. * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
  889. * @quota: No. of units (packets) that can be serviced in one shot.
  890. *
  891. * Return: num of buffers processed
  892. */
  893. uint32_t
  894. dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
  895. uint32_t mac_id, uint32_t quota);
  896. void dp_rx_fill_mesh_stats(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  897. uint8_t *rx_tlv_hdr, struct dp_peer *peer);
  898. QDF_STATUS dp_rx_filter_mesh_packets(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  899. uint8_t *rx_tlv_hdr);
  900. int dp_wds_rx_policy_check(uint8_t *rx_tlv_hdr, struct dp_vdev *vdev,
  901. struct dp_peer *peer);
  902. qdf_nbuf_t
  903. dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev);
  904. /*
  905. * dp_rx_dump_info_and_assert() - dump RX Ring info and Rx Desc info
  906. *
  907. * @soc: core txrx main context
  908. * @hal_ring: opaque pointer to the HAL Rx Ring, which will be serviced
  909. * @ring_desc: opaque pointer to the RX ring descriptor
  910. * @rx_desc: host rs descriptor
  911. *
  912. * Return: void
  913. */
  914. void dp_rx_dump_info_and_assert(struct dp_soc *soc,
  915. hal_ring_handle_t hal_ring_hdl,
  916. hal_ring_desc_t ring_desc,
  917. struct dp_rx_desc *rx_desc);
  918. void dp_rx_compute_delay(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  919. #ifdef RX_DESC_DEBUG_CHECK
  920. /**
  921. * dp_rx_desc_check_magic() - check the magic value in dp_rx_desc
  922. * @rx_desc: rx descriptor pointer
  923. *
  924. * Return: true, if magic is correct, else false.
  925. */
  926. static inline bool dp_rx_desc_check_magic(struct dp_rx_desc *rx_desc)
  927. {
  928. if (qdf_unlikely(rx_desc->magic != DP_RX_DESC_MAGIC))
  929. return false;
  930. rx_desc->magic = 0;
  931. return true;
  932. }
  933. /**
  934. * dp_rx_desc_prep() - prepare rx desc
  935. * @rx_desc: rx descriptor pointer to be prepared
  936. * @nbuf: nbuf to be associated with rx_desc
  937. *
  938. * Note: assumption is that we are associating a nbuf which is mapped
  939. *
  940. * Return: none
  941. */
  942. static inline void dp_rx_desc_prep(struct dp_rx_desc *rx_desc, qdf_nbuf_t nbuf)
  943. {
  944. rx_desc->magic = DP_RX_DESC_MAGIC;
  945. rx_desc->nbuf = nbuf;
  946. rx_desc->unmapped = 0;
  947. }
  948. #else
  949. static inline bool dp_rx_desc_check_magic(struct dp_rx_desc *rx_desc)
  950. {
  951. return true;
  952. }
  953. static inline void dp_rx_desc_prep(struct dp_rx_desc *rx_desc, qdf_nbuf_t nbuf)
  954. {
  955. rx_desc->nbuf = nbuf;
  956. rx_desc->unmapped = 0;
  957. }
  958. #endif /* RX_DESC_DEBUG_CHECK */
  959. void dp_rx_process_rxdma_err(struct dp_soc *soc, qdf_nbuf_t nbuf,
  960. uint8_t *rx_tlv_hdr, struct dp_peer *peer,
  961. uint8_t err_code, uint8_t mac_id);
  962. #ifdef PEER_CACHE_RX_PKTS
  963. /**
  964. * dp_rx_flush_rx_cached() - flush cached rx frames
  965. * @peer: peer
  966. * @drop: set flag to drop frames
  967. *
  968. * Return: None
  969. */
  970. void dp_rx_flush_rx_cached(struct dp_peer *peer, bool drop);
  971. #else
  972. static inline void dp_rx_flush_rx_cached(struct dp_peer *peer, bool drop)
  973. {
  974. }
  975. #endif
  976. #ifndef QCA_MULTIPASS_SUPPORT
  977. static inline
  978. bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf, uint8_t tid)
  979. {
  980. return false;
  981. }
  982. #else
  983. bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf,
  984. uint8_t tid);
  985. #endif
  986. #endif /* _DP_RX_H */