2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/CFG_Wifi_File.h#1 $
5 /*! \file CFG_Wifi_File.h
6 \brief Collection of NVRAM structure used for YuSu project
8 In this file we collect all compiler flags and detail the driver behavior if
9 enable/disable such switch or adjust numeric parameters.
15 ** $Log: CFG_Wifi_File.h $
18 * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
19 * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM
22 * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
26 * [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree
27 * add MT6628-specific definitions.
30 * [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC[WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC
31 * add CCK-DSSS TX-PWR control field in NVRAM and CMD definition for MT5931-MP
34 * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM
35 * update NVRAM data structure definition.
38 * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3
39 * deprecate configuration used by MT6620 E2
42 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
43 * 1) update NVRAM content template to ver 1.02
44 * 2) add compile option for querying NIC capability (default: off)
45 * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
46 * 4) correct auto-rate compiler error under linux (treat warning as error)
47 * 5) simplify usage of NVRAM and REG_INFO_T
48 * 6) add version checking between driver and firmware
51 * [WCXRP00000133] [MT6620 Wi-Fi] [FW][Driver] Change TX power offset band definition
52 * follow-up for CMD_5G_PWR_OFFSET_T definition change
55 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
56 * 1) add NVRAM access API
57 * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
58 * 3) add OID implementation for NVRAM read/write service
61 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
62 * add skeleton for NVRAM integration
66 #ifndef _CFG_WIFI_FILE_H
67 #define _CFG_WIFI_FILE_H
69 /*******************************************************************************
70 * C O M P I L E R F L A G S
71 ********************************************************************************
74 /*******************************************************************************
75 * E X T E R N A L R E F E R E N C E S
76 ********************************************************************************
78 #include "gl_typedef.h"
80 /*******************************************************************************
82 ********************************************************************************
85 /*******************************************************************************
87 ********************************************************************************
90 /*******************************************************************************
92 ********************************************************************************
94 // duplicated from nic_cmd_event.h to avoid header dependency
95 typedef struct _TX_PWR_PARAM_T {
96 INT_8 cTxPwr2G4Cck; /* signed, in unit of 0.5dBm */
99 #elif defined(MT5931) || defined(MT6628)
100 INT_8 cTxPwr2G4Dsss; /* signed, in unit of 0.5dBm */
103 #error "No valid definition!"
106 INT_8 cTxPwr2G4OFDM_BPSK;
107 INT_8 cTxPwr2G4OFDM_QPSK;
108 INT_8 cTxPwr2G4OFDM_16QAM;
109 INT_8 cTxPwr2G4OFDM_Reserved;
110 INT_8 cTxPwr2G4OFDM_48Mbps;
111 INT_8 cTxPwr2G4OFDM_54Mbps;
113 INT_8 cTxPwr2G4HT20_BPSK;
114 INT_8 cTxPwr2G4HT20_QPSK;
115 INT_8 cTxPwr2G4HT20_16QAM;
116 INT_8 cTxPwr2G4HT20_MCS5;
117 INT_8 cTxPwr2G4HT20_MCS6;
118 INT_8 cTxPwr2G4HT20_MCS7;
120 INT_8 cTxPwr2G4HT40_BPSK;
121 INT_8 cTxPwr2G4HT40_QPSK;
122 INT_8 cTxPwr2G4HT40_16QAM;
123 INT_8 cTxPwr2G4HT40_MCS5;
124 INT_8 cTxPwr2G4HT40_MCS6;
125 INT_8 cTxPwr2G4HT40_MCS7;
127 INT_8 cTxPwr5GOFDM_BPSK;
128 INT_8 cTxPwr5GOFDM_QPSK;
129 INT_8 cTxPwr5GOFDM_16QAM;
130 INT_8 cTxPwr5GOFDM_Reserved;
131 INT_8 cTxPwr5GOFDM_48Mbps;
132 INT_8 cTxPwr5GOFDM_54Mbps;
134 INT_8 cTxPwr5GHT20_BPSK;
135 INT_8 cTxPwr5GHT20_QPSK;
136 INT_8 cTxPwr5GHT20_16QAM;
137 INT_8 cTxPwr5GHT20_MCS5;
138 INT_8 cTxPwr5GHT20_MCS6;
139 INT_8 cTxPwr5GHT20_MCS7;
141 INT_8 cTxPwr5GHT40_BPSK;
142 INT_8 cTxPwr5GHT40_QPSK;
143 INT_8 cTxPwr5GHT40_16QAM;
144 INT_8 cTxPwr5GHT40_MCS5;
145 INT_8 cTxPwr5GHT40_MCS6;
146 INT_8 cTxPwr5GHT40_MCS7;
147 } TX_PWR_PARAM_T, *P_TX_PWR_PARAM_T;
149 typedef struct _PWR_5G_OFFSET_T {
150 INT_8 cOffsetBand0; /* 4.915-4.980G */
151 INT_8 cOffsetBand1; /* 5.000-5.080G */
152 INT_8 cOffsetBand2; /* 5.160-5.180G */
153 INT_8 cOffsetBand3; /* 5.200-5.280G */
154 INT_8 cOffsetBand4; /* 5.300-5.340G */
155 INT_8 cOffsetBand5; /* 5.500-5.580G */
156 INT_8 cOffsetBand6; /* 5.600-5.680G */
157 INT_8 cOffsetBand7; /* 5.700-5.825G */
158 } PWR_5G_OFFSET_T, *P_PWR_5G_OFFSET_T;
160 typedef struct _PWR_PARAM_T {
164 } PWR_PARAM_T, *P_PWR_PARAM_T;
166 typedef struct _MT6620_CFG_PARAM_STRUCT {
167 /* 256 bytes of MP data */
168 UINT_16 u2Part1OwnVersion;
169 UINT_16 u2Part1PeerVersion;
170 UINT_8 aucMacAddress[6];
171 UINT_8 aucCountryCode[2];
172 TX_PWR_PARAM_T rTxPwr;
173 UINT_8 aucEFUSE[144];
175 UINT_8 ucSupport5GBand;
176 UINT_8 fg2G4BandEdgePwrUsed;
177 INT_8 cBandEdgeMaxPwrCCK;
178 INT_8 cBandEdgeMaxPwrOFDM20;
179 INT_8 cBandEdgeMaxPwrOFDM40;
181 UINT_8 ucRegChannelListMap;
182 UINT_8 ucRegChannelListIndex;
183 UINT_8 aucRegSubbandInfo[36];
185 UINT_8 aucReserved2[256-240];
187 /* 256 bytes of function data */
188 UINT_16 u2Part2OwnVersion;
189 UINT_16 u2Part2PeerVersion;
190 UINT_8 uc2G4BwFixed20M;
191 UINT_8 uc5GBwFixed20M;
192 UINT_8 ucEnable5GBand;
193 UINT_8 aucPreTailReserved;
194 UINT_8 aucTailReserved[256-8];
195 } MT6620_CFG_PARAM_STRUCT, *P_MT6620_CFG_PARAM_STRUCT,
196 WIFI_CFG_PARAM_STRUCT, *P_WIFI_CFG_PARAM_STRUCT;
198 /*******************************************************************************
199 * P R I V A T E D A T A
200 ********************************************************************************
203 /*******************************************************************************
205 ********************************************************************************
207 #ifndef DATA_STRUC_INSPECTING_ASSERT
208 #define DATA_STRUC_INSPECTING_ASSERT(expr) \
209 switch (0) {case 0: case (expr): default:;}
212 #define CFG_FILE_WIFI_REC_SIZE sizeof(WIFI_CFG_PARAM_STRUCT)
215 /*******************************************************************************
216 * F U N C T I O N D E C L A R A T I O N S
217 ********************************************************************************
220 /*******************************************************************************
222 ********************************************************************************
225 /* We don't have to call following function to inspect the data structure.
226 * It will check automatically while at compile time.
227 * We'll need this to guarantee the same member order in different structures
228 * to simply handling effort in some functions.
235 DATA_STRUC_INSPECTING_ASSERT(
236 OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part2OwnVersion) == 256);
238 DATA_STRUC_INSPECTING_ASSERT(
239 sizeof(WIFI_CFG_PARAM_STRUCT) == 512);
241 DATA_STRUC_INSPECTING_ASSERT(
242 (OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucEFUSE) & 0x0001) == 0);
244 DATA_STRUC_INSPECTING_ASSERT(
245 (OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucRegSubbandInfo) & 0x0001) == 0);
249 #endif /* _CFG_WIFI_FILE_H */