This source file includes following definitions.
- PHY_RF6052SetBandwidth8723B
- phy_RF6052_Config_ParaFile
- PHY_RF6052_Config8723B
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include <rtl8723b_hal.h>
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 void PHY_RF6052SetBandwidth8723B(
58 struct adapter *Adapter, enum CHANNEL_WIDTH Bandwidth
59 )
60 {
61 struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
62
63 switch (Bandwidth) {
64 case CHANNEL_WIDTH_20:
65 pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 0xfffff3ff) | BIT10 | BIT11);
66 PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
67 PHY_SetRFReg(Adapter, ODM_RF_PATH_B, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
68 break;
69
70 case CHANNEL_WIDTH_40:
71 pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 0xfffff3ff) | BIT10);
72 PHY_SetRFReg(Adapter, ODM_RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
73 PHY_SetRFReg(Adapter, ODM_RF_PATH_B, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
74 break;
75
76 default:
77
78 break;
79 }
80
81 }
82
83 static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
84 {
85 u32 u4RegValue = 0;
86 u8 eRFPath;
87 struct bb_register_def *pPhyReg;
88
89 int rtStatus = _SUCCESS;
90 struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
91
92 static char sz8723RadioAFile[] = RTL8723B_PHY_RADIO_A;
93 static char sz8723RadioBFile[] = RTL8723B_PHY_RADIO_B;
94 static s8 sz8723BTxPwrTrackFile[] = RTL8723B_TXPWR_TRACK;
95 char *pszRadioAFile, *pszRadioBFile, *pszTxPwrTrackFile;
96
97 pszRadioAFile = sz8723RadioAFile;
98 pszRadioBFile = sz8723RadioBFile;
99 pszTxPwrTrackFile = sz8723BTxPwrTrackFile;
100
101
102
103
104
105 for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) {
106
107 pPhyReg = &pHalData->PHYRegDef[eRFPath];
108
109
110 switch (eRFPath) {
111 case RF_PATH_A:
112 case RF_PATH_C:
113 u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
114 break;
115 case RF_PATH_B:
116 case RF_PATH_D:
117 u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16);
118 break;
119 }
120
121
122 PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1);
123 udelay(1);
124
125
126 PHY_SetBBReg(Adapter, pPhyReg->rfintfo, bRFSI_RFENV, 0x1);
127 udelay(1);
128
129
130 PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength, 0x0);
131 udelay(1);
132
133 PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0);
134 udelay(1);
135
136
137 switch (eRFPath) {
138 case RF_PATH_A:
139 if (PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile,
140 eRFPath) == _FAIL) {
141 if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
142 rtStatus = _FAIL;
143 }
144 break;
145 case RF_PATH_B:
146 if (PHY_ConfigRFWithParaFile(Adapter, pszRadioBFile,
147 eRFPath) == _FAIL) {
148 if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
149 rtStatus = _FAIL;
150 }
151 break;
152 case RF_PATH_C:
153 break;
154 case RF_PATH_D:
155 break;
156 }
157
158
159 switch (eRFPath) {
160 case RF_PATH_A:
161 case RF_PATH_C:
162 PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
163 break;
164 case RF_PATH_B:
165 case RF_PATH_D:
166 PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue);
167 break;
168 }
169
170 if (rtStatus != _SUCCESS) {
171
172 goto phy_RF6052_Config_ParaFile_Fail;
173 }
174
175 }
176
177
178
179
180
181 if (PHY_ConfigRFWithTxPwrTrackParaFile(Adapter, pszTxPwrTrackFile) ==
182 _FAIL) {
183 ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv);
184 }
185
186
187 return rtStatus;
188
189 phy_RF6052_Config_ParaFile_Fail:
190 return rtStatus;
191 }
192
193
194 int PHY_RF6052_Config8723B(struct adapter *Adapter)
195 {
196 struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
197
198
199
200
201
202 if (pHalData->rf_type == RF_1T1R)
203 pHalData->NumTotalRFPath = 1;
204 else
205 pHalData->NumTotalRFPath = 2;
206
207
208
209
210 return phy_RF6052_Config_ParaFile(Adapter);
211
212 }
213
214