hal_tx.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  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. #if !defined(HAL_TX_H)
  20. #define HAL_TX_H
  21. /*---------------------------------------------------------------------------
  22. Include files
  23. ---------------------------------------------------------------------------*/
  24. #include "hal_api.h"
  25. #include "wcss_version.h"
  26. #include "hal_hw_headers.h"
  27. #include "hal_tx_hw_defines.h"
  28. #define HAL_WBM_RELEASE_RING_2_BUFFER_TYPE 0
  29. #define HAL_WBM_RELEASE_RING_2_DESC_TYPE 1
  30. #define HAL_TX_DESC_TLV_TAG_OFFSET 1
  31. #define HAL_TX_DESC_TLV_LEN_OFFSET 10
  32. /*---------------------------------------------------------------------------
  33. Preprocessor definitions and constants
  34. ---------------------------------------------------------------------------*/
  35. #define HAL_OFFSET(block, field) block ## _ ## field ## _OFFSET
  36. #define HAL_TX_LSB(block, field) block ## _ ## field ## _LSB
  37. #define HAL_TX_MASK(block, field) block ## _ ## field ## _MASK
  38. #define HAL_TX_DESC_OFFSET(desc, block, field) \
  39. (((uint8_t *)desc) + HAL_OFFSET(block, field))
  40. #define HAL_SET_FLD(desc, block , field) \
  41. (*(uint32_t *) ((uint8_t *) desc + HAL_OFFSET(block, field)))
  42. #define HAL_SET_FLD_OFFSET(desc, block , field, offset) \
  43. (*(uint32_t *) ((uint8_t *) desc + HAL_OFFSET(block, field) + (offset)))
  44. #define HAL_SET_FLD_64(desc, block, field) \
  45. (*(uint64_t *)((uint8_t *)desc + HAL_OFFSET(block, field)))
  46. #define HAL_SET_FLD_OFFSET_64(desc, block, field, offset) \
  47. (*(uint64_t *)((uint8_t *)desc + HAL_OFFSET(block, field) + (offset)))
  48. #define HAL_TX_DESC_SET_TLV_HDR(desc, tag, len) \
  49. do { \
  50. uint32_t temp = 0; \
  51. temp |= (tag << HAL_TX_DESC_TLV_TAG_OFFSET); \
  52. temp |= (len << HAL_TX_DESC_TLV_LEN_OFFSET); \
  53. (*(uint32_t *)desc) = temp; \
  54. } while (0)
  55. #define HAL_TX_TCL_DATA_TAG WIFITCL_DATA_CMD_E
  56. #define HAL_TX_TCL_CMD_TAG WIFITCL_GSE_CMD_E
  57. #define HAL_TX_SM(block, field, value) \
  58. ((value << (block ## _ ## field ## _LSB)) & \
  59. (block ## _ ## field ## _MASK))
  60. #define HAL_TX_MS(block, field, value) \
  61. (((value) & (block ## _ ## field ## _MASK)) >> \
  62. (block ## _ ## field ## _LSB))
  63. #define HAL_TX_DESC_GET(desc, block, field) \
  64. HAL_TX_MS(block, field, HAL_SET_FLD(desc, block, field))
  65. #define HAL_TX_DESC_OFFSET_GET(desc, block, field, offset) \
  66. HAL_TX_MS(block, field, HAL_SET_FLD_OFFSET(desc, block, field, offset))
  67. #define HAL_TX_DESC_SUBBLOCK_GET(desc, block, sub, field) \
  68. HAL_TX_MS(sub, field, HAL_SET_FLD(desc, block, sub))
  69. #define HAL_TX_DESC_GET_64(desc, block, field) \
  70. HAL_TX_MS(block, field, HAL_SET_FLD_64(desc, block, field))
  71. #define HAL_TX_DESC_OFFSET_GET_64(desc, block, field, offset) \
  72. HAL_TX_MS(block, field, HAL_SET_FLD_OFFSET_64(desc, block, field,\
  73. offset))
  74. #define HAL_TX_DESC_SUBBLOCK_GET_64(desc, block, sub, field) \
  75. HAL_TX_MS(sub, field, HAL_SET_FLD_64(desc, block, sub))
  76. #define HAL_TX_BUF_TYPE_BUFFER 0
  77. #define HAL_TX_BUF_TYPE_EXT_DESC 1
  78. #define NUM_OF_DWORDS_TX_MSDU_EXTENSION 18
  79. #define HAL_TX_DESC_LEN_DWORDS (NUM_OF_DWORDS_TCL_DATA_CMD)
  80. #define HAL_TX_DESC_LEN_BYTES (NUM_OF_DWORDS_TCL_DATA_CMD * 4)
  81. #define HAL_TX_EXTENSION_DESC_LEN_DWORDS (NUM_OF_DWORDS_TX_MSDU_EXTENSION)
  82. #define HAL_TX_EXTENSION_DESC_LEN_BYTES (NUM_OF_DWORDS_TX_MSDU_EXTENSION * 4)
  83. #define NUM_OF_DWORDS_WBM_RELEASE_RING 8
  84. #define HAL_TX_COMPLETION_DESC_LEN_DWORDS (NUM_OF_DWORDS_WBM_RELEASE_RING)
  85. #define HAL_TX_COMPLETION_DESC_LEN_BYTES (NUM_OF_DWORDS_WBM_RELEASE_RING*4)
  86. #define HAL_TX_BITS_PER_TID 3
  87. #define HAL_TX_TID_BITS_MASK ((1 << HAL_TX_BITS_PER_TID) - 1)
  88. #define HAL_TX_NUM_DSCP_PER_REGISTER 10
  89. #define HAL_MAX_HW_DSCP_TID_MAPS 2
  90. #define HAL_MAX_HW_DSCP_TID_MAPS_11AX 32
  91. #define HAL_MAX_HW_DSCP_TID_V2_MAPS 48
  92. #define HAL_MAX_HW_DSCP_TID_V2_MAPS_5332 24
  93. #define HTT_META_HEADER_LEN_BYTES 64
  94. #define HAL_TX_EXT_DESC_WITH_META_DATA \
  95. (HTT_META_HEADER_LEN_BYTES + HAL_TX_EXTENSION_DESC_LEN_BYTES)
  96. #define HAL_TX_NUM_PCP_PER_REGISTER 8
  97. /* Length of WBM release ring without the status words */
  98. #define HAL_TX_COMPLETION_DESC_BASE_LEN 12
  99. #define HAL_TX_COMP_RELEASE_SOURCE_TQM 0
  100. #define HAL_TX_COMP_RELEASE_SOURCE_REO 2
  101. #define HAL_TX_COMP_RELEASE_SOURCE_FW 3
  102. /* Define a place-holder release reason for FW */
  103. #define HAL_TX_COMP_RELEASE_REASON_FW 99
  104. /*
  105. * Offset of HTT Tx Descriptor in WBM Completion
  106. * HTT Tx Desc structure is passed from firmware to host overlaid
  107. * on wbm_release_ring DWORDs 2,3 ,4 and 5for software based completions
  108. * (Exception frames and TQM bypass frames)
  109. */
  110. #define HAL_TX_COMP_HTT_STATUS_OFFSET 8
  111. #ifdef CONFIG_BERYLLIUM
  112. #define HAL_TX_COMP_HTT_STATUS_LEN 20
  113. #else
  114. #define HAL_TX_COMP_HTT_STATUS_LEN 16
  115. #endif
  116. #define HAL_TX_BUF_TYPE_BUFFER 0
  117. #define HAL_TX_BUF_TYPE_EXT_DESC 1
  118. #define HAL_TX_EXT_DESC_BUF_OFFSET TX_MSDU_EXTENSION_6_BUF0_PTR_31_0_OFFSET
  119. #define HAL_TX_EXT_BUF_LOW_MASK TX_MSDU_EXTENSION_6_BUF0_PTR_31_0_MASK
  120. #define HAL_TX_EXT_BUF_HI_MASK TX_MSDU_EXTENSION_7_BUF0_PTR_39_32_MASK
  121. #define HAL_TX_EXT_BUF_LEN_MASK TX_MSDU_EXTENSION_7_BUF0_LEN_MASK
  122. #define HAL_TX_EXT_BUF_LEN_LSB TX_MSDU_EXTENSION_7_BUF0_LEN_LSB
  123. #define HAL_TX_EXT_BUF_WD_SIZE 2
  124. #define HAL_TX_DESC_ADDRX_EN 0x1
  125. #define HAL_TX_DESC_ADDRY_EN 0x2
  126. #define HAL_TX_DESC_DEFAULT_LMAC_ID 0x3
  127. #define HAL_TX_ADDR_SEARCH_DEFAULT 0x0
  128. #define HAL_TX_ADDR_INDEX_SEARCH 0x1
  129. #define HAL_TX_FLOW_INDEX_SEARCH 0x2
  130. #define HAL_WBM2SW_RELEASE_SRC_GET(wbm_desc)(((*(((uint32_t *)wbm_desc) + \
  131. (HAL_WBM2SW_RING_RELEASE_SOURCE_MODULE_OFFSET >> 2))) & \
  132. HAL_WBM2SW_RING_RELEASE_SOURCE_MODULE_MASK) >> \
  133. HAL_WBM2SW_RING_RELEASE_SOURCE_MODULE_LSB)
  134. #define HAL_WBM_SW0_BM_ID(sw0_bm_id) (sw0_bm_id)
  135. #define HAL_WBM_SW1_BM_ID(sw0_bm_id) ((sw0_bm_id) + 1)
  136. #define HAL_WBM_SW2_BM_ID(sw0_bm_id) ((sw0_bm_id) + 2)
  137. #define HAL_WBM_SW3_BM_ID(sw0_bm_id) ((sw0_bm_id) + 3)
  138. #define HAL_WBM_SW4_BM_ID(sw0_bm_id) ((sw0_bm_id) + 4)
  139. #define HAL_WBM_SW5_BM_ID(sw0_bm_id) ((sw0_bm_id) + 5)
  140. #define HAL_WBM_SW6_BM_ID(sw0_bm_id) ((sw0_bm_id) + 6)
  141. /*---------------------------------------------------------------------------
  142. Structures
  143. ---------------------------------------------------------------------------*/
  144. /**
  145. * struct hal_tx_completion_status - HAL Tx completion descriptor contents
  146. * @status: frame acked/failed
  147. * @release_src: release source = TQM/FW
  148. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  149. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  150. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  151. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  152. * @bw: Indicates the BW of the upcoming transmission -
  153. * <enum 0 transmit_bw_20_MHz>
  154. * <enum 1 transmit_bw_40_MHz>
  155. * <enum 2 transmit_bw_80_MHz>
  156. * <enum 3 transmit_bw_160_MHz>
  157. * <enum 4 transmit_bw_320_MHz>
  158. * <enum 5 transmit_bw_240_MHz>
  159. * @pkt_type: Transmit Packet Type
  160. * @stbc: When set, STBC transmission rate was used
  161. * @ldpc: When set, use LDPC transmission rates
  162. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  163. * <enum 1 0_4_us_sgi > Legacy short GI
  164. * <enum 2 1_6_us_sgi > HE related GI
  165. * <enum 3 3_2_us_sgi > HE
  166. * @mcs: Transmit MCS Rate
  167. * @ofdma: Set when the transmission was an OFDMA transmission
  168. * @tones_in_ru: The number of tones in the RU used.
  169. * @valid:
  170. * @tsf: Lower 32 bits of the TSF
  171. * @ppdu_id: TSF, snapshot of this value when transmission of the
  172. * PPDU containing the frame finished.
  173. * @transmit_cnt: Number of times this frame has been transmitted
  174. * @tid: TID of the flow or MPDU queue
  175. * @peer_id: Peer ID of the flow or MPDU queue
  176. * @buffer_timestamp: Frame system entrance timestamp in units of 1024
  177. * microseconds
  178. */
  179. struct hal_tx_completion_status {
  180. uint8_t status;
  181. uint8_t release_src;
  182. uint8_t ack_frame_rssi;
  183. uint8_t first_msdu:1,
  184. last_msdu:1,
  185. msdu_part_of_amsdu:1;
  186. uint32_t bw:3,
  187. pkt_type:4,
  188. stbc:1,
  189. ldpc:1,
  190. sgi:2,
  191. mcs:4,
  192. ofdma:1,
  193. tones_in_ru:12,
  194. valid:1;
  195. uint32_t tsf;
  196. uint32_t ppdu_id;
  197. uint8_t transmit_cnt;
  198. uint8_t tid;
  199. uint16_t peer_id;
  200. #if defined(WLAN_FEATURE_TSF_UPLINK_DELAY) || defined(WLAN_CONFIG_TX_DELAY)
  201. uint32_t buffer_timestamp:19;
  202. #endif
  203. };
  204. /**
  205. * struct hal_tx_desc_comp_s - hal tx completion descriptor contents
  206. * @desc: Transmit status information from descriptor
  207. */
  208. struct hal_tx_desc_comp_s {
  209. uint32_t desc[HAL_TX_COMPLETION_DESC_LEN_DWORDS];
  210. };
  211. /*
  212. * enum hal_tx_encrypt_type - Type of decrypt cipher used (valid only for RAW)
  213. * @HAL_TX_ENCRYPT_TYPE_WEP_40: WEP 40-bit
  214. * @HAL_TX_ENCRYPT_TYPE_WEP_10: WEP 10-bit
  215. * @HAL_TX_ENCRYPT_TYPE_TKIP_NO_MIC: TKIP without MIC
  216. * @HAL_TX_ENCRYPT_TYPE_WEP_128: WEP_128
  217. * @HAL_TX_ENCRYPT_TYPE_TKIP_WITH_MIC: TKIP_WITH_MIC
  218. * @HAL_TX_ENCRYPT_TYPE_WAPI: WAPI
  219. * @HAL_TX_ENCRYPT_TYPE_AES_CCMP_128: AES_CCMP_128
  220. * @HAL_TX_ENCRYPT_TYPE_NO_CIPHER: NO CIPHER
  221. * @HAL_TX_ENCRYPT_TYPE_AES_CCMP_256: AES_CCMP_256
  222. * @HAL_TX_ENCRYPT_TYPE_AES_GCMP_128: AES_GCMP_128
  223. * @HAL_TX_ENCRYPT_TYPE_AES_GCMP_256: AES_GCMP_256
  224. * @HAL_TX_ENCRYPT_TYPE_WAPI_GCM_SM4: WAPI GCM SM4
  225. */
  226. enum hal_tx_encrypt_type {
  227. HAL_TX_ENCRYPT_TYPE_WEP_40 = 0,
  228. HAL_TX_ENCRYPT_TYPE_WEP_104 = 1 ,
  229. HAL_TX_ENCRYPT_TYPE_TKIP_NO_MIC = 2,
  230. HAL_TX_ENCRYPT_TYPE_WEP_128 = 3,
  231. HAL_TX_ENCRYPT_TYPE_TKIP_WITH_MIC = 4,
  232. HAL_TX_ENCRYPT_TYPE_WAPI = 5,
  233. HAL_TX_ENCRYPT_TYPE_AES_CCMP_128 = 6,
  234. HAL_TX_ENCRYPT_TYPE_NO_CIPHER = 7,
  235. HAL_TX_ENCRYPT_TYPE_AES_CCMP_256 = 8,
  236. HAL_TX_ENCRYPT_TYPE_AES_GCMP_128 = 9,
  237. HAL_TX_ENCRYPT_TYPE_AES_GCMP_256 = 10,
  238. HAL_TX_ENCRYPT_TYPE_WAPI_GCM_SM4 = 11,
  239. };
  240. /*
  241. * enum hal_tx_encap_type - Encapsulation type that HW will perform
  242. * @HAL_TX_ENCAP_TYPE_RAW: Raw Packet Type
  243. * @HAL_TX_ENCAP_TYPE_NWIFI: Native WiFi Type
  244. * @HAL_TX_ENCAP_TYPE_ETHERNET: Ethernet
  245. * @HAL_TX_ENCAP_TYPE_802_3: 802.3 Frame
  246. */
  247. enum hal_tx_encap_type {
  248. HAL_TX_ENCAP_TYPE_RAW = 0,
  249. HAL_TX_ENCAP_TYPE_NWIFI = 1,
  250. HAL_TX_ENCAP_TYPE_ETHERNET = 2,
  251. HAL_TX_ENCAP_TYPE_802_3 = 3,
  252. };
  253. /**
  254. * enum hal_tx_tqm_release_reason - TQM Release reason codes
  255. *
  256. * @HAL_TX_TQM_RR_FRAME_ACKED : ACK of BA for it was received
  257. * @HAL_TX_TQM_RR_REM_CMD_REM : Remove cmd of type “Remove_mpdus” initiated
  258. * by SW
  259. * @HAL_TX_TQM_RR_REM_CMD_TX : Remove command of type Remove_transmitted_mpdus
  260. * initiated by SW
  261. * @HAL_TX_TQM_RR_REM_CMD_NOTX : Remove cmd of type Remove_untransmitted_mpdus
  262. * initiated by SW
  263. * @HAL_TX_TQM_RR_REM_CMD_AGED : Remove command of type “Remove_aged_mpdus” or
  264. * “Remove_aged_msdus” initiated by SW
  265. * @HAL_TX_TQM_RR_FW_REASON1 : Remove command where fw indicated that
  266. * remove reason is fw_reason1
  267. * @HAL_TX_TQM_RR_FW_REASON2 : Remove command where fw indicated that
  268. * remove reason is fw_reason2
  269. * @HAL_TX_TQM_RR_FW_REASON3 : Remove command where fw indicated that
  270. * remove reason is fw_reason3
  271. * @HAL_TX_TQM_RR_REM_CMD_DISABLE_QUEUE : Remove command where fw indicated that
  272. * remove reason is remove disable queue
  273. * @HAL_TX_TQM_RR_REM_CMD_TILL_NONMATCHING: Remove command from fw to remove
  274. * all mpdu until 1st non-match
  275. * @HAL_TX_TQM_RR_DROP_THRESHOLD: Dropped due to drop threshold criteria
  276. * @HAL_TX_TQM_RR_LINK_DESC_UNAVAILABLE: Dropped due to link desc not available
  277. * @HAL_TX_TQM_RR_DROP_OR_INVALID_MSDU: Dropped due drop bit set or null flow
  278. * @HAL_TX_TQM_RR_MULTICAST_DROP: Dropped due mcast drop set for VDEV
  279. * @HAL_TX_TQM_RR_VDEV_MISMATCH_DROP: Dropped due to being set with
  280. * 'TCL_drop_reason'
  281. *
  282. */
  283. enum hal_tx_tqm_release_reason {
  284. HAL_TX_TQM_RR_FRAME_ACKED,
  285. HAL_TX_TQM_RR_REM_CMD_REM,
  286. HAL_TX_TQM_RR_REM_CMD_TX,
  287. HAL_TX_TQM_RR_REM_CMD_NOTX,
  288. HAL_TX_TQM_RR_REM_CMD_AGED,
  289. HAL_TX_TQM_RR_FW_REASON1,
  290. HAL_TX_TQM_RR_FW_REASON2,
  291. HAL_TX_TQM_RR_FW_REASON3,
  292. HAL_TX_TQM_RR_REM_CMD_DISABLE_QUEUE,
  293. HAL_TX_TQM_RR_REM_CMD_TILL_NONMATCHING,
  294. HAL_TX_TQM_RR_DROP_THRESHOLD,
  295. HAL_TX_TQM_RR_LINK_DESC_UNAVAILABLE,
  296. HAL_TX_TQM_RR_DROP_OR_INVALID_MSDU,
  297. HAL_TX_TQM_RR_MULTICAST_DROP,
  298. HAL_TX_TQM_RR_VDEV_MISMATCH_DROP,
  299. };
  300. /* enum - Table IDs for 2 DSCP-TID mapping Tables that TCL H/W supports
  301. * @HAL_TX_DSCP_TID_MAP_TABLE_DEFAULT: Default DSCP-TID mapping table
  302. * @HAL_TX_DSCP_TID_MAP_TABLE_OVERRIDE: DSCP-TID map override table
  303. */
  304. enum hal_tx_dscp_tid_table_id {
  305. HAL_TX_DSCP_TID_MAP_TABLE_DEFAULT,
  306. HAL_TX_DSCP_TID_MAP_TABLE_OVERRIDE,
  307. };
  308. /*---------------------------------------------------------------------------
  309. Function declarations and documentation
  310. ---------------------------------------------------------------------------*/
  311. /*---------------------------------------------------------------------------
  312. Tx MSDU Extension Descriptor accessor APIs
  313. ---------------------------------------------------------------------------*/
  314. /**
  315. * hal_tx_ext_desc_set_tso_enable() - Set TSO Enable Flag
  316. * @desc: Handle to Tx MSDU Extension Descriptor
  317. * @tso_en: bool value set to true if TSO is enabled
  318. *
  319. * Return: none
  320. */
  321. static inline void hal_tx_ext_desc_set_tso_enable(void *desc,
  322. uint8_t tso_en)
  323. {
  324. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, TSO_ENABLE) |=
  325. HAL_TX_SM(HAL_TX_MSDU_EXTENSION, TSO_ENABLE, tso_en);
  326. }
  327. /**
  328. * hal_tx_ext_desc_set_tso_flags() - Set TSO Flags
  329. * @desc: Handle to Tx MSDU Extension Descriptor
  330. * @tso_flags: 32-bit word with all TSO flags consolidated
  331. *
  332. * Return: none
  333. */
  334. static inline void hal_tx_ext_desc_set_tso_flags(void *desc,
  335. uint32_t tso_flags)
  336. {
  337. HAL_SET_FLD_OFFSET(desc, HAL_TX_MSDU_EXTENSION, TSO_ENABLE, 0) =
  338. tso_flags;
  339. }
  340. /**
  341. * hal_tx_ext_desc_set_tcp_flags() - Enable HW Checksum offload
  342. * @desc: Handle to Tx MSDU Extension Descriptor
  343. * @tcp_flags: TCP flags {NS,CWR,ECE,URG,ACK,PSH, RST ,SYN,FIN}
  344. * @mask: TCP flag mask. Tcp_flag is inserted into the header
  345. * based on the mask, if tso is enabled
  346. *
  347. * Return: none
  348. */
  349. static inline void hal_tx_ext_desc_set_tcp_flags(void *desc,
  350. uint16_t tcp_flags,
  351. uint16_t mask)
  352. {
  353. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, TCP_FLAG) |=
  354. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, TCP_FLAG, tcp_flags)) |
  355. (HAL_TX_SM(HAL_TX_MSDU_EXTENSION, TCP_FLAG_MASK, mask)));
  356. }
  357. /**
  358. * hal_tx_ext_desc_set_msdu_length() - Set L2 and IP Lengths
  359. * @desc: Handle to Tx MSDU Extension Descriptor
  360. * @l2_len: L2 length for the msdu, if tso is enabled
  361. * @ip_len: IP length for the msdu, if tso is enabled
  362. *
  363. * Return: none
  364. */
  365. static inline void hal_tx_ext_desc_set_msdu_length(void *desc,
  366. uint16_t l2_len,
  367. uint16_t ip_len)
  368. {
  369. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, L2_LENGTH) |=
  370. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, L2_LENGTH, l2_len)) |
  371. (HAL_TX_SM(HAL_TX_MSDU_EXTENSION, IP_LENGTH, ip_len)));
  372. }
  373. /**
  374. * hal_tx_ext_desc_set_tcp_seq() - Set TCP Sequence number
  375. * @desc: Handle to Tx MSDU Extension Descriptor
  376. * @seq_num: Tcp_seq_number for the msdu, if tso is enabled
  377. *
  378. * Return: none
  379. */
  380. static inline void hal_tx_ext_desc_set_tcp_seq(void *desc,
  381. uint32_t seq_num)
  382. {
  383. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, TCP_SEQ_NUMBER) |=
  384. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, TCP_SEQ_NUMBER, seq_num)));
  385. }
  386. /**
  387. * hal_tx_ext_desc_set_ip_id() - Set IP Identification field
  388. * @desc: Handle to Tx MSDU Extension Descriptor
  389. * @id: IP Id field for the msdu, if tso is enabled
  390. *
  391. * Return: none
  392. */
  393. static inline void hal_tx_ext_desc_set_ip_id(void *desc,
  394. uint16_t id)
  395. {
  396. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, IP_IDENTIFICATION) |=
  397. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, IP_IDENTIFICATION, id)));
  398. }
  399. /**
  400. * hal_tx_ext_desc_set_buffer() - Set Buffer Pointer and Length for a fragment
  401. * @desc: Handle to Tx MSDU Extension Descriptor
  402. * @frag_num: Fragment number (value can be 0 to 5)
  403. * @paddr_lo: Lower 32-bit of Buffer Physical address
  404. * @paddr_hi: Upper 32-bit of Buffer Physical address
  405. * @length: Buffer Length
  406. *
  407. * Return: none
  408. */
  409. static inline void hal_tx_ext_desc_set_buffer(void *desc,
  410. uint8_t frag_num,
  411. uint32_t paddr_lo,
  412. uint16_t paddr_hi,
  413. uint16_t length)
  414. {
  415. HAL_SET_FLD_OFFSET(desc, HAL_TX_MSDU_EXTENSION, BUF0_PTR_31_0,
  416. (frag_num << 3)) |=
  417. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF0_PTR_31_0, paddr_lo)));
  418. HAL_SET_FLD_OFFSET(desc, HAL_TX_MSDU_EXTENSION, BUF0_PTR_39_32,
  419. (frag_num << 3)) |=
  420. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF0_PTR_39_32,
  421. (paddr_hi))));
  422. HAL_SET_FLD_OFFSET(desc, HAL_TX_MSDU_EXTENSION, BUF0_LEN,
  423. (frag_num << 3)) |=
  424. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF0_LEN, length)));
  425. }
  426. /**
  427. * hal_tx_ext_desc_get_frag_info() - Get the frag_num'th frag iova and len
  428. * @desc: Handle to Tx MSDU Extension Descriptor
  429. * @frag_num: fragment number (value can be 0 to 5)
  430. * @iova: fragment dma address
  431. * @len: fragment Length
  432. *
  433. * Return: None
  434. */
  435. static inline void hal_tx_ext_desc_get_frag_info(void *desc, uint8_t frag_num,
  436. qdf_dma_addr_t *iova,
  437. uint32_t *len)
  438. {
  439. uint64_t iova_hi;
  440. *iova = HAL_TX_DESC_OFFSET_GET(desc, HAL_TX_MSDU_EXTENSION,
  441. BUF0_PTR_31_0, (frag_num << 3));
  442. iova_hi = HAL_TX_DESC_OFFSET_GET(desc, HAL_TX_MSDU_EXTENSION,
  443. BUF0_PTR_39_32, (frag_num << 3));
  444. *iova |= (iova_hi << 32);
  445. *len = HAL_TX_DESC_OFFSET_GET(desc, HAL_TX_MSDU_EXTENSION, BUF0_LEN,
  446. (frag_num << 3));
  447. }
  448. /**
  449. * hal_tx_ext_desc_set_buffer0_param() - Set Buffer 0 Pointer and Length
  450. * @desc: Handle to Tx MSDU Extension Descriptor
  451. * @paddr_lo: Lower 32-bit of Buffer Physical address
  452. * @paddr_hi: Upper 32-bit of Buffer Physical address
  453. * @length: Buffer 0 Length
  454. *
  455. * Return: none
  456. */
  457. static inline void hal_tx_ext_desc_set_buffer0_param(void *desc,
  458. uint32_t paddr_lo,
  459. uint16_t paddr_hi,
  460. uint16_t length)
  461. {
  462. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF0_PTR_31_0) |=
  463. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF0_PTR_31_0, paddr_lo)));
  464. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF0_PTR_39_32) |=
  465. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION,
  466. BUF0_PTR_39_32, paddr_hi)));
  467. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF0_LEN) |=
  468. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF0_LEN, length)));
  469. }
  470. /**
  471. * hal_tx_ext_desc_set_buffer1_param() - Set Buffer 1 Pointer and Length
  472. * @desc: Handle to Tx MSDU Extension Descriptor
  473. * @paddr_lo: Lower 32-bit of Buffer Physical address
  474. * @paddr_hi: Upper 32-bit of Buffer Physical address
  475. * @length: Buffer 1 Length
  476. *
  477. * Return: none
  478. */
  479. static inline void hal_tx_ext_desc_set_buffer1_param(void *desc,
  480. uint32_t paddr_lo,
  481. uint16_t paddr_hi,
  482. uint16_t length)
  483. {
  484. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF1_PTR_31_0) |=
  485. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF1_PTR_31_0, paddr_lo)));
  486. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF1_PTR_39_32) |=
  487. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION,
  488. BUF1_PTR_39_32, paddr_hi)));
  489. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF1_LEN) |=
  490. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF1_LEN, length)));
  491. }
  492. /**
  493. * hal_tx_ext_desc_set_buffer2_param() - Set Buffer 2 Pointer and Length
  494. * @desc: Handle to Tx MSDU Extension Descriptor
  495. * @paddr_lo: Lower 32-bit of Buffer Physical address
  496. * @paddr_hi: Upper 32-bit of Buffer Physical address
  497. * @length: Buffer 2 Length
  498. *
  499. * Return: none
  500. */
  501. static inline void hal_tx_ext_desc_set_buffer2_param(void *desc,
  502. uint32_t paddr_lo,
  503. uint16_t paddr_hi,
  504. uint16_t length)
  505. {
  506. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF2_PTR_31_0) |=
  507. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF2_PTR_31_0,
  508. paddr_lo)));
  509. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF2_PTR_39_32) |=
  510. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF2_PTR_39_32,
  511. paddr_hi)));
  512. HAL_SET_FLD(desc, HAL_TX_MSDU_EXTENSION, BUF2_LEN) |=
  513. ((HAL_TX_SM(HAL_TX_MSDU_EXTENSION, BUF2_LEN, length)));
  514. }
  515. /**
  516. * hal_tx_ext_desc_sync - Commit the descriptor to Hardware
  517. * @desc_cached: Cached descriptor that software maintains
  518. * @hw_desc: Hardware descriptor to be updated
  519. *
  520. * Return: none
  521. */
  522. static inline void hal_tx_ext_desc_sync(uint8_t *desc_cached,
  523. uint8_t *hw_desc)
  524. {
  525. qdf_mem_copy(&hw_desc[0], &desc_cached[0],
  526. HAL_TX_EXT_DESC_WITH_META_DATA);
  527. }
  528. /**
  529. * hal_tx_ext_desc_get_tso_enable() - Set TSO Enable Flag
  530. * @hal_tx_ext_desc: Handle to Tx MSDU Extension Descriptor
  531. *
  532. * Return: tso_enable value in the descriptor
  533. */
  534. static inline uint32_t hal_tx_ext_desc_get_tso_enable(void *hal_tx_ext_desc)
  535. {
  536. uint32_t *desc = (uint32_t *) hal_tx_ext_desc;
  537. return (*desc & HAL_TX_MSDU_EXTENSION_TSO_ENABLE_MASK) >>
  538. HAL_TX_MSDU_EXTENSION_TSO_ENABLE_LSB;
  539. }
  540. /*---------------------------------------------------------------------------
  541. WBM Descriptor accessor APIs for Tx completions
  542. ---------------------------------------------------------------------------*/
  543. /**
  544. * hal_tx_comp_get_buffer_type() - Buffer or Descriptor type
  545. * @hal_desc: completion ring descriptor pointer
  546. *
  547. * This function will return the type of pointer - buffer or descriptor
  548. *
  549. * Return: buffer type
  550. */
  551. static inline uint32_t hal_tx_comp_get_buffer_type(void *hal_desc)
  552. {
  553. uint32_t comp_desc =
  554. *(uint32_t *) (((uint8_t *) hal_desc) +
  555. HAL_TX_COMP_BUFFER_OR_DESC_TYPE_OFFSET);
  556. return (comp_desc & HAL_TX_COMP_BUFFER_OR_DESC_TYPE_MASK) >>
  557. HAL_TX_COMP_BUFFER_OR_DESC_TYPE_LSB;
  558. }
  559. #ifdef QCA_WIFI_KIWI
  560. /**
  561. * hal_tx_comp_get_buffer_source() - Get buffer release source value
  562. * @hal_soc_hdl: HAL SoC context
  563. * @hal_desc: completion ring descriptor pointer
  564. *
  565. * This function will get buffer release source from Tx completion descriptor
  566. *
  567. * Return: buffer release source
  568. */
  569. static inline uint32_t
  570. hal_tx_comp_get_buffer_source(hal_soc_handle_t hal_soc_hdl,
  571. void *hal_desc)
  572. {
  573. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  574. return hal_soc->ops->hal_tx_comp_get_buffer_source(hal_desc);
  575. }
  576. #else
  577. static inline uint32_t
  578. hal_tx_comp_get_buffer_source(hal_soc_handle_t hal_soc_hdl,
  579. void *hal_desc)
  580. {
  581. return HAL_WBM2SW_RELEASE_SRC_GET(hal_desc);
  582. }
  583. #endif
  584. /**
  585. * hal_tx_comp_get_release_reason() - TQM Release reason
  586. * @hal_desc: completion ring descriptor pointer
  587. * @hal_soc_hdl: HAL SoC context
  588. *
  589. * This function will return the type of pointer - buffer or descriptor
  590. *
  591. * Return: buffer type
  592. */
  593. static inline
  594. uint8_t hal_tx_comp_get_release_reason(void *hal_desc,
  595. hal_soc_handle_t hal_soc_hdl)
  596. {
  597. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  598. return hal_soc->ops->hal_tx_comp_get_release_reason(hal_desc);
  599. }
  600. /**
  601. * hal_tx_comp_get_peer_id() - Get peer_id value
  602. * @hal_desc: completion ring descriptor pointer
  603. *
  604. * This function will get peer_id value from Tx completion descriptor
  605. *
  606. * Return: buffer release source
  607. */
  608. static inline uint16_t hal_tx_comp_get_peer_id(void *hal_desc)
  609. {
  610. uint32_t comp_desc =
  611. *(uint32_t *)(((uint8_t *)hal_desc) +
  612. HAL_TX_COMP_SW_PEER_ID_OFFSET);
  613. return (comp_desc & HAL_TX_COMP_SW_PEER_ID_MASK) >>
  614. HAL_TX_COMP_SW_PEER_ID_LSB;
  615. }
  616. /**
  617. * hal_tx_comp_get_tx_status() - Get tx transmission status()
  618. * @hal_desc: completion ring descriptor pointer
  619. *
  620. * This function will get transmit status value from Tx completion descriptor
  621. *
  622. * Return: buffer release source
  623. */
  624. static inline uint8_t hal_tx_comp_get_tx_status(void *hal_desc)
  625. {
  626. uint32_t comp_desc =
  627. *(uint32_t *)(((uint8_t *)hal_desc) +
  628. HAL_TX_COMP_TQM_RELEASE_REASON_OFFSET);
  629. return (comp_desc & HAL_TX_COMP_TQM_RELEASE_REASON_MASK) >>
  630. HAL_TX_COMP_TQM_RELEASE_REASON_LSB;
  631. }
  632. /**
  633. * hal_tx_comp_desc_sync() - collect hardware descriptor contents
  634. * @hw_desc: hardware descriptor pointer
  635. * @comp: software descriptor pointer
  636. * @read_status: 0 - Do not read status words from descriptors
  637. * 1 - Enable reading of status words from descriptor
  638. *
  639. * This function will collect hardware release ring element contents and
  640. * translate to software descriptor content
  641. *
  642. * Return: none
  643. */
  644. static inline void hal_tx_comp_desc_sync(void *hw_desc,
  645. struct hal_tx_desc_comp_s *comp,
  646. bool read_status)
  647. {
  648. if (!read_status)
  649. qdf_mem_copy(comp, hw_desc, HAL_TX_COMPLETION_DESC_BASE_LEN);
  650. else
  651. qdf_mem_copy(comp, hw_desc, HAL_TX_COMPLETION_DESC_LEN_BYTES);
  652. }
  653. /**
  654. * hal_dump_comp_desc() - dump tx completion descriptor
  655. * @hw_desc: hardware descriptor pointer
  656. *
  657. * This function will print tx completion descriptor
  658. *
  659. * Return: none
  660. */
  661. static inline void hal_dump_comp_desc(void *hw_desc)
  662. {
  663. struct hal_tx_desc_comp_s *comp =
  664. (struct hal_tx_desc_comp_s *)hw_desc;
  665. uint32_t i;
  666. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_FATAL,
  667. "Current tx completion descriptor is");
  668. for (i = 0; i < HAL_TX_COMPLETION_DESC_LEN_DWORDS; i++) {
  669. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_FATAL,
  670. "DWORD[i] = 0x%x", comp->desc[i]);
  671. }
  672. }
  673. /**
  674. * hal_tx_comp_get_htt_desc() - Read the HTT portion of WBM Descriptor
  675. * @hw_desc: Hardware (WBM) descriptor pointer
  676. * @htt_desc: Software HTT descriptor pointer
  677. *
  678. * This function will read the HTT structure overlaid on WBM descriptor
  679. * into a cached software descriptor
  680. *
  681. */
  682. static inline void hal_tx_comp_get_htt_desc(void *hw_desc, uint8_t *htt_desc)
  683. {
  684. uint8_t *desc = hw_desc + HAL_TX_COMP_HTT_STATUS_OFFSET;
  685. qdf_mem_copy(htt_desc, desc, HAL_TX_COMP_HTT_STATUS_LEN);
  686. }
  687. /**
  688. * hal_tx_init_data_ring() - Initialize all the TCL Descriptors in SRNG
  689. * @hal_soc_hdl: Handle to HAL SoC structure
  690. * @hal_ring_hdl: Handle to HAL SRNG structure
  691. *
  692. * Return: none
  693. */
  694. static inline void hal_tx_init_data_ring(hal_soc_handle_t hal_soc_hdl,
  695. hal_ring_handle_t hal_ring_hdl)
  696. {
  697. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  698. hal_soc->ops->hal_tx_init_data_ring(hal_soc_hdl, hal_ring_hdl);
  699. }
  700. /**
  701. * hal_tx_set_dscp_tid_map() - Configure default DSCP to TID map table
  702. * @hal_soc_hdl: HAL SoC context
  703. * @map: DSCP-TID mapping table
  704. * @id: mapping table ID - 0,1
  705. *
  706. * Return: void
  707. */
  708. static inline void hal_tx_set_dscp_tid_map(hal_soc_handle_t hal_soc_hdl,
  709. uint8_t *map, uint8_t id)
  710. {
  711. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  712. hal_soc->ops->hal_tx_set_dscp_tid_map(hal_soc, map, id);
  713. }
  714. /**
  715. * hal_tx_update_dscp_tid() - Update the dscp tid map table as updated by user
  716. * @hal_soc_hdl: HAL SoC context
  717. * @tid: TID
  718. * @id: MAP ID
  719. * @dscp: DSCP
  720. *
  721. * Return: void
  722. */
  723. static inline
  724. void hal_tx_update_dscp_tid(hal_soc_handle_t hal_soc_hdl, uint8_t tid,
  725. uint8_t id, uint8_t dscp)
  726. {
  727. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  728. hal_soc->ops->hal_tx_update_dscp_tid(hal_soc, tid, id, dscp);
  729. }
  730. /**
  731. * hal_tx_comp_get_status() - TQM Release reason
  732. * @desc: completion ring Tx status
  733. * @ts: returned tx completion status
  734. * @hal_soc_hdl: HAL SoC context
  735. *
  736. * This function will parse the WBM completion descriptor and populate in
  737. * HAL structure
  738. *
  739. * Return: none
  740. */
  741. static inline void hal_tx_comp_get_status(void *desc, void *ts,
  742. hal_soc_handle_t hal_soc_hdl)
  743. {
  744. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  745. hal_soc->ops->hal_tx_comp_get_status(desc, ts, hal_soc);
  746. }
  747. /**
  748. * hal_tx_set_pcp_tid_map_default() - Configure default PCP to TID map table
  749. * @hal_soc_hdl: HAL SoC context
  750. * @map: PCP-TID mapping table
  751. *
  752. * Return: void
  753. */
  754. static inline void hal_tx_set_pcp_tid_map_default(hal_soc_handle_t hal_soc_hdl,
  755. uint8_t *map)
  756. {
  757. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  758. hal_soc->ops->hal_tx_set_pcp_tid_map(hal_soc, map);
  759. }
  760. /**
  761. * hal_tx_update_pcp_tid_map() - Update PCP to TID map table
  762. * @hal_soc_hdl: HAL SoC context
  763. * @pcp: pcp value
  764. * @tid: tid no
  765. *
  766. * Return: void
  767. */
  768. static inline void hal_tx_update_pcp_tid_map(hal_soc_handle_t hal_soc_hdl,
  769. uint8_t pcp, uint8_t tid)
  770. {
  771. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  772. hal_soc->ops->hal_tx_update_pcp_tid_map(hal_soc, pcp, tid);
  773. }
  774. /**
  775. * hal_tx_set_tidmap_prty() - Configure TIDmap priority
  776. * @hal_soc_hdl: HAL SoC context
  777. * @val: priority value
  778. *
  779. * Return: void
  780. */
  781. static inline
  782. void hal_tx_set_tidmap_prty(hal_soc_handle_t hal_soc_hdl, uint8_t val)
  783. {
  784. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  785. hal_soc->ops->hal_tx_set_tidmap_prty(hal_soc, val);
  786. }
  787. /**
  788. * hal_get_wbm_internal_error() - wbm internal error
  789. * @hal_soc_hdl: HAL SoC context
  790. * @hal_desc: completion ring descriptor pointer
  791. *
  792. * This function will return the type of pointer - buffer or descriptor
  793. *
  794. * Return: buffer type
  795. */
  796. static inline
  797. uint8_t hal_get_wbm_internal_error(hal_soc_handle_t hal_soc_hdl, void *hal_desc)
  798. {
  799. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  800. return hal_soc->ops->hal_get_wbm_internal_error(hal_desc);
  801. }
  802. /**
  803. * hal_get_tsf2_offset() - get tsf2 offset
  804. * @hal_soc_hdl: HAL SoC context
  805. * @mac_id: mac id
  806. * @value: pointer to update tsf2 offset value
  807. *
  808. * Return: void
  809. */
  810. static inline void
  811. hal_get_tsf2_offset(hal_soc_handle_t hal_soc_hdl, uint8_t mac_id,
  812. uint64_t *value)
  813. {
  814. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  815. if (hal_soc->ops->hal_get_tsf2_scratch_reg)
  816. hal_soc->ops->hal_get_tsf2_scratch_reg(hal_soc_hdl, mac_id,
  817. value);
  818. }
  819. /**
  820. * hal_get_tqm_offset() - get tqm offset
  821. *
  822. * @hal_soc_hdl: HAL SoC context
  823. * @value: pointer to update tqm offset value
  824. *
  825. * Return: void
  826. */
  827. static inline void
  828. hal_get_tqm_offset(hal_soc_handle_t hal_soc_hdl, uint64_t *value)
  829. {
  830. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  831. if (hal_soc->ops->hal_get_tqm_scratch_reg)
  832. hal_soc->ops->hal_get_tqm_scratch_reg(hal_soc_hdl, value);
  833. }
  834. #endif /* HAL_TX_H */