blob: 4ffa207cb84da07893ee92751dcda27cd6bef9f1 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21/*
Jeff Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
24 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
25 *
26 *
27 * Permission to use, copy, modify, and/or distribute this software for
28 * any purpose with or without fee is hereby granted, provided that the
29 * above copyright notice and this permission notice appear in all
30 * copies.
31 *
32 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
33 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
35 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
36 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
37 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
38 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39 * PERFORMANCE OF THIS SOFTWARE.
40 */
41
42/** ------------------------------------------------------------------------- *
43 ------------------------------------------------------------------------- *
44
45
46 \file wlan_nv.h
47
48 \brief Types for NV implementation
49 Anything that needs to be publicly available should
50 be in this file
51
52 $Id$
53
54 Copyright (C) 2006 Airgo Networks, Incorporated
55
56
57 ========================================================================== */
58
59#if !defined( __WLAN_NV_H )
60#define __WLAN_NV_H
61
62#include "halLegacyPalTypes.h"
63#include "halCompiler.h"
64
65//From HAL/inc/halNv.h
66typedef enum
67{
68 //Common Nv Fields
69 NV_COMMON_PRODUCT_ID, // 0
70 NV_COMMON_PRODUCT_BANDS, // 1
71 NV_COMMON_NUM_OF_TX_CHAINS, // 2
72 NV_COMMON_NUM_OF_RX_CHAINS, // 3
73 NV_COMMON_MAC_ADDR, // 4
74 NV_COMMON_MFG_SERIAL_NUMBER, // 5
75 NV_COMMON_WLAN_NV_REV_ID, // 6
76 NV_COMMON_COUPLER_TYPE, // 7
77
78 NUM_NV_FIELDS,
79 NV_MAX_FIELD = 0x7FFFFFFF /* define as 4 bytes data */
80
81}eNvField;
82
83
84#define NV_FIELD_MAC_ADDR_SIZE 6
85#define NV_FIELD_MFG_SN_SIZE 40
86typedef enum
87{
88 PRODUCT_BAND_11_B_G = 0, //Gen6.0 is only this setting
89 PRODUCT_BAND_11_A_B_G = 1,
90 PRODUCT_BAND_11_A = 2,
91
92 NUM_PRODUCT_BANDS,
93 NUM_PRODUCT_BANDS_INVALID = 0x7FFFFFFF /* define as 4 bytes data */
94}eNvProductBands; //NV_COMMON_PRODUCT_BANDS
95
96
97typedef PACKED_PRE union PACKED_POST
98{
99 //common NV fields
100 tANI_U16 productId;
101 tANI_U8 productBands;
102 tANI_U8 wlanNvRevId;
103 tANI_U8 numOfTxChains;
104 tANI_U8 numOfRxChains;
105 tANI_U8 macAddr[NV_FIELD_MAC_ADDR_SIZE]; /* Default, not change name for compatibility */
106 tANI_U8 macAddr2[NV_FIELD_MAC_ADDR_SIZE];
107 tANI_U8 macAddr3[NV_FIELD_MAC_ADDR_SIZE];
108 tANI_U8 macAddr4[NV_FIELD_MAC_ADDR_SIZE];
109 tANI_U8 mfgSN[NV_FIELD_MFG_SN_SIZE];
110 tANI_U8 couplerType; /* 0 : Internal coupler, 1 : External coupler */
111 tANI_U8 reserved; /* Make Byte alignment */
112} uNvFields;
113
114
115
116//format of common part of nv
117typedef PACKED_PRE struct PACKED_POST
118{
119 //always ensure fields are aligned to 32-bit boundaries
120 tANI_U16 productId;
121 tANI_U8 productBands;
122 tANI_U8 wlanNvRevId; //0: WCN1312, 1: WCN1314, 2: WCN3660
123
124 tANI_U8 numOfTxChains;
125 tANI_U8 numOfRxChains;
126 tANI_U8 macAddr[NV_FIELD_MAC_ADDR_SIZE]; /* Default, not change name for compatibility */
127 tANI_U8 macAddr2[NV_FIELD_MAC_ADDR_SIZE];
128 tANI_U8 macAddr3[NV_FIELD_MAC_ADDR_SIZE];
129 tANI_U8 macAddr4[NV_FIELD_MAC_ADDR_SIZE];
130 tANI_U8 mfgSN[NV_FIELD_MFG_SN_SIZE];
131 tANI_U8 couplerType; /* 0 : Internal coupler, 1 : External coupler */
132 tANI_U8 reserved; /* Make Byte alignment */
133} sNvFields;
134
135
136//From wlanfw/inc/halPhyTypes.h
137
138typedef tANI_S8 tPowerdBm; //power in signed 8-bit integer, no decimal places
139
140typedef PACKED_PRE union PACKED_POST
141{
142 tANI_U32 measurement; //measured values can be passed to pttApi, but are maintained to 2 decimal places internally
143 tANI_S16 reported; //used internally only - reported values only maintain 2 decimals places
144}uAbsPwrPrecision;
145
146typedef enum
147{
148 PHY_TX_CHAIN_0 = 0,
149
150 PHY_MAX_TX_CHAINS = 1,
151 PHY_ALL_TX_CHAINS,
152
153 //possible tx chain combinations
154 PHY_NO_TX_CHAINS,
155 PHY_TX_CHAIN_INVALID = 0x7FFFFFFF /* define as 4 bytes data */
156}ePhyTxChains;
157
158//From wlanfw/inc/halRfTypes.h
159
160typedef enum
161{
162 REG_DOMAIN_FCC,
163 REG_DOMAIN_ETSI,
164 REG_DOMAIN_JAPAN,
165 REG_DOMAIN_WORLD,
166 REG_DOMAIN_N_AMER_EXC_FCC,
167 REG_DOMAIN_APAC,
168 REG_DOMAIN_KOREA,
169 REG_DOMAIN_HI_5GHZ,
170 REG_DOMAIN_NO_5GHZ,
171
172 NUM_REG_DOMAINS,
173 NUM_REG_DOMAINS_INVALID = 0x7FFFFFFF /* define as 4 bytes data */
174}eRegDomainId;
175
176typedef enum
177{
178 RF_SUBBAND_2_4_GHZ = 0,
179 RF_SUBBAND_5_LOW_GHZ = 1, //Low & Mid U-NII
180 RF_SUBBAND_5_MID_GHZ = 2, //ETSI
181 RF_SUBBAND_5_HIGH_GHZ = 3, //High U-NII
Madan Mohan Koyyalamudi8cb5dc72012-09-24 12:08:56 -0700182 RF_SUBBAND_4_9_GHZ = 4, //Japanese
Jeff Johnson295189b2012-06-20 16:38:30 -0700183
184
185 NUM_RF_SUBBANDS,
186
187 MAX_RF_SUBBANDS,
188 INVALID_RF_SUBBAND,
189
190 RF_BAND_2_4_GHZ = 0,
191 RF_BAND_5_GHZ = 1,
192 NUM_RF_BANDS,
193 BOTH_RF_BANDS,
194 RF_SUBBAND_INVALID = 0x7FFFFFFF /* define as 4 bytes data */
195}eRfSubBand;
196
197typedef enum
198{
199 //2.4GHz Band
200 RF_CHAN_1 = 0,
201 RF_CHAN_2 = 1,
202 RF_CHAN_3 = 2,
203 RF_CHAN_4 = 3,
204 RF_CHAN_5 = 4,
205 RF_CHAN_6 = 5,
206 RF_CHAN_7 = 6,
207 RF_CHAN_8 = 7,
208 RF_CHAN_9 = 8,
209 RF_CHAN_10 = 9,
210 RF_CHAN_11 = 10,
211 RF_CHAN_12 = 11,
212 RF_CHAN_13 = 12,
213 RF_CHAN_14 = 13,
214
Madan Mohan Koyyalamudi8cb5dc72012-09-24 12:08:56 -0700215 //4.9GHz Band
216 RF_CHAN_240 = 14,
217 RF_CHAN_244 = 15,
218 RF_CHAN_248 = 16,
219 RF_CHAN_252 = 17,
220 RF_CHAN_208 = 18,
221 RF_CHAN_212 = 19,
222 RF_CHAN_216 = 20,
Jeff Johnson295189b2012-06-20 16:38:30 -0700223
224 //5GHz Low & Mid U-NII Band
225 RF_CHAN_36 = 21,
226 RF_CHAN_40 = 22,
227 RF_CHAN_44 = 23,
228 RF_CHAN_48 = 24,
229 RF_CHAN_52 = 25,
230 RF_CHAN_56 = 26,
231 RF_CHAN_60 = 27,
232 RF_CHAN_64 = 28,
233
234 //5GHz Mid Band - ETSI & FCC
235 RF_CHAN_100 = 29,
236 RF_CHAN_104 = 30,
237 RF_CHAN_108 = 31,
238 RF_CHAN_112 = 32,
239 RF_CHAN_116 = 33,
240 RF_CHAN_120 = 34,
241 RF_CHAN_124 = 35,
242 RF_CHAN_128 = 36,
243 RF_CHAN_132 = 37,
244 RF_CHAN_136 = 38,
245 RF_CHAN_140 = 39,
246
247 //5GHz High U-NII Band
248 RF_CHAN_149 = 40,
249 RF_CHAN_153 = 41,
250 RF_CHAN_157 = 42,
251 RF_CHAN_161 = 43,
252 RF_CHAN_165 = 44,
253
254 //CHANNEL BONDED CHANNELS
255 RF_CHAN_BOND_3 = 45,
256 RF_CHAN_BOND_4 = 46,
257 RF_CHAN_BOND_5 = 47,
258 RF_CHAN_BOND_6 = 48,
259 RF_CHAN_BOND_7 = 49,
260 RF_CHAN_BOND_8 = 50,
261 RF_CHAN_BOND_9 = 51,
262 RF_CHAN_BOND_10 = 52,
263 RF_CHAN_BOND_11 = 53,
Madan Mohan Koyyalamudi8cb5dc72012-09-24 12:08:56 -0700264 RF_CHAN_BOND_242 = 54, //4.9GHz Band
265 RF_CHAN_BOND_246 = 55,
266 RF_CHAN_BOND_250 = 56,
267 RF_CHAN_BOND_210 = 57,
268 RF_CHAN_BOND_214 = 58,
Jeff Johnson295189b2012-06-20 16:38:30 -0700269 RF_CHAN_BOND_38 = 59, //5GHz Low & Mid U-NII Band
270 RF_CHAN_BOND_42 = 60,
271 RF_CHAN_BOND_46 = 61,
272 RF_CHAN_BOND_50 = 62,
273 RF_CHAN_BOND_54 = 63,
274 RF_CHAN_BOND_58 = 64,
275 RF_CHAN_BOND_62 = 65,
276 RF_CHAN_BOND_102 = 66, //5GHz Mid Band - ETSI & FCC
277 RF_CHAN_BOND_106 = 67,
278 RF_CHAN_BOND_110 = 68,
279 RF_CHAN_BOND_114 = 69,
280 RF_CHAN_BOND_118 = 70,
281 RF_CHAN_BOND_122 = 71,
282 RF_CHAN_BOND_126 = 72,
283 RF_CHAN_BOND_130 = 73,
284 RF_CHAN_BOND_134 = 74,
285 RF_CHAN_BOND_138 = 75,
286 RF_CHAN_BOND_151 = 76, //5GHz High U-NII Band
287 RF_CHAN_BOND_155 = 77,
288 RF_CHAN_BOND_159 = 78,
289 RF_CHAN_BOND_163 = 79,
290
291 NUM_RF_CHANNELS,
292
293 MIN_2_4GHZ_CHANNEL = RF_CHAN_1,
294 MAX_2_4GHZ_CHANNEL = RF_CHAN_14,
295 NUM_2_4GHZ_CHANNELS = (MAX_2_4GHZ_CHANNEL - MIN_2_4GHZ_CHANNEL + 1),
296
Madan Mohan Koyyalamudi8cb5dc72012-09-24 12:08:56 -0700297 MIN_5GHZ_CHANNEL = RF_CHAN_240,
Jeff Johnson295189b2012-06-20 16:38:30 -0700298 MAX_5GHZ_CHANNEL = RF_CHAN_165,
299 NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1),
300
Madan Mohan Koyyalamudi8cb5dc72012-09-24 12:08:56 -0700301 MIN_20MHZ_RF_CHANNEL = RF_CHAN_1,
Jeff Johnson295189b2012-06-20 16:38:30 -0700302 MAX_20MHZ_RF_CHANNEL = RF_CHAN_165,
303 NUM_20MHZ_RF_CHANNELS = (MAX_20MHZ_RF_CHANNEL - MIN_20MHZ_RF_CHANNEL + 1),
304
305 MIN_40MHZ_RF_CHANNEL = RF_CHAN_BOND_3,
306 MAX_40MHZ_RF_CHANNEL = RF_CHAN_BOND_163,
307 NUM_40MHZ_RF_CHANNELS = (MAX_40MHZ_RF_CHANNEL - MIN_40MHZ_RF_CHANNEL + 1),
308
309 MIN_CB_2_4GHZ_CHANNEL = RF_CHAN_BOND_3,
310 MAX_CB_2_4GHZ_CHANNEL = RF_CHAN_BOND_11,
311
Madan Mohan Koyyalamudi8cb5dc72012-09-24 12:08:56 -0700312 MIN_CB_5GHZ_CHANNEL = RF_CHAN_BOND_242,
Jeff Johnson295189b2012-06-20 16:38:30 -0700313 MAX_CB_5GHZ_CHANNEL = RF_CHAN_BOND_163,
314
315 NUM_TPC_2_4GHZ_CHANNELS = 14,
316 NUM_TPC_5GHZ_CHANNELS = NUM_5GHZ_CHANNELS,
317
318 INVALID_RF_CHANNEL = 0xBAD,
319 RF_CHANNEL_INVALID_MAX_FIELD = 0x7FFFFFFF /* define as 4 bytes data */
320}eRfChannels;
321
322enum
323{
324 NV_CHANNEL_DISABLE,
325 NV_CHANNEL_ENABLE,
326 NV_CHANNEL_DFS,
327 NV_CHANNEL_INVALID
328};
329typedef tANI_U8 eNVChannelEnabledType;
330
331typedef PACKED_PRE struct PACKED_POST
332{
333 eNVChannelEnabledType enabled;
334 tPowerdBm pwrLimit;
335}sRegulatoryChannel;
336
337typedef PACKED_PRE struct PACKED_POST
338{
339 sRegulatoryChannel channels[NUM_RF_CHANNELS];
340 uAbsPwrPrecision antennaGain[NUM_RF_SUBBANDS];
341 uAbsPwrPrecision bRatePowerOffset[NUM_2_4GHZ_CHANNELS];
342 uAbsPwrPrecision gnRatePowerOffset[NUM_RF_CHANNELS];
343}ALIGN_4 sRegulatoryDomains;
344
345typedef PACKED_PRE struct PACKED_POST
346{
347 tANI_S16 bRssiOffset[NUM_RF_CHANNELS];
348 tANI_S16 gnRssiOffset[NUM_RF_CHANNELS];
349}ALIGN_4 sRssiChannelOffsets;
350
351typedef PACKED_PRE struct PACKED_POST
352{
353 tANI_U16 targetFreq; //number in MHz
354 tANI_U16 channelNum; //channel number as in the eRfChannels enumeration
355 eRfSubBand band; //band that this channel belongs to
356}tRfChannelProps;
357
358typedef enum
359{
360 MODE_802_11B = 0,
361 MODE_802_11AG = 1,
362 MODE_802_11N = 2,
363 NUM_802_11_MODES,
364 MODE_802_11_INVALID = 0x7FFFFFFF /* define as 4 bytes data */
365} e80211Modes;
366
367
368//From wlanfw/inc/halPhyCalMemory.h
369typedef PACKED_PRE struct PACKED_POST
370{
371 tANI_U16 process_monitor;
372 tANI_U8 hdet_cal_code;
373 tANI_U8 rxfe_gm_2;
374
375 tANI_U8 tx_bbf_rtune;
376 tANI_U8 pa_rtune_reg;
377 tANI_U8 rt_code;
378 tANI_U8 bias_rtune;
379
380 tANI_U8 bb_bw1;
381 tANI_U8 bb_bw2;
382 tANI_U8 pa_ctune_reg;
383 tANI_U8 reserved1;
384
385 tANI_U8 bb_bw3;
386 tANI_U8 bb_bw4;
387 tANI_U8 bb_bw5;
388 tANI_U8 bb_bw6;
389
390 tANI_U16 rcMeasured;
391 tANI_U8 tx_bbf_ct;
392 tANI_U8 tx_bbf_ctr;
393
394 tANI_U8 csh_maxgain_reg;
395 tANI_U8 csh_0db_reg;
396 tANI_U8 csh_m3db_reg;
397 tANI_U8 csh_m6db_reg;
398
399 tANI_U8 cff_0db_reg;
400 tANI_U8 cff_m3db_reg;
401 tANI_U8 cff_m6db_reg;
402 tANI_U8 rxfe_gpio_ctl_1;
403
404 tANI_U8 mix_bal_cnt_2;
405 tANI_S8 rxfe_lna_highgain_bias_ctl_delta;
406 tANI_U8 rxfe_lna_load_ctune;
407 tANI_U8 rxfe_lna_ngm_rtune;
408
409 tANI_U8 rx_im2_spare0;
410 tANI_U8 rx_im2_spare1;
411 tANI_U16 hdet_dco;
412
413 tANI_U8 pll_vfc_reg3_b0;
414 tANI_U8 pll_vfc_reg3_b1;
415 tANI_U8 pll_vfc_reg3_b2;
416 tANI_U8 pll_vfc_reg3_b3;
417
418 tANI_U16 tempStart;
419 tANI_U16 roomTemp;
420
421 tANI_S16 ambientCalTemp;
422 tANI_U8 ambientCalTempValid;
423 tANI_U8 reserved2;
424
425}sCalData;
426
427typedef PACKED_PRE struct PACKED_POST
428{
429 tANI_U32 calStatus; //use eNvCalID
430 sCalData calData;
431}sRFCalValues;
432
433typedef PACKED_PRE struct PACKED_POST
434{
435 tANI_U32 txFirFilterMode;
436}sTxBbFilterMode;
437
438typedef PACKED_PRE struct PACKED_POST
439{
440 tANI_S16 ofdmPwrOffset;
441 tANI_S16 rsvd;
442}sOfdmCmdPwrOffset;
443
444//From wlanfw/inc/halPhyCfg.h
445typedef tANI_U8 tTpcLutValue;
446
447#define MAX_TPC_CAL_POINTS (8)
448
449typedef tANI_U8 tPowerDetect; //7-bit power detect reading
450
451typedef PACKED_PRE struct PACKED_POST
452{
453 tPowerDetect pwrDetAdc; //= SENSED_PWR register, which reports the 8-bit ADC
454 // the stored ADC value gets shifted to 7-bits as the index to the LUT
455 tPowerDetect adjustedPwrDet; //7-bit value that goes into the LUT at the LUT[pwrDet] location
456 //MSB set if extraPrecision.hi8_adjustedPwrDet is used
457}tTpcCaldPowerPoint;
458
459typedef tTpcCaldPowerPoint tTpcCaldPowerTable[PHY_MAX_TX_CHAINS][MAX_TPC_CAL_POINTS];
460
461typedef PACKED_PRE struct PACKED_POST
462{
463 tTpcCaldPowerTable empirical; //calibrated power points
464}tTpcConfig;
465
466//From wlanfw/inc/phyTxPower.h
467#ifndef TPC_MEM_POWER_LUT_DEPTH
468#define TPC_MEM_POWER_LUT_DEPTH 256
469#endif
470
471typedef tTpcLutValue tTpcPowerTable[PHY_MAX_TX_CHAINS][TPC_MEM_POWER_LUT_DEPTH];
472
473typedef PACKED_PRE struct PACKED_POST
474{
475 tTpcConfig *pwrSampled; //points to CLPC data in calMemory
476}tPhyTxPowerBand;
477
478//From halPhyRates.h
479typedef enum
480{
481 //802.11b Rates
482 HAL_PHY_RATE_11B_LONG_1_MBPS,
483 HAL_PHY_RATE_11B_LONG_2_MBPS,
484 HAL_PHY_RATE_11B_LONG_5_5_MBPS,
485 HAL_PHY_RATE_11B_LONG_11_MBPS,
486 HAL_PHY_RATE_11B_SHORT_2_MBPS,
487 HAL_PHY_RATE_11B_SHORT_5_5_MBPS,
488 HAL_PHY_RATE_11B_SHORT_11_MBPS,
489
490 //Spica_Virgo 11A 20MHz Rates
491 HAL_PHY_RATE_11A_6_MBPS,
492 HAL_PHY_RATE_11A_9_MBPS,
493 HAL_PHY_RATE_11A_12_MBPS,
494 HAL_PHY_RATE_11A_18_MBPS,
495 HAL_PHY_RATE_11A_24_MBPS,
496 HAL_PHY_RATE_11A_36_MBPS,
497 HAL_PHY_RATE_11A_48_MBPS,
498 HAL_PHY_RATE_11A_54_MBPS,
499
500 // 11A 20MHz Rates
501 HAL_PHY_RATE_11A_DUP_6_MBPS,
502 HAL_PHY_RATE_11A_DUP_9_MBPS,
503 HAL_PHY_RATE_11A_DUP_12_MBPS,
504 HAL_PHY_RATE_11A_DUP_18_MBPS,
505 HAL_PHY_RATE_11A_DUP_24_MBPS,
506 HAL_PHY_RATE_11A_DUP_36_MBPS,
507 HAL_PHY_RATE_11A_DUP_48_MBPS,
508 HAL_PHY_RATE_11A_DUP_54_MBPS,
509
510 //MCS Index #0-7 (20/40MHz)
511 HAL_PHY_RATE_MCS_1NSS_6_5_MBPS,
512 HAL_PHY_RATE_MCS_1NSS_13_MBPS,
513 HAL_PHY_RATE_MCS_1NSS_19_5_MBPS,
514 HAL_PHY_RATE_MCS_1NSS_26_MBPS,
515 HAL_PHY_RATE_MCS_1NSS_39_MBPS,
516 HAL_PHY_RATE_MCS_1NSS_52_MBPS,
517 HAL_PHY_RATE_MCS_1NSS_58_5_MBPS,
518 HAL_PHY_RATE_MCS_1NSS_65_MBPS,
519 HAL_PHY_RATE_MCS_1NSS_MM_SG_7_2_MBPS,
520 HAL_PHY_RATE_MCS_1NSS_MM_SG_14_4_MBPS,
521 HAL_PHY_RATE_MCS_1NSS_MM_SG_21_7_MBPS,
522 HAL_PHY_RATE_MCS_1NSS_MM_SG_28_9_MBPS,
523 HAL_PHY_RATE_MCS_1NSS_MM_SG_43_3_MBPS,
524 HAL_PHY_RATE_MCS_1NSS_MM_SG_57_8_MBPS,
525 HAL_PHY_RATE_MCS_1NSS_MM_SG_65_MBPS,
526 HAL_PHY_RATE_MCS_1NSS_MM_SG_72_2_MBPS,
527
528 //MCS Index #8-15 (20/40MHz)
529 HAL_PHY_RATE_MCS_1NSS_CB_13_5_MBPS,
530 HAL_PHY_RATE_MCS_1NSS_CB_27_MBPS,
531 HAL_PHY_RATE_MCS_1NSS_CB_40_5_MBPS,
532 HAL_PHY_RATE_MCS_1NSS_CB_54_MBPS,
533 HAL_PHY_RATE_MCS_1NSS_CB_81_MBPS,
534 HAL_PHY_RATE_MCS_1NSS_CB_108_MBPS,
535 HAL_PHY_RATE_MCS_1NSS_CB_121_5_MBPS,
536 HAL_PHY_RATE_MCS_1NSS_CB_135_MBPS,
537 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_15_MBPS,
538 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_30_MBPS,
539 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_45_MBPS,
540 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_60_MBPS,
541 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_90_MBPS,
542 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_120_MBPS,
543 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_135_MBPS,
544 HAL_PHY_RATE_MCS_1NSS_MM_SG_CB_150_MBPS,
545
Jeff Johnsone7245742012-09-05 17:12:55 -0700546#ifdef WLAN_FEATURE_11AC
547 /*11A duplicate 80MHz Rates*/
548 HAL_PHY_RATE_11AC_DUP_6_MBPS,
549 HAL_PHY_RATE_11AC_DUP_9_MBPS,
550 HAL_PHY_RATE_11AC_DUP_12_MBPS,
551 HAL_PHY_RATE_11AC_DUP_18_MBPS,
552 HAL_PHY_RATE_11AC_DUP_24_MBPS,
553 HAL_PHY_RATE_11AC_DUP_36_MBPS,
554 HAL_PHY_RATE_11AC_DUP_48_MBPS,
555 HAL_PHY_RATE_11AC_DUP_54_MBPS,
556
557 /*11AC rate 20MHZ Normal GI*/
558 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_6_5_MBPS,
559 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_13_MBPS,
560 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_19_5_MBPS,
561 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_26_MBPS,
562 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_39_MBPS,
563 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_52_MBPS,
564 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_58_5_MBPS,
565 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_65_MBPS,
566 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_NGI_78_MBPS,
567
568 /*11AC rate 20MHZ Shortl GI*/
569 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_7_2_MBPS,
570 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_14_4_MBPS,
571 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_21_6_MBPS,
572 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_28_8_MBPS,
573 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_43_3_MBPS,
574 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_57_7_MBPS,
575 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_65_MBPS,
576 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_72_2_MBPS,
577 HAL_PHY_RATE_VHT_20MHZ_MCS_1NSS_SGI_86_6_MBPS,
578
579 /*11AC rates 40MHZ normal GI*/
580 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_13_5_MBPS ,
581 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_27_MBPS,
582 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_40_5_MBPS,
583 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_54_MBPS,
584 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_81_MBPS,
585 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_108_MBPS,
586 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_121_5_MBPS,
587 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_135_MBPS,
588 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_162_MBPS,
589 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_NGI_180_MBPS,
590
591 /*11AC rates 40MHZ short GI*/
592 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_15_MBPS ,
593 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_30_MBPS,
594 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_45_MBPS,
595 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_60_MBPS,
596 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_90_MBPS,
597 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_120_MBPS,
598 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_135_MBPS,
599 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_150_MBPS,
600 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_180_MBPS,
601 HAL_PHY_RATE_VHT_40MHZ_MCS_1NSS_CB_SGI_200_MBPS,
602
603 /*11AC rates 80 MHZ normal GI*/
604 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_29_3_MBPS ,
605 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_58_5_MBPS,
606 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_87_8_MBPS,
607 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_117_MBPS,
608 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_175_5_MBPS,
609 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_234_MBPS,
610 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_263_3_MBPS,
611 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_292_5_MBPS,
612 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_351_MBPS,
613 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_NGI_390_MBPS,
614
615 /*11AC rates 80 MHZ short GI*/
616 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_32_5_MBPS ,
617 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_65_MBPS,
618 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_97_5_MBPS,
619 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_130_MBPS,
620 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_195_MBPS,
621 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_260_MBPS,
622 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_292_5_MBPS,
623 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_325_MBPS,
624 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_390_MBPS,
625 HAL_PHY_RATE_VHT_80MHZ_MCS_1NSS_CB_SGI_433_3_MBPS,
626#endif //WLAN_FEATURE_11AC
627
Jeff Johnson295189b2012-06-20 16:38:30 -0700628 NUM_HAL_PHY_RATES,
629 HAL_PHY_RATE_INVALID,
630 MIN_RATE_INDEX = 0,
Jeff Johnsone7245742012-09-05 17:12:55 -0700631 MAX_RATE_INDEX = NUM_HAL_PHY_RATES - 1,
Jeff Johnson295189b2012-06-20 16:38:30 -0700632 HAL_PHY_RATE_INVALID_MAX_FIELD = 0x7FFFFFFF /* define as 4 bytes data */
633}eHalPhyRates;
634
635
636#define NUM_RATE_POWER_GROUPS NUM_HAL_PHY_RATES //total number of rate power groups including the CB_RATE_POWER_OFFSET
637typedef uAbsPwrPrecision tRateGroupPwr[NUM_RATE_POWER_GROUPS];
638
639//From halNvTables.h
640#define NV_FIELD_COUNTRY_CODE_SIZE 3
641typedef PACKED_PRE struct PACKED_POST
642{
643 tANI_U8 regDomain; //from eRegDomainId
644 tANI_U8 countryCode[NV_FIELD_COUNTRY_CODE_SIZE]; // string identifier
645}sDefaultCountry;
646
647typedef PACKED_PRE struct PACKED_POST
648{
649 tANI_U8 overall;
650 tANI_U8 fwInit;
651 tANI_U8 hdet_dco;
652 tANI_U8 rtuner;
653
654 tANI_U8 ctuner;
655 tANI_U8 insitu;
656 tANI_U8 process_monitor;
657 tANI_U8 pllVcoLinearity;
658
659 tANI_U8 txIQ;
660 tANI_U8 rxIQ;
661 tANI_U8 rxDco;
662 tANI_U8 txLo;
663
664 tANI_U8 lnaBias;
665 tANI_U8 lnaBandTuning;
666 tANI_U8 lnaGainAdjust;
667 tANI_U8 im2UsingNoisePwr;
668
669 tANI_U8 temperature;
670 tANI_U8 clpc;
671 tANI_U8 clpc_temp_adjust;
672 tANI_U8 txDpd;
673
674 tANI_U8 channelTune;
675 tANI_U8 rxGmStageLinearity;
676 tANI_U8 im2UsingToneGen;
677 tANI_U8 rxBbfTuning; // rx baseband filert tuning
678
679 tANI_U8 txBbfTuning; // tx baseband filter tuning
680 tANI_U8 paCTuning; // PA adjustments baed on C-tuner
681 tANI_U8 unused[6];
682}sCalStatus;
683
684#define NUM_RF_VR_RATE 13
685typedef uAbsPwrPrecision tRateGroupPwrVR[NUM_RF_VR_RATE];
686
687typedef PACKED_PRE union PACKED_POST
688{
689 tRateGroupPwr pwrOptimum[NUM_RF_SUBBANDS]; // NV_TABLE_RATE_POWER_SETTINGS
690 sRegulatoryDomains regDomains[NUM_REG_DOMAINS]; // NV_TABLE_REGULATORY_DOMAINS
691 sDefaultCountry defaultCountryTable; // NV_TABLE_DEFAULT_COUNTRY
692 tTpcPowerTable plutCharacterized[NUM_RF_CHANNELS]; // NV_TABLE_TPC_POWER_TABLE
693 tANI_S16 plutPdadcOffset[NUM_RF_CHANNELS]; // NV_TABLE_TPC_PDADC_OFFSETS
694 tRateGroupPwrVR pwrOptimum_virtualRate[NUM_RF_SUBBANDS]; // NV_TABLE_VIRTUAL_RATE
695 //sCalFlashMemory calFlashMemory; // NV_TABLE_CAL_MEMORY
696 sCalStatus calStatus; // NV_TABLE_CAL_STATUS
697 sRssiChannelOffsets rssiChanOffsets[2]; // NV_TABLE_RSSI_CHANNEL_OFFSETS
698 sRFCalValues rFCalValues; // NV_TABLE_RF_CAL_VALUES
699 tANI_S16 antennaPathLoss[NUM_RF_CHANNELS]; // NV_TABLE_ANTENNA_PATH_LOSS
700 tANI_S16 pktTypePwrLimits[NUM_802_11_MODES][NUM_RF_CHANNELS]; // NV_TABLE_PACKET_TYPE_POWER_LIMITS
701 sOfdmCmdPwrOffset ofdmCmdPwrOffset; // NV_TABLE_OFDM_CMD_PWR_OFFSET
702 sTxBbFilterMode txbbFilterMode; // NV_TABLE_TX_BB_FILTER_MODE
703}ALIGN_4 uNvTables;
704
705//From halPhy.h
706typedef tPowerdBm tChannelPwrLimit;
707
708typedef PACKED_PRE struct PACKED_POST
709{
710 tANI_U8 chanId;
711 tChannelPwrLimit pwr;
712} ALIGN_4 tChannelListWithPower;
713
714//From HAL/inc/halNvTables.h
715typedef enum
716{
717 NV_FIELDS_IMAGE = 0, //contains all fields
718
719 NV_TABLE_RATE_POWER_SETTINGS = 2,
720 NV_TABLE_REGULATORY_DOMAINS = 3,
721 NV_TABLE_DEFAULT_COUNTRY = 4,
722 NV_TABLE_TPC_POWER_TABLE = 5,
723 NV_TABLE_TPC_PDADC_OFFSETS = 6,
724 NV_TABLE_RF_CAL_VALUES = 7,
725 NV_TABLE_RSSI_CHANNEL_OFFSETS = 9,
726 NV_TABLE_CAL_MEMORY = 10, //cal memory structure from halPhyCalMemory.h preceded by status
727 NV_TABLE_CAL_STATUS = 11,
728 NV_TABLE_ANTENNA_PATH_LOSS = 12,
729 NV_TABLE_PACKET_TYPE_POWER_LIMITS = 13,
730 NV_TABLE_OFDM_CMD_PWR_OFFSET = 14,
731 NV_TABLE_TX_BB_FILTER_MODE = 15,
732 NV_TABLE_VIRTUAL_RATE = 18,
733
734 NUM_NV_TABLE_IDS,
735 NV_ALL_TABLES = 0xFFF,
736 NV_BINARY_IMAGE = 0x1000,
737 NV_MAX_TABLE = 0x7FFFFFFF /* define as 4 bytes data */
738}eNvTable;
739
740typedef PACKED_PRE struct PACKED_POST
741{
742 tRateGroupPwr pwrOptimum[NUM_RF_SUBBANDS]; // NV_TABLE_RATE_POWER_SETTINGS
743 sRegulatoryDomains regDomains[NUM_REG_DOMAINS]; // NV_TABLE_REGULATORY_DOMAINS
744 sDefaultCountry defaultCountryTable; // NV_TABLE_DEFAULT_COUNTRY
745 tTpcPowerTable plutCharacterized[NUM_RF_CHANNELS]; // NV_TABLE_TPC_POWER_TABLE
746 tANI_S16 plutPdadcOffset[NUM_RF_CHANNELS]; // NV_TABLE_TPC_PDADC_OFFSETS
747 tRateGroupPwrVR pwrOptimum_virtualRate[NUM_RF_SUBBANDS]; // NV_TABLE_VIRTUAL_RATE
748 //sCalFlashMemory calFlashMemory; // NV_TABLE_CAL_MEMORY
749 sCalStatus calStatus; // NV_TABLE_CAL_STATUS
750 sRssiChannelOffsets rssiChanOffsets[2]; // NV_TABLE_RSSI_CHANNEL_OFFSETS
751 sRFCalValues rFCalValues; // NV_TABLE_RF_CAL_VALUES
752 tANI_S16 antennaPathLoss[NUM_RF_CHANNELS]; // NV_TABLE_ANTENNA_PATH_LOSS
753 tANI_S16 pktTypePwrLimits[NUM_802_11_MODES][NUM_RF_CHANNELS]; // NV_TABLE_PACKET_TYPE_POWER_LIMITS
754 sOfdmCmdPwrOffset ofdmCmdPwrOffset; // NV_TABLE_OFDM_CMD_PWR_OFFSET
755 sTxBbFilterMode txbbFilterMode; // NV_TABLE_TX_BB_FILTER_MODE
756}ALIGN_4 sNvTables;
757
758typedef PACKED_PRE struct PACKED_POST
759{
760 sNvFields fields;
761 sNvTables tables;
762}ALIGN_4 sHalNv;
763
764extern const sHalNv nvDefaults;
765
766#endif
767