dp_tx.h 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef __DP_TX_H
  20. #define __DP_TX_H
  21. #include <qdf_types.h>
  22. #include <qdf_nbuf.h>
  23. #include "dp_types.h"
  24. #ifdef FEATURE_PERPKT_INFO
  25. #if defined(QCA_SUPPORT_LATENCY_CAPTURE) || \
  26. defined(QCA_TX_CAPTURE_SUPPORT) || \
  27. defined(QCA_MCOPY_SUPPORT)
  28. #include "if_meta_hdr.h"
  29. #endif
  30. #endif
  31. #include "dp_internal.h"
  32. #include "hal_tx.h"
  33. #include <qdf_tracepoint.h>
  34. #ifdef CONFIG_SAWF
  35. #include "dp_sawf.h"
  36. #endif
  37. #include <qdf_pkt_add_timestamp.h>
  38. #include "dp_ipa.h"
  39. #ifdef IPA_OFFLOAD
  40. #include <wlan_ipa_obj_mgmt_api.h>
  41. #endif
  42. #define DP_INVALID_VDEV_ID 0xFF
  43. #define DP_TX_MAX_NUM_FRAGS 6
  44. /* invalid peer id for reinject*/
  45. #define DP_INVALID_PEER 0XFFFE
  46. void dp_tx_nawds_handler(struct dp_soc *soc, struct dp_vdev *vdev,
  47. struct dp_tx_msdu_info_s *msdu_info,
  48. qdf_nbuf_t nbuf, uint16_t sa_peer_id);
  49. int dp_tx_proxy_arp(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  50. /*
  51. * DP_TX_DESC_FLAG_FRAG flags should always be defined to 0x1
  52. * please do not change this flag's definition
  53. */
  54. #define DP_TX_DESC_FLAG_FRAG 0x1
  55. #define DP_TX_DESC_FLAG_TO_FW 0x2
  56. #define DP_TX_DESC_FLAG_SIMPLE 0x4
  57. #define DP_TX_DESC_FLAG_RAW 0x8
  58. #define DP_TX_DESC_FLAG_MESH 0x10
  59. #define DP_TX_DESC_FLAG_QUEUED_TX 0x20
  60. #define DP_TX_DESC_FLAG_COMPLETED_TX 0x40
  61. #define DP_TX_DESC_FLAG_ME 0x80
  62. #define DP_TX_DESC_FLAG_TDLS_FRAME 0x100
  63. #define DP_TX_DESC_FLAG_ALLOCATED 0x200
  64. #define DP_TX_DESC_FLAG_MESH_MODE 0x400
  65. #define DP_TX_DESC_FLAG_UNMAP_DONE 0x800
  66. #define DP_TX_DESC_FLAG_TX_COMP_ERR 0x1000
  67. #define DP_TX_DESC_FLAG_FLUSH 0x2000
  68. #define DP_TX_DESC_FLAG_TRAFFIC_END_IND 0x4000
  69. #define DP_TX_DESC_FLAG_RMNET 0x8000
  70. #define DP_TX_DESC_FLAG_FASTPATH_SIMPLE 0x10000
  71. #define DP_TX_DESC_FLAG_PPEDS 0x20000
  72. #define DP_TX_DESC_FLAG_FAST 0x40000
  73. #define DP_TX_DESC_FLAG_SPECIAL 0x80000
  74. #define DP_TX_EXT_DESC_FLAG_METADATA_VALID 0x1
  75. #define DP_TX_FREE_SINGLE_BUF(soc, buf) \
  76. do { \
  77. qdf_nbuf_unmap(soc->osdev, buf, QDF_DMA_TO_DEVICE); \
  78. qdf_nbuf_free(buf); \
  79. } while (0)
  80. #define OCB_HEADER_VERSION 1
  81. #ifdef TX_PER_PDEV_DESC_POOL
  82. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  83. #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
  84. #else /* QCA_LL_TX_FLOW_CONTROL_V2 */
  85. #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->pdev->pdev_id)
  86. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  87. #define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
  88. #else
  89. #ifdef TX_PER_VDEV_DESC_POOL
  90. #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
  91. #define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
  92. #endif /* TX_PER_VDEV_DESC_POOL */
  93. #endif /* TX_PER_PDEV_DESC_POOL */
  94. #define DP_TX_QUEUE_MASK 0x3
  95. #define MAX_CDP_SEC_TYPE 12
  96. /* number of dwords for htt_tx_msdu_desc_ext2_t */
  97. #define DP_TX_MSDU_INFO_META_DATA_DWORDS 7
  98. #define dp_tx_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_TX, params)
  99. #define dp_tx_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_TX, params)
  100. #define dp_tx_err_rl(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_DP_TX, params)
  101. #define dp_tx_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_TX, params)
  102. #define dp_tx_info(params...) \
  103. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_TX, ## params)
  104. #define dp_tx_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_TX, params)
  105. #define dp_tx_comp_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_TX_COMP, params)
  106. #define dp_tx_comp_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_TX_COMP, params)
  107. #define dp_tx_comp_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_TX_COMP, params)
  108. #define dp_tx_comp_info(params...) \
  109. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_TX_COMP, ## params)
  110. #define dp_tx_comp_info_rl(params...) \
  111. __QDF_TRACE_RL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_TX_COMP, ## params)
  112. #define dp_tx_comp_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_TX_COMP, params)
  113. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  114. /**
  115. * struct dp_tx_frag_info_s
  116. * @vaddr: hlos virtual address for buffer
  117. * @paddr_lo: physical address lower 32bits
  118. * @paddr_hi: physical address higher bits
  119. * @len: length of the buffer
  120. */
  121. struct dp_tx_frag_info_s {
  122. uint8_t *vaddr;
  123. uint32_t paddr_lo;
  124. uint16_t paddr_hi;
  125. uint16_t len;
  126. };
  127. /**
  128. * struct dp_tx_seg_info_s - Segmentation Descriptor
  129. * @nbuf: NBUF pointer if segment corresponds to separate nbuf
  130. * @frag_cnt: Fragment count in this segment
  131. * @total_len: Total length of segment
  132. * @frags: per-Fragment information
  133. * @next: pointer to next MSDU segment
  134. */
  135. struct dp_tx_seg_info_s {
  136. qdf_nbuf_t nbuf;
  137. uint16_t frag_cnt;
  138. uint16_t total_len;
  139. struct dp_tx_frag_info_s frags[DP_TX_MAX_NUM_FRAGS];
  140. struct dp_tx_seg_info_s *next;
  141. };
  142. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  143. /**
  144. * struct dp_tx_sg_info_s - Scatter Gather Descriptor
  145. * @num_segs: Number of segments (TSO/ME) in the frame
  146. * @total_len: Total length of the frame
  147. * @curr_seg: Points to current segment descriptor to be processed. Chain of
  148. * descriptors for SG frames/multicast-unicast converted packets.
  149. *
  150. * Used for SG (802.3 or Raw) frames and Multicast-Unicast converted frames to
  151. * carry fragmentation information
  152. * Raw Frames will be handed over to driver as an SKB chain with MPDU boundaries
  153. * indicated through flags in SKB CB (first_msdu and last_msdu). This will be
  154. * converted into set of skb sg (nr_frags) structures.
  155. */
  156. struct dp_tx_sg_info_s {
  157. uint32_t num_segs;
  158. uint32_t total_len;
  159. struct dp_tx_seg_info_s *curr_seg;
  160. };
  161. /**
  162. * struct dp_tx_queue - Tx queue
  163. * @desc_pool_id: Descriptor Pool to be used for the tx queue
  164. * @ring_id: TCL descriptor ring ID corresponding to the tx queue
  165. *
  166. * Tx queue contains information of the software (Descriptor pool)
  167. * and hardware resources (TCL ring id) to be used for a particular
  168. * transmit queue (obtained from skb_queue_mapping in case of linux)
  169. */
  170. struct dp_tx_queue {
  171. uint8_t desc_pool_id;
  172. uint8_t ring_id;
  173. };
  174. /**
  175. * struct dp_tx_msdu_info_s - MSDU Descriptor
  176. * @frm_type: Frame type - Regular/TSO/SG/Multicast enhancement
  177. * @tx_queue: Tx queue on which this MSDU should be transmitted
  178. * @num_seg: Number of segments (TSO)
  179. * @tid: TID (override) that is sent from HLOS
  180. * @exception_fw: Duplicate frame to be sent to firmware
  181. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  182. * @u: union of frame information structs
  183. * @u.tso_info: TSO information for TSO frame types
  184. * (chain of the TSO segments, number of segments)
  185. * @u.sg_info: Scatter Gather information for non-TSO SG frames
  186. * @meta_data: Mesh meta header information
  187. * @ppdu_cookie: 16-bit ppdu_cookie that has to be replayed back in completions
  188. * @xmit_type: xmit type of packet Link (0)/MLD (1)
  189. * @gsn: global sequence for reinjected mcast packets
  190. * @vdev_id : vdev_id for reinjected mcast packets
  191. * @skip_hp_update : Skip HP update for TSO segments and update in last segment
  192. * @buf_len:
  193. * @payload_addr:
  194. * @driver_ingress_ts: driver ingress timestamp
  195. *
  196. * This structure holds the complete MSDU information needed to program the
  197. * Hardware TCL and MSDU extension descriptors for different frame types
  198. *
  199. */
  200. struct dp_tx_msdu_info_s {
  201. enum dp_tx_frm_type frm_type;
  202. struct dp_tx_queue tx_queue;
  203. uint32_t num_seg;
  204. uint8_t tid;
  205. uint8_t exception_fw;
  206. uint8_t is_tx_sniffer;
  207. union {
  208. struct qdf_tso_info_t tso_info;
  209. struct dp_tx_sg_info_s sg_info;
  210. } u;
  211. uint32_t meta_data[DP_TX_MSDU_INFO_META_DATA_DWORDS];
  212. uint16_t ppdu_cookie;
  213. uint8_t xmit_type;
  214. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  215. #ifdef WLAN_MCAST_MLO
  216. uint16_t gsn;
  217. uint8_t vdev_id;
  218. #endif
  219. #endif
  220. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  221. uint8_t skip_hp_update;
  222. #endif
  223. #ifdef QCA_DP_TX_RMNET_OPTIMIZATION
  224. uint16_t buf_len;
  225. uint8_t *payload_addr;
  226. #endif
  227. #ifdef WLAN_FEATURE_TX_LATENCY_STATS
  228. qdf_ktime_t driver_ingress_ts;
  229. #endif
  230. };
  231. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  232. /**
  233. * dp_tx_deinit_pair_by_index() - Deinit TX rings based on index
  234. * @soc: core txrx context
  235. * @index: index of ring to deinit
  236. *
  237. * Deinit 1 TCL and 1 WBM2SW release ring on as needed basis using
  238. * index of the respective TCL/WBM2SW release in soc structure.
  239. * For example, if the index is 2 then &soc->tcl_data_ring[2]
  240. * and &soc->tx_comp_ring[2] will be deinitialized.
  241. *
  242. * Return: none
  243. */
  244. void dp_tx_deinit_pair_by_index(struct dp_soc *soc, int index);
  245. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  246. /**
  247. * dp_tx_comp_process_desc_list() - Tx complete software descriptor handler
  248. * @soc: core txrx main context
  249. * @comp_head: software descriptor head pointer
  250. * @ring_id: ring number
  251. *
  252. * This function will process batch of descriptors reaped by dp_tx_comp_handler
  253. * and release the software descriptors after processing is complete
  254. *
  255. * Return: none
  256. */
  257. void
  258. dp_tx_comp_process_desc_list(struct dp_soc *soc,
  259. struct dp_tx_desc_s *comp_head, uint8_t ring_id);
  260. /**
  261. * dp_tx_comp_process_desc_list_fast() - Tx complete fast sw descriptor handler
  262. * @soc: core txrx main context
  263. * @head_desc: software descriptor head pointer
  264. * @tail_desc: software descriptor tail pointer
  265. * @ring_id: ring number
  266. * @fast_desc_count: Total descriptor count in the list
  267. *
  268. * This function will process batch of descriptors reaped by dp_tx_comp_handler
  269. * and append the list of descriptors to the freelist
  270. *
  271. * Return: none
  272. */
  273. void
  274. dp_tx_comp_process_desc_list_fast(struct dp_soc *soc,
  275. struct dp_tx_desc_s *head_desc,
  276. struct dp_tx_desc_s *tail_desc,
  277. uint8_t ring_id,
  278. uint32_t fast_desc_count);
  279. /**
  280. * dp_tx_comp_free_buf() - Free nbuf associated with the Tx Descriptor
  281. * @soc: Soc handle
  282. * @desc: software Tx descriptor to be processed
  283. * @delayed_free: defer freeing of nbuf
  284. *
  285. * Return: nbuf to be freed later
  286. */
  287. qdf_nbuf_t dp_tx_comp_free_buf(struct dp_soc *soc, struct dp_tx_desc_s *desc,
  288. bool delayed_free);
  289. /**
  290. * dp_tx_desc_release() - Release Tx Descriptor
  291. * @soc: Soc handle
  292. * @tx_desc: Tx Descriptor
  293. * @desc_pool_id: Descriptor Pool ID
  294. *
  295. * Deallocate all resources attached to Tx descriptor and free the Tx
  296. * descriptor.
  297. *
  298. * Return:
  299. */
  300. void dp_tx_desc_release(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc,
  301. uint8_t desc_pool_id);
  302. /**
  303. * dp_tx_compute_delay() - Compute and fill in all timestamps
  304. * to pass in correct fields
  305. * @vdev: pdev handle
  306. * @tx_desc: tx descriptor
  307. * @tid: tid value
  308. * @ring_id: TCL or WBM ring number for transmit path
  309. *
  310. * Return: none
  311. */
  312. void dp_tx_compute_delay(struct dp_vdev *vdev, struct dp_tx_desc_s *tx_desc,
  313. uint8_t tid, uint8_t ring_id);
  314. /**
  315. * dp_tx_comp_process_tx_status() - Parse and Dump Tx completion status info
  316. * @soc: DP soc handle
  317. * @tx_desc: software descriptor head pointer
  318. * @ts: Tx completion status
  319. * @txrx_peer: txrx peer handle
  320. * @ring_id: ring number
  321. *
  322. * Return: none
  323. */
  324. void dp_tx_comp_process_tx_status(struct dp_soc *soc,
  325. struct dp_tx_desc_s *tx_desc,
  326. struct hal_tx_completion_status *ts,
  327. struct dp_txrx_peer *txrx_peer,
  328. uint8_t ring_id);
  329. /**
  330. * dp_tx_comp_process_desc() - Process tx descriptor and free associated nbuf
  331. * @soc: DP Soc handle
  332. * @desc: software Tx descriptor
  333. * @ts: Tx completion status from HAL/HTT descriptor
  334. * @txrx_peer: DP peer context
  335. *
  336. * Return: none
  337. */
  338. void dp_tx_comp_process_desc(struct dp_soc *soc,
  339. struct dp_tx_desc_s *desc,
  340. struct hal_tx_completion_status *ts,
  341. struct dp_txrx_peer *txrx_peer);
  342. /**
  343. * dp_tx_reinject_handler() - Tx Reinject Handler
  344. * @soc: datapath soc handle
  345. * @vdev: datapath vdev handle
  346. * @tx_desc: software descriptor head pointer
  347. * @status: Tx completion status from HTT descriptor
  348. * @reinject_reason: reinject reason from HTT descriptor
  349. *
  350. * This function reinjects frames back to Target.
  351. * Todo - Host queue needs to be added
  352. *
  353. * Return: none
  354. */
  355. void dp_tx_reinject_handler(struct dp_soc *soc,
  356. struct dp_vdev *vdev,
  357. struct dp_tx_desc_s *tx_desc,
  358. uint8_t *status,
  359. uint8_t reinject_reason);
  360. /**
  361. * dp_tx_inspect_handler() - Tx Inspect Handler
  362. * @soc: datapath soc handle
  363. * @vdev: datapath vdev handle
  364. * @tx_desc: software descriptor head pointer
  365. * @status: Tx completion status from HTT descriptor
  366. *
  367. * Handles Tx frames sent back to Host for inspection
  368. * (ProxyARP)
  369. *
  370. * Return: none
  371. */
  372. void dp_tx_inspect_handler(struct dp_soc *soc,
  373. struct dp_vdev *vdev,
  374. struct dp_tx_desc_s *tx_desc,
  375. uint8_t *status);
  376. /**
  377. * dp_tx_update_peer_basic_stats() - Update peer basic stats
  378. * @txrx_peer: Datapath txrx_peer handle
  379. * @length: Length of the packet
  380. * @tx_status: Tx status from TQM/FW
  381. * @update: enhanced flag value present in dp_pdev
  382. *
  383. * Return: none
  384. */
  385. void dp_tx_update_peer_basic_stats(struct dp_txrx_peer *txrx_peer,
  386. uint32_t length, uint8_t tx_status,
  387. bool update);
  388. #ifdef DP_UMAC_HW_RESET_SUPPORT
  389. /**
  390. * dp_tx_drop() - Drop the frame on a given VAP
  391. * @soc: DP soc handle
  392. * @vdev_id: id of DP vdev handle
  393. * @nbuf: skb
  394. *
  395. * Drop all the incoming packets
  396. *
  397. * Return: nbuf
  398. */
  399. qdf_nbuf_t dp_tx_drop(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t nbuf);
  400. /**
  401. * dp_tx_exc_drop() - Drop the frame on a given VAP
  402. * @soc_hdl: DP soc handle
  403. * @vdev_id: id of DP vdev handle
  404. * @nbuf: skb
  405. * @tx_exc_metadata: Handle that holds exception path meta data
  406. *
  407. * Drop all the incoming packets
  408. *
  409. * Return: nbuf
  410. */
  411. qdf_nbuf_t dp_tx_exc_drop(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  412. qdf_nbuf_t nbuf,
  413. struct cdp_tx_exception_metadata *tx_exc_metadata);
  414. #endif
  415. #ifdef WLAN_SUPPORT_PPEDS
  416. qdf_nbuf_t
  417. dp_ppeds_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc);
  418. #else
  419. static inline qdf_nbuf_t
  420. dp_ppeds_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc)
  421. {
  422. return NULL;
  423. }
  424. #endif
  425. /**
  426. * dp_get_updated_tx_desc() - get updated tx_desc value
  427. * @psoc: psoc object
  428. * @pool_num: Tx desc pool Id
  429. * @current_desc: Current Tx Desc value
  430. *
  431. * In Lowmem profiles the number of Tx desc in 4th pool is reduced to quarter
  432. * for memory optimizations via this flag DP_TX_DESC_POOL_OPTIMIZE
  433. *
  434. * Return: Updated Tx Desc value
  435. */
  436. #ifdef DP_TX_DESC_POOL_OPTIMIZE
  437. static inline uint32_t dp_get_updated_tx_desc(struct cdp_ctrl_objmgr_psoc *psoc,
  438. uint8_t pool_num,
  439. uint32_t current_desc)
  440. {
  441. if (pool_num == 3)
  442. return cfg_get(psoc, CFG_DP_TX_DESC_POOL_3);
  443. else
  444. return current_desc;
  445. }
  446. #else
  447. static inline uint32_t dp_get_updated_tx_desc(struct cdp_ctrl_objmgr_psoc *psoc,
  448. uint8_t pool_num,
  449. uint32_t current_desc)
  450. {
  451. return current_desc;
  452. }
  453. #endif
  454. #ifdef DP_TX_EXT_DESC_POOL_OPTIMIZE
  455. /**
  456. * dp_tx_ext_desc_pool_override() - Override tx ext desc pool Id
  457. * @desc_pool_id: Desc pool Id
  458. *
  459. * For low mem profiles the number of ext_tx_desc_pool is reduced to 1.
  460. * Since in Tx path the desc_pool_id is filled based on CPU core,
  461. * dp_tx_ext_desc_pool_override will return the desc_pool_id as 0 for lowmem
  462. * profiles.
  463. *
  464. * Return: updated tx_ext_desc_pool Id
  465. */
  466. static inline uint8_t dp_tx_ext_desc_pool_override(uint8_t desc_pool_id)
  467. {
  468. return 0;
  469. }
  470. /**
  471. * dp_get_ext_tx_desc_pool_num() - get the number of ext_tx_desc pool
  472. * @soc: core txrx main context
  473. *
  474. * For lowmem profiles the number of ext_tx_desc pool is reduced to 1 for
  475. * memory optimizations.
  476. * Based on this flag DP_TX_EXT_DESC_POOL_OPTIMIZE dp_get_ext_tx_desc_pool_num
  477. * will return reduced desc_pool value 1 for low mem profile and for the other
  478. * profiles it will return the same value as tx_desc pool.
  479. *
  480. * Return: number of ext_tx_desc pool
  481. */
  482. static inline uint8_t dp_get_ext_tx_desc_pool_num(struct dp_soc *soc)
  483. {
  484. return 1;
  485. }
  486. #else
  487. static inline uint8_t dp_tx_ext_desc_pool_override(uint8_t desc_pool_id)
  488. {
  489. return desc_pool_id;
  490. }
  491. static inline uint8_t dp_get_ext_tx_desc_pool_num(struct dp_soc *soc)
  492. {
  493. return wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
  494. }
  495. #endif
  496. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  497. /**
  498. * dp_tso_soc_attach() - TSO Attach handler
  499. * @txrx_soc: Opaque Dp handle
  500. *
  501. * Reserve TSO descriptor buffers
  502. *
  503. * Return: QDF_STATUS_E_FAILURE on failure or
  504. * QDF_STATUS_SUCCESS on success
  505. */
  506. QDF_STATUS dp_tso_soc_attach(struct cdp_soc_t *txrx_soc);
  507. /**
  508. * dp_tso_soc_detach() - TSO Detach handler
  509. * @txrx_soc: Opaque Dp handle
  510. *
  511. * Deallocate TSO descriptor buffers
  512. *
  513. * Return: QDF_STATUS_E_FAILURE on failure or
  514. * QDF_STATUS_SUCCESS on success
  515. */
  516. QDF_STATUS dp_tso_soc_detach(struct cdp_soc_t *txrx_soc);
  517. /**
  518. * dp_tx_send() - Transmit a frame on a given VAP
  519. * @soc_hdl: DP soc handle
  520. * @vdev_id: id of DP vdev handle
  521. * @nbuf: skb
  522. *
  523. * Entry point for Core Tx layer (DP_TX) invoked from
  524. * hard_start_xmit in OSIF/HDD or from dp_rx_process for intravap forwarding
  525. * cases
  526. *
  527. * Return: NULL on success,
  528. * nbuf when it fails to send
  529. */
  530. qdf_nbuf_t dp_tx_send(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  531. qdf_nbuf_t nbuf);
  532. /**
  533. * dp_tx_send_vdev_id_check() - Transmit a frame on a given VAP in special
  534. * case to avoid check in per-packet path.
  535. * @soc_hdl: DP soc handle
  536. * @vdev_id: id of DP vdev handle
  537. * @nbuf: skb
  538. *
  539. * Entry point for Core Tx layer (DP_TX) invoked from
  540. * hard_start_xmit in OSIF/HDD to transmit packet through dp_tx_send
  541. * with special condition to avoid per pkt check in dp_tx_send
  542. *
  543. * Return: NULL on success,
  544. * nbuf when it fails to send
  545. */
  546. qdf_nbuf_t dp_tx_send_vdev_id_check(struct cdp_soc_t *soc_hdl,
  547. uint8_t vdev_id, qdf_nbuf_t nbuf);
  548. /**
  549. * dp_tx_send_exception() - Transmit a frame on a given VAP in exception path
  550. * @soc_hdl: DP soc handle
  551. * @vdev_id: id of DP vdev handle
  552. * @nbuf: skb
  553. * @tx_exc_metadata: Handle that holds exception path meta data
  554. *
  555. * Entry point for Core Tx layer (DP_TX) invoked from
  556. * hard_start_xmit in OSIF/HDD to transmit frames through fw
  557. *
  558. * Return: NULL on success,
  559. * nbuf when it fails to send
  560. */
  561. qdf_nbuf_t
  562. dp_tx_send_exception(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  563. qdf_nbuf_t nbuf,
  564. struct cdp_tx_exception_metadata *tx_exc_metadata);
  565. /**
  566. * dp_tx_send_exception_vdev_id_check() - Transmit a frame on a given VAP
  567. * in exception path in special case to avoid regular exception path chk.
  568. * @soc_hdl: DP soc handle
  569. * @vdev_id: id of DP vdev handle
  570. * @nbuf: skb
  571. * @tx_exc_metadata: Handle that holds exception path meta data
  572. *
  573. * Entry point for Core Tx layer (DP_TX) invoked from
  574. * hard_start_xmit in OSIF/HDD to transmit frames through fw
  575. *
  576. * Return: NULL on success,
  577. * nbuf when it fails to send
  578. */
  579. qdf_nbuf_t
  580. dp_tx_send_exception_vdev_id_check(struct cdp_soc_t *soc_hdl,
  581. uint8_t vdev_id, qdf_nbuf_t nbuf,
  582. struct cdp_tx_exception_metadata *tx_exc_metadata);
  583. /**
  584. * dp_tx_send_mesh() - Transmit mesh frame on a given VAP
  585. * @soc_hdl: DP soc handle
  586. * @vdev_id: DP vdev handle
  587. * @nbuf: skb
  588. *
  589. * Entry point for Core Tx layer (DP_TX) invoked from
  590. * hard_start_xmit in OSIF/HDD
  591. *
  592. * Return: NULL on success,
  593. * nbuf when it fails to send
  594. */
  595. qdf_nbuf_t dp_tx_send_mesh(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  596. qdf_nbuf_t nbuf);
  597. /**
  598. * dp_tx_send_msdu_single() - Setup descriptor and enqueue single MSDU to TCL
  599. * @vdev: DP vdev handle
  600. * @nbuf: skb
  601. * @msdu_info: MSDU information
  602. * @peer_id: peer_id of the peer in case of NAWDS frames
  603. * @tx_exc_metadata: Handle that holds exception path metadata
  604. *
  605. * Return: NULL on success,
  606. * nbuf when it fails to send
  607. */
  608. qdf_nbuf_t
  609. dp_tx_send_msdu_single(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  610. struct dp_tx_msdu_info_s *msdu_info, uint16_t peer_id,
  611. struct cdp_tx_exception_metadata *tx_exc_metadata);
  612. /**
  613. * dp_tx_mcast_enhance() - Multicast enhancement on TX
  614. * @vdev: DP vdev handle
  615. * @nbuf: network buffer to be transmitted
  616. *
  617. * Return: true on success
  618. * false on failure
  619. */
  620. bool dp_tx_mcast_enhance(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  621. /**
  622. * dp_tx_send_msdu_multiple() - Enqueue multiple MSDUs
  623. * @vdev: DP vdev handle
  624. * @nbuf: skb
  625. * @msdu_info: MSDU info to be setup in MSDU extension descriptor
  626. *
  627. * Prepare descriptors for multiple MSDUs (TSO segments) and enqueue to TCL
  628. *
  629. * Return: NULL on success,
  630. * nbuf when it fails to send
  631. */
  632. #if QDF_LOCK_STATS
  633. noinline qdf_nbuf_t
  634. dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  635. struct dp_tx_msdu_info_s *msdu_info);
  636. #else
  637. qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
  638. struct dp_tx_msdu_info_s *msdu_info);
  639. #endif
  640. #ifdef FEATURE_WLAN_TDLS
  641. /**
  642. * dp_tx_non_std() - Allow the control-path SW to send data frames
  643. * @soc_hdl: Datapath soc handle
  644. * @vdev_id: id of vdev
  645. * @tx_spec: what non-standard handling to apply to the tx data frames
  646. * @msdu_list: NULL-terminated list of tx MSDUs
  647. *
  648. * Return: NULL on success,
  649. * nbuf when it fails to send
  650. */
  651. qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  652. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  653. #endif
  654. /**
  655. * dp_tx_frame_is_drop() - checks if the packet is loopback
  656. * @vdev: DP vdev handle
  657. * @srcmac: source MAC address
  658. * @dstmac: destination MAC address
  659. *
  660. * Return: 1 if frame needs to be dropped else 0
  661. */
  662. int dp_tx_frame_is_drop(struct dp_vdev *vdev, uint8_t *srcmac, uint8_t *dstmac);
  663. #ifndef WLAN_SOFTUMAC_SUPPORT
  664. /**
  665. * dp_tx_comp_handler() - Tx completion handler
  666. * @int_ctx: pointer to DP interrupt context
  667. * @soc: core txrx main context
  668. * @hal_srng: Opaque HAL SRNG pointer
  669. * @ring_id: completion ring id
  670. * @quota: No. of packets/descriptors that can be serviced in one loop
  671. *
  672. * This function will collect hardware release ring element contents and
  673. * handle descriptor contents. Based on contents, free packet or handle error
  674. * conditions
  675. *
  676. * Return: Number of TX completions processed
  677. */
  678. uint32_t dp_tx_comp_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
  679. hal_ring_handle_t hal_srng, uint8_t ring_id,
  680. uint32_t quota);
  681. #endif
  682. void
  683. dp_tx_comp_process_desc_list(struct dp_soc *soc,
  684. struct dp_tx_desc_s *comp_head, uint8_t ring_id);
  685. QDF_STATUS
  686. dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  687. QDF_STATUS
  688. dp_tx_prepare_send_igmp_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
  689. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  690. #if defined(QCA_HOST_MODE_WIFI_DISABLED) || !defined(ATH_SUPPORT_IQUE)
  691. static inline void dp_tx_me_exit(struct dp_pdev *pdev)
  692. {
  693. return;
  694. }
  695. #endif
  696. /**
  697. * dp_tx_pdev_init() - dp tx pdev init
  698. * @pdev: physical device instance
  699. *
  700. * Return: QDF_STATUS_SUCCESS: success
  701. * QDF_STATUS_E_RESOURCES: Error return
  702. */
  703. static inline QDF_STATUS dp_tx_pdev_init(struct dp_pdev *pdev)
  704. {
  705. struct dp_soc *soc = pdev->soc;
  706. /* Initialize Flow control counters */
  707. qdf_atomic_init(&pdev->num_tx_outstanding);
  708. pdev->tx_descs_max = 0;
  709. if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
  710. /* Initialize descriptors in TCL Ring */
  711. hal_tx_init_data_ring(soc->hal_soc,
  712. soc->tcl_data_ring[pdev->pdev_id].hal_srng);
  713. }
  714. return QDF_STATUS_SUCCESS;
  715. }
  716. /**
  717. * dp_tx_prefetch_hw_sw_nbuf_desc() - function to prefetch HW and SW desc
  718. * @soc: Handle to HAL Soc structure
  719. * @hal_soc: HAL SOC handle
  720. * @num_avail_for_reap: descriptors available for reap
  721. * @hal_ring_hdl: ring pointer
  722. * @last_prefetched_hw_desc: pointer to the last prefetched HW descriptor
  723. * @last_prefetched_sw_desc: pointer to last prefetch SW desc
  724. *
  725. * Return: None
  726. */
  727. #ifdef QCA_DP_TX_HW_SW_NBUF_DESC_PREFETCH
  728. static inline
  729. void dp_tx_prefetch_hw_sw_nbuf_desc(struct dp_soc *soc,
  730. hal_soc_handle_t hal_soc,
  731. uint32_t num_avail_for_reap,
  732. hal_ring_handle_t hal_ring_hdl,
  733. void **last_prefetched_hw_desc,
  734. struct dp_tx_desc_s
  735. **last_prefetched_sw_desc)
  736. {
  737. if (*last_prefetched_sw_desc) {
  738. qdf_prefetch((uint8_t *)(*last_prefetched_sw_desc)->nbuf);
  739. qdf_prefetch((uint8_t *)(*last_prefetched_sw_desc)->nbuf + 64);
  740. }
  741. if (num_avail_for_reap && *last_prefetched_hw_desc) {
  742. soc->arch_ops.tx_comp_get_params_from_hal_desc(soc,
  743. *last_prefetched_hw_desc,
  744. last_prefetched_sw_desc);
  745. if ((uintptr_t)*last_prefetched_hw_desc & 0x3f)
  746. *last_prefetched_hw_desc =
  747. hal_srng_dst_prefetch_next_cached_desc(
  748. hal_soc,
  749. hal_ring_hdl,
  750. (uint8_t *)*last_prefetched_hw_desc);
  751. else
  752. *last_prefetched_hw_desc =
  753. hal_srng_dst_get_next_32_byte_desc(hal_soc,
  754. hal_ring_hdl,
  755. (uint8_t *)*last_prefetched_hw_desc);
  756. }
  757. }
  758. #else
  759. static inline
  760. void dp_tx_prefetch_hw_sw_nbuf_desc(struct dp_soc *soc,
  761. hal_soc_handle_t hal_soc,
  762. uint32_t num_avail_for_reap,
  763. hal_ring_handle_t hal_ring_hdl,
  764. void **last_prefetched_hw_desc,
  765. struct dp_tx_desc_s
  766. **last_prefetched_sw_desc)
  767. {
  768. }
  769. #endif
  770. #ifndef FEATURE_WDS
  771. static inline void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
  772. {
  773. return;
  774. }
  775. #endif
  776. #ifndef QCA_MULTIPASS_SUPPORT
  777. static inline
  778. bool dp_tx_multipass_process(struct dp_soc *soc, struct dp_vdev *vdev,
  779. qdf_nbuf_t nbuf,
  780. struct dp_tx_msdu_info_s *msdu_info)
  781. {
  782. return true;
  783. }
  784. static inline
  785. void dp_tx_vdev_multipass_deinit(struct dp_vdev *vdev)
  786. {
  787. }
  788. #else
  789. /**
  790. * dp_tx_multipass_process() - Process vlan frames in tx path
  791. * @soc: dp soc handle
  792. * @vdev: DP vdev handle
  793. * @nbuf: skb
  794. * @msdu_info: msdu descriptor
  795. *
  796. * Return: status whether frame needs to be dropped or transmitted
  797. */
  798. bool dp_tx_multipass_process(struct dp_soc *soc, struct dp_vdev *vdev,
  799. qdf_nbuf_t nbuf,
  800. struct dp_tx_msdu_info_s *msdu_info);
  801. /**
  802. * dp_tx_vdev_multipass_deinit() - set vlan map for vdev
  803. * @vdev: pointer to vdev
  804. *
  805. * return: void
  806. */
  807. void dp_tx_vdev_multipass_deinit(struct dp_vdev *vdev);
  808. /**
  809. * dp_tx_add_groupkey_metadata() - Add group key in metadata
  810. * @vdev: DP vdev handle
  811. * @msdu_info: MSDU info to be setup in MSDU descriptor
  812. * @group_key: Group key index programmed in metadata
  813. *
  814. * Return: void
  815. */
  816. void dp_tx_add_groupkey_metadata(struct dp_vdev *vdev,
  817. struct dp_tx_msdu_info_s *msdu_info,
  818. uint16_t group_key);
  819. #endif
  820. /**
  821. * dp_tx_hw_to_qdf()- convert hw status to qdf status
  822. * @status: hw status
  823. *
  824. * Return: qdf tx rx status
  825. */
  826. static inline enum qdf_dp_tx_rx_status dp_tx_hw_to_qdf(uint16_t status)
  827. {
  828. switch (status) {
  829. case HAL_TX_TQM_RR_FRAME_ACKED:
  830. return QDF_TX_RX_STATUS_OK;
  831. case HAL_TX_TQM_RR_REM_CMD_TX:
  832. return QDF_TX_RX_STATUS_NO_ACK;
  833. case HAL_TX_TQM_RR_REM_CMD_REM:
  834. case HAL_TX_TQM_RR_REM_CMD_NOTX:
  835. case HAL_TX_TQM_RR_REM_CMD_AGED:
  836. return QDF_TX_RX_STATUS_FW_DISCARD;
  837. default:
  838. return QDF_TX_RX_STATUS_DEFAULT;
  839. }
  840. }
  841. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  842. /**
  843. * dp_tx_get_queue() - Returns Tx queue IDs to be used for this Tx frame
  844. * @vdev: DP Virtual device handle
  845. * @nbuf: Buffer pointer
  846. * @queue: queue ids container for nbuf
  847. *
  848. * TX packet queue has 2 instances, software descriptors id and dma ring id
  849. * Based on tx feature and hardware configuration queue id combination could be
  850. * different.
  851. * For example -
  852. * With XPS enabled,all TX descriptor pools and dma ring are assigned per cpu id
  853. * With no XPS,lock based resource protection, Descriptor pool ids are different
  854. * for each vdev, dma ring id will be same as single pdev id
  855. *
  856. * Return: None
  857. */
  858. #ifdef QCA_OL_TX_MULTIQ_SUPPORT
  859. #if defined(IPA_OFFLOAD) && defined(QCA_IPA_LL_TX_FLOW_CONTROL)
  860. #ifdef IPA_WDI3_TX_TWO_PIPES
  861. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  862. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  863. {
  864. queue->ring_id = qdf_get_cpu();
  865. if (vdev->pdev->soc->wlan_cfg_ctx->ipa_enabled)
  866. if ((queue->ring_id == IPA_TCL_DATA_RING_IDX) ||
  867. (queue->ring_id == IPA_TX_ALT_RING_IDX))
  868. queue->ring_id = 0;
  869. queue->desc_pool_id = queue->ring_id;
  870. }
  871. #else
  872. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  873. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  874. {
  875. queue->ring_id = qdf_get_cpu();
  876. if (vdev->pdev->soc->wlan_cfg_ctx->ipa_enabled)
  877. if (queue->ring_id == IPA_TCL_DATA_RING_IDX)
  878. queue->ring_id = 0;
  879. queue->desc_pool_id = queue->ring_id;
  880. }
  881. #endif
  882. #else
  883. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  884. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  885. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  886. {
  887. if (qdf_unlikely(vdev->is_override_rbm_id))
  888. queue->ring_id = vdev->rbm_id;
  889. else
  890. queue->ring_id = qdf_get_cpu();
  891. queue->desc_pool_id = queue->ring_id;
  892. }
  893. #else
  894. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  895. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  896. {
  897. queue->ring_id = qdf_get_cpu();
  898. queue->desc_pool_id = queue->ring_id;
  899. }
  900. #endif
  901. #endif
  902. /**
  903. * dp_tx_get_hal_ring_hdl() - Get the hal_tx_ring_hdl for data transmission
  904. * @soc: DP soc structure pointer
  905. * @ring_id: Transmit Queue/ring_id to be used when XPS is enabled
  906. *
  907. * Return: HAL ring handle
  908. */
  909. static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
  910. uint8_t ring_id)
  911. {
  912. if (ring_id == soc->num_tcl_data_rings)
  913. return soc->tcl_cmd_credit_ring.hal_srng;
  914. return soc->tcl_data_ring[ring_id].hal_srng;
  915. }
  916. #else /* QCA_OL_TX_MULTIQ_SUPPORT */
  917. #ifdef TX_MULTI_TCL
  918. #ifdef IPA_OFFLOAD
  919. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  920. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  921. {
  922. /* get flow id */
  923. queue->desc_pool_id = DP_TX_GET_DESC_POOL_ID(vdev);
  924. if (vdev->pdev->soc->wlan_cfg_ctx->ipa_enabled &&
  925. !ipa_config_is_opt_wifi_dp_enabled())
  926. queue->ring_id = DP_TX_GET_RING_ID(vdev);
  927. else
  928. queue->ring_id = (qdf_nbuf_get_queue_mapping(nbuf) %
  929. vdev->pdev->soc->num_tcl_data_rings);
  930. }
  931. #else
  932. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  933. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  934. {
  935. /* get flow id */
  936. queue->desc_pool_id = DP_TX_GET_DESC_POOL_ID(vdev);
  937. queue->ring_id = (qdf_nbuf_get_queue_mapping(nbuf) %
  938. vdev->pdev->soc->num_tcl_data_rings);
  939. }
  940. #endif
  941. #else
  942. static inline void dp_tx_get_queue(struct dp_vdev *vdev,
  943. qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
  944. {
  945. /* get flow id */
  946. queue->desc_pool_id = DP_TX_GET_DESC_POOL_ID(vdev);
  947. queue->ring_id = DP_TX_GET_RING_ID(vdev);
  948. }
  949. #endif
  950. static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
  951. uint8_t ring_id)
  952. {
  953. return soc->tcl_data_ring[ring_id].hal_srng;
  954. }
  955. #endif
  956. #ifdef QCA_OL_TX_LOCK_LESS_ACCESS
  957. /**
  958. * dp_tx_hal_ring_access_start() - hal_tx_ring access for data transmission
  959. * @soc: DP soc structure pointer
  960. * @hal_ring_hdl: HAL ring handle
  961. *
  962. * Return: None
  963. */
  964. static inline int dp_tx_hal_ring_access_start(struct dp_soc *soc,
  965. hal_ring_handle_t hal_ring_hdl)
  966. {
  967. return hal_srng_access_start_unlocked(soc->hal_soc, hal_ring_hdl);
  968. }
  969. /**
  970. * dp_tx_hal_ring_access_end() - hal_tx_ring access for data transmission
  971. * @soc: DP soc structure pointer
  972. * @hal_ring_hdl: HAL ring handle
  973. *
  974. * Return: None
  975. */
  976. static inline void dp_tx_hal_ring_access_end(struct dp_soc *soc,
  977. hal_ring_handle_t hal_ring_hdl)
  978. {
  979. hal_srng_access_end_unlocked(soc->hal_soc, hal_ring_hdl);
  980. }
  981. /**
  982. * dp_tx_hal_ring_access_end_reap() - hal_tx_ring access for data transmission
  983. * @soc: DP soc structure pointer
  984. * @hal_ring_hdl: HAL ring handle
  985. *
  986. * Return: None
  987. */
  988. static inline void dp_tx_hal_ring_access_end_reap(struct dp_soc *soc,
  989. hal_ring_handle_t
  990. hal_ring_hdl)
  991. {
  992. }
  993. #else
  994. static inline int dp_tx_hal_ring_access_start(struct dp_soc *soc,
  995. hal_ring_handle_t hal_ring_hdl)
  996. {
  997. return hal_srng_access_start(soc->hal_soc, hal_ring_hdl);
  998. }
  999. static inline void dp_tx_hal_ring_access_end(struct dp_soc *soc,
  1000. hal_ring_handle_t hal_ring_hdl)
  1001. {
  1002. hal_srng_access_end(soc->hal_soc, hal_ring_hdl);
  1003. }
  1004. static inline void dp_tx_hal_ring_access_end_reap(struct dp_soc *soc,
  1005. hal_ring_handle_t
  1006. hal_ring_hdl)
  1007. {
  1008. hal_srng_access_end_reap(soc->hal_soc, hal_ring_hdl);
  1009. }
  1010. #endif
  1011. #ifdef ATH_TX_PRI_OVERRIDE
  1012. #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf) \
  1013. ((_msdu_info)->tid = qdf_nbuf_get_priority(_nbuf))
  1014. #else
  1015. #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf)
  1016. #endif
  1017. /* TODO TX_FEATURE_NOT_YET */
  1018. static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc)
  1019. {
  1020. return;
  1021. }
  1022. /* TODO TX_FEATURE_NOT_YET */
  1023. /**
  1024. * dp_tx_desc_flush() - release resources associated
  1025. * to TX Desc
  1026. *
  1027. * @pdev: Handle to DP pdev structure
  1028. * @vdev: virtual device instance
  1029. * NULL: no specific Vdev is required and check all allcated TX desc
  1030. * on this pdev.
  1031. * Non-NULL: only check the allocated TX Desc associated to this Vdev.
  1032. *
  1033. * @force_free:
  1034. * true: flush the TX desc.
  1035. * false: only reset the Vdev in each allocated TX desc
  1036. * that associated to current Vdev.
  1037. *
  1038. * This function will go through the TX desc pool to flush
  1039. * the outstanding TX data or reset Vdev to NULL in associated TX
  1040. * Desc.
  1041. */
  1042. void dp_tx_desc_flush(struct dp_pdev *pdev, struct dp_vdev *vdev,
  1043. bool force_free);
  1044. /**
  1045. * dp_tx_vdev_attach() - attach vdev to dp tx
  1046. * @vdev: virtual device instance
  1047. *
  1048. * Return: QDF_STATUS_SUCCESS: success
  1049. * QDF_STATUS_E_RESOURCES: Error return
  1050. */
  1051. QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev);
  1052. /**
  1053. * dp_tx_vdev_detach() - detach vdev from dp tx
  1054. * @vdev: virtual device instance
  1055. *
  1056. * Return: QDF_STATUS_SUCCESS: success
  1057. * QDF_STATUS_E_RESOURCES: Error return
  1058. */
  1059. QDF_STATUS dp_tx_vdev_detach(struct dp_vdev *vdev);
  1060. /**
  1061. * dp_tx_vdev_update_search_flags() - Update vdev flags as per opmode
  1062. * @vdev: virtual device instance
  1063. *
  1064. * Return: void
  1065. *
  1066. */
  1067. void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev);
  1068. /**
  1069. * dp_soc_tx_desc_sw_pools_alloc() - Allocate tx descriptor pool memory
  1070. * @soc: core txrx main context
  1071. *
  1072. * This function allocates memory for following descriptor pools
  1073. * 1. regular sw tx descriptor pools (static pools)
  1074. * 2. TX extension descriptor pools (ME, RAW, TSO etc...)
  1075. * 3. TSO descriptor pools
  1076. *
  1077. * Return: QDF_STATUS_SUCCESS: success
  1078. * QDF_STATUS_E_RESOURCES: Error return
  1079. */
  1080. QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc);
  1081. /**
  1082. * dp_soc_tx_desc_sw_pools_init() - Initialise TX descriptor pools
  1083. * @soc: core txrx main context
  1084. *
  1085. * This function initializes the following TX descriptor pools
  1086. * 1. regular sw tx descriptor pools (static pools)
  1087. * 2. TX extension descriptor pools (ME, RAW, TSO etc...)
  1088. * 3. TSO descriptor pools
  1089. *
  1090. * Return: QDF_STATUS_SUCCESS: success
  1091. * QDF_STATUS_E_RESOURCES: Error return
  1092. */
  1093. QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc);
  1094. /**
  1095. * dp_soc_tx_desc_sw_pools_free() - free all TX descriptors
  1096. * @soc: core txrx main context
  1097. *
  1098. * This function frees all tx related descriptors as below
  1099. * 1. Regular TX descriptors (static pools)
  1100. * 2. extension TX descriptors (used for ME, RAW, TSO etc...)
  1101. * 3. TSO descriptors
  1102. *
  1103. */
  1104. void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc);
  1105. /**
  1106. * dp_soc_tx_desc_sw_pools_deinit() - de-initialize all TX descriptors
  1107. * @soc: core txrx main context
  1108. *
  1109. * This function de-initializes all tx related descriptors as below
  1110. * 1. Regular TX descriptors (static pools)
  1111. * 2. extension TX descriptors (used for ME, RAW, TSO etc...)
  1112. * 3. TSO descriptors
  1113. *
  1114. */
  1115. void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc);
  1116. #ifndef WLAN_SOFTUMAC_SUPPORT
  1117. /**
  1118. * dp_handle_wbm_internal_error() - handles wbm_internal_error case
  1119. * @soc: core DP main context
  1120. * @hal_desc: hal descriptor
  1121. * @buf_type: indicates if the buffer is of type link disc or msdu
  1122. *
  1123. * wbm_internal_error is seen in following scenarios :
  1124. *
  1125. * 1. Null pointers detected in WBM_RELEASE_RING descriptors
  1126. * 2. Null pointers detected during delinking process
  1127. *
  1128. * Some null pointer cases:
  1129. *
  1130. * a. MSDU buffer pointer is NULL
  1131. * b. Next_MSDU_Link_Desc pointer is NULL, with no last msdu flag
  1132. * c. MSDU buffer pointer is NULL or Next_Link_Desc pointer is NULL
  1133. *
  1134. * Return: None
  1135. */
  1136. void
  1137. dp_handle_wbm_internal_error(struct dp_soc *soc, void *hal_desc,
  1138. uint32_t buf_type);
  1139. #endif
  1140. #else /* QCA_HOST_MODE_WIFI_DISABLED */
  1141. static inline
  1142. QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc)
  1143. {
  1144. return QDF_STATUS_SUCCESS;
  1145. }
  1146. static inline
  1147. QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc)
  1148. {
  1149. return QDF_STATUS_SUCCESS;
  1150. }
  1151. static inline void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc)
  1152. {
  1153. }
  1154. static inline void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc)
  1155. {
  1156. }
  1157. static inline
  1158. void dp_tx_desc_flush(struct dp_pdev *pdev, struct dp_vdev *vdev,
  1159. bool force_free)
  1160. {
  1161. }
  1162. static inline QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
  1163. {
  1164. return QDF_STATUS_SUCCESS;
  1165. }
  1166. static inline QDF_STATUS dp_tx_vdev_detach(struct dp_vdev *vdev)
  1167. {
  1168. return QDF_STATUS_SUCCESS;
  1169. }
  1170. static inline void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev)
  1171. {
  1172. }
  1173. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  1174. #if defined(QCA_SUPPORT_LATENCY_CAPTURE) || \
  1175. defined(QCA_TX_CAPTURE_SUPPORT) || \
  1176. defined(QCA_MCOPY_SUPPORT)
  1177. #ifdef FEATURE_PERPKT_INFO
  1178. /**
  1179. * dp_get_completion_indication_for_stack() - send completion to stack
  1180. * @soc : dp_soc handle
  1181. * @pdev: dp_pdev handle
  1182. * @txrx_peer: dp peer handle
  1183. * @ts: transmit completion status structure
  1184. * @netbuf: Buffer pointer for free
  1185. * @time_latency:
  1186. *
  1187. * This function is used for indication whether buffer needs to be
  1188. * sent to stack for freeing or not
  1189. *
  1190. * Return: QDF_STATUS
  1191. */
  1192. QDF_STATUS
  1193. dp_get_completion_indication_for_stack(struct dp_soc *soc,
  1194. struct dp_pdev *pdev,
  1195. struct dp_txrx_peer *txrx_peer,
  1196. struct hal_tx_completion_status *ts,
  1197. qdf_nbuf_t netbuf,
  1198. uint64_t time_latency);
  1199. /**
  1200. * dp_send_completion_to_stack() - send completion to stack
  1201. * @soc : dp_soc handle
  1202. * @pdev: dp_pdev handle
  1203. * @peer_id: peer_id of the peer for which completion came
  1204. * @ppdu_id: ppdu_id
  1205. * @netbuf: Buffer pointer for free
  1206. *
  1207. * This function is used to send completion to stack
  1208. * to free buffer
  1209. *
  1210. * Return: QDF_STATUS
  1211. */
  1212. void dp_send_completion_to_stack(struct dp_soc *soc, struct dp_pdev *pdev,
  1213. uint16_t peer_id, uint32_t ppdu_id,
  1214. qdf_nbuf_t netbuf);
  1215. #endif
  1216. #else
  1217. static inline
  1218. QDF_STATUS dp_get_completion_indication_for_stack(struct dp_soc *soc,
  1219. struct dp_pdev *pdev,
  1220. struct dp_txrx_peer *peer,
  1221. struct hal_tx_completion_status *ts,
  1222. qdf_nbuf_t netbuf,
  1223. uint64_t time_latency)
  1224. {
  1225. return QDF_STATUS_E_NOSUPPORT;
  1226. }
  1227. static inline
  1228. void dp_send_completion_to_stack(struct dp_soc *soc, struct dp_pdev *pdev,
  1229. uint16_t peer_id, uint32_t ppdu_id,
  1230. qdf_nbuf_t netbuf)
  1231. {
  1232. }
  1233. #endif
  1234. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  1235. /**
  1236. * dp_send_completion_to_pkt_capture() - send tx completion to packet capture
  1237. * @soc: dp_soc handle
  1238. * @desc: Tx Descriptor
  1239. * @ts: HAL Tx completion descriptor contents
  1240. *
  1241. * This function is used to send tx completion to packet capture
  1242. */
  1243. void dp_send_completion_to_pkt_capture(struct dp_soc *soc,
  1244. struct dp_tx_desc_s *desc,
  1245. struct hal_tx_completion_status *ts);
  1246. #else
  1247. static inline void
  1248. dp_send_completion_to_pkt_capture(struct dp_soc *soc,
  1249. struct dp_tx_desc_s *desc,
  1250. struct hal_tx_completion_status *ts)
  1251. {
  1252. }
  1253. #endif
  1254. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  1255. #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
  1256. /**
  1257. * dp_tx_update_stats() - Update soc level tx stats
  1258. * @soc: DP soc handle
  1259. * @tx_desc: TX descriptor reference
  1260. * @ring_id: TCL ring id
  1261. *
  1262. * Return: none
  1263. */
  1264. void dp_tx_update_stats(struct dp_soc *soc,
  1265. struct dp_tx_desc_s *tx_desc,
  1266. uint8_t ring_id);
  1267. /**
  1268. * dp_tx_attempt_coalescing() - Check and attempt TCL register write coalescing
  1269. * @soc: Datapath soc handle
  1270. * @vdev: DP vdev handle
  1271. * @tx_desc: tx packet descriptor
  1272. * @tid: TID for pkt transmission
  1273. * @msdu_info: MSDU info of tx packet
  1274. * @ring_id: TCL ring id
  1275. *
  1276. * Return: 1, if coalescing is to be done
  1277. * 0, if coalescing is not to be done
  1278. */
  1279. int
  1280. dp_tx_attempt_coalescing(struct dp_soc *soc, struct dp_vdev *vdev,
  1281. struct dp_tx_desc_s *tx_desc,
  1282. uint8_t tid,
  1283. struct dp_tx_msdu_info_s *msdu_info,
  1284. uint8_t ring_id);
  1285. /**
  1286. * dp_tx_ring_access_end() - HAL ring access end for data transmission
  1287. * @soc: Datapath soc handle
  1288. * @hal_ring_hdl: HAL ring handle
  1289. * @coalesce: Coalesce the current write or not
  1290. *
  1291. * Return: none
  1292. */
  1293. void
  1294. dp_tx_ring_access_end(struct dp_soc *soc, hal_ring_handle_t hal_ring_hdl,
  1295. int coalesce);
  1296. #else
  1297. /**
  1298. * dp_tx_update_stats() - Update soc level tx stats
  1299. * @soc: DP soc handle
  1300. * @tx_desc: TX descriptor reference
  1301. * @ring_id: TCL ring id
  1302. *
  1303. * Return: none
  1304. */
  1305. static inline void dp_tx_update_stats(struct dp_soc *soc,
  1306. struct dp_tx_desc_s *tx_desc,
  1307. uint8_t ring_id){ }
  1308. static inline void
  1309. dp_tx_ring_access_end(struct dp_soc *soc, hal_ring_handle_t hal_ring_hdl,
  1310. int coalesce)
  1311. {
  1312. dp_tx_hal_ring_access_end(soc, hal_ring_hdl);
  1313. }
  1314. static inline int
  1315. dp_tx_attempt_coalescing(struct dp_soc *soc, struct dp_vdev *vdev,
  1316. struct dp_tx_desc_s *tx_desc,
  1317. uint8_t tid,
  1318. struct dp_tx_msdu_info_s *msdu_info,
  1319. uint8_t ring_id)
  1320. {
  1321. return 0;
  1322. }
  1323. #endif /* WLAN_DP_FEATURE_SW_LATENCY_MGR */
  1324. #ifdef FEATURE_RUNTIME_PM
  1325. /**
  1326. * dp_set_rtpm_tput_policy_requirement() - Update RTPM throughput policy
  1327. * @soc_hdl: DP soc handle
  1328. * @is_high_tput: flag to indicate whether throughput is high
  1329. *
  1330. * Return: none
  1331. */
  1332. static inline
  1333. void dp_set_rtpm_tput_policy_requirement(struct cdp_soc_t *soc_hdl,
  1334. bool is_high_tput)
  1335. {
  1336. struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
  1337. qdf_atomic_set(&soc->rtpm_high_tput_flag, is_high_tput);
  1338. }
  1339. /**
  1340. * dp_tx_ring_access_end_wrapper() - Wrapper for ring access end
  1341. * @soc: Datapath soc handle
  1342. * @hal_ring_hdl: HAL ring handle
  1343. * @coalesce: Coalesce the current write or not
  1344. *
  1345. * Feature-specific wrapper for HAL ring access end for data
  1346. * transmission
  1347. *
  1348. * Return: none
  1349. */
  1350. void
  1351. dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
  1352. hal_ring_handle_t hal_ring_hdl,
  1353. int coalesce);
  1354. #else
  1355. #ifdef DP_POWER_SAVE
  1356. void
  1357. dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
  1358. hal_ring_handle_t hal_ring_hdl,
  1359. int coalesce);
  1360. #else
  1361. static inline void
  1362. dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
  1363. hal_ring_handle_t hal_ring_hdl,
  1364. int coalesce)
  1365. {
  1366. dp_tx_ring_access_end(soc, hal_ring_hdl, coalesce);
  1367. }
  1368. #endif
  1369. static inline void
  1370. dp_set_rtpm_tput_policy_requirement(struct cdp_soc_t *soc_hdl,
  1371. bool is_high_tput)
  1372. { }
  1373. #endif
  1374. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  1375. #ifdef DP_TX_HW_DESC_HISTORY
  1376. static inline void
  1377. dp_tx_hw_desc_update_evt(uint8_t *hal_tx_desc_cached,
  1378. hal_ring_handle_t hal_ring_hdl,
  1379. struct dp_soc *soc, uint8_t ring_id)
  1380. {
  1381. struct dp_tx_hw_desc_history *tx_hw_desc_history =
  1382. &soc->tx_hw_desc_history;
  1383. struct dp_tx_hw_desc_evt *evt;
  1384. uint32_t idx = 0;
  1385. uint16_t slot = 0;
  1386. if (!tx_hw_desc_history->allocated)
  1387. return;
  1388. dp_get_frag_hist_next_atomic_idx(&tx_hw_desc_history->index, &idx,
  1389. &slot,
  1390. DP_TX_HW_DESC_HIST_SLOT_SHIFT,
  1391. DP_TX_HW_DESC_HIST_PER_SLOT_MAX,
  1392. DP_TX_HW_DESC_HIST_MAX);
  1393. evt = &tx_hw_desc_history->entry[slot][idx];
  1394. qdf_mem_copy(evt->tcl_desc, hal_tx_desc_cached, HAL_TX_DESC_LEN_BYTES);
  1395. evt->posted = qdf_get_log_timestamp();
  1396. evt->tcl_ring_id = ring_id;
  1397. hal_get_sw_hptp(soc->hal_soc, hal_ring_hdl, &evt->tp, &evt->hp);
  1398. }
  1399. #else
  1400. static inline void
  1401. dp_tx_hw_desc_update_evt(uint8_t *hal_tx_desc_cached,
  1402. hal_ring_handle_t hal_ring_hdl,
  1403. struct dp_soc *soc, uint8_t ring_id)
  1404. {
  1405. }
  1406. #endif
  1407. #if defined(WLAN_FEATURE_TSF_AUTO_REPORT) || defined(WLAN_CONFIG_TX_DELAY)
  1408. /**
  1409. * dp_tx_compute_hw_delay_us() - Compute hardware Tx completion delay
  1410. * @ts: Tx completion status
  1411. * @delta_tsf: Difference between TSF clock and qtimer
  1412. * @delay_us: Delay in microseconds
  1413. *
  1414. * Return: QDF_STATUS_SUCCESS : Success
  1415. * QDF_STATUS_E_INVAL : Tx completion status is invalid or
  1416. * delay_us is NULL
  1417. * QDF_STATUS_E_FAILURE : Error in delay calculation
  1418. */
  1419. QDF_STATUS
  1420. dp_tx_compute_hw_delay_us(struct hal_tx_completion_status *ts,
  1421. uint32_t delta_tsf,
  1422. uint32_t *delay_us);
  1423. /**
  1424. * dp_set_delta_tsf() - Set delta_tsf to dp_soc structure
  1425. * @soc_hdl: cdp soc pointer
  1426. * @vdev_id: vdev id
  1427. * @delta_tsf: difference between TSF clock and qtimer
  1428. *
  1429. * Return: None
  1430. */
  1431. void dp_set_delta_tsf(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1432. uint32_t delta_tsf);
  1433. #endif
  1434. #ifdef WLAN_FEATURE_TSF_UPLINK_DELAY
  1435. /**
  1436. * dp_set_tsf_ul_delay_report() - Enable or disable reporting uplink delay
  1437. * @soc_hdl: cdp soc pointer
  1438. * @vdev_id: vdev id
  1439. * @enable: true to enable and false to disable
  1440. *
  1441. * Return: QDF_STATUS
  1442. */
  1443. QDF_STATUS dp_set_tsf_ul_delay_report(struct cdp_soc_t *soc_hdl,
  1444. uint8_t vdev_id, bool enable);
  1445. /**
  1446. * dp_get_uplink_delay() - Get uplink delay value
  1447. * @soc_hdl: cdp soc pointer
  1448. * @vdev_id: vdev id
  1449. * @val: pointer to save uplink delay value
  1450. *
  1451. * Return: QDF_STATUS
  1452. */
  1453. QDF_STATUS dp_get_uplink_delay(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1454. uint32_t *val);
  1455. #endif /* WLAN_FEATURE_TSF_UPLINK_TSF */
  1456. /**
  1457. * dp_tx_pkt_tracepoints_enabled() - Get the state of tx pkt tracepoint
  1458. *
  1459. * Return: True if any tx pkt tracepoint is enabled else false
  1460. */
  1461. static inline
  1462. bool dp_tx_pkt_tracepoints_enabled(void)
  1463. {
  1464. return (qdf_trace_dp_tx_comp_tcp_pkt_enabled() ||
  1465. qdf_trace_dp_tx_comp_udp_pkt_enabled() ||
  1466. qdf_trace_dp_tx_comp_pkt_enabled());
  1467. }
  1468. #ifdef QCA_SUPPORT_DP_GLOBAL_CTX
  1469. static inline
  1470. struct dp_tx_desc_pool_s *dp_get_tx_desc_pool(struct dp_soc *soc,
  1471. uint8_t pool_id)
  1472. {
  1473. struct dp_global_context *dp_global = NULL;
  1474. dp_global = wlan_objmgr_get_global_ctx();
  1475. return dp_global->tx_desc[soc->arch_id][pool_id];
  1476. }
  1477. static inline
  1478. struct dp_tx_desc_pool_s *dp_get_spcl_tx_desc_pool(struct dp_soc *soc,
  1479. uint8_t pool_id)
  1480. {
  1481. struct dp_global_context *dp_global = NULL;
  1482. dp_global = wlan_objmgr_get_global_ctx();
  1483. return dp_global->spcl_tx_desc[soc->arch_id][pool_id];
  1484. }
  1485. #else
  1486. static inline
  1487. struct dp_tx_desc_pool_s *dp_get_tx_desc_pool(struct dp_soc *soc,
  1488. uint8_t pool_id)
  1489. {
  1490. return &soc->tx_desc[pool_id];
  1491. }
  1492. static inline
  1493. struct dp_tx_desc_pool_s *dp_get_spcl_tx_desc_pool(struct dp_soc *soc,
  1494. uint8_t pool_id)
  1495. {
  1496. return &soc->tx_desc[pool_id];
  1497. }
  1498. #endif
  1499. #ifdef DP_TX_TRACKING
  1500. /**
  1501. * dp_tx_desc_set_timestamp() - set timestamp in tx descriptor
  1502. * @tx_desc: tx descriptor
  1503. *
  1504. * Return: None
  1505. */
  1506. static inline
  1507. void dp_tx_desc_set_timestamp(struct dp_tx_desc_s *tx_desc)
  1508. {
  1509. tx_desc->timestamp_tick = qdf_system_ticks();
  1510. }
  1511. /**
  1512. * dp_tx_desc_check_corruption() - Verify magic pattern in tx descriptor
  1513. * @tx_desc: tx descriptor
  1514. *
  1515. * Check for corruption in tx descriptor, if magic pattern is not matching
  1516. * trigger self recovery
  1517. *
  1518. * Return: none
  1519. */
  1520. void dp_tx_desc_check_corruption(struct dp_tx_desc_s *tx_desc);
  1521. #else
  1522. static inline
  1523. void dp_tx_desc_set_timestamp(struct dp_tx_desc_s *tx_desc)
  1524. {
  1525. }
  1526. static inline
  1527. void dp_tx_desc_check_corruption(struct dp_tx_desc_s *tx_desc)
  1528. {
  1529. }
  1530. #endif
  1531. #ifndef CONFIG_SAWF
  1532. static inline bool dp_sawf_tag_valid_get(qdf_nbuf_t nbuf)
  1533. {
  1534. return false;
  1535. }
  1536. #endif
  1537. #ifdef HW_TX_DELAY_STATS_ENABLE
  1538. /**
  1539. * dp_tx_desc_set_ktimestamp() - set kernel timestamp in tx descriptor
  1540. * @vdev: DP vdev handle
  1541. * @tx_desc: tx descriptor
  1542. *
  1543. * Return: true when descriptor is timestamped, false otherwise
  1544. */
  1545. static inline
  1546. bool dp_tx_desc_set_ktimestamp(struct dp_vdev *vdev,
  1547. struct dp_tx_desc_s *tx_desc)
  1548. {
  1549. if (qdf_unlikely(vdev->pdev->delay_stats_flag) ||
  1550. qdf_unlikely(vdev->pdev->soc->wlan_cfg_ctx->pext_stats_enabled) ||
  1551. qdf_unlikely(dp_tx_pkt_tracepoints_enabled()) ||
  1552. qdf_unlikely(vdev->pdev->soc->peerstats_enabled) ||
  1553. qdf_unlikely(dp_is_vdev_tx_delay_stats_enabled(vdev)) ||
  1554. qdf_unlikely(wlan_cfg_is_peer_jitter_stats_enabled(vdev->pdev->soc->wlan_cfg_ctx))) {
  1555. tx_desc->timestamp = qdf_ktime_real_get();
  1556. return true;
  1557. }
  1558. return false;
  1559. }
  1560. #else
  1561. static inline
  1562. bool dp_tx_desc_set_ktimestamp(struct dp_vdev *vdev,
  1563. struct dp_tx_desc_s *tx_desc)
  1564. {
  1565. if (qdf_unlikely(vdev->pdev->delay_stats_flag) ||
  1566. qdf_unlikely(vdev->pdev->soc->wlan_cfg_ctx->pext_stats_enabled) ||
  1567. qdf_unlikely(dp_tx_pkt_tracepoints_enabled()) ||
  1568. qdf_unlikely(vdev->pdev->soc->peerstats_enabled) ||
  1569. qdf_unlikely(wlan_cfg_is_peer_jitter_stats_enabled(vdev->pdev->soc->wlan_cfg_ctx))) {
  1570. tx_desc->timestamp = qdf_ktime_real_get();
  1571. return true;
  1572. }
  1573. return false;
  1574. }
  1575. #endif
  1576. #ifdef CONFIG_DP_PKT_ADD_TIMESTAMP
  1577. /**
  1578. * dp_pkt_add_timestamp() - add timestamp in data payload
  1579. *
  1580. * @vdev: dp vdev
  1581. * @index: index to decide offset in payload
  1582. * @time: timestamp to add in data payload
  1583. * @nbuf: network buffer
  1584. *
  1585. * Return: none
  1586. */
  1587. void dp_pkt_add_timestamp(struct dp_vdev *vdev,
  1588. enum qdf_pkt_timestamp_index index, uint64_t time,
  1589. qdf_nbuf_t nbuf);
  1590. /**
  1591. * dp_pkt_get_timestamp() - get current system time
  1592. *
  1593. * @time: return current system time
  1594. *
  1595. * Return: none
  1596. */
  1597. void dp_pkt_get_timestamp(uint64_t *time);
  1598. #else
  1599. #define dp_pkt_add_timestamp(vdev, index, time, nbuf)
  1600. static inline
  1601. void dp_pkt_get_timestamp(uint64_t *time)
  1602. {
  1603. }
  1604. #endif
  1605. #ifdef CONFIG_WLAN_SYSFS_MEM_STATS
  1606. /**
  1607. * dp_update_tx_desc_stats - Update the increase or decrease in
  1608. * outstanding tx desc count
  1609. * values on pdev and soc
  1610. * @pdev: DP pdev handle
  1611. *
  1612. * Return: void
  1613. */
  1614. static inline void
  1615. dp_update_tx_desc_stats(struct dp_pdev *pdev)
  1616. {
  1617. int32_t tx_descs_cnt =
  1618. qdf_atomic_read(&pdev->num_tx_outstanding);
  1619. if (pdev->tx_descs_max < tx_descs_cnt)
  1620. pdev->tx_descs_max = tx_descs_cnt;
  1621. qdf_mem_tx_desc_cnt_update(pdev->num_tx_outstanding,
  1622. pdev->tx_descs_max);
  1623. }
  1624. #else /* CONFIG_WLAN_SYSFS_MEM_STATS */
  1625. static inline void
  1626. dp_update_tx_desc_stats(struct dp_pdev *pdev)
  1627. {
  1628. }
  1629. #endif /* CONFIG_WLAN_SYSFS_MEM_STATS */
  1630. #ifdef QCA_SUPPORT_DP_GLOBAL_CTX
  1631. /**
  1632. * dp_tx_get_global_desc_in_use() - read global descriptors in usage
  1633. * @dp_global: Datapath global context
  1634. *
  1635. * Return: global descriptors in use
  1636. */
  1637. static inline int32_t
  1638. dp_tx_get_global_desc_in_use(struct dp_global_context *dp_global)
  1639. {
  1640. return qdf_atomic_read(&dp_global->global_descriptor_in_use);
  1641. }
  1642. #endif
  1643. #ifdef QCA_TX_LIMIT_CHECK
  1644. static inline bool is_spl_packet(qdf_nbuf_t nbuf)
  1645. {
  1646. if (qdf_nbuf_is_ipv4_eapol_pkt(nbuf))
  1647. return true;
  1648. return false;
  1649. }
  1650. #ifdef QCA_SUPPORT_DP_GLOBAL_CTX
  1651. /**
  1652. * dp_tx_limit_check - Check if allocated tx descriptors reached
  1653. * global max reg limit and pdev max reg limit for regular packets. Also check
  1654. * if the limit is reached for special packets.
  1655. * @vdev: DP vdev handle
  1656. * @nbuf: network buffer
  1657. *
  1658. * Return: true if allocated tx descriptors reached max limit for regular
  1659. * packets and in case of special packets, if the limit is reached max
  1660. * configured vale for the soc/pdev, else false
  1661. */
  1662. static inline bool
  1663. dp_tx_limit_check(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
  1664. {
  1665. return false;
  1666. }
  1667. static inline bool
  1668. __dp_tx_limit_check(struct dp_soc *soc)
  1669. {
  1670. return false;
  1671. }
  1672. #else
  1673. /**
  1674. * is_dp_spl_tx_limit_reached - Check if the packet is a special packet to allow
  1675. * allocation if allocated tx descriptors are within the soc max limit
  1676. * and pdev max limit.
  1677. * @vdev: DP vdev handle
  1678. * @nbuf: network buffer
  1679. *
  1680. * Return: true if allocated tx descriptors reached max configured value, else
  1681. * false
  1682. */
  1683. static inline bool
  1684. is_dp_spl_tx_limit_reached(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
  1685. {
  1686. struct dp_pdev *pdev = vdev->pdev;
  1687. struct dp_soc *soc = pdev->soc;
  1688. if (is_spl_packet(nbuf)) {
  1689. if (qdf_atomic_read(&soc->num_tx_outstanding) >=
  1690. soc->num_tx_allowed)
  1691. return true;
  1692. if (qdf_atomic_read(&pdev->num_tx_outstanding) >=
  1693. pdev->num_tx_allowed)
  1694. return true;
  1695. return false;
  1696. }
  1697. return true;
  1698. }
  1699. static inline bool
  1700. __dp_tx_limit_check(struct dp_soc *soc)
  1701. {
  1702. return (qdf_atomic_read(&soc->num_tx_outstanding) >=
  1703. soc->num_reg_tx_allowed);
  1704. }
  1705. /**
  1706. * dp_tx_limit_check - Check if allocated tx descriptors reached
  1707. * soc max reg limit and pdev max reg limit for regular packets. Also check if
  1708. * the limit is reached for special packets.
  1709. * @vdev: DP vdev handle
  1710. * @nbuf: network buffer
  1711. *
  1712. * Return: true if allocated tx descriptors reached max limit for regular
  1713. * packets and in case of special packets, if the limit is reached max
  1714. * configured vale for the soc/pdev, else false
  1715. */
  1716. static inline bool
  1717. dp_tx_limit_check(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
  1718. {
  1719. struct dp_pdev *pdev = vdev->pdev;
  1720. struct dp_soc *soc = pdev->soc;
  1721. uint8_t xmit_type = qdf_nbuf_get_vdev_xmit_type(nbuf);
  1722. if (__dp_tx_limit_check(soc)) {
  1723. if (is_dp_spl_tx_limit_reached(vdev, nbuf)) {
  1724. dp_tx_info("queued packets are more than max tx, drop the frame");
  1725. DP_STATS_INC(vdev,
  1726. tx_i[xmit_type].dropped.desc_na.num, 1);
  1727. return true;
  1728. }
  1729. }
  1730. if (qdf_atomic_read(&pdev->num_tx_outstanding) >=
  1731. pdev->num_reg_tx_allowed) {
  1732. if (is_dp_spl_tx_limit_reached(vdev, nbuf)) {
  1733. dp_tx_info("queued packets are more than max tx, drop the frame");
  1734. DP_STATS_INC(vdev,
  1735. tx_i[xmit_type].dropped.desc_na.num, 1);
  1736. DP_STATS_INC(vdev,
  1737. tx_i[xmit_type].dropped.desc_na_exc_outstand.num,
  1738. 1);
  1739. return true;
  1740. }
  1741. }
  1742. return false;
  1743. }
  1744. #endif
  1745. /**
  1746. * dp_tx_exception_limit_check - Check if allocated tx exception descriptors
  1747. * reached soc max limit
  1748. * @vdev: DP vdev handle
  1749. * @xmit_type: xmit type of packet - MLD/Link
  1750. *
  1751. * Return: true if allocated tx descriptors reached max configured value, else
  1752. * false
  1753. */
  1754. static inline bool
  1755. dp_tx_exception_limit_check(struct dp_vdev *vdev, uint8_t xmit_type)
  1756. {
  1757. struct dp_pdev *pdev = vdev->pdev;
  1758. struct dp_soc *soc = pdev->soc;
  1759. if (qdf_atomic_read(&soc->num_tx_exception) >=
  1760. soc->num_msdu_exception_desc) {
  1761. dp_info("exc packets are more than max drop the exc pkt");
  1762. DP_STATS_INC(vdev, tx_i[xmit_type].dropped.exc_desc_na.num, 1);
  1763. return true;
  1764. }
  1765. return false;
  1766. }
  1767. #ifdef QCA_SUPPORT_DP_GLOBAL_CTX
  1768. /**
  1769. * dp_tx_outstanding_inc - Inc outstanding tx desc values on global and pdev
  1770. * @pdev: DP pdev handle
  1771. *
  1772. * Return: void
  1773. */
  1774. static inline void
  1775. dp_tx_outstanding_inc(struct dp_pdev *pdev)
  1776. {
  1777. }
  1778. static inline void
  1779. __dp_tx_outstanding_inc(struct dp_soc *soc)
  1780. {
  1781. }
  1782. static inline void
  1783. __dp_tx_outstanding_dec(struct dp_soc *soc)
  1784. {
  1785. }
  1786. /**
  1787. * dp_tx_outstanding_dec - Dec outstanding tx desc values on global and pdev
  1788. * @pdev: DP pdev handle
  1789. *
  1790. * Return: void
  1791. */
  1792. static inline void
  1793. dp_tx_outstanding_dec(struct dp_pdev *pdev)
  1794. {
  1795. }
  1796. /**
  1797. * dp_tx_outstanding_sub - Subtract outstanding tx desc values on pdev
  1798. * @pdev: DP pdev handle
  1799. * @count: count of descs to subtract from outstanding
  1800. *
  1801. * Return: void
  1802. */
  1803. static inline void
  1804. dp_tx_outstanding_sub(struct dp_pdev *pdev, uint32_t count)
  1805. {
  1806. }
  1807. #else
  1808. static inline void
  1809. __dp_tx_outstanding_inc(struct dp_soc *soc)
  1810. {
  1811. qdf_atomic_inc(&soc->num_tx_outstanding);
  1812. }
  1813. /**
  1814. * dp_tx_outstanding_inc - Increment outstanding tx desc values on pdev and soc
  1815. * @pdev: DP pdev handle
  1816. *
  1817. * Return: void
  1818. */
  1819. static inline void
  1820. dp_tx_outstanding_inc(struct dp_pdev *pdev)
  1821. {
  1822. struct dp_soc *soc = pdev->soc;
  1823. __dp_tx_outstanding_inc(soc);
  1824. qdf_atomic_inc(&pdev->num_tx_outstanding);
  1825. dp_update_tx_desc_stats(pdev);
  1826. }
  1827. static inline void
  1828. __dp_tx_outstanding_dec(struct dp_soc *soc)
  1829. {
  1830. qdf_atomic_dec(&soc->num_tx_outstanding);
  1831. }
  1832. /**
  1833. * dp_tx_outstanding_dec - Decrement outstanding tx desc values on pdev and soc
  1834. * @pdev: DP pdev handle
  1835. *
  1836. * Return: void
  1837. */
  1838. static inline void
  1839. dp_tx_outstanding_dec(struct dp_pdev *pdev)
  1840. {
  1841. struct dp_soc *soc = pdev->soc;
  1842. __dp_tx_outstanding_dec(soc);
  1843. qdf_atomic_dec(&pdev->num_tx_outstanding);
  1844. dp_update_tx_desc_stats(pdev);
  1845. }
  1846. /**
  1847. * __dp_tx_outstanding_sub - Sub outstanding tx desc values from soc
  1848. * @soc: DP soc handle
  1849. * @count: count of descs to subtract from outstanding
  1850. *
  1851. * Return: void
  1852. */
  1853. static inline void
  1854. __dp_tx_outstanding_sub(struct dp_soc *soc, uint32_t count)
  1855. {
  1856. qdf_atomic_sub(count, &soc->num_tx_outstanding);
  1857. }
  1858. /**
  1859. * dp_tx_outstanding_sub - Subtract outstanding tx desc values on pdev
  1860. * @pdev: DP pdev handle
  1861. * @count: count of descs to subtract from outstanding
  1862. *
  1863. * Return: void
  1864. */
  1865. static inline void
  1866. dp_tx_outstanding_sub(struct dp_pdev *pdev, uint32_t count)
  1867. {
  1868. struct dp_soc *soc = pdev->soc;
  1869. __dp_tx_outstanding_sub(soc, count);
  1870. qdf_atomic_sub(count, &pdev->num_tx_outstanding);
  1871. dp_update_tx_desc_stats(pdev);
  1872. }
  1873. #endif /* QCA_SUPPORT_DP_GLOBAL_CTX */
  1874. #else //QCA_TX_LIMIT_CHECK
  1875. static inline bool
  1876. __dp_tx_limit_check(struct dp_soc *soc)
  1877. {
  1878. return false;
  1879. }
  1880. static inline bool
  1881. dp_tx_limit_check(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
  1882. {
  1883. return false;
  1884. }
  1885. static inline bool
  1886. dp_tx_exception_limit_check(struct dp_vdev *vdev, uint8_t xmit_type)
  1887. {
  1888. return false;
  1889. }
  1890. static inline void
  1891. __dp_tx_outstanding_inc(struct dp_soc *soc)
  1892. {
  1893. }
  1894. static inline void
  1895. dp_tx_outstanding_inc(struct dp_pdev *pdev)
  1896. {
  1897. qdf_atomic_inc(&pdev->num_tx_outstanding);
  1898. dp_update_tx_desc_stats(pdev);
  1899. }
  1900. static inline void
  1901. __dp_tx_outstanding_dec(struct dp_soc *soc)
  1902. {
  1903. }
  1904. static inline void
  1905. dp_tx_outstanding_dec(struct dp_pdev *pdev)
  1906. {
  1907. qdf_atomic_dec(&pdev->num_tx_outstanding);
  1908. dp_update_tx_desc_stats(pdev);
  1909. }
  1910. static inline void
  1911. __dp_tx_outstanding_sub(struct dp_soc *soc, uint32_t count)
  1912. {
  1913. }
  1914. /**
  1915. * dp_tx_outstanding_sub - Subtract outstanding tx desc values on pdev
  1916. * @pdev: DP pdev handle
  1917. * @count: count of descs to subtract from outstanding
  1918. *
  1919. * Return: void
  1920. */
  1921. static inline void
  1922. dp_tx_outstanding_sub(struct dp_pdev *pdev, uint32_t count)
  1923. {
  1924. qdf_atomic_sub(count, &pdev->num_tx_outstanding);
  1925. dp_update_tx_desc_stats(pdev);
  1926. }
  1927. #endif //QCA_TX_LIMIT_CHECK
  1928. /**
  1929. * dp_tx_get_pkt_len() - Get the packet length of a msdu
  1930. * @tx_desc: tx descriptor
  1931. *
  1932. * Return: Packet length of a msdu. If the packet is fragmented,
  1933. * it will return the single fragment length.
  1934. *
  1935. * In TSO mode, the msdu from stack will be fragmented into small
  1936. * fragments and each of these new fragments will be transmitted
  1937. * as an individual msdu.
  1938. *
  1939. * Please note that the length of a msdu from stack may be smaller
  1940. * than the length of the total length of the fragments it has been
  1941. * fragmentted because each of the fragments has a nbuf header.
  1942. */
  1943. static inline uint32_t dp_tx_get_pkt_len(struct dp_tx_desc_s *tx_desc)
  1944. {
  1945. return tx_desc->frm_type == dp_tx_frm_tso ?
  1946. tx_desc->msdu_ext_desc->tso_desc->seg.total_len :
  1947. tx_desc->length;
  1948. }
  1949. #ifdef FEATURE_RUNTIME_PM
  1950. static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
  1951. {
  1952. return qdf_atomic_read(&soc->rtpm_high_tput_flag) &&
  1953. (hif_rtpm_get_state() <= HIF_RTPM_STATE_ON);
  1954. }
  1955. #else
  1956. static inline int dp_get_rtpm_tput_policy_requirement(struct dp_soc *soc)
  1957. {
  1958. return 0;
  1959. }
  1960. #endif
  1961. #if defined WLAN_FEATURE_11BE_MLO && defined DP_MLO_LINK_STATS_SUPPORT
  1962. /**
  1963. * dp_tx_set_nbuf_band() - Set band info in nbuf cb
  1964. * @nbuf: nbuf pointer
  1965. * @txrx_peer: txrx_peer pointer
  1966. * @link_id: Peer Link ID
  1967. *
  1968. * Return: None
  1969. */
  1970. static inline void
  1971. dp_tx_set_nbuf_band(qdf_nbuf_t nbuf, struct dp_txrx_peer *txrx_peer,
  1972. uint8_t link_id)
  1973. {
  1974. qdf_nbuf_tx_set_band(nbuf, txrx_peer->band[link_id]);
  1975. }
  1976. #else
  1977. static inline void
  1978. dp_tx_set_nbuf_band(qdf_nbuf_t nbuf, struct dp_txrx_peer *txrx_peer,
  1979. uint8_t link_id)
  1980. {
  1981. }
  1982. #endif
  1983. #ifdef WLAN_FEATURE_TX_LATENCY_STATS
  1984. /**
  1985. * dp_tx_latency_stats_fetch() - fetch transmit latency statistics for
  1986. * specified link mac address
  1987. * @soc_hdl: Handle to struct dp_soc
  1988. * @vdev_id: vdev id
  1989. * @mac: link mac address of remote peer
  1990. * @latency: buffer to hold per-link transmit latency statistics
  1991. *
  1992. * Return: QDF_STATUS
  1993. */
  1994. QDF_STATUS
  1995. dp_tx_latency_stats_fetch(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1996. uint8_t *mac, struct cdp_tx_latency *latency);
  1997. /**
  1998. * dp_tx_latency_stats_config() - config transmit latency statistics for
  1999. * specified vdev
  2000. * @soc_hdl: Handle to struct dp_soc
  2001. * @vdev_id: vdev id
  2002. * @cfg: configuration for transmit latency statistics
  2003. *
  2004. * Return: QDF_STATUS
  2005. */
  2006. QDF_STATUS
  2007. dp_tx_latency_stats_config(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  2008. struct cdp_tx_latency_config *cfg);
  2009. /**
  2010. * dp_tx_latency_stats_register_cb() - register transmit latency statistics
  2011. * callback
  2012. * @handle: Handle to struct dp_soc
  2013. * @cb: callback function for transmit latency statistics
  2014. *
  2015. * Return: QDF_STATUS
  2016. */
  2017. QDF_STATUS dp_tx_latency_stats_register_cb(struct cdp_soc_t *handle,
  2018. cdp_tx_latency_cb cb);
  2019. #endif
  2020. #endif