xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723ds/include/Hal8703BPhyCfg.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2017 Realtek Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  *****************************************************************************/
16 #ifndef __INC_HAL8703BPHYCFG_H__
17 #define __INC_HAL8703BPHYCFG_H__
18 
19 /*--------------------------Define Parameters-------------------------------*/
20 #define LOOP_LIMIT				5
21 #define MAX_STALL_TIME			50		/* us */
22 #define AntennaDiversityValue	0x80	/* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */
23 #define MAX_TXPWR_IDX_NMODE_92S	63
24 #define Reset_Cnt_Limit			3
25 
26 #ifdef CONFIG_PCI_HCI
27 	#define MAX_AGGR_NUM	0x0B
28 #else
29 	#define MAX_AGGR_NUM	0x07
30 #endif /* CONFIG_PCI_HCI */
31 
32 
33 /*--------------------------Define Parameters End-------------------------------*/
34 
35 
36 /*------------------------------Define structure----------------------------*/
37 
38 /*------------------------------Define structure End----------------------------*/
39 
40 /*--------------------------Exported Function prototype---------------------*/
41 u32
42 PHY_QueryBBReg_8703B(
43 		PADAPTER	Adapter,
44 		u32		RegAddr,
45 		u32		BitMask
46 );
47 
48 void
49 PHY_SetBBReg_8703B(
50 		PADAPTER	Adapter,
51 		u32		RegAddr,
52 		u32		BitMask,
53 		u32		Data
54 );
55 
56 u32
57 PHY_QueryRFReg_8703B(
58 		PADAPTER		Adapter,
59 		enum rf_path		eRFPath,
60 		u32				RegAddr,
61 		u32				BitMask
62 );
63 
64 void
65 PHY_SetRFReg_8703B(
66 		PADAPTER		Adapter,
67 		enum rf_path		eRFPath,
68 		u32				RegAddr,
69 		u32				BitMask,
70 		u32				Data
71 );
72 
73 /* MAC/BB/RF HAL config */
74 int PHY_BBConfig8703B(PADAPTER	Adapter);
75 
76 int PHY_RFConfig8703B(PADAPTER	Adapter);
77 
78 s32 PHY_MACConfig8703B(PADAPTER padapter);
79 
80 int
81 PHY_ConfigRFWithParaFile_8703B(
82 		PADAPTER			Adapter,
83 		u8					*pFileName,
84 	enum rf_path				eRFPath
85 );
86 
87 void
88 PHY_SetTxPowerIndex_8703B(
89 		PADAPTER			Adapter,
90 		u32					PowerIndex,
91 		enum rf_path			RFPath,
92 		u8					Rate
93 );
94 
95 void
96 PHY_SetTxPowerLevel8703B(
97 		PADAPTER		Adapter,
98 		u8			channel
99 );
100 
101 void
102 PHY_SetSwChnlBWMode8703B(
103 		PADAPTER			Adapter,
104 		u8					channel,
105 		enum channel_width	Bandwidth,
106 		u8					Offset40,
107 		u8					Offset80
108 );
109 
110 void phy_set_rf_path_switch_8703b(
111 		struct dm_struct		*phydm,
112 		bool		bMain
113 );
114 
115 /*--------------------------Exported Function prototype End---------------------*/
116 
117 #endif
118