18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012  Realtek Corporation.*/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __RTL92CU_TRX_H__
58c2ecf20Sopenharmony_ci#define __RTL92CU_TRX_H__
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define RTL92C_USB_BULK_IN_NUM			1
88c2ecf20Sopenharmony_ci#define RTL92C_NUM_RX_URBS			8
98c2ecf20Sopenharmony_ci#define RTL92C_NUM_TX_URBS			32
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define RTL92C_SIZE_MAX_RX_BUFFER		15360   /* 8192 */
128c2ecf20Sopenharmony_ci#define RX_DRV_INFO_SIZE_UNIT			8
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define RTL_AGG_ON				1
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cienum usb_rx_agg_mode {
178c2ecf20Sopenharmony_ci	USB_RX_AGG_DISABLE,
188c2ecf20Sopenharmony_ci	USB_RX_AGG_DMA,
198c2ecf20Sopenharmony_ci	USB_RX_AGG_USB,
208c2ecf20Sopenharmony_ci	USB_RX_AGG_DMA_USB
218c2ecf20Sopenharmony_ci};
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define TX_SELE_HQ				BIT(0)	/* High Queue */
248c2ecf20Sopenharmony_ci#define TX_SELE_LQ				BIT(1)	/* Low Queue */
258c2ecf20Sopenharmony_ci#define TX_SELE_NQ				BIT(2)	/* Normal Queue */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define RTL_USB_TX_AGG_NUM_DESC			5
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#define RTL_USB_RX_AGG_PAGE_NUM			4
308c2ecf20Sopenharmony_ci#define RTL_USB_RX_AGG_PAGE_TIMEOUT		3
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define RTL_USB_RX_AGG_BLOCK_NUM		5
338c2ecf20Sopenharmony_ci#define RTL_USB_RX_AGG_BLOCK_TIMEOUT		3
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/*======================== rx status =========================================*/
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_cistruct rx_drv_info_92c {
388c2ecf20Sopenharmony_ci	/*
398c2ecf20Sopenharmony_ci	 * Driver info contain PHY status and other variabel size info
408c2ecf20Sopenharmony_ci	 * PHY Status content as below
418c2ecf20Sopenharmony_ci	 */
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci	/* DWORD 0 */
448c2ecf20Sopenharmony_ci	u8 gain_trsw[4];
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci	/* DWORD 1 */
478c2ecf20Sopenharmony_ci	u8 pwdb_all;
488c2ecf20Sopenharmony_ci	u8 cfosho[4];
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci	/* DWORD 2 */
518c2ecf20Sopenharmony_ci	u8 cfotail[4];
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	/* DWORD 3 */
548c2ecf20Sopenharmony_ci	s8 rxevm[2];
558c2ecf20Sopenharmony_ci	s8 rxsnr[4];
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci	/* DWORD 4 */
588c2ecf20Sopenharmony_ci	u8 pdsnr[2];
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci	/* DWORD 5 */
618c2ecf20Sopenharmony_ci	u8 csi_current[2];
628c2ecf20Sopenharmony_ci	u8 csi_target[2];
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci	/* DWORD 6 */
658c2ecf20Sopenharmony_ci	u8 sigevm;
668c2ecf20Sopenharmony_ci	u8 max_ex_pwr;
678c2ecf20Sopenharmony_ci	u8 ex_intf_flag:1;
688c2ecf20Sopenharmony_ci	u8 sgi_en:1;
698c2ecf20Sopenharmony_ci	u8 rxsc:2;
708c2ecf20Sopenharmony_ci	u8 reserve:4;
718c2ecf20Sopenharmony_ci} __packed;
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci/* macros to read various fields in RX descriptor */
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/* DWORD 0 */
768c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_pkt_len(__le32 *__rxdesc)
778c2ecf20Sopenharmony_ci{
788c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, GENMASK(13, 0));
798c2ecf20Sopenharmony_ci}
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_crc32(__le32 *__rxdesc)
828c2ecf20Sopenharmony_ci{
838c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, BIT(14));
848c2ecf20Sopenharmony_ci}
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_icv(__le32 *__rxdesc)
878c2ecf20Sopenharmony_ci{
888c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, BIT(15));
898c2ecf20Sopenharmony_ci}
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_drvinfo_size(__le32 *__rxdesc)
928c2ecf20Sopenharmony_ci{
938c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, GENMASK(19, 16));
948c2ecf20Sopenharmony_ci}
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_shift(__le32 *__rxdesc)
978c2ecf20Sopenharmony_ci{
988c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, GENMASK(25, 24));
998c2ecf20Sopenharmony_ci}
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_phy_status(__le32 *__rxdesc)
1028c2ecf20Sopenharmony_ci{
1038c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, BIT(26));
1048c2ecf20Sopenharmony_ci}
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_swdec(__le32 *__rxdesc)
1078c2ecf20Sopenharmony_ci{
1088c2ecf20Sopenharmony_ci	return le32_get_bits(*__rxdesc, BIT(27));
1098c2ecf20Sopenharmony_ci}
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci/* DWORD 1 */
1138c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_paggr(__le32 *__rxdesc)
1148c2ecf20Sopenharmony_ci{
1158c2ecf20Sopenharmony_ci	return le32_get_bits(*(__rxdesc + 1), BIT(14));
1168c2ecf20Sopenharmony_ci}
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_faggr(__le32 *__rxdesc)
1198c2ecf20Sopenharmony_ci{
1208c2ecf20Sopenharmony_ci	return le32_get_bits(*(__rxdesc + 1), BIT(15));
1218c2ecf20Sopenharmony_ci}
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci/* DWORD 3 */
1258c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_rx_mcs(__le32 *__rxdesc)
1268c2ecf20Sopenharmony_ci{
1278c2ecf20Sopenharmony_ci	return le32_get_bits(*(__rxdesc + 3), GENMASK(5, 0));
1288c2ecf20Sopenharmony_ci}
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_rx_ht(__le32 *__rxdesc)
1318c2ecf20Sopenharmony_ci{
1328c2ecf20Sopenharmony_ci	return le32_get_bits(*(__rxdesc + 3), BIT(6));
1338c2ecf20Sopenharmony_ci}
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_splcp(__le32 *__rxdesc)
1368c2ecf20Sopenharmony_ci{
1378c2ecf20Sopenharmony_ci	return le32_get_bits(*(__rxdesc + 3), BIT(8));
1388c2ecf20Sopenharmony_ci}
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_bw(__le32 *__rxdesc)
1418c2ecf20Sopenharmony_ci{
1428c2ecf20Sopenharmony_ci	return le32_get_bits(*(__rxdesc + 3), BIT(9));
1438c2ecf20Sopenharmony_ci}
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci/* DWORD 5 */
1478c2ecf20Sopenharmony_cistatic inline u32 get_rx_desc_tsfl(__le32 *__rxdesc)
1488c2ecf20Sopenharmony_ci{
1498c2ecf20Sopenharmony_ci	return le32_to_cpu(*((__rxdesc + 5)));
1508c2ecf20Sopenharmony_ci}
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/*======================= tx desc ============================================*/
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* macros to set various fields in TX descriptor */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci/* Dword 0 */
1588c2ecf20Sopenharmony_cistatic inline void set_tx_desc_pkt_size(__le32 *__txdesc, u32 __value)
1598c2ecf20Sopenharmony_ci{
1608c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, GENMASK(15, 0));
1618c2ecf20Sopenharmony_ci}
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_cistatic inline void set_tx_desc_offset(__le32 *__txdesc, u32 __value)
1648c2ecf20Sopenharmony_ci{
1658c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, GENMASK(23, 16));
1668c2ecf20Sopenharmony_ci}
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_cistatic inline void set_tx_desc_bmc(__le32 *__txdesc, u32 __value)
1698c2ecf20Sopenharmony_ci{
1708c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, BIT(24));
1718c2ecf20Sopenharmony_ci}
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_cistatic inline void set_tx_desc_htc(__le32 *__txdesc, u32 __value)
1748c2ecf20Sopenharmony_ci{
1758c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, BIT(25));
1768c2ecf20Sopenharmony_ci}
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_cistatic inline void set_tx_desc_last_seg(__le32 *__txdesc, u32 __value)
1798c2ecf20Sopenharmony_ci{
1808c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, BIT(26));
1818c2ecf20Sopenharmony_ci}
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_cistatic inline void set_tx_desc_first_seg(__le32 *__txdesc, u32 __value)
1848c2ecf20Sopenharmony_ci{
1858c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, BIT(27));
1868c2ecf20Sopenharmony_ci}
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_cistatic inline void set_tx_desc_linip(__le32 *__txdesc, u32 __value)
1898c2ecf20Sopenharmony_ci{
1908c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, BIT(28));
1918c2ecf20Sopenharmony_ci}
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_cistatic inline void set_tx_desc_own(__le32 *__txdesc, u32 __value)
1948c2ecf20Sopenharmony_ci{
1958c2ecf20Sopenharmony_ci	le32p_replace_bits(__txdesc, __value, BIT(31));
1968c2ecf20Sopenharmony_ci}
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci/* Dword 1 */
2008c2ecf20Sopenharmony_cistatic inline void set_tx_desc_macid(__le32 *__txdesc, u32 __value)
2018c2ecf20Sopenharmony_ci{
2028c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, GENMASK(4, 0));
2038c2ecf20Sopenharmony_ci}
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_cistatic inline void set_tx_desc_agg_enable(__le32 *__txdesc, u32 __value)
2068c2ecf20Sopenharmony_ci{
2078c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, BIT(5));
2088c2ecf20Sopenharmony_ci}
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_cistatic inline void set_tx_desc_agg_break(__le32 *__txdesc, u32 __value)
2118c2ecf20Sopenharmony_ci{
2128c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, BIT(6));
2138c2ecf20Sopenharmony_ci}
2148c2ecf20Sopenharmony_ci
2158c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rdg_enable(__le32 *__txdesc, u32 __value)
2168c2ecf20Sopenharmony_ci{
2178c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, BIT(7));
2188c2ecf20Sopenharmony_ci}
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_cistatic inline void set_tx_desc_queue_sel(__le32 *__txdesc, u32 __value)
2218c2ecf20Sopenharmony_ci{
2228c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, GENMASK(12, 8));
2238c2ecf20Sopenharmony_ci}
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rate_id(__le32 *__txdesc, u32 __value)
2268c2ecf20Sopenharmony_ci{
2278c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, GENMASK(19, 16));
2288c2ecf20Sopenharmony_ci}
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_cistatic inline void set_tx_desc_nav_use_hdr(__le32 *__txdesc, u32 __value)
2318c2ecf20Sopenharmony_ci{
2328c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, BIT(20));
2338c2ecf20Sopenharmony_ci}
2348c2ecf20Sopenharmony_ci
2358c2ecf20Sopenharmony_cistatic inline void set_tx_desc_sec_type(__le32 *__txdesc, u32 __value)
2368c2ecf20Sopenharmony_ci{
2378c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, GENMASK(23, 22));
2388c2ecf20Sopenharmony_ci}
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_cistatic inline void set_tx_desc_pkt_offset(__le32 *__txdesc, u32 __value)
2418c2ecf20Sopenharmony_ci{
2428c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 1), __value, GENMASK(30, 26));
2438c2ecf20Sopenharmony_ci}
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/* Dword 2 */
2478c2ecf20Sopenharmony_cistatic inline void set_tx_desc_more_frag(__le32 *__txdesc, u32 __value)
2488c2ecf20Sopenharmony_ci{
2498c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 2), __value, BIT(17));
2508c2ecf20Sopenharmony_ci}
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_cistatic inline void set_tx_desc_ampdu_density(__le32 *__txdesc, u32 __value)
2538c2ecf20Sopenharmony_ci{
2548c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 2), __value, GENMASK(22, 20));
2558c2ecf20Sopenharmony_ci}
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci
2588c2ecf20Sopenharmony_ci/* Dword 3 */
2598c2ecf20Sopenharmony_cistatic inline void set_tx_desc_seq(__le32 *__txdesc, u32 __value)
2608c2ecf20Sopenharmony_ci{
2618c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 3), __value, GENMASK(27, 16));
2628c2ecf20Sopenharmony_ci}
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_cistatic inline void set_tx_desc_pkt_id(__le32 *__txdesc, u32 __value)
2658c2ecf20Sopenharmony_ci{
2668c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 3), __value, GENMASK(31, 28));
2678c2ecf20Sopenharmony_ci}
2688c2ecf20Sopenharmony_ci
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci/* Dword 4 */
2718c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_rate(__le32 *__txdesc, u32 __value)
2728c2ecf20Sopenharmony_ci{
2738c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, GENMASK(4, 0));
2748c2ecf20Sopenharmony_ci}
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_cistatic inline void set_tx_desc_qos(__le32 *__txdesc, u32 __value)
2778c2ecf20Sopenharmony_ci{
2788c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(6));
2798c2ecf20Sopenharmony_ci}
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_cistatic inline void set_tx_desc_hwseq_en(__le32 *__txdesc, u32 __value)
2828c2ecf20Sopenharmony_ci{
2838c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(7));
2848c2ecf20Sopenharmony_ci}
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_cistatic inline void set_tx_desc_use_rate(__le32 *__txdesc, u32 __value)
2878c2ecf20Sopenharmony_ci{
2888c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(8));
2898c2ecf20Sopenharmony_ci}
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_cistatic inline void set_tx_desc_disable_fb(__le32 *__txdesc, u32 __value)
2928c2ecf20Sopenharmony_ci{
2938c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(10));
2948c2ecf20Sopenharmony_ci}
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_cistatic inline void set_tx_desc_cts2self(__le32 *__txdesc, u32 __value)
2978c2ecf20Sopenharmony_ci{
2988c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(11));
2998c2ecf20Sopenharmony_ci}
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_enable(__le32 *__txdesc, u32 __value)
3028c2ecf20Sopenharmony_ci{
3038c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(12));
3048c2ecf20Sopenharmony_ci}
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_cistatic inline void set_tx_desc_hw_rts_enable(__le32 *__txdesc, u32 __value)
3078c2ecf20Sopenharmony_ci{
3088c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(13));
3098c2ecf20Sopenharmony_ci}
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_cistatic inline void set_tx_desc_data_sc(__le32 *__txdesc, u32 __value)
3128c2ecf20Sopenharmony_ci{
3138c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, GENMASK(21, 20));
3148c2ecf20Sopenharmony_ci}
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_cistatic inline void set_tx_desc_data_bw(__le32 *__txdesc, u32 __value)
3178c2ecf20Sopenharmony_ci{
3188c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(25));
3198c2ecf20Sopenharmony_ci}
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_short(__le32 *__txdesc, u32 __value)
3228c2ecf20Sopenharmony_ci{
3238c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(26));
3248c2ecf20Sopenharmony_ci}
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_bw(__le32 *__txdesc, u32 __value)
3278c2ecf20Sopenharmony_ci{
3288c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, BIT(27));
3298c2ecf20Sopenharmony_ci}
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_sc(__le32 *__txdesc, u32 __value)
3328c2ecf20Sopenharmony_ci{
3338c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, GENMASK(29, 28));
3348c2ecf20Sopenharmony_ci}
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_stbc(__le32 *__txdesc, u32 __value)
3378c2ecf20Sopenharmony_ci{
3388c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 4), __value, GENMASK(31, 30));
3398c2ecf20Sopenharmony_ci}
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci/* Dword 5 */
3438c2ecf20Sopenharmony_cistatic inline void set_tx_desc_tx_rate(__le32 *__pdesc, u32 __val)
3448c2ecf20Sopenharmony_ci{
3458c2ecf20Sopenharmony_ci	le32p_replace_bits((__pdesc + 5), __val, GENMASK(5, 0));
3468c2ecf20Sopenharmony_ci}
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_cistatic inline void set_tx_desc_data_shortgi(__le32 *__pdesc, u32 __val)
3498c2ecf20Sopenharmony_ci{
3508c2ecf20Sopenharmony_ci	le32p_replace_bits((__pdesc + 5), __val, BIT(6));
3518c2ecf20Sopenharmony_ci}
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_cistatic inline void set_tx_desc_data_rate_fb_limit(__le32 *__txdesc, u32 __value)
3548c2ecf20Sopenharmony_ci{
3558c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 5), __value, GENMASK(12, 8));
3568c2ecf20Sopenharmony_ci}
3578c2ecf20Sopenharmony_ci
3588c2ecf20Sopenharmony_cistatic inline void set_tx_desc_rts_rate_fb_limit(__le32 *__txdesc, u32 __value)
3598c2ecf20Sopenharmony_ci{
3608c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 5), __value, GENMASK(16, 13));
3618c2ecf20Sopenharmony_ci}
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_ci/* Dword 6 */
3658c2ecf20Sopenharmony_cistatic inline void set_tx_desc_max_agg_num(__le32 *__txdesc, u32 __value)
3668c2ecf20Sopenharmony_ci{
3678c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 6), __value, GENMASK(15, 11));
3688c2ecf20Sopenharmony_ci}
3698c2ecf20Sopenharmony_ci
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci/* Dword 7 */
3728c2ecf20Sopenharmony_cistatic inline void set_tx_desc_tx_desc_checksum(__le32 *__txdesc, u32 __value)
3738c2ecf20Sopenharmony_ci{
3748c2ecf20Sopenharmony_ci	le32p_replace_bits((__txdesc + 7), __value, GENMASK(15, 0));
3758c2ecf20Sopenharmony_ci}
3768c2ecf20Sopenharmony_ci
3778c2ecf20Sopenharmony_ci
3788c2ecf20Sopenharmony_ciint  rtl8192cu_endpoint_mapping(struct ieee80211_hw *hw);
3798c2ecf20Sopenharmony_ciu16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index);
3808c2ecf20Sopenharmony_cibool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
3818c2ecf20Sopenharmony_ci			   struct rtl_stats *stats,
3828c2ecf20Sopenharmony_ci			   struct ieee80211_rx_status *rx_status,
3838c2ecf20Sopenharmony_ci			   u8 *p_desc, struct sk_buff *skb);
3848c2ecf20Sopenharmony_civoid  rtl8192cu_rx_hdl(struct ieee80211_hw *hw, struct sk_buff * skb);
3858c2ecf20Sopenharmony_civoid rtl8192c_tx_cleanup(struct ieee80211_hw *hw, struct sk_buff  *skb);
3868c2ecf20Sopenharmony_ciint rtl8192c_tx_post_hdl(struct ieee80211_hw *hw, struct urb *urb,
3878c2ecf20Sopenharmony_ci			 struct sk_buff *skb);
3888c2ecf20Sopenharmony_cistruct sk_buff *rtl8192c_tx_aggregate_hdl(struct ieee80211_hw *,
3898c2ecf20Sopenharmony_ci					   struct sk_buff_head *);
3908c2ecf20Sopenharmony_civoid rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
3918c2ecf20Sopenharmony_ci			  struct ieee80211_hdr *hdr, u8 *pdesc_tx,
3928c2ecf20Sopenharmony_ci			  u8 *pbd_desc_tx, struct ieee80211_tx_info *info,
3938c2ecf20Sopenharmony_ci			  struct ieee80211_sta *sta,
3948c2ecf20Sopenharmony_ci			  struct sk_buff *skb,
3958c2ecf20Sopenharmony_ci			  u8 queue_index,
3968c2ecf20Sopenharmony_ci			  struct rtl_tcb_desc *tcb_desc);
3978c2ecf20Sopenharmony_civoid rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 *pdesc,
3988c2ecf20Sopenharmony_ci			       u32 buffer_len, bool ispspoll);
3998c2ecf20Sopenharmony_civoid rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw,
4008c2ecf20Sopenharmony_ci			     u8 *pdesc, bool b_firstseg,
4018c2ecf20Sopenharmony_ci			     bool b_lastseg, struct sk_buff *skb);
4028c2ecf20Sopenharmony_ci
4038c2ecf20Sopenharmony_ci#endif
404