diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/eeprom.h')
-rw-r--r-- | drivers/net/wireless/ath5k/eeprom.h | 253 |
1 files changed, 216 insertions, 37 deletions
diff --git a/drivers/net/wireless/ath5k/eeprom.h b/drivers/net/wireless/ath5k/eeprom.h index a468ecfbb18a..09eb7d0176a4 100644 --- a/drivers/net/wireless/ath5k/eeprom.h +++ b/drivers/net/wireless/ath5k/eeprom.h | |||
@@ -25,24 +25,8 @@ | |||
25 | #define AR5K_EEPROM_MAGIC_5211 0x0000145b /* 5211 */ | 25 | #define AR5K_EEPROM_MAGIC_5211 0x0000145b /* 5211 */ |
26 | #define AR5K_EEPROM_MAGIC_5210 0x0000145a /* 5210 */ | 26 | #define AR5K_EEPROM_MAGIC_5210 0x0000145a /* 5210 */ |
27 | 27 | ||
28 | #define AR5K_EEPROM_PROTECT 0x003f /* EEPROM protect status */ | ||
29 | #define AR5K_EEPROM_PROTECT_RD_0_31 0x0001 /* Read protection bit for offsets 0x0 - 0x1f */ | ||
30 | #define AR5K_EEPROM_PROTECT_WR_0_31 0x0002 /* Write protection bit for offsets 0x0 - 0x1f */ | ||
31 | #define AR5K_EEPROM_PROTECT_RD_32_63 0x0004 /* 0x20 - 0x3f */ | ||
32 | #define AR5K_EEPROM_PROTECT_WR_32_63 0x0008 | ||
33 | #define AR5K_EEPROM_PROTECT_RD_64_127 0x0010 /* 0x40 - 0x7f */ | ||
34 | #define AR5K_EEPROM_PROTECT_WR_64_127 0x0020 | ||
35 | #define AR5K_EEPROM_PROTECT_RD_128_191 0x0040 /* 0x80 - 0xbf (regdom) */ | ||
36 | #define AR5K_EEPROM_PROTECT_WR_128_191 0x0080 | ||
37 | #define AR5K_EEPROM_PROTECT_RD_192_207 0x0100 /* 0xc0 - 0xcf */ | ||
38 | #define AR5K_EEPROM_PROTECT_WR_192_207 0x0200 | ||
39 | #define AR5K_EEPROM_PROTECT_RD_208_223 0x0400 /* 0xd0 - 0xdf */ | ||
40 | #define AR5K_EEPROM_PROTECT_WR_208_223 0x0800 | ||
41 | #define AR5K_EEPROM_PROTECT_RD_224_239 0x1000 /* 0xe0 - 0xef */ | ||
42 | #define AR5K_EEPROM_PROTECT_WR_224_239 0x2000 | ||
43 | #define AR5K_EEPROM_PROTECT_RD_240_255 0x4000 /* 0xf0 - 0xff */ | ||
44 | #define AR5K_EEPROM_PROTECT_WR_240_255 0x8000 | ||
45 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ | 28 | #define AR5K_EEPROM_REG_DOMAIN 0x00bf /* EEPROM regdom */ |
29 | #define AR5K_EEPROM_CHECKSUM 0x00c0 /* EEPROM checksum */ | ||
46 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ | 30 | #define AR5K_EEPROM_INFO_BASE 0x00c0 /* EEPROM header */ |
47 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) | 31 | #define AR5K_EEPROM_INFO_MAX (0x400 - AR5K_EEPROM_INFO_BASE) |
48 | #define AR5K_EEPROM_INFO_CKSUM 0xffff | 32 | #define AR5K_EEPROM_INFO_CKSUM 0xffff |
@@ -53,15 +37,19 @@ | |||
53 | #define AR5K_EEPROM_VERSION_3_1 0x3001 /* ob/db values for 2Ghz (ar5211_rfregs) */ | 37 | #define AR5K_EEPROM_VERSION_3_1 0x3001 /* ob/db values for 2Ghz (ar5211_rfregs) */ |
54 | #define AR5K_EEPROM_VERSION_3_2 0x3002 /* different frequency representation (eeprom_bin2freq) */ | 38 | #define AR5K_EEPROM_VERSION_3_2 0x3002 /* different frequency representation (eeprom_bin2freq) */ |
55 | #define AR5K_EEPROM_VERSION_3_3 0x3003 /* offsets changed, has 32 CTLs (see below) and ee_false_detect (eeprom_read_modes) */ | 39 | #define AR5K_EEPROM_VERSION_3_3 0x3003 /* offsets changed, has 32 CTLs (see below) and ee_false_detect (eeprom_read_modes) */ |
56 | #define AR5K_EEPROM_VERSION_3_4 0x3004 /* has ee_i_gain ee_cck_ofdm_power_delta (eeprom_read_modes) */ | 40 | #define AR5K_EEPROM_VERSION_3_4 0x3004 /* has ee_i_gain, ee_cck_ofdm_power_delta (eeprom_read_modes) */ |
57 | #define AR5K_EEPROM_VERSION_4_0 0x4000 /* has ee_misc*, ee_cal_pier, ee_turbo_max_power and ee_xr_power (eeprom_init) */ | 41 | #define AR5K_EEPROM_VERSION_4_0 0x4000 /* has ee_misc, ee_cal_pier, ee_turbo_max_power and ee_xr_power (eeprom_init) */ |
58 | #define AR5K_EEPROM_VERSION_4_1 0x4001 /* has ee_margin_tx_rx (eeprom_init) */ | 42 | #define AR5K_EEPROM_VERSION_4_1 0x4001 /* has ee_margin_tx_rx (eeprom_init) */ |
59 | #define AR5K_EEPROM_VERSION_4_2 0x4002 /* has ee_cck_ofdm_gain_delta (eeprom_init) */ | 43 | #define AR5K_EEPROM_VERSION_4_2 0x4002 /* has ee_cck_ofdm_gain_delta (eeprom_init) */ |
60 | #define AR5K_EEPROM_VERSION_4_3 0x4003 | 44 | #define AR5K_EEPROM_VERSION_4_3 0x4003 /* power calibration changes */ |
61 | #define AR5K_EEPROM_VERSION_4_4 0x4004 | 45 | #define AR5K_EEPROM_VERSION_4_4 0x4004 |
62 | #define AR5K_EEPROM_VERSION_4_5 0x4005 | 46 | #define AR5K_EEPROM_VERSION_4_5 0x4005 |
63 | #define AR5K_EEPROM_VERSION_4_6 0x4006 /* has ee_scaled_cck_delta */ | 47 | #define AR5K_EEPROM_VERSION_4_6 0x4006 /* has ee_scaled_cck_delta */ |
64 | #define AR5K_EEPROM_VERSION_4_7 0x4007 | 48 | #define AR5K_EEPROM_VERSION_4_7 0x3007 /* 4007 ? */ |
49 | #define AR5K_EEPROM_VERSION_4_9 0x4009 /* EAR futureproofing */ | ||
50 | #define AR5K_EEPROM_VERSION_5_0 0x5000 /* Has 2413 PDADC calibration etc */ | ||
51 | #define AR5K_EEPROM_VERSION_5_1 0x5001 /* Has capability values */ | ||
52 | #define AR5K_EEPROM_VERSION_5_3 0x5003 /* Has spur mitigation tables */ | ||
65 | 53 | ||
66 | #define AR5K_EEPROM_MODE_11A 0 | 54 | #define AR5K_EEPROM_MODE_11A 0 |
67 | #define AR5K_EEPROM_MODE_11B 1 | 55 | #define AR5K_EEPROM_MODE_11B 1 |
@@ -74,8 +62,8 @@ | |||
74 | #define AR5K_EEPROM_HDR_T_2GHZ_DIS(_v) (((_v) >> 3) & 0x1) /* Disable turbo for 2Ghz (?) */ | 62 | #define AR5K_EEPROM_HDR_T_2GHZ_DIS(_v) (((_v) >> 3) & 0x1) /* Disable turbo for 2Ghz (?) */ |
75 | #define AR5K_EEPROM_HDR_T_5GHZ_DBM(_v) (((_v) >> 4) & 0x7f) /* Max turbo power for a/XR mode (eeprom_init) */ | 63 | #define AR5K_EEPROM_HDR_T_5GHZ_DBM(_v) (((_v) >> 4) & 0x7f) /* Max turbo power for a/XR mode (eeprom_init) */ |
76 | #define AR5K_EEPROM_HDR_DEVICE(_v) (((_v) >> 11) & 0x7) | 64 | #define AR5K_EEPROM_HDR_DEVICE(_v) (((_v) >> 11) & 0x7) |
77 | #define AR5K_EEPROM_HDR_T_5GHZ_DIS(_v) (((_v) >> 15) & 0x1) /* Disable turbo for 5Ghz (?) */ | ||
78 | #define AR5K_EEPROM_HDR_RFKILL(_v) (((_v) >> 14) & 0x1) /* Device has RFKill support */ | 65 | #define AR5K_EEPROM_HDR_RFKILL(_v) (((_v) >> 14) & 0x1) /* Device has RFKill support */ |
66 | #define AR5K_EEPROM_HDR_T_5GHZ_DIS(_v) (((_v) >> 15) & 0x1) /* Disable turbo for 5Ghz */ | ||
79 | 67 | ||
80 | #define AR5K_EEPROM_RFKILL_GPIO_SEL 0x0000001c | 68 | #define AR5K_EEPROM_RFKILL_GPIO_SEL 0x0000001c |
81 | #define AR5K_EEPROM_RFKILL_GPIO_SEL_S 2 | 69 | #define AR5K_EEPROM_RFKILL_GPIO_SEL_S 2 |
@@ -87,27 +75,95 @@ | |||
87 | (((_v) >= AR5K_EEPROM_VERSION_3_3) ? _v3_3 : _v3_0) | 75 | (((_v) >= AR5K_EEPROM_VERSION_3_3) ? _v3_3 : _v3_0) |
88 | 76 | ||
89 | #define AR5K_EEPROM_ANT_GAIN(_v) AR5K_EEPROM_OFF(_v, 0x00c4, 0x00c3) | 77 | #define AR5K_EEPROM_ANT_GAIN(_v) AR5K_EEPROM_OFF(_v, 0x00c4, 0x00c3) |
90 | #define AR5K_EEPROM_ANT_GAIN_5GHZ(_v) ((int8_t)(((_v) >> 8) & 0xff)) | 78 | #define AR5K_EEPROM_ANT_GAIN_5GHZ(_v) ((s8)(((_v) >> 8) & 0xff)) |
91 | #define AR5K_EEPROM_ANT_GAIN_2GHZ(_v) ((int8_t)((_v) & 0xff)) | 79 | #define AR5K_EEPROM_ANT_GAIN_2GHZ(_v) ((s8)((_v) & 0xff)) |
80 | |||
81 | /* Misc values available since EEPROM 4.0 */ | ||
82 | #define AR5K_EEPROM_MISC0 AR5K_EEPROM_INFO(4) | ||
83 | #define AR5K_EEPROM_EARSTART(_v) ((_v) & 0xfff) | ||
84 | #define AR5K_EEPROM_HDR_XR2_DIS(_v) (((_v) >> 12) & 0x1) | ||
85 | #define AR5K_EEPROM_HDR_XR5_DIS(_v) (((_v) >> 13) & 0x1) | ||
86 | #define AR5K_EEPROM_EEMAP(_v) (((_v) >> 14) & 0x3) | ||
87 | |||
88 | #define AR5K_EEPROM_MISC1 AR5K_EEPROM_INFO(5) | ||
89 | #define AR5K_EEPROM_TARGET_PWRSTART(_v) ((_v) & 0xfff) | ||
90 | #define AR5K_EEPROM_HAS32KHZCRYSTAL(_v) (((_v) >> 14) & 0x1) | ||
91 | #define AR5K_EEPROM_HAS32KHZCRYSTAL_OLD(_v) (((_v) >> 15) & 0x1) | ||
92 | |||
93 | #define AR5K_EEPROM_MISC2 AR5K_EEPROM_INFO(6) | ||
94 | #define AR5K_EEPROM_EEP_FILE_VERSION(_v) (((_v) >> 8) & 0xff) | ||
95 | #define AR5K_EEPROM_EAR_FILE_VERSION(_v) ((_v) & 0xff) | ||
96 | |||
97 | #define AR5K_EEPROM_MISC3 AR5K_EEPROM_INFO(7) | ||
98 | #define AR5K_EEPROM_ART_BUILD_NUM(_v) (((_v) >> 10) & 0x3f) | ||
99 | #define AR5K_EEPROM_EAR_FILE_ID(_v) ((_v) & 0xff) | ||
100 | |||
101 | #define AR5K_EEPROM_MISC4 AR5K_EEPROM_INFO(8) | ||
102 | #define AR5K_EEPROM_CAL_DATA_START(_v) (((_v) >> 4) & 0xfff) | ||
103 | #define AR5K_EEPROM_MASK_R0(_v) (((_v) >> 2) & 0x3) | ||
104 | #define AR5K_EEPROM_MASK_R1(_v) ((_v) & 0x3) | ||
105 | |||
106 | #define AR5K_EEPROM_MISC5 AR5K_EEPROM_INFO(9) | ||
107 | #define AR5K_EEPROM_COMP_DIS(_v) ((_v) & 0x1) | ||
108 | #define AR5K_EEPROM_AES_DIS(_v) (((_v) >> 1) & 0x1) | ||
109 | #define AR5K_EEPROM_FF_DIS(_v) (((_v) >> 2) & 0x1) | ||
110 | #define AR5K_EEPROM_BURST_DIS(_v) (((_v) >> 3) & 0x1) | ||
111 | #define AR5K_EEPROM_MAX_QCU(_v) (((_v) >> 4) & 0xf) | ||
112 | #define AR5K_EEPROM_HEAVY_CLIP_EN(_v) (((_v) >> 8) & 0x1) | ||
113 | #define AR5K_EEPROM_KEY_CACHE_SIZE(_v) (((_v) >> 12) & 0xf) | ||
114 | |||
115 | #define AR5K_EEPROM_MISC6 AR5K_EEPROM_INFO(10) | ||
116 | #define AR5K_EEPROM_TX_CHAIN_DIS ((_v) & 0x8) | ||
117 | #define AR5K_EEPROM_RX_CHAIN_DIS (((_v) >> 3) & 0x8) | ||
118 | #define AR5K_EEPROM_FCC_MID_EN (((_v) >> 6) & 0x1) | ||
119 | #define AR5K_EEPROM_JAP_U1EVEN_EN (((_v) >> 7) & 0x1) | ||
120 | #define AR5K_EEPROM_JAP_U2_EN (((_v) >> 8) & 0x1) | ||
121 | #define AR5K_EEPROM_JAP_U1ODD_EN (((_v) >> 9) & 0x1) | ||
122 | #define AR5K_EEPROM_JAP_11A_NEW_EN (((_v) >> 10) & 0x1) | ||
92 | 123 | ||
93 | /* calibration settings */ | 124 | /* calibration settings */ |
94 | #define AR5K_EEPROM_MODES_11A(_v) AR5K_EEPROM_OFF(_v, 0x00c5, 0x00d4) | 125 | #define AR5K_EEPROM_MODES_11A(_v) AR5K_EEPROM_OFF(_v, 0x00c5, 0x00d4) |
95 | #define AR5K_EEPROM_MODES_11B(_v) AR5K_EEPROM_OFF(_v, 0x00d0, 0x00f2) | 126 | #define AR5K_EEPROM_MODES_11B(_v) AR5K_EEPROM_OFF(_v, 0x00d0, 0x00f2) |
96 | #define AR5K_EEPROM_MODES_11G(_v) AR5K_EEPROM_OFF(_v, 0x00da, 0x010d) | 127 | #define AR5K_EEPROM_MODES_11G(_v) AR5K_EEPROM_OFF(_v, 0x00da, 0x010d) |
97 | #define AR5K_EEPROM_CTL(_v) AR5K_EEPROM_OFF(_v, 0x00e4, 0x0128) /* Conformance test limits */ | 128 | #define AR5K_EEPROM_CTL(_v) AR5K_EEPROM_OFF(_v, 0x00e4, 0x0128) /* Conformance test limits */ |
129 | #define AR5K_EEPROM_GROUPS_START(_v) AR5K_EEPROM_OFF(_v, 0x0100, 0x0150) /* Start of Groups */ | ||
130 | #define AR5K_EEPROM_GROUP1_OFFSET 0x0 | ||
131 | #define AR5K_EEPROM_GROUP2_OFFSET 0x5 | ||
132 | #define AR5K_EEPROM_GROUP3_OFFSET 0x37 | ||
133 | #define AR5K_EEPROM_GROUP4_OFFSET 0x46 | ||
134 | #define AR5K_EEPROM_GROUP5_OFFSET 0x55 | ||
135 | #define AR5K_EEPROM_GROUP6_OFFSET 0x65 | ||
136 | #define AR5K_EEPROM_GROUP7_OFFSET 0x69 | ||
137 | #define AR5K_EEPROM_GROUP8_OFFSET 0x6f | ||
138 | |||
139 | #define AR5K_EEPROM_TARGET_PWR_OFF_11A(_v) AR5K_EEPROM_OFF(_v, AR5K_EEPROM_GROUPS_START(_v) + \ | ||
140 | AR5K_EEPROM_GROUP5_OFFSET, 0x0000) | ||
141 | #define AR5K_EEPROM_TARGET_PWR_OFF_11B(_v) AR5K_EEPROM_OFF(_v, AR5K_EEPROM_GROUPS_START(_v) + \ | ||
142 | AR5K_EEPROM_GROUP6_OFFSET, 0x0010) | ||
143 | #define AR5K_EEPROM_TARGET_PWR_OFF_11G(_v) AR5K_EEPROM_OFF(_v, AR5K_EEPROM_GROUPS_START(_v) + \ | ||
144 | AR5K_EEPROM_GROUP7_OFFSET, 0x0014) | ||
98 | 145 | ||
99 | /* [3.1 - 3.3] */ | 146 | /* [3.1 - 3.3] */ |
100 | #define AR5K_EEPROM_OBDB0_2GHZ 0x00ec | 147 | #define AR5K_EEPROM_OBDB0_2GHZ 0x00ec |
101 | #define AR5K_EEPROM_OBDB1_2GHZ 0x00ed | 148 | #define AR5K_EEPROM_OBDB1_2GHZ 0x00ed |
102 | 149 | ||
103 | /* Misc values available since EEPROM 4.0 */ | 150 | #define AR5K_EEPROM_PROTECT 0x003f /* EEPROM protect status */ |
104 | #define AR5K_EEPROM_MISC0 0x00c4 | 151 | #define AR5K_EEPROM_PROTECT_RD_0_31 0x0001 /* Read protection bit for offsets 0x0 - 0x1f */ |
105 | #define AR5K_EEPROM_EARSTART(_v) ((_v) & 0xfff) | 152 | #define AR5K_EEPROM_PROTECT_WR_0_31 0x0002 /* Write protection bit for offsets 0x0 - 0x1f */ |
106 | #define AR5K_EEPROM_EEMAP(_v) (((_v) >> 14) & 0x3) | 153 | #define AR5K_EEPROM_PROTECT_RD_32_63 0x0004 /* 0x20 - 0x3f */ |
107 | #define AR5K_EEPROM_MISC1 0x00c5 | 154 | #define AR5K_EEPROM_PROTECT_WR_32_63 0x0008 |
108 | #define AR5K_EEPROM_TARGET_PWRSTART(_v) ((_v) & 0xfff) | 155 | #define AR5K_EEPROM_PROTECT_RD_64_127 0x0010 /* 0x40 - 0x7f */ |
109 | #define AR5K_EEPROM_HAS32KHZCRYSTAL(_v) (((_v) >> 14) & 0x1) | 156 | #define AR5K_EEPROM_PROTECT_WR_64_127 0x0020 |
110 | 157 | #define AR5K_EEPROM_PROTECT_RD_128_191 0x0040 /* 0x80 - 0xbf (regdom) */ | |
158 | #define AR5K_EEPROM_PROTECT_WR_128_191 0x0080 | ||
159 | #define AR5K_EEPROM_PROTECT_RD_192_207 0x0100 /* 0xc0 - 0xcf */ | ||
160 | #define AR5K_EEPROM_PROTECT_WR_192_207 0x0200 | ||
161 | #define AR5K_EEPROM_PROTECT_RD_208_223 0x0400 /* 0xd0 - 0xdf */ | ||
162 | #define AR5K_EEPROM_PROTECT_WR_208_223 0x0800 | ||
163 | #define AR5K_EEPROM_PROTECT_RD_224_239 0x1000 /* 0xe0 - 0xef */ | ||
164 | #define AR5K_EEPROM_PROTECT_WR_224_239 0x2000 | ||
165 | #define AR5K_EEPROM_PROTECT_RD_240_255 0x4000 /* 0xf0 - 0xff */ | ||
166 | #define AR5K_EEPROM_PROTECT_WR_240_255 0x8000 | ||
111 | 167 | ||
112 | /* Some EEPROM defines */ | 168 | /* Some EEPROM defines */ |
113 | #define AR5K_EEPROM_EEP_SCALE 100 | 169 | #define AR5K_EEPROM_EEP_SCALE 100 |
@@ -115,8 +171,11 @@ | |||
115 | #define AR5K_EEPROM_N_MODES 3 | 171 | #define AR5K_EEPROM_N_MODES 3 |
116 | #define AR5K_EEPROM_N_5GHZ_CHAN 10 | 172 | #define AR5K_EEPROM_N_5GHZ_CHAN 10 |
117 | #define AR5K_EEPROM_N_2GHZ_CHAN 3 | 173 | #define AR5K_EEPROM_N_2GHZ_CHAN 3 |
174 | #define AR5K_EEPROM_N_2GHZ_CHAN_2413 4 | ||
118 | #define AR5K_EEPROM_MAX_CHAN 10 | 175 | #define AR5K_EEPROM_MAX_CHAN 10 |
176 | #define AR5K_EEPROM_N_PWR_POINTS_5111 11 | ||
119 | #define AR5K_EEPROM_N_PCDAC 11 | 177 | #define AR5K_EEPROM_N_PCDAC 11 |
178 | #define AR5K_EEPROM_N_PHASE_CAL 5 | ||
120 | #define AR5K_EEPROM_N_TEST_FREQ 8 | 179 | #define AR5K_EEPROM_N_TEST_FREQ 8 |
121 | #define AR5K_EEPROM_N_EDGES 8 | 180 | #define AR5K_EEPROM_N_EDGES 8 |
122 | #define AR5K_EEPROM_N_INTERCEPTS 11 | 181 | #define AR5K_EEPROM_N_INTERCEPTS 11 |
@@ -136,6 +195,8 @@ | |||
136 | #define AR5K_EEPROM_N_XPD_PER_CHANNEL 4 | 195 | #define AR5K_EEPROM_N_XPD_PER_CHANNEL 4 |
137 | #define AR5K_EEPROM_N_XPD0_POINTS 4 | 196 | #define AR5K_EEPROM_N_XPD0_POINTS 4 |
138 | #define AR5K_EEPROM_N_XPD3_POINTS 3 | 197 | #define AR5K_EEPROM_N_XPD3_POINTS 3 |
198 | #define AR5K_EEPROM_N_PD_GAINS 4 | ||
199 | #define AR5K_EEPROM_N_PD_POINTS 5 | ||
139 | #define AR5K_EEPROM_N_INTERCEPT_10_2GHZ 35 | 200 | #define AR5K_EEPROM_N_INTERCEPT_10_2GHZ 35 |
140 | #define AR5K_EEPROM_N_INTERCEPT_10_5GHZ 55 | 201 | #define AR5K_EEPROM_N_INTERCEPT_10_5GHZ 55 |
141 | #define AR5K_EEPROM_POWER_M 0x3f | 202 | #define AR5K_EEPROM_POWER_M 0x3f |
@@ -158,8 +219,99 @@ | |||
158 | #define AR5K_EEPROM_READ_HDR(_o, _v) \ | 219 | #define AR5K_EEPROM_READ_HDR(_o, _v) \ |
159 | AR5K_EEPROM_READ(_o, ah->ah_capabilities.cap_eeprom._v); \ | 220 | AR5K_EEPROM_READ(_o, ah->ah_capabilities.cap_eeprom._v); \ |
160 | 221 | ||
161 | /* Struct to hold EEPROM calibration data */ | 222 | enum ath5k_ant_setting { |
223 | AR5K_ANT_VARIABLE = 0, /* variable by programming */ | ||
224 | AR5K_ANT_FIXED_A = 1, /* fixed to 11a frequencies */ | ||
225 | AR5K_ANT_FIXED_B = 2, /* fixed to 11b frequencies */ | ||
226 | AR5K_ANT_MAX = 3, | ||
227 | }; | ||
228 | |||
229 | enum ath5k_ctl_mode { | ||
230 | AR5K_CTL_11A = 0, | ||
231 | AR5K_CTL_11B = 1, | ||
232 | AR5K_CTL_11G = 2, | ||
233 | AR5K_CTL_TURBO = 3, | ||
234 | AR5K_CTL_108G = 4, | ||
235 | AR5K_CTL_2GHT20 = 5, | ||
236 | AR5K_CTL_5GHT20 = 6, | ||
237 | AR5K_CTL_2GHT40 = 7, | ||
238 | AR5K_CTL_5GHT40 = 8, | ||
239 | AR5K_CTL_MODE_M = 15, | ||
240 | }; | ||
241 | |||
242 | /* Per channel calibration data, used for power table setup */ | ||
243 | struct ath5k_chan_pcal_info_rf5111 { | ||
244 | /* Power levels in half dbm units | ||
245 | * for one power curve. */ | ||
246 | u8 pwr[AR5K_EEPROM_N_PWR_POINTS_5111]; | ||
247 | /* PCDAC table steps | ||
248 | * for the above values */ | ||
249 | u8 pcdac[AR5K_EEPROM_N_PWR_POINTS_5111]; | ||
250 | /* Starting PCDAC step */ | ||
251 | u8 pcdac_min; | ||
252 | /* Final PCDAC step */ | ||
253 | u8 pcdac_max; | ||
254 | }; | ||
255 | |||
256 | struct ath5k_chan_pcal_info_rf5112 { | ||
257 | /* Power levels in quarter dBm units | ||
258 | * for lower (0) and higher (3) | ||
259 | * level curves */ | ||
260 | s8 pwr_x0[AR5K_EEPROM_N_XPD0_POINTS]; | ||
261 | s8 pwr_x3[AR5K_EEPROM_N_XPD3_POINTS]; | ||
262 | /* PCDAC table steps | ||
263 | * for the above values */ | ||
264 | u8 pcdac_x0[AR5K_EEPROM_N_XPD0_POINTS]; | ||
265 | u8 pcdac_x3[AR5K_EEPROM_N_XPD3_POINTS]; | ||
266 | }; | ||
267 | |||
268 | struct ath5k_chan_pcal_info_rf2413 { | ||
269 | /* Starting pwr/pddac values */ | ||
270 | s8 pwr_i[AR5K_EEPROM_N_PD_GAINS]; | ||
271 | u8 pddac_i[AR5K_EEPROM_N_PD_GAINS]; | ||
272 | /* (pwr,pddac) points */ | ||
273 | s8 pwr[AR5K_EEPROM_N_PD_GAINS] | ||
274 | [AR5K_EEPROM_N_PD_POINTS]; | ||
275 | u8 pddac[AR5K_EEPROM_N_PD_GAINS] | ||
276 | [AR5K_EEPROM_N_PD_POINTS]; | ||
277 | }; | ||
278 | |||
279 | struct ath5k_chan_pcal_info { | ||
280 | /* Frequency */ | ||
281 | u16 freq; | ||
282 | /* Max available power */ | ||
283 | s8 max_pwr; | ||
284 | union { | ||
285 | struct ath5k_chan_pcal_info_rf5111 rf5111_info; | ||
286 | struct ath5k_chan_pcal_info_rf5112 rf5112_info; | ||
287 | struct ath5k_chan_pcal_info_rf2413 rf2413_info; | ||
288 | }; | ||
289 | }; | ||
290 | |||
291 | /* Per rate calibration data for each mode, used for power table setup */ | ||
292 | struct ath5k_rate_pcal_info { | ||
293 | u16 freq; /* Frequency */ | ||
294 | /* Power level for 6-24Mbit/s rates */ | ||
295 | u16 target_power_6to24; | ||
296 | /* Power level for 36Mbit rate */ | ||
297 | u16 target_power_36; | ||
298 | /* Power level for 48Mbit rate */ | ||
299 | u16 target_power_48; | ||
300 | /* Power level for 54Mbit rate */ | ||
301 | u16 target_power_54; | ||
302 | }; | ||
303 | |||
304 | /* Power edges for conformance test limits */ | ||
305 | struct ath5k_edge_power { | ||
306 | u16 freq; | ||
307 | u16 edge; /* in half dBm */ | ||
308 | bool flag; | ||
309 | }; | ||
310 | |||
311 | /* EEPROM calibration data */ | ||
162 | struct ath5k_eeprom_info { | 312 | struct ath5k_eeprom_info { |
313 | |||
314 | /* Header information */ | ||
163 | u16 ee_magic; | 315 | u16 ee_magic; |
164 | u16 ee_protect; | 316 | u16 ee_protect; |
165 | u16 ee_regdomain; | 317 | u16 ee_regdomain; |
@@ -168,6 +320,11 @@ struct ath5k_eeprom_info { | |||
168 | u16 ee_ant_gain; | 320 | u16 ee_ant_gain; |
169 | u16 ee_misc0; | 321 | u16 ee_misc0; |
170 | u16 ee_misc1; | 322 | u16 ee_misc1; |
323 | u16 ee_misc2; | ||
324 | u16 ee_misc3; | ||
325 | u16 ee_misc4; | ||
326 | u16 ee_misc5; | ||
327 | u16 ee_misc6; | ||
171 | u16 ee_cck_ofdm_gain_delta; | 328 | u16 ee_cck_ofdm_gain_delta; |
172 | u16 ee_cck_ofdm_power_delta; | 329 | u16 ee_cck_ofdm_power_delta; |
173 | u16 ee_scaled_cck_delta; | 330 | u16 ee_scaled_cck_delta; |
@@ -185,7 +342,7 @@ struct ath5k_eeprom_info { | |||
185 | u16 ee_turbo_max_power[AR5K_EEPROM_N_MODES]; | 342 | u16 ee_turbo_max_power[AR5K_EEPROM_N_MODES]; |
186 | u16 ee_xr_power[AR5K_EEPROM_N_MODES]; | 343 | u16 ee_xr_power[AR5K_EEPROM_N_MODES]; |
187 | u16 ee_switch_settling[AR5K_EEPROM_N_MODES]; | 344 | u16 ee_switch_settling[AR5K_EEPROM_N_MODES]; |
188 | u16 ee_ant_tx_rx[AR5K_EEPROM_N_MODES]; | 345 | u16 ee_atn_tx_rx[AR5K_EEPROM_N_MODES]; |
189 | u16 ee_ant_control[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_PCDAC]; | 346 | u16 ee_ant_control[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_PCDAC]; |
190 | u16 ee_ob[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]; | 347 | u16 ee_ob[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]; |
191 | u16 ee_db[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]; | 348 | u16 ee_db[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]; |
@@ -198,18 +355,40 @@ struct ath5k_eeprom_info { | |||
198 | u16 ee_x_gain[AR5K_EEPROM_N_MODES]; | 355 | u16 ee_x_gain[AR5K_EEPROM_N_MODES]; |
199 | u16 ee_i_gain[AR5K_EEPROM_N_MODES]; | 356 | u16 ee_i_gain[AR5K_EEPROM_N_MODES]; |
200 | u16 ee_margin_tx_rx[AR5K_EEPROM_N_MODES]; | 357 | u16 ee_margin_tx_rx[AR5K_EEPROM_N_MODES]; |
358 | u16 ee_switch_settling_turbo[AR5K_EEPROM_N_MODES]; | ||
359 | u16 ee_margin_tx_rx_turbo[AR5K_EEPROM_N_MODES]; | ||
360 | u16 ee_atn_tx_rx_turbo[AR5K_EEPROM_N_MODES]; | ||
201 | 361 | ||
202 | /* Unused */ | 362 | /* Power calibration data */ |
203 | u16 ee_false_detect[AR5K_EEPROM_N_MODES]; | 363 | u16 ee_false_detect[AR5K_EEPROM_N_MODES]; |
204 | u16 ee_cal_pier[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_2GHZ_CHAN]; | 364 | |
205 | u16 ee_channel[AR5K_EEPROM_N_MODES][AR5K_EEPROM_MAX_CHAN]; /*empty*/ | 365 | /* Number of pd gain curves per mode (RF2413) */ |
366 | u8 ee_pd_gains[AR5K_EEPROM_N_MODES]; | ||
367 | |||
368 | u8 ee_n_piers[AR5K_EEPROM_N_MODES]; | ||
369 | struct ath5k_chan_pcal_info ee_pwr_cal_a[AR5K_EEPROM_N_5GHZ_CHAN]; | ||
370 | struct ath5k_chan_pcal_info ee_pwr_cal_b[AR5K_EEPROM_N_2GHZ_CHAN]; | ||
371 | struct ath5k_chan_pcal_info ee_pwr_cal_g[AR5K_EEPROM_N_2GHZ_CHAN]; | ||
372 | |||
373 | /* Per rate target power levels */ | ||
374 | u16 ee_rate_target_pwr_num[AR5K_EEPROM_N_MODES]; | ||
375 | struct ath5k_rate_pcal_info ee_rate_tpwr_a[AR5K_EEPROM_N_5GHZ_CHAN]; | ||
376 | struct ath5k_rate_pcal_info ee_rate_tpwr_b[AR5K_EEPROM_N_2GHZ_CHAN]; | ||
377 | struct ath5k_rate_pcal_info ee_rate_tpwr_g[AR5K_EEPROM_N_2GHZ_CHAN]; | ||
206 | 378 | ||
207 | /* Conformance test limits (Unused) */ | 379 | /* Conformance test limits (Unused) */ |
208 | u16 ee_ctls; | 380 | u16 ee_ctls; |
209 | u16 ee_ctl[AR5K_EEPROM_MAX_CTLS]; | 381 | u16 ee_ctl[AR5K_EEPROM_MAX_CTLS]; |
382 | struct ath5k_edge_power ee_ctl_pwr[AR5K_EEPROM_N_EDGES * AR5K_EEPROM_MAX_CTLS]; | ||
210 | 383 | ||
211 | /* Noise Floor Calibration settings */ | 384 | /* Noise Floor Calibration settings */ |
212 | s16 ee_noise_floor_thr[AR5K_EEPROM_N_MODES]; | 385 | s16 ee_noise_floor_thr[AR5K_EEPROM_N_MODES]; |
213 | s8 ee_adc_desired_size[AR5K_EEPROM_N_MODES]; | 386 | s8 ee_adc_desired_size[AR5K_EEPROM_N_MODES]; |
214 | s8 ee_pga_desired_size[AR5K_EEPROM_N_MODES]; | 387 | s8 ee_pga_desired_size[AR5K_EEPROM_N_MODES]; |
388 | s8 ee_adc_desired_size_turbo[AR5K_EEPROM_N_MODES]; | ||
389 | s8 ee_pga_desired_size_turbo[AR5K_EEPROM_N_MODES]; | ||
390 | s8 ee_pd_gain_overlap; | ||
391 | |||
392 | u32 ee_antenna[AR5K_EEPROM_N_MODES][AR5K_ANT_MAX]; | ||
215 | }; | 393 | }; |
394 | |||