xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723ds/include/Hal8812PhyCfg.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_HAL8812PHYCFG_H__
17 #define __INC_HAL8812PHYCFG_H__
18 
19 
20 /*--------------------------Define Parameters-------------------------------*/
21 #define LOOP_LIMIT				5
22 #define MAX_STALL_TIME			50		/* us */
23 #define AntennaDiversityValue	0x80	/* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */
24 #define MAX_TXPWR_IDX_NMODE_92S	63
25 #define Reset_Cnt_Limit			3
26 
27 
28 #ifdef CONFIG_PCI_HCI
29 	#define MAX_AGGR_NUM	0x0B
30 #else
31 	#define MAX_AGGR_NUM	0x07
32 #endif /* CONFIG_PCI_HCI */
33 
34 
35 /*--------------------------Define Parameters-------------------------------*/
36 
37 /*------------------------------Define structure----------------------------*/
38 
39 
40 /* BB/RF related */
41 
42 /*------------------------------Define structure----------------------------*/
43 
44 
45 /*------------------------Export global variable----------------------------*/
46 /*------------------------Export global variable----------------------------*/
47 
48 
49 /*------------------------Export Marco Definition---------------------------*/
50 /*------------------------Export Marco Definition---------------------------*/
51 
52 
53 /*--------------------------Exported Function prototype---------------------*/
54 /*
55  * BB and RF register read/write
56  *   */
57 u32	PHY_QueryBBReg8812(PADAPTER	Adapter,
58 				u32			RegAddr,
59 				u32			BitMask);
60 void	PHY_SetBBReg8812(PADAPTER		Adapter,
61 				u32			RegAddr,
62 				u32			BitMask,
63 				u32			Data);
64 u32	PHY_QueryRFReg8812(PADAPTER	Adapter,
65 				enum rf_path	eRFPath,
66 				u32			RegAddr,
67 				u32			BitMask);
68 void	PHY_SetRFReg8812(PADAPTER		Adapter,
69 				enum rf_path	eRFPath,
70 				u32			RegAddr,
71 				u32			BitMask,
72 				u32			Data);
73 
74 /*
75  * Initialization related function
76  *
77  * MAC/BB/RF HAL config */
78 int	PHY_MACConfig8812(PADAPTER	Adapter);
79 int	PHY_BBConfig8812(PADAPTER	Adapter);
80 void	PHY_BB8812_Config_1T(PADAPTER	Adapter);
81 int	PHY_RFConfig8812(PADAPTER	Adapter);
82 
83 /* RF config */
84 
85 s32
86 PHY_SwitchWirelessBand8812(
87 		PADAPTER		Adapter,
88 		u8			Band
89 );
90 
91 /*
92  * BB TX Power R/W
93  *   */
94 void	PHY_SetTxPowerLevel8812(PADAPTER	Adapter, u8	Channel);
95 
96 bool phy_get_txpwr_target_skip_by_rate_8812a(_adapter *adapter, enum MGN_RATE rate);
97 
98 u32 phy_get_tx_bb_swing_8812a(
99 		PADAPTER	Adapter,
100 		BAND_TYPE	Band,
101 		enum rf_path	RFPath
102 );
103 
104 void
105 PHY_SetTxPowerIndex_8812A(
106 		PADAPTER		Adapter,
107 		u32				PowerIndex,
108 		enum rf_path		RFPath,
109 		u8				Rate
110 );
111 
112 /*
113  * channel switch related funciton
114  *   */
115 void
116 PHY_SetSwChnlBWMode8812(
117 		PADAPTER			Adapter,
118 		u8					channel,
119 		enum channel_width	Bandwidth,
120 		u8					Offset40,
121 		u8					Offset80
122 );
123 
124 /*
125  * BB/MAC/RF other monitor API
126  *   */
127 
128 void
129 phy_set_rf_path_switch_8812a(
130 		struct dm_struct		*phydm,
131 		bool		bMain
132 );
133 
134 /*--------------------------Exported Function prototype---------------------*/
135 #endif /* __INC_HAL8192CPHYCFG_H */
136