dp_tx.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  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_TX_H
  19. #define __DP_TX_H
  20. #include <qdf_types.h>
  21. #include <qdf_nbuf.h>
  22. #include "dp_types.h"
  23. #if defined(MESH_MODE_SUPPORT) || defined(FEATURE_PERPKT_INFO)
  24. #include "if_meta_hdr.h"
  25. #endif
  26. #include "dp_internal.h"
  27. #define DP_INVALID_VDEV_ID 0xFF
  28. #define DP_TX_MAX_NUM_FRAGS 6
  29. /*
  30. * DP_TX_DESC_FLAG_FRAG flags should always be defined to 0x1
  31. * please do not change this flag's definition
  32. */
  33. #define DP_TX_DESC_FLAG_FRAG 0x1
  34. #define DP_TX_DESC_FLAG_TO_FW 0x2
  35. #define DP_TX_DESC_FLAG_SIMPLE 0x4
  36. #define DP_TX_DESC_FLAG_RAW 0x8
  37. #define DP_TX_DESC_FLAG_MESH 0x10
  38. #define DP_TX_DESC_FLAG_QUEUED_TX 0x20
  39. #define DP_TX_DESC_FLAG_COMPLETED_TX 0x40
  40. #define DP_TX_DESC_FLAG_ME 0x80
  41. #define DP_TX_DESC_FLAG_TDLS_FRAME 0x100
  42. #define DP_TX_DESC_FLAG_ALLOCATED 0x200
  43. #define DP_TX_DESC_FLAG_MESH_MODE 0x400
  44. #define DP_TX_EXT_DESC_FLAG_METADATA_VALID 0x1
  45. #define DP_TX_FREE_SINGLE_BUF(soc, buf) \
  46. do { \
  47. qdf_nbuf_unmap(soc->osdev, buf, QDF_DMA_TO_DEVICE); \
  48. qdf_nbuf_free(buf); \
  49. } while (0)
  50. #define OCB_HEADER_VERSION 1
  51. #ifdef TX_PER_PDEV_DESC_POOL
  52. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  53. #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
  54. #else /* QCA_LL_TX_FLOW_CONTROL_V2 */
  55. #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->pdev->pdev_id)
  56. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  57. #define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
  58. #else
  59. #ifdef TX_PER_VDEV_DESC_POOL
  60. #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
  61. #define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
  62. #endif /* TX_PER_VDEV_DESC_POOL */
  63. #endif /* TX_PER_PDEV_DESC_POOL */
  64. #define DP_TX_QUEUE_MASK 0x3
  65. /* number of dwords for htt_tx_msdu_desc_ext2_t */
  66. #define DP_TX_MSDU_INFO_META_DATA_DWORDS 7
  67. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  68. /**
  69. * struct dp_tx_frag_info_s
  70. * @vaddr: hlos vritual address for buffer
  71. * @paddr_lo: physical address lower 32bits
  72. * @paddr_hi: physical address higher bits
  73. * @len: length of the buffer
  74. */
  75. struct dp_tx_frag_info_s {
  76. uint8_t *vaddr;
  77. uint32_t paddr_lo;
  78. uint16_t paddr_hi;
  79. uint16_t len;
  80. };
  81. /**
  82. * struct dp_tx_seg_info_s - Segmentation Descriptor
  83. * @nbuf: NBUF pointer if segment corresponds to separate nbuf
  84. * @frag_cnt: Fragment count in this segment
  85. * @total_len: Total length of segment
  86. * @frags: per-Fragment information
  87. * @next: pointer to next MSDU segment
  88. */
  89. struct dp_tx_seg_info_s {
  90. qdf_nbuf_t nbuf;
  91. uint16_t frag_cnt;
  92. uint16_t total_len;
  93. struct dp_tx_frag_info_s frags[DP_TX_MAX_NUM_FRAGS];
  94. struct dp_tx_seg_info_s *next;
  95. };
  96. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  97. /**
  98. * struct dp_tx_sg_info_s - Scatter Gather Descriptor
  99. * @num_segs: Number of segments (TSO/ME) in the frame
  100. * @total_len: Total length of the frame
  101. * @curr_seg: Points to current segment descriptor to be processed. Chain of
  102. * descriptors for SG frames/multicast-unicast converted packets.
  103. *
  104. * Used for SG (802.3 or Raw) frames and Multicast-Unicast converted frames to
  105. * carry fragmentation information
  106. * Raw Frames will be handed over to driver as an SKB chain with MPDU boundaries
  107. * indicated through flags in SKB CB (first_msdu and last_msdu). This will be
  108. * converted into set of skb sg (nr_frags) structures.
  109. */
  110. struct dp_tx_sg_info_s {
  111. uint32_t num_segs;
  112. uint32_t total_len;
  113. struct dp_tx_seg_info_s *curr_seg;
  114. };
  115. /**
  116. * struct dp_tx_queue - Tx queue
  117. * @desc_pool_id: Descriptor Pool to be used for the tx queue
  118. * @ring_id: TCL descriptor ring ID corresponding to the tx queue
  119. *
  120. * Tx queue contains information of the software (Descriptor pool)
  121. * and hardware resources (TCL ring id) to be used for a particular
  122. * transmit queue (obtained from skb_queue_mapping in case of linux)
  123. */
  124. struct dp_tx_queue {
  125. uint8_t desc_pool_id;
  126. uint8_t ring_id;
  127. };
  128. /**
  129. * struct dp_tx_msdu_info_s - MSDU Descriptor
  130. * @frm_type: Frame type - Regular/TSO/SG/Multicast enhancement
  131. * @tx_queue: Tx queue on which this MSDU should be transmitted
  132. * @num_seg: Number of segments (TSO)
  133. * @tid: TID (override) that is sent from HLOS
  134. * @u.tso_info: TSO information for TSO frame types
  135. * (chain of the TSO segments, number of segments)
  136. * @u.sg_info: Scatter Gather information for non-TSO SG frames
  137. * @meta_data: Mesh meta header information
  138. * @exception_fw: Duplicate frame to be sent to firmware
  139. * @ppdu_cookie: 16-bit ppdu_cookie that has to be replayed back in completions
  140. * @ix_tx_sniffer: Indicates if the packet has to be sniffed
  141. *
  142. * This structure holds the complete MSDU information needed to program the
  143. * Hardware TCL and MSDU extension descriptors for different frame types
  144. *
  145. */
  146. struct dp_tx_msdu_info_s {
  147. enum dp_tx_frm_type frm_type;
  148. struct dp_tx_queue tx_queue;
  149. uint32_t num_seg;
  150. uint8_t tid;
  151. uint8_t exception_fw;
  152. uint8_t is_tx_sniffer;
  153. union {
  154. struct qdf_tso_info_t tso_info;
  155. struct dp_tx_sg_info_s sg_info;
  156. } u;
  157. uint32_t meta_data[DP_TX_MSDU_INFO_META_DATA_DWORDS];
  158. uint16_t ppdu_cookie;
  159. };
  160. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  161. /**
  162. * dp_tx_deinit_pair_by_index() - Deinit TX rings based on index
  163. * @soc: core txrx context
  164. * @index: index of ring to deinit
  165. *
  166. * Deinit 1 TCL and 1 WBM2SW release ring on as needed basis using
  167. * index of the respective TCL/WBM2SW release in soc structure.
  168. * For example, if the index is 2 then &soc->tcl_data_ring[2]
  169. * and &soc->tx_comp_ring[2] will be deinitialized.
  170. *
  171. * Return: none
  172. */
  173. void dp_tx_deinit_pair_by_index(struct dp_soc *soc, int index);
  174. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  175. void dp_tx_tso_cmn_desc_pool_deinit(struct dp_soc *soc, uint8_t num_pool);
  176. void dp_tx_tso_cmn_desc_pool_free(struct dp_soc *soc, uint8_t num_pool);
  177. QDF_STATUS dp_tx_tso_cmn_desc_pool_alloc(struct dp_soc *soc,
  178. uint8_t num_pool,
  179. uint16_t num_desc);
  180. QDF_STATUS dp_tx_tso_cmn_desc_pool_init(struct dp_soc *soc,
  181. uint8_t num_pool,
  182. uint16_t num_desc);
  183. void dp_tx_tso_cmn_desc_pool_deinit(struct dp_soc *soc, uint8_t num_pool);
  184. void dp_tx_tso_cmn_desc_pool_free(struct dp_soc *soc, uint8_t num_pool);
  185. QDF_STATUS dp_tx_tso_cmn_desc_pool_alloc(struct dp_soc *soc,
  186. uint8_t num_pool,
  187. uint16_t num_desc);
  188. QDF_STATUS dp_tx_tso_cmn_desc_pool_init(struct dp_soc *soc,
  189. uint8_t num_pool,
  190. uint16_t num_desc);
  191. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  192. /**
  193. * dp_tso_attach() - TSO Attach handler
  194. * @txrx_soc: Opaque Dp handle
  195. *
  196. * Reserve TSO descriptor buffers
  197. *
  198. * Return: QDF_STATUS_E_FAILURE on failure or
  199. * QDF_STATUS_SUCCESS on success
  200. */
  201. QDF_STATUS dp_tso_soc_attach(struct cdp_soc_t *txrx_soc);
  202. /**
  203. * dp_tso_detach() - TSO Detach handler
  204. * @txrx_soc: Opaque Dp handle
  205. *
  206. * Deallocate TSO descriptor buffers
  207. *
  208. * Return: QDF_STATUS_E_FAILURE on failure or
  209. * QDF_STATUS_SUCCESS on success
  210. */
  211. QDF_STATUS dp_tso_soc_detach(struct cdp_soc_t *txrx_soc);
  212. qdf_nbuf_t dp_tx_send(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t nbuf);
  213. qdf_nbuf_t dp_tx_send_vdev_id_check(struct cdp_soc_t *soc, uint8_t vdev_id,
  214. qdf_nbuf_t nbuf);
  215. qdf_nbuf_t dp_tx_send_exception(struct cdp_soc_t *soc, uint8_t vdev_id,
  216. qdf_nbuf_t nbuf,
  217. struct cdp_tx_exception_metadata *tx_exc);
  218. qdf_nbuf_t dp_tx_send_exception_vdev_id_check(struct cdp_soc_t *soc,
  219. uint8_t vdev_id,
  220. qdf_nbuf_t nbuf,
  221. struct cdp_tx_exception_metadata *tx_exc);
  222. qdf_nbuf_t dp_tx_send_mesh(struct cdp_soc_t *soc, uint8_t vdev_id,
  223. qdf_nbuf_t nbuf);
  224. qdf_nbuf_t
  225. dp_tx_send_msdu_single(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  226. struct dp_tx_msdu_info_s *msdu_info, uint16_t peer_id,
  227. struct cdp_tx_exception_metadata *tx_exc_metadata);
  228. #if QDF_LOCK_STATS
  229. noinline qdf_nbuf_t
  230. dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  231. struct dp_tx_msdu_info_s *msdu_info);
  232. #else
  233. qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  234. struct dp_tx_msdu_info_s *msdu_info);
  235. #endif
  236. #ifdef FEATURE_WLAN_TDLS
  237. /**
  238. * dp_tx_non_std() - Allow the control-path SW to send data frames
  239. * @soc_hdl: Datapath soc handle
  240. * @vdev_id: id of vdev
  241. * @tx_spec: what non-standard handling to apply to the tx data frames
  242. * @msdu_list: NULL-terminated list of tx MSDUs
  243. *
  244. * Return: NULL on success,
  245. * nbuf when it fails to send
  246. */
  247. qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  248. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  249. #endif
  250. int dp_tx_frame_is_drop(struct dp_vdev *vdev, uint8_t *srcmac, uint8_t *dstmac);
  251. /**
  252. * dp_tx_comp_handler() - Tx completion handler
  253. * @int_ctx: pointer to DP interrupt context
  254. * @soc: core txrx main context
  255. * @hal_srng: Opaque HAL SRNG pointer
  256. * @ring_id: completion ring id
  257. * @quota: No. of packets/descriptors that can be serviced in one loop
  258. *
  259. * This function will collect hardware release ring element contents and
  260. * handle descriptor contents. Based on contents, free packet or handle error
  261. * conditions
  262. *
  263. * Return: Number of TX completions processed
  264. */
  265. uint32_t dp_tx_comp_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
  266. hal_ring_handle_t hal_srng, uint8_t ring_id,
  267. uint32_t quota);
  268. QDF_STATUS
  269. dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  270. QDF_STATUS
  271. dp_tx_prepare_send_igmp_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  272. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  273. #if defined(QCA_HOST_MODE_WIFI_DISABLED) || !defined(ATH_SUPPORT_IQUE)
  274. static inline void dp_tx_me_exit(struct dp_pdev *pdev)
  275. {
  276. return;
  277. }
  278. #endif
  279. /**
  280. * dp_tx_pdev_init() - dp tx pdev init
  281. * @pdev: physical device instance
  282. *
  283. * Return: QDF_STATUS_SUCCESS: success
  284. * QDF_STATUS_E_RESOURCES: Error return
  285. */
  286. static inline QDF_STATUS dp_tx_pdev_init(struct dp_pdev *pdev)
  287. {
  288. struct dp_soc *soc = pdev->soc;
  289. /* Initialize Flow control counters */
  290. qdf_atomic_init(&pdev->num_tx_outstanding);
  291. pdev->tx_descs_max = 0;
  292. if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
  293. /* Initialize descriptors in TCL Ring */
  294. hal_tx_init_data_ring(soc->hal_soc,
  295. soc->tcl_data_ring[pdev->pdev_id].hal_srng);
  296. }
  297. return QDF_STATUS_SUCCESS;
  298. }
  299. #ifndef FEATURE_WDS
  300. static inline void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
  301. {
  302. return;
  303. }
  304. #endif
  305. #ifndef QCA_MULTIPASS_SUPPORT
  306. static inline
  307. bool dp_tx_multipass_process(struct dp_soc *soc, struct dp_vdev *vdev,
  308. qdf_nbuf_t nbuf,
  309. struct dp_tx_msdu_info_s *msdu_info)
  310. {
  311. return true;
  312. }
  313. static inline
  314. void dp_tx_vdev_multipass_deinit(struct dp_vdev *vdev)
  315. {
  316. }
  317. #else
  318. bool dp_tx_multipass_process(struct dp_soc *soc, struct dp_vdev *vdev,
  319. qdf_nbuf_t nbuf,
  320. struct dp_tx_msdu_info_s *msdu_info);
  321. void dp_tx_vdev_multipass_deinit(struct dp_vdev *vdev);
  322. #endif
  323. /**
  324. * dp_tx_hw_to_qdf()- convert hw status to qdf status
  325. * @status: hw status
  326. *
  327. * Return: qdf tx rx status
  328. */
  329. static inline enum qdf_dp_tx_rx_status dp_tx_hw_to_qdf(uint16_t status)
  330. {
  331. switch (status) {
  332. case HAL_TX_TQM_RR_FRAME_ACKED:
  333. return QDF_TX_RX_STATUS_OK;
  334. case HAL_TX_TQM_RR_REM_CMD_REM:
  335. case HAL_TX_TQM_RR_REM_CMD_TX:
  336. case HAL_TX_TQM_RR_REM_CMD_NOTX:
  337. case HAL_TX_TQM_RR_REM_CMD_AGED:
  338. return QDF_TX_RX_STATUS_FW_DISCARD;
  339. default:
  340. return QDF_TX_RX_STATUS_DEFAULT;
  341. }
  342. }
  343. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  344. /**
  345. * dp_tx_get_queue() - Returns Tx queue IDs to be used for this Tx frame
  346. * @vdev: DP Virtual device handle
  347. * @nbuf: Buffer pointer
  348. * @queue: queue ids container for nbuf
  349. *
  350. * TX packet queue has 2 instances, software descriptors id and dma ring id
  351. * Based on tx feature and hardware configuration queue id combination could be
  352. * different.
  353. * For example -
  354. * With XPS enabled,all TX descriptor pools and dma ring are assigned per cpu id
  355. * With no XPS,lock based resource protection, Descriptor pool ids are different
  356. * for each vdev, dma ring id will be same as single pdev id
  357. *
  358. * Return: None
  359. */
  360. #ifdef QCA_OL_TX_MULTIQ_SUPPORT
  361. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  362. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  363. {
  364. uint16_t queue_offset = qdf_nbuf_get_queue_mapping(nbuf) &
  365. DP_TX_QUEUE_MASK;
  366. queue->desc_pool_id = queue_offset;
  367. queue->ring_id = qdf_get_cpu();
  368. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  369. "%s, pool_id:%d ring_id: %d",
  370. __func__, queue->desc_pool_id, queue->ring_id);
  371. }
  372. /*
  373. * dp_tx_get_hal_ring_hdl()- Get the hal_tx_ring_hdl for data transmission
  374. * @dp_soc - DP soc structure pointer
  375. * @ring_id - Transmit Queue/ring_id to be used when XPS is enabled
  376. *
  377. * Return - HAL ring handle
  378. */
  379. static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
  380. uint8_t ring_id)
  381. {
  382. if (ring_id == soc->num_tcl_data_rings)
  383. return soc->tcl_cmd_credit_ring.hal_srng;
  384. return soc->tcl_data_ring[ring_id].hal_srng;
  385. }
  386. /*
  387. * dp_tx_get_rbm_id()- Get the RBM ID for data transmission completion.
  388. * @dp_soc - DP soc structure pointer
  389. * @ring_id - Transmit Queue/ring_id to be used when XPS is enabled
  390. *
  391. * Return - HAL ring handle
  392. */
  393. static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *doc,
  394. uint8_t ring_id)
  395. {
  396. return (ring_id ? HAL_WBM_SW0_BM_ID + (ring_id - 1) :
  397. HAL_WBM_SW2_BM_ID);
  398. }
  399. #else /* QCA_OL_TX_MULTIQ_SUPPORT */
  400. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  401. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  402. {
  403. /* get flow id */
  404. queue->desc_pool_id = DP_TX_GET_DESC_POOL_ID(vdev);
  405. queue->ring_id = DP_TX_GET_RING_ID(vdev);
  406. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  407. "%s, pool_id:%d ring_id: %d",
  408. __func__, queue->desc_pool_id, queue->ring_id);
  409. }
  410. static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
  411. uint8_t ring_id)
  412. {
  413. return soc->tcl_data_ring[ring_id].hal_srng;
  414. }
  415. static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *soc,
  416. uint8_t ring_id)
  417. {
  418. return (ring_id + HAL_WBM_SW0_BM_ID);
  419. }
  420. #endif
  421. #ifdef QCA_OL_TX_LOCK_LESS_ACCESS
  422. /*
  423. * dp_tx_hal_ring_access_start()- hal_tx_ring access for data transmission
  424. * @dp_soc - DP soc structure pointer
  425. * @hal_ring_hdl - HAL ring handle
  426. *
  427. * Return - None
  428. */
  429. static inline int dp_tx_hal_ring_access_start(struct dp_soc *soc,
  430. hal_ring_handle_t hal_ring_hdl)
  431. {
  432. return hal_srng_access_start_unlocked(soc->hal_soc, hal_ring_hdl);
  433. }
  434. /*
  435. * dp_tx_hal_ring_access_end()- hal_tx_ring access for data transmission
  436. * @dp_soc - DP soc structure pointer
  437. * @hal_ring_hdl - HAL ring handle
  438. *
  439. * Return - None
  440. */
  441. static inline void dp_tx_hal_ring_access_end(struct dp_soc *soc,
  442. hal_ring_handle_t hal_ring_hdl)
  443. {
  444. hal_srng_access_end_unlocked(soc->hal_soc, hal_ring_hdl);
  445. }
  446. /*
  447. * dp_tx_hal_ring_access_reap()- hal_tx_ring access for data transmission
  448. * @dp_soc - DP soc structure pointer
  449. * @hal_ring_hdl - HAL ring handle
  450. *
  451. * Return - None
  452. */
  453. static inline void dp_tx_hal_ring_access_end_reap(struct dp_soc *soc,
  454. hal_ring_handle_t
  455. hal_ring_hdl)
  456. {
  457. }
  458. #else
  459. static inline int dp_tx_hal_ring_access_start(struct dp_soc *soc,
  460. hal_ring_handle_t hal_ring_hdl)
  461. {
  462. return hal_srng_access_start(soc->hal_soc, hal_ring_hdl);
  463. }
  464. static inline void dp_tx_hal_ring_access_end(struct dp_soc *soc,
  465. hal_ring_handle_t hal_ring_hdl)
  466. {
  467. hal_srng_access_end(soc->hal_soc, hal_ring_hdl);
  468. }
  469. static inline void dp_tx_hal_ring_access_end_reap(struct dp_soc *soc,
  470. hal_ring_handle_t
  471. hal_ring_hdl)
  472. {
  473. hal_srng_access_end_reap(soc->hal_soc, hal_ring_hdl);
  474. }
  475. #endif
  476. void dp_iterate_update_peer_list(struct cdp_pdev *pdev_hdl);
  477. #ifdef ATH_TX_PRI_OVERRIDE
  478. #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf) \
  479. ((_msdu_info)->tid = qdf_nbuf_get_priority(_nbuf))
  480. #else
  481. #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf)
  482. #endif
  483. /* TODO TX_FEATURE_NOT_YET */
  484. static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc)
  485. {
  486. return;
  487. }
  488. /* TODO TX_FEATURE_NOT_YET */
  489. void dp_tx_desc_flush(struct dp_pdev *pdev, struct dp_vdev *vdev,
  490. bool force_free);
  491. QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev);
  492. QDF_STATUS dp_tx_vdev_detach(struct dp_vdev *vdev);
  493. void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev);
  494. QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc);
  495. QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc);
  496. void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc);
  497. void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc);
  498. void
  499. dp_handle_wbm_internal_error(struct dp_soc *soc, void *hal_desc,
  500. uint32_t buf_type);
  501. #else /* QCA_HOST_MODE_WIFI_DISABLED */
  502. static inline
  503. QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc)
  504. {
  505. return QDF_STATUS_SUCCESS;
  506. }
  507. static inline
  508. QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc)
  509. {
  510. return QDF_STATUS_SUCCESS;
  511. }
  512. static inline void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc)
  513. {
  514. }
  515. static inline void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc)
  516. {
  517. }
  518. static inline
  519. void dp_tx_desc_flush(struct dp_pdev *pdev, struct dp_vdev *vdev,
  520. bool force_free)
  521. {
  522. }
  523. static inline QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
  524. {
  525. return QDF_STATUS_SUCCESS;
  526. }
  527. static inline QDF_STATUS dp_tx_vdev_detach(struct dp_vdev *vdev)
  528. {
  529. return QDF_STATUS_SUCCESS;
  530. }
  531. static inline void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev)
  532. {
  533. }
  534. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  535. #ifdef FEATURE_PERPKT_INFO
  536. QDF_STATUS
  537. dp_get_completion_indication_for_stack(struct dp_soc *soc,
  538. struct dp_pdev *pdev,
  539. struct dp_peer *peer,
  540. struct hal_tx_completion_status *ts,
  541. qdf_nbuf_t netbuf,
  542. uint64_t time_latency);
  543. void dp_send_completion_to_stack(struct dp_soc *soc, struct dp_pdev *pdev,
  544. uint16_t peer_id, uint32_t ppdu_id,
  545. qdf_nbuf_t netbuf);
  546. #else
  547. static inline
  548. QDF_STATUS dp_get_completion_indication_for_stack(struct dp_soc *soc,
  549. struct dp_pdev *pdev,
  550. struct dp_peer *peer,
  551. struct hal_tx_completion_status *ts,
  552. qdf_nbuf_t netbuf,
  553. uint64_t time_latency)
  554. {
  555. return QDF_STATUS_E_NOSUPPORT;
  556. }
  557. static inline
  558. void dp_send_completion_to_stack(struct dp_soc *soc, struct dp_pdev *pdev,
  559. uint16_t peer_id, uint32_t ppdu_id,
  560. qdf_nbuf_t netbuf)
  561. {
  562. }
  563. #endif
  564. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  565. static inline
  566. QDF_STATUS dp_peer_set_tx_capture_enabled(struct dp_pdev *pdev,
  567. struct dp_peer *peer_handle,
  568. uint8_t value, uint8_t *peer_mac)
  569. {
  570. return QDF_STATUS_SUCCESS;
  571. }
  572. #endif
  573. #endif