revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / networks / atheros5000 / hal / ah_eeprom.h
blobc5892339f49fa2a6e82088b7cb29374bcb392e0d
1 /*
2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2008 Atheros Communications, Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * $Id$
19 #ifndef _ATH_AH_EEPROM_H_
20 #define _ATH_AH_EEPROM_H_
23 * Version 3 EEPROMs are all 16K.
24 * 3.1 adds turbo limit, antenna gain, 16 CTL's, 11g info,
25 * and 2.4Ghz ob/db for B & G
26 * 3.2 has more accurate pcdac intercepts and analog chip
27 * calibration.
28 * 3.3 adds ctl in-band limit, 32 ctl's, and frequency
29 * expansion
30 * 3.4 adds xr power, gainI, and 2.4 turbo params
32 #define AR_EEPROM_VER3 0x3000 /* Version 3.0; start of 16k EEPROM */
33 #define AR_EEPROM_VER3_1 0x3001 /* Version 3.1 */
34 #define AR_EEPROM_VER3_2 0x3002 /* Version 3.2 */
35 #define AR_EEPROM_VER3_3 0x3003 /* Version 3.3 */
36 #define AR_EEPROM_VER3_4 0x3004 /* Version 3.4 */
37 #define AR_EEPROM_VER4_0 0x4000 /* Version 4.0 */
38 #define AR_EEPROM_VER4_1 0x4001 /* Version 4.0 */
39 #define AR_EEPROM_VER4_2 0x4002 /* Version 4.0 */
40 #define AR_EEPROM_VER4_3 0x4003 /* Version 4.0 */
41 #define AR_EEPROM_VER4_6 0x4006 /* Version 4.0 */
42 #define AR_EEPROM_VER4_7 0x3007 /* Version 4.7 */
43 #define AR_EEPROM_VER4_9 0x4009 /* EEPROM EAR futureproofing */
44 #define AR_EEPROM_VER5_0 0x5000 /* Adds new 2413 cal powers and added params */
45 #define AR_EEPROM_VER5_1 0x5001 /* Adds capability values */
46 #define AR_EEPROM_VER5_3 0x5003 /* Adds spur mitigation table */
47 #define AR_EEPROM_VER5_4 0x5004
49 * Version 14 EEPROMs came in with AR5416.
50 * 14.2 adds txFrameToPaOn, txFrameToDataStart, ht40PowerInc
51 * 14.3 adds bswAtten, bswMargin, swSettle, and base OpFlags for HT20/40
53 #define AR_EEPROM_VER14_1 0xE001 /* 11n support */
54 #define AR_EEPROM_VER14_2 0xE002
55 #define AR_EEPROM_VER14_3 0xE003
56 #define AR_EEPROM_VER14_7 0xE007
57 #define AR_EEPROM_VER14_9 0xE009
58 #define AR_EEPROM_VER14_16 0xE010
59 #define AR_EEPROM_VER14_17 0xE011
60 #define AR_EEPROM_VER14_19 0xE013
62 enum {
63 AR_EEP_RFKILL, /* use ath_hal_eepromGetFlag */
64 AR_EEP_AMODE, /* use ath_hal_eepromGetFlag */
65 AR_EEP_BMODE, /* use ath_hal_eepromGetFlag */
66 AR_EEP_GMODE, /* use ath_hal_eepromGetFlag */
67 AR_EEP_TURBO5DISABLE, /* use ath_hal_eepromGetFlag */
68 AR_EEP_TURBO2DISABLE, /* use ath_hal_eepromGetFlag */
69 AR_EEP_ISTALON, /* use ath_hal_eepromGetFlag */
70 AR_EEP_32KHZCRYSTAL, /* use ath_hal_eepromGetFlag */
71 AR_EEP_MACADDR, /* uint8_t* */
72 AR_EEP_COMPRESS, /* use ath_hal_eepromGetFlag */
73 AR_EEP_FASTFRAME, /* use ath_hal_eepromGetFlag */
74 AR_EEP_AES, /* use ath_hal_eepromGetFlag */
75 AR_EEP_BURST, /* use ath_hal_eepromGetFlag */
76 AR_EEP_MAXQCU, /* uint16_t* */
77 AR_EEP_KCENTRIES, /* uint16_t* */
78 AR_EEP_NFTHRESH_5, /* uint8_t* */
79 AR_EEP_NFTHRESH_2, /* uint8_t* */
80 AR_EEP_REGDMN_0, /* uint16_t* */
81 AR_EEP_REGDMN_1, /* uint16_t* */
82 AR_EEP_OPCAP, /* uint16_t* */
83 AR_EEP_OPMODE, /* uint16_t* */
84 AR_EEP_RFSILENT, /* uint16_t* */
85 AR_EEP_OB_5, /* uint8_t* */
86 AR_EEP_DB_5, /* uint8_t* */
87 AR_EEP_OB_2, /* uint8_t* */
88 AR_EEP_DB_2, /* uint8_t* */
89 AR_EEP_TXMASK, /* uint8_t* */
90 AR_EEP_RXMASK, /* uint8_t* */
91 AR_EEP_RXGAIN_TYPE, /* uint8_t* */
92 AR_EEP_TXGAIN_TYPE, /* uint8_t* */
93 AR_EEP_OL_PWRCTRL, /* use ath_hal_eepromGetFlag */
94 AR_EEP_FSTCLK_5G, /* use ath_hal_eepromGetFlag */
95 AR_EEP_ANTGAINMAX_5, /* int8_t* */
96 AR_EEP_ANTGAINMAX_2, /* int8_t* */
97 AR_EEP_WRITEPROTECT, /* use ath_hal_eepromGetFlag */
100 typedef struct {
101 uint16_t rdEdge;
102 uint16_t twice_rdEdgePower;
103 HAL_BOOL flag;
104 } RD_EDGES_POWER;
106 /* XXX should probably be version-dependent */
107 #define SD_NO_CTL 0xf0
108 #define NO_CTL 0xff
109 #define CTL_MODE_M 0x0f
110 #define CTL_11A 0
111 #define CTL_11B 1
112 #define CTL_11G 2
113 #define CTL_TURBO 3
114 #define CTL_108G 4
115 #define CTL_2GHT20 5
116 #define CTL_5GHT20 6
117 #define CTL_2GHT40 7
118 #define CTL_5GHT40 8
120 #define AR_NO_SPUR 0x8000
122 /* XXX exposed to chip code */
123 #define MAX_RATE_POWER 63
125 HAL_STATUS ath_hal_legacyEepromAttach(struct ath_hal *ah);
126 HAL_STATUS ath_hal_v14EepromAttach(struct ath_hal *ah);
127 #endif /* _ATH_AH_EEPROM_H_ */