dp_tx.h 59 KB

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