hal_be_tx.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 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 _HAL_BE_TX_H_
  20. #define _HAL_BE_TX_H_
  21. #include "hal_be_hw_headers.h"
  22. #include "hal_tx.h"
  23. /* Number of TX banks reserved i.e, will not be used by host driver. */
  24. /* MAX_TCL_BANK reserved for FW use */
  25. #define HAL_TX_NUM_RESERVED_BANKS 1
  26. /*
  27. * Number of Priority to TID mapping
  28. */
  29. #define HAL_BE_TX_MAP0_PRI2TID_MAX 10
  30. #define HAL_BE_TX_MAP1_PRI2TID_MAX 6
  31. enum hal_be_tx_ret_buf_manager {
  32. HAL_BE_WBM_SW0_BM_ID = 5,
  33. HAL_BE_WBM_SW1_BM_ID = 6,
  34. HAL_BE_WBM_SW2_BM_ID = 7,
  35. HAL_BE_WBM_SW3_BM_ID = 8,
  36. HAL_BE_WBM_SW4_BM_ID = 9,
  37. HAL_BE_WBM_SW5_BM_ID = 10,
  38. HAL_BE_WBM_SW6_BM_ID = 11,
  39. };
  40. enum hal_tx_mcast_ctrl {
  41. /* mcast traffic exceptioned to FW
  42. * valid only for AP VAP default for AP
  43. */
  44. HAL_TX_MCAST_CTRL_FW_EXCEPTION = 0,
  45. /* mcast traffic dropped in TCL*/
  46. HAL_TX_MCAST_CTRL_DROP,
  47. /* MEC notification are enabled
  48. * valid only for client VAP
  49. */
  50. HAL_TX_MCAST_CTRL_MEC_NOTIFY,
  51. /* no special routing for mcast
  52. * valid for client vap when index search is enabled
  53. */
  54. HAL_TX_MCAST_CTRL_NO_SPECIAL,
  55. };
  56. /**
  57. * enum hal_tx_vdev_mismatch_notify
  58. * @HAL_TX_VDEV_MISMATCH_TQM_NOTIFY: vdev mismatch exception routed to TQM
  59. * @HAL_TX_VDEV_MISMATCH_FW_NOTIFY: vdev mismatch exception routed to FW
  60. */
  61. enum hal_tx_vdev_mismatch_notify {
  62. HAL_TX_VDEV_MISMATCH_TQM_NOTIFY = 0,
  63. HAL_TX_VDEV_MISMATCH_FW_NOTIFY,
  64. };
  65. /* enum hal_tx_notify_frame_type - TX notify frame type
  66. * @NO_TX_NOTIFY: Not a notify frame
  67. * @TX_HARD_NOTIFY: Hard notify TX frame
  68. * @TX_SOFT_NOTIFY_E: Soft Notify Tx frame
  69. * @TX_SEMI_HARD_NOTIFY_E: Semi Hard notify TX frame
  70. */
  71. enum hal_tx_notify_frame_type {
  72. NO_TX_NOTIFY = 0,
  73. TX_HARD_NOTIFY = 1,
  74. TX_SOFT_NOTIFY_E = 2,
  75. TX_SEMI_HARD_NOTIFY_E = 3
  76. };
  77. /*---------------------------------------------------------------------------
  78. * Structures
  79. * ---------------------------------------------------------------------------
  80. */
  81. /**
  82. * struct hal_tx_bank_config - SW config bank params
  83. * @epd: EPD indication flag
  84. * @encap_type: encapsulation type
  85. * @encrypt_type: encrypt type
  86. * @src_buffer_swap: big-endia switch for packet buffer
  87. * @link_meta_swap: big-endian switch for link metadata
  88. * @index_lookup_enable: Enabel index lookup
  89. * @addrx_en: Address-X search
  90. * @addry_en: Address-Y search
  91. * @mesh_enable:mesh enable flag
  92. * @vdev_id_check_en: vdev id check
  93. * @pmac_id: mac id
  94. * @mcast_pkt_ctrl: mulitcast packet control
  95. * @val: value representing bank config
  96. */
  97. union hal_tx_bank_config {
  98. struct {
  99. uint32_t epd:1,
  100. encap_type:2,
  101. encrypt_type:4,
  102. src_buffer_swap:1,
  103. link_meta_swap:1,
  104. index_lookup_enable:1,
  105. addrx_en:1,
  106. addry_en:1,
  107. mesh_enable:2,
  108. vdev_id_check_en:1,
  109. pmac_id:2,
  110. mcast_pkt_ctrl:2,
  111. dscp_tid_map_id:6,
  112. reserved:7;
  113. };
  114. uint32_t val;
  115. };
  116. /**
  117. * struct hal_tx_cmn_config_ppe - SW config exception related parameters
  118. * @drop_prec_err - Exception drop_prec errors.
  119. * @fake_mac_hdr - Exception fake mac header.
  120. * @cpu_code_inv - Exception cpu code invalid.
  121. * @data_buff_err - Exception buffer length/offset erorors.
  122. * @l3_l4_err - Exception m3_l4 checksum errors
  123. * @data_offset_max - Maximum data offset allowed.
  124. * @data_len_max - Maximum data length allowed.
  125. */
  126. union hal_tx_cmn_config_ppe {
  127. struct {
  128. uint32_t drop_prec_err:1,
  129. fake_mac_hdr:1,
  130. cpu_code_inv:1,
  131. data_buff_err:1,
  132. l3_l4_err:1,
  133. data_offset_max:12,
  134. data_len_max:14;
  135. };
  136. uint32_t val;
  137. };
  138. /**
  139. * hal_tx_ppe_vp_config - SW config PPE VP table
  140. * @vp_num - Virtual port number
  141. * @pmac_id - Lmac ID
  142. * @bank_id: Bank ID correspondig to this I/F.
  143. * @vdev_id: VDEV ID of the I/F.
  144. * @search_idx_reg_num: Register number of this SI.
  145. * @use_ppe_int_pri: Use the PPE INT_PRI to TID table
  146. * @to_fw: Use FW
  147. * @drop_prec_enable: Enable precendance drop.
  148. */
  149. union hal_tx_ppe_vp_config {
  150. struct {
  151. uint32_t vp_num:8,
  152. pmac_id:2,
  153. bank_id:6,
  154. vdev_id:8,
  155. search_idx_reg_num:3,
  156. use_ppe_int_pri:1,
  157. to_fw:1,
  158. drop_prec_enable:1;
  159. };
  160. uint32_t val;
  161. };
  162. /**
  163. * hal_tx_cmn_ppe_idx_map_config: Use ppe index mapping table
  164. * @search_idx: Search index
  165. * @cache_set: Cache set number
  166. */
  167. union hal_tx_ppe_idx_map_config {
  168. struct {
  169. uint32_t search_idx:20,
  170. cache_set:4;
  171. };
  172. uint32_t val;
  173. };
  174. /**
  175. * hal_tx_ppe_pri2tid_map0_config : Configure ppe INT_PRI to tid map
  176. * @int_pri0: INT_PRI_0
  177. * @int_pri1: INT_PRI_1
  178. * @int_pri2: INT_PRI_2
  179. * @int_pri3: INT_PRI_3
  180. * @int_pri4: INT_PRI_4
  181. * @int_pri5: INT_PRI_5
  182. * @int_pri6: INT_PRI_6
  183. * @int_pri7: INT_PRI_7
  184. * @int_pri8: INT_PRI_8
  185. * @int_pri9: INT_PRI_9
  186. */
  187. union hal_tx_ppe_pri2tid_map0_config {
  188. struct {
  189. uint32_t int_pri0:3,
  190. int_pri1:3,
  191. int_pri2:3,
  192. int_pri3:3,
  193. int_pri4:3,
  194. int_pri5:3,
  195. int_pri6:3,
  196. int_pri7:3,
  197. int_pri8:3,
  198. int_pri9:3;
  199. };
  200. uint32_t val;
  201. };
  202. /**
  203. * hal_tx_ppe_pri2tid_map1_config : Configure ppe INT_PRI to tid map
  204. * @int_pri0: INT_PRI_10
  205. * @int_pri1: INT_PRI_11
  206. * @int_pri2: INT_PRI_12
  207. * @int_pri3: INT_PRI_13
  208. * @int_pri4: INT_PRI_14
  209. * @int_pri5: INT_PRI_15
  210. */
  211. union hal_tx_ppe_pri2tid_map1_config {
  212. struct {
  213. uint32_t int_pri10:3,
  214. int_pri11:3,
  215. int_pri12:3,
  216. int_pri13:3,
  217. int_pri14:3,
  218. int_pri15:3;
  219. };
  220. uint32_t val;
  221. };
  222. /*---------------------------------------------------------------------------
  223. * Function declarations and documentation
  224. * ---------------------------------------------------------------------------
  225. */
  226. /*---------------------------------------------------------------------------
  227. * TCL Descriptor accessor APIs
  228. *---------------------------------------------------------------------------
  229. */
  230. /**
  231. * hal_tx_desc_set_tx_notify_frame - Set TX notify_frame field in Tx desc
  232. * @desc: Handle to Tx Descriptor
  233. * @val: Value to be set
  234. *
  235. * Return: None
  236. */
  237. static inline void hal_tx_desc_set_tx_notify_frame(void *desc,
  238. uint8_t val)
  239. {
  240. HAL_SET_FLD(desc, TCL_DATA_CMD, TX_NOTIFY_FRAME) |=
  241. HAL_TX_SM(TCL_DATA_CMD, TX_NOTIFY_FRAME, val);
  242. }
  243. /**
  244. * hal_tx_desc_set_flow_override_enable - Set flow_override_enable field
  245. * @desc: Handle to Tx Descriptor
  246. * @val: Value to be set
  247. *
  248. * Return: None
  249. */
  250. static inline void hal_tx_desc_set_flow_override_enable(void *desc,
  251. uint8_t val)
  252. {
  253. HAL_SET_FLD(desc, TCL_DATA_CMD, FLOW_OVERRIDE_ENABLE) |=
  254. HAL_TX_SM(TCL_DATA_CMD, FLOW_OVERRIDE_ENABLE, val);
  255. }
  256. /**
  257. * hal_tx_desc_set_flow_override - Set flow_override field in TX desc
  258. * @desc: Handle to Tx Descriptor
  259. * @val: Value to be set
  260. *
  261. * Return: None
  262. */
  263. static inline void hal_tx_desc_set_flow_override(void *desc,
  264. uint8_t val)
  265. {
  266. HAL_SET_FLD(desc, TCL_DATA_CMD, FLOW_OVERRIDE) |=
  267. HAL_TX_SM(TCL_DATA_CMD, FLOW_OVERRIDE, val);
  268. }
  269. /**
  270. * hal_tx_desc_set_who_classify_info_sel - Set who_classify_info_sel field
  271. * @desc: Handle to Tx Descriptor
  272. * @val: Value to be set
  273. *
  274. * Return: None
  275. */
  276. static inline void hal_tx_desc_set_who_classify_info_sel(void *desc,
  277. uint8_t val)
  278. {
  279. HAL_SET_FLD(desc, TCL_DATA_CMD, WHO_CLASSIFY_INFO_SEL) |=
  280. HAL_TX_SM(TCL_DATA_CMD, WHO_CLASSIFY_INFO_SEL, val);
  281. }
  282. /**
  283. * hal_tx_desc_set_buf_length - Set Data length in bytes in Tx Descriptor
  284. * @desc: Handle to Tx Descriptor
  285. * @data_length: MSDU length in case of direct descriptor.
  286. * Length of link extension descriptor in case of Link extension
  287. * descriptor.Includes the length of Metadata
  288. * Return: None
  289. */
  290. static inline void hal_tx_desc_set_buf_length(void *desc,
  291. uint16_t data_length)
  292. {
  293. HAL_SET_FLD(desc, TCL_DATA_CMD, DATA_LENGTH) |=
  294. HAL_TX_SM(TCL_DATA_CMD, DATA_LENGTH, data_length);
  295. }
  296. /**
  297. * hal_tx_desc_set_buf_offset - Sets Packet Offset field in Tx descriptor
  298. * @desc: Handle to Tx Descriptor
  299. * @offset: Packet offset from Metadata in case of direct buffer descriptor.
  300. *
  301. * Return: void
  302. */
  303. static inline void hal_tx_desc_set_buf_offset(void *desc,
  304. uint8_t offset)
  305. {
  306. HAL_SET_FLD(desc, TCL_DATA_CMD, PACKET_OFFSET) |=
  307. HAL_TX_SM(TCL_DATA_CMD, PACKET_OFFSET, offset);
  308. }
  309. /**
  310. * hal_tx_desc_set_l4_checksum_en - Set TCP/IP checksum enable flags
  311. * Tx Descriptor for MSDU_buffer type
  312. * @desc: Handle to Tx Descriptor
  313. * @en: UDP/TCP over ipv4/ipv6 checksum enable flags (5 bits)
  314. *
  315. * Return: void
  316. */
  317. static inline void hal_tx_desc_set_l4_checksum_en(void *desc,
  318. uint8_t en)
  319. {
  320. HAL_SET_FLD(desc, TCL_DATA_CMD, IPV4_CHECKSUM_EN) |=
  321. (HAL_TX_SM(TCL_DATA_CMD, UDP_OVER_IPV4_CHECKSUM_EN, en) |
  322. HAL_TX_SM(TCL_DATA_CMD, UDP_OVER_IPV6_CHECKSUM_EN, en) |
  323. HAL_TX_SM(TCL_DATA_CMD, TCP_OVER_IPV4_CHECKSUM_EN, en) |
  324. HAL_TX_SM(TCL_DATA_CMD, TCP_OVER_IPV6_CHECKSUM_EN, en));
  325. }
  326. /**
  327. * hal_tx_desc_set_l3_checksum_en - Set IPv4 checksum enable flag in
  328. * Tx Descriptor for MSDU_buffer type
  329. * @desc: Handle to Tx Descriptor
  330. * @checksum_en_flags: ipv4 checksum enable flags
  331. *
  332. * Return: void
  333. */
  334. static inline void hal_tx_desc_set_l3_checksum_en(void *desc,
  335. uint8_t en)
  336. {
  337. HAL_SET_FLD(desc, TCL_DATA_CMD, IPV4_CHECKSUM_EN) |=
  338. HAL_TX_SM(TCL_DATA_CMD, IPV4_CHECKSUM_EN, en);
  339. }
  340. /**
  341. * hal_tx_desc_set_fw_metadata- Sets the metadata that is part of TCL descriptor
  342. * @desc:Handle to Tx Descriptor
  343. * @metadata: Metadata to be sent to Firmware
  344. *
  345. * Return: void
  346. */
  347. static inline void hal_tx_desc_set_fw_metadata(void *desc,
  348. uint16_t metadata)
  349. {
  350. HAL_SET_FLD(desc, TCL_DATA_CMD, TCL_CMD_NUMBER) |=
  351. HAL_TX_SM(TCL_DATA_CMD, TCL_CMD_NUMBER, metadata);
  352. }
  353. /**
  354. * hal_tx_desc_set_to_fw - Set To_FW bit in Tx Descriptor.
  355. * @desc:Handle to Tx Descriptor
  356. * @to_fw: if set, Forward packet to FW along with classification result
  357. *
  358. * Return: void
  359. */
  360. static inline void hal_tx_desc_set_to_fw(void *desc, uint8_t to_fw)
  361. {
  362. HAL_SET_FLD(desc, TCL_DATA_CMD, TO_FW) |=
  363. HAL_TX_SM(TCL_DATA_CMD, TO_FW, to_fw);
  364. }
  365. /**
  366. * hal_tx_desc_set_hlos_tid - Set the TID value (override DSCP/PCP fields in
  367. * frame) to be used for Tx Frame
  368. * @desc: Handle to Tx Descriptor
  369. * @hlos_tid: HLOS TID
  370. *
  371. * Return: void
  372. */
  373. static inline void hal_tx_desc_set_hlos_tid(void *desc,
  374. uint8_t hlos_tid)
  375. {
  376. HAL_SET_FLD(desc, TCL_DATA_CMD, HLOS_TID) |=
  377. HAL_TX_SM(TCL_DATA_CMD, HLOS_TID, hlos_tid);
  378. HAL_SET_FLD(desc, TCL_DATA_CMD, HLOS_TID_OVERWRITE) |=
  379. HAL_TX_SM(TCL_DATA_CMD, HLOS_TID_OVERWRITE, 1);
  380. }
  381. /**
  382. * hal_tx_desc_sync - Commit the descriptor to Hardware
  383. * @hal_tx_des_cached: Cached descriptor that software maintains
  384. * @hw_desc: Hardware descriptor to be updated
  385. */
  386. static inline void hal_tx_desc_sync(void *hal_tx_desc_cached,
  387. void *hw_desc)
  388. {
  389. qdf_mem_copy(hw_desc, hal_tx_desc_cached, HAL_TX_DESC_LEN_BYTES);
  390. }
  391. /**
  392. * hal_tx_desc_set_vdev_id - set vdev id to the descriptor to Hardware
  393. * @hal_tx_des_cached: Cached descriptor that software maintains
  394. * @vdev_id: vdev id
  395. */
  396. static inline void hal_tx_desc_set_vdev_id(void *desc, uint8_t vdev_id)
  397. {
  398. HAL_SET_FLD(desc, TCL_DATA_CMD, VDEV_ID) |=
  399. HAL_TX_SM(TCL_DATA_CMD, VDEV_ID, vdev_id);
  400. }
  401. /**
  402. * hal_tx_desc_set_bank_id - set bank id to the descriptor to Hardware
  403. * @hal_tx_des_cached: Cached descriptor that software maintains
  404. * @bank_id: bank id
  405. */
  406. static inline void hal_tx_desc_set_bank_id(void *desc, uint8_t bank_id)
  407. {
  408. HAL_SET_FLD(desc, TCL_DATA_CMD, BANK_ID) |=
  409. HAL_TX_SM(TCL_DATA_CMD, BANK_ID, bank_id);
  410. }
  411. /**
  412. * hal_tx_desc_set_tcl_cmd_type - set tcl command type to the descriptor
  413. * to Hardware
  414. * @hal_tx_des_cached: Cached descriptor that software maintains
  415. * @tcl_cmd_type: tcl command type
  416. */
  417. static inline void
  418. hal_tx_desc_set_tcl_cmd_type(void *desc, uint8_t tcl_cmd_type)
  419. {
  420. HAL_SET_FLD(desc, TCL_DATA_CMD, TCL_CMD_TYPE) |=
  421. HAL_TX_SM(TCL_DATA_CMD, TCL_CMD_TYPE, tcl_cmd_type);
  422. }
  423. /**
  424. * hal_tx_desc_set_lmac_id_be - set lmac id to the descriptor to Hardware
  425. * @hal_soc_hdl: hal soc handle
  426. * @hal_tx_des_cached: Cached descriptor that software maintains
  427. * @lmac_id: lmac id
  428. */
  429. static inline void
  430. hal_tx_desc_set_lmac_id_be(hal_soc_handle_t hal_soc_hdl, void *desc,
  431. uint8_t lmac_id)
  432. {
  433. HAL_SET_FLD(desc, TCL_DATA_CMD, PMAC_ID) |=
  434. HAL_TX_SM(TCL_DATA_CMD, PMAC_ID, lmac_id);
  435. }
  436. /**
  437. * hal_tx_desc_set_search_index_be - set search index to the
  438. * descriptor to Hardware
  439. * @hal_soc_hdl: hal soc handle
  440. * @hal_tx_des_cached: Cached descriptor that software maintains
  441. * @search_index: search index
  442. */
  443. static inline void
  444. hal_tx_desc_set_search_index_be(hal_soc_handle_t hal_soc_hdl, void *desc,
  445. uint32_t search_index)
  446. {
  447. HAL_SET_FLD(desc, TCL_DATA_CMD, SEARCH_INDEX) |=
  448. HAL_TX_SM(TCL_DATA_CMD, SEARCH_INDEX, search_index);
  449. }
  450. /**
  451. * hal_tx_desc_set_cache_set_num - set cache set num to the
  452. * descriptor to Hardware
  453. * @hal_soc_hdl: hal soc handle
  454. * @hal_tx_des_cached: Cached descriptor that software maintains
  455. * @cache_num: cache number
  456. */
  457. static inline void
  458. hal_tx_desc_set_cache_set_num(hal_soc_handle_t hal_soc_hdl, void *desc,
  459. uint8_t cache_num)
  460. {
  461. HAL_SET_FLD(desc, TCL_DATA_CMD, CACHE_SET_NUM) |=
  462. HAL_TX_SM(TCL_DATA_CMD, CACHE_SET_NUM, cache_num);
  463. }
  464. /*---------------------------------------------------------------------------
  465. * WBM Descriptor accessor APIs for Tx completions
  466. * ---------------------------------------------------------------------------
  467. */
  468. /**
  469. * hal_tx_get_wbm_sw0_bm_id() - Get the BM ID for first tx completion ring
  470. *
  471. * Return: BM ID for first tx completion ring
  472. */
  473. static inline uint32_t hal_tx_get_wbm_sw0_bm_id(void)
  474. {
  475. return HAL_BE_WBM_SW0_BM_ID;
  476. }
  477. /**
  478. * hal_tx_comp_get_desc_id() - Get TX descriptor id within comp descriptor
  479. * @hal_desc: completion ring descriptor pointer
  480. *
  481. * This function will tx descriptor id, cookie, within hardware completion
  482. * descriptor. For cases when cookie conversion is disabled, the sw_cookie
  483. * is present in the 2nd DWORD.
  484. *
  485. * Return: cookie
  486. */
  487. static inline uint32_t hal_tx_comp_get_desc_id(void *hal_desc)
  488. {
  489. uint32_t comp_desc =
  490. *(uint32_t *)(((uint8_t *)hal_desc) +
  491. BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET);
  492. /* Cookie is placed on 2nd word */
  493. return (comp_desc & BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_MASK) >>
  494. BUFFER_ADDR_INFO_SW_BUFFER_COOKIE_LSB;
  495. }
  496. /**
  497. * hal_tx_comp_get_paddr() - Get paddr within comp descriptor
  498. * @hal_desc: completion ring descriptor pointer
  499. *
  500. * This function will get buffer physical address within hardware completion
  501. * descriptor
  502. *
  503. * Return: Buffer physical address
  504. */
  505. static inline qdf_dma_addr_t hal_tx_comp_get_paddr(void *hal_desc)
  506. {
  507. uint32_t paddr_lo;
  508. uint32_t paddr_hi;
  509. paddr_lo = *(uint32_t *)(((uint8_t *)hal_desc) +
  510. BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET);
  511. paddr_hi = *(uint32_t *)(((uint8_t *)hal_desc) +
  512. BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET);
  513. paddr_hi = (paddr_hi & BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_MASK) >>
  514. BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_LSB;
  515. return (qdf_dma_addr_t)(paddr_lo | (((uint64_t)paddr_hi) << 32));
  516. }
  517. #ifdef DP_HW_COOKIE_CONVERT_EXCEPTION
  518. /* HW set dowrd-2 bit30 to 1 if HW CC is done */
  519. #define HAL_WBM2SW_COMPLETION_RING_TX_CC_DONE_OFFSET 0x8
  520. #define HAL_WBM2SW_COMPLETION_RING_TX_CC_DONE_MASK 0x40000000
  521. #define HAL_WBM2SW_COMPLETION_RING_TX_CC_DONE_LSB 0x1E
  522. /**
  523. * hal_tx_comp_get_cookie_convert_done() - Get cookie conversion done flag
  524. * @hal_desc: completion ring descriptor pointer
  525. *
  526. * This function will get the bit value that indicate HW cookie
  527. * conversion done or not
  528. *
  529. * Return: 1 - HW cookie conversion done, 0 - not
  530. */
  531. static inline uint8_t hal_tx_comp_get_cookie_convert_done(void *hal_desc)
  532. {
  533. return HAL_TX_DESC_GET(hal_desc, HAL_WBM2SW_COMPLETION_RING_TX,
  534. CC_DONE);
  535. }
  536. #endif
  537. /**
  538. * hal_tx_comp_get_desc_va() - Get Desc virtual address within completion Desc
  539. * @hal_desc: completion ring descriptor pointer
  540. *
  541. * This function will get the TX Desc virtual address
  542. *
  543. * Return: TX desc virtual address
  544. */
  545. static inline uintptr_t hal_tx_comp_get_desc_va(void *hal_desc)
  546. {
  547. uint64_t va_from_desc;
  548. va_from_desc = HAL_TX_DESC_GET(hal_desc,
  549. WBM2SW_COMPLETION_RING_TX,
  550. BUFFER_VIRT_ADDR_31_0) |
  551. (((uint64_t)HAL_TX_DESC_GET(
  552. hal_desc,
  553. WBM2SW_COMPLETION_RING_TX,
  554. BUFFER_VIRT_ADDR_63_32)) << 32);
  555. return (uintptr_t)va_from_desc;
  556. }
  557. /*---------------------------------------------------------------------------
  558. * TX BANK register accessor APIs
  559. * ---------------------------------------------------------------------------
  560. */
  561. /**
  562. * hal_tx_get_num_tcl_banks() - Get number of banks for target
  563. *
  564. * Return: None
  565. */
  566. static inline uint8_t
  567. hal_tx_get_num_tcl_banks(hal_soc_handle_t hal_soc_hdl)
  568. {
  569. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  570. int hal_banks = 0;
  571. if (hal_soc->ops->hal_tx_get_num_tcl_banks) {
  572. hal_banks = hal_soc->ops->hal_tx_get_num_tcl_banks();
  573. hal_banks -= HAL_TX_NUM_RESERVED_BANKS;
  574. hal_banks = (hal_banks < 0) ? 0 : hal_banks;
  575. }
  576. return hal_banks;
  577. }
  578. /**
  579. * hal_tx_populate_bank_register() - populate the bank register with
  580. * the software configs.
  581. * @soc: HAL soc handle
  582. * @config: bank config
  583. * @bank_id: bank id to be configured
  584. *
  585. * Returns: None
  586. */
  587. #ifdef HWIO_TCL_R0_SW_CONFIG_BANK_n_MCAST_PACKET_CTRL_SHFT
  588. static inline void
  589. hal_tx_populate_bank_register(hal_soc_handle_t hal_soc_hdl,
  590. union hal_tx_bank_config *config,
  591. uint8_t bank_id)
  592. {
  593. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  594. uint32_t reg_addr, reg_val = 0;
  595. reg_addr = HWIO_TCL_R0_SW_CONFIG_BANK_n_ADDR(MAC_TCL_REG_REG_BASE,
  596. bank_id);
  597. reg_val |= (config->epd << HWIO_TCL_R0_SW_CONFIG_BANK_n_EPD_SHFT);
  598. reg_val |= (config->encap_type <<
  599. HWIO_TCL_R0_SW_CONFIG_BANK_n_ENCAP_TYPE_SHFT);
  600. reg_val |= (config->encrypt_type <<
  601. HWIO_TCL_R0_SW_CONFIG_BANK_n_ENCRYPT_TYPE_SHFT);
  602. reg_val |= (config->src_buffer_swap <<
  603. HWIO_TCL_R0_SW_CONFIG_BANK_n_SRC_BUFFER_SWAP_SHFT);
  604. reg_val |= (config->link_meta_swap <<
  605. HWIO_TCL_R0_SW_CONFIG_BANK_n_LINK_META_SWAP_SHFT);
  606. reg_val |= (config->index_lookup_enable <<
  607. HWIO_TCL_R0_SW_CONFIG_BANK_n_INDEX_LOOKUP_ENABLE_SHFT);
  608. reg_val |= (config->addrx_en <<
  609. HWIO_TCL_R0_SW_CONFIG_BANK_n_ADDRX_EN_SHFT);
  610. reg_val |= (config->addry_en <<
  611. HWIO_TCL_R0_SW_CONFIG_BANK_n_ADDRY_EN_SHFT);
  612. reg_val |= (config->mesh_enable <<
  613. HWIO_TCL_R0_SW_CONFIG_BANK_n_MESH_ENABLE_SHFT);
  614. reg_val |= (config->vdev_id_check_en <<
  615. HWIO_TCL_R0_SW_CONFIG_BANK_n_VDEV_ID_CHECK_EN_SHFT);
  616. reg_val |= (config->pmac_id <<
  617. HWIO_TCL_R0_SW_CONFIG_BANK_n_PMAC_ID_SHFT);
  618. reg_val |= (config->mcast_pkt_ctrl <<
  619. HWIO_TCL_R0_SW_CONFIG_BANK_n_MCAST_PACKET_CTRL_SHFT);
  620. HAL_REG_WRITE(hal_soc, reg_addr, reg_val);
  621. }
  622. #else
  623. static inline void
  624. hal_tx_populate_bank_register(hal_soc_handle_t hal_soc_hdl,
  625. union hal_tx_bank_config *config,
  626. uint8_t bank_id)
  627. {
  628. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  629. uint32_t reg_addr, reg_val = 0;
  630. reg_addr = HWIO_TCL_R0_SW_CONFIG_BANK_n_ADDR(MAC_TCL_REG_REG_BASE,
  631. bank_id);
  632. reg_val |= (config->epd << HWIO_TCL_R0_SW_CONFIG_BANK_n_EPD_SHFT);
  633. reg_val |= (config->encap_type <<
  634. HWIO_TCL_R0_SW_CONFIG_BANK_n_ENCAP_TYPE_SHFT);
  635. reg_val |= (config->encrypt_type <<
  636. HWIO_TCL_R0_SW_CONFIG_BANK_n_ENCRYPT_TYPE_SHFT);
  637. reg_val |= (config->src_buffer_swap <<
  638. HWIO_TCL_R0_SW_CONFIG_BANK_n_SRC_BUFFER_SWAP_SHFT);
  639. reg_val |= (config->link_meta_swap <<
  640. HWIO_TCL_R0_SW_CONFIG_BANK_n_LINK_META_SWAP_SHFT);
  641. reg_val |= (config->index_lookup_enable <<
  642. HWIO_TCL_R0_SW_CONFIG_BANK_n_INDEX_LOOKUP_ENABLE_SHFT);
  643. reg_val |= (config->addrx_en <<
  644. HWIO_TCL_R0_SW_CONFIG_BANK_n_ADDRX_EN_SHFT);
  645. reg_val |= (config->addry_en <<
  646. HWIO_TCL_R0_SW_CONFIG_BANK_n_ADDRY_EN_SHFT);
  647. reg_val |= (config->mesh_enable <<
  648. HWIO_TCL_R0_SW_CONFIG_BANK_n_MESH_ENABLE_SHFT);
  649. reg_val |= (config->vdev_id_check_en <<
  650. HWIO_TCL_R0_SW_CONFIG_BANK_n_VDEV_ID_CHECK_EN_SHFT);
  651. reg_val |= (config->pmac_id <<
  652. HWIO_TCL_R0_SW_CONFIG_BANK_n_PMAC_ID_SHFT);
  653. reg_val |= (config->dscp_tid_map_id <<
  654. HWIO_TCL_R0_SW_CONFIG_BANK_n_DSCP_TID_TABLE_NUM_SHFT);
  655. HAL_REG_WRITE(hal_soc, reg_addr, reg_val);
  656. }
  657. #endif
  658. #ifdef DP_TX_IMPLICIT_RBM_MAPPING
  659. #define RBM_MAPPING_BMSK HWIO_TCL_R0_RBM_MAPPING0_SW2TCL1_RING_BMSK
  660. #define RBM_MAPPING_SHFT HWIO_TCL_R0_RBM_MAPPING0_SW2TCL2_RING_SHFT
  661. #define RBM_PPE2TCL_OFFSET \
  662. (HWIO_TCL_R0_RBM_MAPPING0_PPE2TCL1_RING_SHFT >> 2)
  663. #define RBM_TCL_CMD_CREDIT_OFFSET \
  664. (HWIO_TCL_R0_RBM_MAPPING0_SW2TCL_CREDIT_RING_SHFT >> 2)
  665. /**
  666. * hal_tx_config_rbm_mapping_be() - Update return buffer manager ring id
  667. * @hal_soc: HAL SoC context
  668. * @hal_ring_hdl: Source ring pointer
  669. * @rbm_id: return buffer manager ring id
  670. *
  671. * Return: void
  672. */
  673. static inline void
  674. hal_tx_config_rbm_mapping_be(hal_soc_handle_t hal_soc_hdl,
  675. hal_ring_handle_t hal_ring_hdl,
  676. uint8_t rbm_id)
  677. {
  678. struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
  679. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  680. uint32_t reg_addr = 0;
  681. uint32_t reg_val = 0;
  682. uint32_t val = 0;
  683. uint8_t ring_num;
  684. enum hal_ring_type ring_type;
  685. ring_type = srng->ring_type;
  686. ring_num = hal_soc->hw_srng_table[ring_type].start_ring_id;
  687. ring_num = srng->ring_id - ring_num;
  688. reg_addr = HWIO_TCL_R0_RBM_MAPPING0_ADDR(MAC_TCL_REG_REG_BASE);
  689. if (ring_type == PPE2TCL)
  690. ring_num = ring_num + RBM_PPE2TCL_OFFSET;
  691. else if (ring_type == TCL_CMD_CREDIT)
  692. ring_num = ring_num + RBM_TCL_CMD_CREDIT_OFFSET;
  693. /* get current value stored in register address */
  694. val = HAL_REG_READ(hal_soc, reg_addr);
  695. /* mask out other stored value */
  696. val &= (~(RBM_MAPPING_BMSK << (RBM_MAPPING_SHFT * ring_num)));
  697. reg_val = val | ((RBM_MAPPING_BMSK & rbm_id) <<
  698. (RBM_MAPPING_SHFT * ring_num));
  699. /* write rbm mapped value to register address */
  700. HAL_REG_WRITE(hal_soc, reg_addr, reg_val);
  701. }
  702. #else
  703. static inline void
  704. hal_tx_config_rbm_mapping_be(hal_soc_handle_t hal_soc_hdl,
  705. hal_ring_handle_t hal_ring_hdl,
  706. uint8_t rbm_id)
  707. {
  708. }
  709. #endif
  710. /**
  711. * hal_tx_desc_set_buf_addr_be - Fill Buffer Address information in Tx Desc
  712. * @desc: Handle to Tx Descriptor
  713. * @paddr: Physical Address
  714. * @pool_id: Return Buffer Manager ID
  715. * @desc_id: Descriptor ID
  716. * @type: 0 - Address points to a MSDU buffer
  717. * 1 - Address points to MSDU extension descriptor
  718. *
  719. * Return: void
  720. */
  721. #ifdef DP_TX_IMPLICIT_RBM_MAPPING
  722. static inline void
  723. hal_tx_desc_set_buf_addr_be(hal_soc_handle_t hal_soc_hdl, void *desc,
  724. dma_addr_t paddr, uint8_t rbm_id,
  725. uint32_t desc_id, uint8_t type)
  726. {
  727. /* Set buffer_addr_info.buffer_addr_31_0 */
  728. HAL_SET_FLD(desc, TCL_DATA_CMD,
  729. BUF_ADDR_INFO_BUFFER_ADDR_31_0) =
  730. HAL_TX_SM(TCL_DATA_CMD, BUF_ADDR_INFO_BUFFER_ADDR_31_0, paddr);
  731. /* Set buffer_addr_info.buffer_addr_39_32 */
  732. HAL_SET_FLD(desc, TCL_DATA_CMD,
  733. BUF_ADDR_INFO_BUFFER_ADDR_39_32) |=
  734. HAL_TX_SM(TCL_DATA_CMD, BUF_ADDR_INFO_BUFFER_ADDR_39_32,
  735. (((uint64_t)paddr) >> 32));
  736. /* Set buffer_addr_info.sw_buffer_cookie = desc_id */
  737. HAL_SET_FLD(desc, TCL_DATA_CMD,
  738. BUF_ADDR_INFO_SW_BUFFER_COOKIE) |=
  739. HAL_TX_SM(TCL_DATA_CMD, BUF_ADDR_INFO_SW_BUFFER_COOKIE,
  740. desc_id);
  741. /* Set Buffer or Ext Descriptor Type */
  742. HAL_SET_FLD(desc, TCL_DATA_CMD,
  743. BUF_OR_EXT_DESC_TYPE) |=
  744. HAL_TX_SM(TCL_DATA_CMD, BUF_OR_EXT_DESC_TYPE, type);
  745. }
  746. #else
  747. static inline void
  748. hal_tx_desc_set_buf_addr_be(hal_soc_handle_t hal_soc_hdl, void *desc,
  749. dma_addr_t paddr, uint8_t rbm_id,
  750. uint32_t desc_id, uint8_t type)
  751. {
  752. /* Set buffer_addr_info.buffer_addr_31_0 */
  753. HAL_SET_FLD(desc, TCL_DATA_CMD,
  754. BUF_ADDR_INFO_BUFFER_ADDR_31_0) =
  755. HAL_TX_SM(TCL_DATA_CMD, BUF_ADDR_INFO_BUFFER_ADDR_31_0, paddr);
  756. /* Set buffer_addr_info.buffer_addr_39_32 */
  757. HAL_SET_FLD(desc, TCL_DATA_CMD,
  758. BUF_ADDR_INFO_BUFFER_ADDR_39_32) |=
  759. HAL_TX_SM(TCL_DATA_CMD, BUF_ADDR_INFO_BUFFER_ADDR_39_32,
  760. (((uint64_t)paddr) >> 32));
  761. /* Set buffer_addr_info.return_buffer_manager = rbm id */
  762. HAL_SET_FLD(desc, TCL_DATA_CMD,
  763. BUF_ADDR_INFO_RETURN_BUFFER_MANAGER) |=
  764. HAL_TX_SM(TCL_DATA_CMD,
  765. BUF_ADDR_INFO_RETURN_BUFFER_MANAGER, rbm_id);
  766. /* Set buffer_addr_info.sw_buffer_cookie = desc_id */
  767. HAL_SET_FLD(desc, TCL_DATA_CMD,
  768. BUF_ADDR_INFO_SW_BUFFER_COOKIE) |=
  769. HAL_TX_SM(TCL_DATA_CMD, BUF_ADDR_INFO_SW_BUFFER_COOKIE,
  770. desc_id);
  771. /* Set Buffer or Ext Descriptor Type */
  772. HAL_SET_FLD(desc, TCL_DATA_CMD,
  773. BUF_OR_EXT_DESC_TYPE) |=
  774. HAL_TX_SM(TCL_DATA_CMD, BUF_OR_EXT_DESC_TYPE, type);
  775. }
  776. #endif
  777. #ifdef HWIO_TCL_R0_VDEV_MCAST_PACKET_CTRL_MAP_n_VAL_SHFT
  778. #define HAL_TCL_VDEV_MCAST_PACKET_CTRL_REG_ID(vdev_id) (vdev_id >> 0x4)
  779. #define HAL_TCL_VDEV_MCAST_PACKET_CTRL_INDEX_IN_REG(vdev_id) (vdev_id & 0xF)
  780. #define HAL_TCL_VDEV_MCAST_PACKET_CTRL_MASK 0x3
  781. #define HAL_TCL_VDEV_MCAST_PACKET_CTRL_SHIFT 0x2
  782. /**
  783. * hal_tx_vdev_mcast_ctrl_set - set mcast_ctrl value
  784. * @hal_soc: HAL SoC context
  785. * @mcast_ctrl_val: mcast ctrl value for this VAP
  786. *
  787. * Return: void
  788. */
  789. static inline void
  790. hal_tx_vdev_mcast_ctrl_set(hal_soc_handle_t hal_soc_hdl,
  791. uint8_t vdev_id,
  792. uint8_t mcast_ctrl_val)
  793. {
  794. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  795. uint32_t reg_addr, reg_val = 0;
  796. uint32_t val;
  797. uint8_t reg_idx = HAL_TCL_VDEV_MCAST_PACKET_CTRL_REG_ID(vdev_id);
  798. uint8_t index_in_reg =
  799. HAL_TCL_VDEV_MCAST_PACKET_CTRL_INDEX_IN_REG(vdev_id);
  800. reg_addr =
  801. HWIO_TCL_R0_VDEV_MCAST_PACKET_CTRL_MAP_n_ADDR(MAC_TCL_REG_REG_BASE,
  802. reg_idx);
  803. val = HAL_REG_READ(hal_soc, reg_addr);
  804. /* mask out other stored value */
  805. val &= (~(HAL_TCL_VDEV_MCAST_PACKET_CTRL_MASK <<
  806. (HAL_TCL_VDEV_MCAST_PACKET_CTRL_SHIFT * index_in_reg)));
  807. reg_val = val |
  808. ((HAL_TCL_VDEV_MCAST_PACKET_CTRL_MASK & mcast_ctrl_val) <<
  809. (HAL_TCL_VDEV_MCAST_PACKET_CTRL_SHIFT * index_in_reg));
  810. HAL_REG_WRITE(hal_soc, reg_addr, reg_val);
  811. }
  812. #else
  813. static inline void
  814. hal_tx_vdev_mcast_ctrl_set(hal_soc_handle_t hal_soc_hdl,
  815. uint8_t vdev_id,
  816. uint8_t mcast_ctrl_val)
  817. {
  818. }
  819. #endif
  820. /**
  821. * hal_tx_vdev_mismatch_routing_set - set vdev mismatch exception routing
  822. * @hal_soc: HAL SoC context
  823. * @config: HAL_TX_VDEV_MISMATCH_TQM_NOTIFY - route via TQM
  824. * HAL_TX_VDEV_MISMATCH_FW_NOTIFY - route via FW
  825. *
  826. * Return: void
  827. */
  828. #ifdef HWIO_TCL_R0_CMN_CONFIG_VDEVID_MISMATCH_EXCEPTION_BMSK
  829. static inline void
  830. hal_tx_vdev_mismatch_routing_set(hal_soc_handle_t hal_soc_hdl,
  831. enum hal_tx_vdev_mismatch_notify config)
  832. {
  833. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  834. uint32_t reg_addr, reg_val = 0;
  835. uint32_t val = 0;
  836. reg_addr = HWIO_TCL_R0_CMN_CONFIG_ADDR(MAC_TCL_REG_REG_BASE);
  837. val = HAL_REG_READ(hal_soc, reg_addr);
  838. /* reset the corresponding bits in register */
  839. val &= (~(HWIO_TCL_R0_CMN_CONFIG_VDEVID_MISMATCH_EXCEPTION_BMSK));
  840. /* set config value */
  841. reg_val = val | (config <<
  842. HWIO_TCL_R0_CMN_CONFIG_VDEVID_MISMATCH_EXCEPTION_SHFT);
  843. HAL_REG_WRITE(hal_soc, reg_addr, reg_val);
  844. }
  845. #else
  846. static inline void
  847. hal_tx_vdev_mismatch_routing_set(hal_soc_handle_t hal_soc_hdl,
  848. enum hal_tx_vdev_mismatch_notify config)
  849. {
  850. }
  851. #endif
  852. /*
  853. * hal_tx_get_num_ppe_vp_tbl_entries() - Get the total number of VP table
  854. * @hal_soc: HAL SoC Context
  855. *
  856. * Return: Total number of entries.
  857. */
  858. static inline
  859. uint32_t hal_tx_get_num_ppe_vp_tbl_entries(hal_soc_handle_t hal_soc_hdl)
  860. {
  861. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  862. return hal_soc->ops->hal_tx_get_num_ppe_vp_tbl_entries(hal_soc_hdl);
  863. }
  864. /**
  865. * hal_tx_set_ppe_cmn_cfg()- Set the PPE common config
  866. * @hal_soc: HAL SoC context
  867. * @cmn_cfg: HAL PPE VP common config
  868. *
  869. * Return: void
  870. */
  871. static inline void
  872. hal_tx_set_ppe_cmn_cfg(hal_soc_handle_t hal_soc_hdl,
  873. union hal_tx_cmn_config_ppe *cmn_cfg)
  874. {
  875. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  876. hal_soc->ops->hal_tx_set_ppe_cmn_cfg(hal_soc_hdl, cmn_cfg);
  877. }
  878. /**
  879. * hal_tx_populate_ppe_vp_entry - Populate ppe VP entry
  880. * @hal_soc: HAL SoC context
  881. * @vp_cfg: HAL PPE VP config
  882. * @ppe_vp_idx: PPE VP index
  883. *
  884. * Return: void
  885. */
  886. static inline void
  887. hal_tx_populate_ppe_vp_entry(hal_soc_handle_t hal_soc_hdl,
  888. union hal_tx_ppe_vp_config *vp_cfg,
  889. int ppe_vp_idx)
  890. {
  891. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  892. hal_soc->ops->hal_tx_set_ppe_vp_entry(hal_soc_hdl, vp_cfg, ppe_vp_idx);
  893. }
  894. /**
  895. * hal_tx_set_int_pri2id - Set the prit2tid table.
  896. * @hal_soc: HAL SoC context
  897. * @pri2tid: Reference to SW INT_PRI to TID table
  898. *
  899. * Return: void
  900. */
  901. static inline void
  902. hal_tx_set_int_pri2tid(hal_soc_handle_t hal_soc_hdl,
  903. uint32_t val, uint8_t map_no)
  904. {
  905. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  906. hal_soc->ops->hal_tx_set_ppe_pri2tid(hal_soc_hdl, val, map_no);
  907. }
  908. /**
  909. * hal_tx_update_int_pri2id - Populate the prit2tid table.
  910. * @hal_soc: HAL SoC context
  911. * @pri: INT_PRI value
  912. * @tid: Wi-Fi TID
  913. *
  914. * Return: void
  915. */
  916. static inline void
  917. hal_tx_update_int_pri2tid(hal_soc_handle_t hal_soc_hdl,
  918. uint8_t pri, uint8_t tid)
  919. {
  920. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  921. hal_soc->ops->hal_tx_update_ppe_pri2tid(hal_soc_hdl, pri, tid);
  922. }
  923. /**
  924. * hal_tx_dump_ppe_vp_entry - Dump the PPE VP entry
  925. * @hal_soc_hdl: HAL SoC context
  926. *
  927. * Return: void
  928. */
  929. static inline void
  930. hal_tx_dump_ppe_vp_entry(hal_soc_handle_t hal_soc_hdl)
  931. {
  932. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  933. hal_soc->ops->hal_tx_dump_ppe_vp_entry(hal_soc_hdl);
  934. }
  935. /**
  936. * hal_tx_enable_pri2tid_map- Enable the priority to tid mapping
  937. * @hal_soc_hdl: HAL SoC context
  938. * @val: True/False value
  939. *
  940. * Return: void
  941. */
  942. static inline void
  943. hal_tx_enable_pri2tid_map(hal_soc_handle_t hal_soc_hdl, bool val,
  944. uint8_t ppe_vp_idx)
  945. {
  946. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  947. hal_soc->ops->hal_tx_enable_pri2tid_map(hal_soc_hdl, val,
  948. ppe_vp_idx);
  949. }
  950. #endif /* _HAL_BE_TX_H_ */