Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/include/Hal8188EPhyCfg.h
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2017 Realtek Corporation.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of version 2 of the GNU General Public License as
7
* published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
*****************************************************************************/
15
#ifndef __INC_HAL8188EPHYCFG_H__
16
#define __INC_HAL8188EPHYCFG_H__
17
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-------------------------------*/
34
35
36
/*------------------------------Define structure----------------------------*/
37
38
#define MAX_TX_COUNT_8188E 1
39
40
/* BB/RF related */
41
42
43
/*------------------------------Define structure----------------------------*/
44
45
46
/*------------------------Export global variable----------------------------*/
47
/*------------------------Export global variable----------------------------*/
48
49
50
/*------------------------Export Marco Definition---------------------------*/
51
/*------------------------Export Marco Definition---------------------------*/
52
53
54
/*--------------------------Exported Function prototype---------------------*/
55
/*
56
* BB and RF register read/write
57
* */
58
u32 PHY_QueryBBReg8188E(PADAPTER Adapter,
59
u32 RegAddr,
60
u32 BitMask);
61
void PHY_SetBBReg8188E(PADAPTER Adapter,
62
u32 RegAddr,
63
u32 BitMask,
64
u32 Data);
65
u32 PHY_QueryRFReg8188E(PADAPTER Adapter,
66
enum rf_path eRFPath,
67
u32 RegAddr,
68
u32 BitMask);
69
void PHY_SetRFReg8188E(PADAPTER Adapter,
70
enum rf_path eRFPath,
71
u32 RegAddr,
72
u32 BitMask,
73
u32 Data);
74
75
/*
76
* Initialization related function
77
*/
78
/* MAC/BB/RF HAL config */
79
int PHY_MACConfig8188E(PADAPTER Adapter);
80
int PHY_BBConfig8188E(PADAPTER Adapter);
81
int PHY_RFConfig8188E(PADAPTER Adapter);
82
83
/* RF config */
84
int rtl8188e_PHY_ConfigRFWithParaFile( PADAPTER Adapter, u8 *pFileName, enum rf_path eRFPath);
85
86
/*
87
* RF Power setting
88
*/
89
/* extern BOOLEAN PHY_SetRFPowerState(PADAPTER Adapter,
90
* RT_RF_POWER_STATE eRFPowerState); */
91
92
/*
93
* BB TX Power R/W
94
* */
95
void PHY_SetTxPowerLevel8188E(PADAPTER Adapter,
96
u8 channel);
97
98
void
99
PHY_SetTxPowerIndex_8188E(
100
PADAPTER Adapter,
101
u32 PowerIndex,
102
enum rf_path RFPath,
103
u8 Rate
104
);
105
106
u8
107
PHY_GetTxPowerIndex_8188E(
108
PADAPTER pAdapter,
109
enum rf_path RFPath,
110
u8 Rate,
111
u8 BandWidth,
112
u8 Channel,
113
struct txpwr_idx_comp *tic
114
);
115
116
/*
117
* Switch bandwidth for 8192S
118
*/
119
/* extern void PHY_SetBWModeCallback8192C(PRT_TIMER pTimer ); */
120
void PHY_SetBWMode8188E(PADAPTER pAdapter,
121
enum channel_width ChnlWidth,
122
unsigned char Offset);
123
124
/*
125
* Set FW CMD IO for 8192S.
126
*/
127
/* extern BOOLEAN HalSetIO8192C(PADAPTER Adapter,
128
* IO_TYPE IOType); */
129
130
/*
131
* Set A2 entry to fw for 8192S
132
* */
133
extern void FillA2Entry8192C(PADAPTER Adapter,
134
u8 index,
135
u8 *val);
136
137
138
/*
139
* channel switch related funciton
140
*/
141
/* extern void PHY_SwChnlCallback8192C(PRT_TIMER pTimer ); */
142
void PHY_SwChnl8188E(PADAPTER pAdapter,
143
u8 channel);
144
145
void
146
PHY_SetSwChnlBWMode8188E(
147
PADAPTER Adapter,
148
u8 channel,
149
enum channel_width Bandwidth,
150
u8 Offset40,
151
u8 Offset80
152
);
153
154
void
155
PHY_SetRFEReg_8188E(
156
PADAPTER Adapter
157
);
158
/*
159
* BB/MAC/RF other monitor API
160
* */
161
void phy_set_rf_path_switch_8188e(struct dm_struct *phydm, bool bMain);
162
163
extern void
164
PHY_SwitchEphyParameter(
165
PADAPTER Adapter
166
);
167
168
extern void
169
PHY_EnableHostClkReq(
170
PADAPTER Adapter
171
);
172
173
BOOLEAN
174
SetAntennaConfig92C(
175
PADAPTER Adapter,
176
u8 DefaultAnt
177
);
178
179
/*--------------------------Exported Function prototype---------------------*/
180
181
/*
182
* Initialization related function
183
*
184
* MAC/BB/RF HAL config */
185
/* extern s32 PHY_MACConfig8723(PADAPTER padapter);
186
* s32 PHY_BBConfig8723(PADAPTER padapter);
187
* s32 PHY_RFConfig8723(PADAPTER padapter); */
188
189
190
191
/* ******************************************************************
192
* Note: If SIC_ENABLE under PCIE, because of the slow operation
193
* you should
194
* 2) "#define RTL8723_FPGA_VERIFICATION 1" in Precomp.h.WlanE.Windows
195
* 3) "#define RTL8190_Download_Firmware_From_Header 0" in Precomp.h.WlanE.Windows if needed.
196
* */
197
#if (RTL8188E_SUPPORT == 1) && (RTL8188E_FPGA_TRUE_PHY_VERIFICATION == 1)
198
#define SIC_ENABLE 1
199
#define SIC_HW_SUPPORT 1
200
#else
201
#define SIC_ENABLE 0
202
#define SIC_HW_SUPPORT 0
203
#endif
204
/* ****************************************************************** */
205
206
207
#define SIC_MAX_POLL_CNT 5
208
209
#if (SIC_HW_SUPPORT == 1)
210
#define SIC_CMD_READY 0
211
#define SIC_CMD_PREWRITE 0x1
212
#if (RTL8188E_SUPPORT == 1)
213
#define SIC_CMD_WRITE 0x40
214
#define SIC_CMD_PREREAD 0x2
215
#define SIC_CMD_READ 0x80
216
#define SIC_CMD_INIT 0xf0
217
#define SIC_INIT_VAL 0xff
218
219
#define SIC_INIT_REG 0x1b7
220
#define SIC_CMD_REG 0x1EB /* 1byte */
221
#define SIC_ADDR_REG 0x1E8 /* 1b4~1b5, 2 bytes */
222
#define SIC_DATA_REG 0x1EC /* 1b0~1b3 */
223
#else
224
#define SIC_CMD_WRITE 0x11
225
#define SIC_CMD_PREREAD 0x2
226
#define SIC_CMD_READ 0x12
227
#define SIC_CMD_INIT 0x1f
228
#define SIC_INIT_VAL 0xff
229
230
#define SIC_INIT_REG 0x1b7
231
#define SIC_CMD_REG 0x1b6 /* 1byte */
232
#define SIC_ADDR_REG 0x1b4 /* 1b4~1b5, 2 bytes */
233
#define SIC_DATA_REG 0x1b0 /* 1b0~1b3 */
234
#endif
235
#else
236
#define SIC_CMD_READY 0
237
#define SIC_CMD_WRITE 1
238
#define SIC_CMD_READ 2
239
240
#if (RTL8188E_SUPPORT == 1)
241
#define SIC_CMD_REG 0x1EB /* 1byte */
242
#define SIC_ADDR_REG 0x1E8 /* 1b9~1ba, 2 bytes */
243
#define SIC_DATA_REG 0x1EC /* 1bc~1bf */
244
#else
245
#define SIC_CMD_REG 0x1b8 /* 1byte */
246
#define SIC_ADDR_REG 0x1b9 /* 1b9~1ba, 2 bytes */
247
#define SIC_DATA_REG 0x1bc /* 1bc~1bf */
248
#endif
249
#endif
250
251
#if (SIC_ENABLE == 1)
252
void SIC_Init( PADAPTER Adapter);
253
#endif
254
255
256
#endif /* __INC_HAL8192CPHYCFG_H */
257
258