if_otusreg.h revision 1.3 1 1.3 christos /* $NetBSD: if_otusreg.h,v 1.3 2012/08/19 07:55:54 christos Exp $ */
2 1.1 christos /* $OpenBSD: if_otusreg.h,v 1.6 2009/04/06 18:17:01 damien Exp $ */
3 1.1 christos
4 1.1 christos /*-
5 1.1 christos * Copyright (c) 2009 Damien Bergamini <damien.bergamini (at) free.fr>
6 1.1 christos * Copyright (c) 2007-2008 Atheros Communications, Inc.
7 1.1 christos *
8 1.1 christos * Permission to use, copy, modify, and distribute this software for any
9 1.1 christos * purpose with or without fee is hereby granted, provided that the above
10 1.1 christos * copyright notice and this permission notice appear in all copies.
11 1.1 christos *
12 1.1 christos * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 1.1 christos * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 1.1 christos * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 1.1 christos * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 1.1 christos * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 1.1 christos * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 1.1 christos * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 1.1 christos */
20 1.3 christos #ifndef _IF_OTUSREG_H_
21 1.3 christos #define _IF_OTUSREG_H_
22 1.1 christos
23 1.1 christos /* USB Endpoints addresses. */
24 1.1 christos #define AR_EPT_BULK_TX_NO (UE_DIR_OUT | 1)
25 1.1 christos #define AR_EPT_BULK_RX_NO (UE_DIR_IN | 2)
26 1.1 christos #define AR_EPT_INTR_RX_NO (UE_DIR_IN | 3)
27 1.1 christos #define AR_EPT_INTR_TX_NO (UE_DIR_OUT | 4)
28 1.1 christos
29 1.1 christos /* USB Requests. */
30 1.1 christos #define AR_FW_DOWNLOAD 0x30
31 1.1 christos #define AR_FW_DOWNLOAD_COMPLETE 0x31
32 1.1 christos
33 1.1 christos /* Maximum number of writes that can fit in a single FW command is 7. */
34 1.2 christos #define AR_FW_MAX_WRITES 7 /* 56 bytes */
35 1.1 christos
36 1.1 christos #define AR_FW_INIT_ADDR 0x102800
37 1.1 christos #define AR_FW_MAIN_ADDR 0x200000
38 1.1 christos #define AR_USB_MODE_CTRL 0x1e1108
39 1.1 christos
40 1.1 christos /*
41 1.1 christos * AR9170 MAC registers.
42 1.1 christos */
43 1.1 christos #define AR_MAC_REG_BASE 0x1c3000
44 1.1 christos #define AR_MAC_REG_MAC_ADDR_L (AR_MAC_REG_BASE + 0x610)
45 1.1 christos #define AR_MAC_REG_MAC_ADDR_H (AR_MAC_REG_BASE + 0x614)
46 1.1 christos #define AR_MAC_REG_BSSID_L (AR_MAC_REG_BASE + 0x618)
47 1.1 christos #define AR_MAC_REG_BSSID_H (AR_MAC_REG_BASE + 0x61c)
48 1.1 christos #define AR_MAC_REG_GROUP_HASH_TBL_L (AR_MAC_REG_BASE + 0x624)
49 1.1 christos #define AR_MAC_REG_GROUP_HASH_TBL_H (AR_MAC_REG_BASE + 0x628)
50 1.1 christos #define AR_MAC_REG_BASIC_RATE (AR_MAC_REG_BASE + 0x630)
51 1.1 christos #define AR_MAC_REG_MANDATORY_RATE (AR_MAC_REG_BASE + 0x634)
52 1.1 christos #define AR_MAC_REG_RTS_CTS_RATE (AR_MAC_REG_BASE + 0x638)
53 1.1 christos #define AR_MAC_REG_BACKOFF_PROTECT (AR_MAC_REG_BASE + 0x63c)
54 1.1 christos #define AR_MAC_REG_RX_THRESHOLD (AR_MAC_REG_BASE + 0x640)
55 1.1 christos #define AR_MAC_REG_RX_PE_DELAY (AR_MAC_REG_BASE + 0x64c)
56 1.1 christos #define AR_MAC_REG_DYNAMIC_SIFS_ACK (AR_MAC_REG_BASE + 0x658)
57 1.1 christos #define AR_MAC_REG_SNIFFER (AR_MAC_REG_BASE + 0x674)
58 1.1 christos #define AR_MAC_REG_ACK_EXTENSION (AR_MAC_REG_BASE + 0x690)
59 1.1 christos #define AR_MAC_REG_EIFS_AND_SIFS (AR_MAC_REG_BASE + 0x698)
60 1.1 christos #define AR_MAC_REG_BUSY (AR_MAC_REG_BASE + 0x6e8)
61 1.1 christos #define AR_MAC_REG_BUSY_EXT (AR_MAC_REG_BASE + 0x6ec)
62 1.1 christos #define AR_MAC_REG_SLOT_TIME (AR_MAC_REG_BASE + 0x6f0)
63 1.1 christos #define AR_MAC_REG_AC0_CW (AR_MAC_REG_BASE + 0xb00)
64 1.1 christos #define AR_MAC_REG_AC1_CW (AR_MAC_REG_BASE + 0xb04)
65 1.1 christos #define AR_MAC_REG_AC2_CW (AR_MAC_REG_BASE + 0xb08)
66 1.1 christos #define AR_MAC_REG_AC3_CW (AR_MAC_REG_BASE + 0xb0c)
67 1.1 christos #define AR_MAC_REG_AC4_CW (AR_MAC_REG_BASE + 0xb10)
68 1.1 christos #define AR_MAC_REG_AC1_AC0_AIFS (AR_MAC_REG_BASE + 0xb14)
69 1.1 christos #define AR_MAC_REG_AC3_AC2_AIFS (AR_MAC_REG_BASE + 0xb18)
70 1.1 christos #define AR_MAC_REG_RETRY_MAX (AR_MAC_REG_BASE + 0xb28)
71 1.1 christos #define AR_MAC_REG_TXOP_NOT_ENOUGH_INDICATION \
72 1.1 christos (AR_MAC_REG_BASE + 0xb30)
73 1.1 christos #define AR_MAC_REG_AC1_AC0_TXOP (AR_MAC_REG_BASE + 0xb44)
74 1.1 christos #define AR_MAC_REG_AC3_AC2_TXOP (AR_MAC_REG_BASE + 0xb48)
75 1.1 christos #define AR_MAC_REG_OFDM_PHY_ERRORS (AR_MAC_REG_BASE + 0xcb4)
76 1.1 christos #define AR_MAC_REG_CCK_PHY_ERRORS (AR_MAC_REG_BASE + 0xcb8)
77 1.1 christos #define AR_MAC_REG_BCN_HT1 (AR_MAC_REG_BASE + 0xda0)
78 1.1 christos
79 1.1 christos /* Possible values for register AR_USB_MODE_CTRL. */
80 1.1 christos #define AR_USB_DS_ENA (1 << 0)
81 1.1 christos #define AR_USB_US_ENA (1 << 1)
82 1.1 christos #define AR_USB_US_PACKET_MODE (1 << 3)
83 1.1 christos #define AR_USB_RX_STREAM_4K (0 << 4)
84 1.1 christos #define AR_USB_RX_STREAM_8K (1 << 4)
85 1.1 christos #define AR_USB_RX_STREAM_16K (2 << 4)
86 1.1 christos #define AR_USB_RX_STREAM_32K (3 << 4)
87 1.1 christos #define AR_USB_TX_STREAM_MODE (1 << 6)
88 1.1 christos
89 1.1 christos #define AR_LED0_ON (1 << 0)
90 1.1 christos #define AR_LED1_ON (1 << 1)
91 1.1 christos
92 1.1 christos /*
93 1.1 christos * PHY registers.
94 1.1 christos */
95 1.1 christos #define AR_PHY_BASE 0x1c5800
96 1.1 christos #define AR_PHY(reg) (AR_PHY_BASE + (reg) * 4)
97 1.1 christos #define AR_PHY_TURBO (AR_PHY_BASE + 0x0004)
98 1.1 christos #define AR_PHY_RF_CTL3 (AR_PHY_BASE + 0x0028)
99 1.1 christos #define AR_PHY_RF_CTL4 (AR_PHY_BASE + 0x0034)
100 1.1 christos #define AR_PHY_SETTLING (AR_PHY_BASE + 0x0044)
101 1.1 christos #define AR_PHY_RXGAIN (AR_PHY_BASE + 0x0048)
102 1.1 christos #define AR_PHY_DESIRED_SZ (AR_PHY_BASE + 0x0050)
103 1.1 christos #define AR_PHY_FIND_SIG (AR_PHY_BASE + 0x0058)
104 1.1 christos #define AR_PHY_AGC_CTL1 (AR_PHY_BASE + 0x005c)
105 1.1 christos #define AR_PHY_SFCORR (AR_PHY_BASE + 0x0068)
106 1.1 christos #define AR_PHY_SFCORR_LOW (AR_PHY_BASE + 0x006c)
107 1.1 christos #define AR_PHY_TIMING_CTRL4 (AR_PHY_BASE + 0x0120)
108 1.1 christos #define AR_PHY_TIMING5 (AR_PHY_BASE + 0x0124)
109 1.1 christos #define AR_PHY_POWER_TX_RATE1 (AR_PHY_BASE + 0x0134)
110 1.1 christos #define AR_PHY_POWER_TX_RATE2 (AR_PHY_BASE + 0x0138)
111 1.1 christos #define AR_PHY_POWER_TX_RATE_MAX (AR_PHY_BASE + 0x013c)
112 1.1 christos #define AR_PHY_SWITCH_CHAIN_0 (AR_PHY_BASE + 0x0160)
113 1.1 christos #define AR_PHY_SWITCH_COM (AR_PHY_BASE + 0x0164)
114 1.1 christos #define AR_PHY_HEAVY_CLIP_ENABLE (AR_PHY_BASE + 0x01e0)
115 1.1 christos #define AR_PHY_CCK_DETECT (AR_PHY_BASE + 0x0a08)
116 1.1 christos #define AR_PHY_GAIN_2GHZ (AR_PHY_BASE + 0x0a0c)
117 1.1 christos #define AR_PHY_POWER_TX_RATE3 (AR_PHY_BASE + 0x0a34)
118 1.1 christos #define AR_PHY_POWER_TX_RATE4 (AR_PHY_BASE + 0x0a38)
119 1.1 christos #define AR_PHY_TPCRG1 (AR_PHY_BASE + 0x0a58)
120 1.1 christos #define AR_PHY_POWER_TX_RATE5 (AR_PHY_BASE + 0x0b8c)
121 1.1 christos #define AR_PHY_POWER_TX_RATE6 (AR_PHY_BASE + 0x0b90)
122 1.1 christos #define AR_PHY_POWER_TX_RATE7 (AR_PHY_BASE + 0x0bcc)
123 1.1 christos #define AR_PHY_POWER_TX_RATE8 (AR_PHY_BASE + 0x0bd0)
124 1.1 christos #define AR_PHY_POWER_TX_RATE9 (AR_PHY_BASE + 0x0bd4)
125 1.1 christos #define AR_PHY_CCA (AR_PHY_BASE + 0x3064)
126 1.1 christos
127 1.1 christos #define AR_SEEPROM_HW_TYPE_OFFSET 0x1374
128 1.1 christos #define AR_EEPROM_OFFSET 0x1600
129 1.1 christos
130 1.1 christos #define AR_BANK4_CHUP (1 << 0)
131 1.1 christos #define AR_BANK4_BMODE_LF_SYNTH_FREQ (1 << 1)
132 1.1 christos #define AR_BANK4_AMODE_REFSEL(x) ((x) << 2)
133 1.1 christos #define AR_BANK4_ADDR(x) ((x) << 5)
134 1.1 christos
135 1.1 christos /* Tx descriptor. */
136 1.1 christos struct ar_tx_head {
137 1.1 christos uint16_t len;
138 1.1 christos uint16_t macctl;
139 1.1 christos #define AR_TX_MAC_RTS (1 << 0)
140 1.1 christos #define AR_TX_MAC_CTS (1 << 1)
141 1.1 christos #define AR_TX_MAC_BACKOFF (1 << 3)
142 1.1 christos #define AR_TX_MAC_NOACK (1 << 2)
143 1.1 christos #define AR_TX_MAC_HW_DUR (1 << 9)
144 1.1 christos #define AR_TX_MAC_QID(qid) ((qid) << 10)
145 1.1 christos #define AR_TX_MAC_RATE_PROBING (1 << 15)
146 1.1 christos
147 1.1 christos uint32_t phyctl;
148 1.1 christos /* Modulation type. */
149 1.1 christos #define AR_TX_PHY_MT_CCK 0
150 1.1 christos #define AR_TX_PHY_MT_OFDM 1
151 1.1 christos #define AR_TX_PHY_MT_HT 2
152 1.1 christos #define AR_TX_PHY_GF (1 << 2)
153 1.1 christos #define AR_TX_PHY_BW_SHIFT 3
154 1.1 christos #define AR_TX_PHY_TPC_SHIFT 9
155 1.1 christos #define AR_TX_PHY_ANTMSK(msk) ((msk) << 15)
156 1.1 christos #define AR_TX_PHY_MCS(mcs) ((mcs) << 18)
157 1.1 christos #define AR_TX_PHY_SHGI (1 << 31)
158 1.1 christos } __packed;
159 1.1 christos
160 1.1 christos /* USB Rx stream mode header. */
161 1.1 christos struct ar_rx_head {
162 1.1 christos uint16_t len;
163 1.1 christos uint16_t tag;
164 1.1 christos #define AR_RX_HEAD_TAG 0x4e00
165 1.1 christos } __packed;
166 1.1 christos
167 1.1 christos /* Rx descriptor. */
168 1.1 christos struct ar_rx_tail {
169 1.1 christos uint8_t rssi_ant[3];
170 1.1 christos uint8_t rssi_ant_ext[3];
171 1.1 christos uint8_t rssi; /* Combined RSSI. */
172 1.1 christos uint8_t evm[2][6]; /* Error Vector Magnitude. */
173 1.1 christos uint8_t phy_err;
174 1.1 christos uint8_t sa_idx;
175 1.1 christos uint8_t da_idx;
176 1.1 christos uint8_t error;
177 1.1 christos #define AR_RX_ERROR_TIMEOUT (1 << 0)
178 1.1 christos #define AR_RX_ERROR_OVERRUN (1 << 1)
179 1.1 christos #define AR_RX_ERROR_DECRYPT (1 << 2)
180 1.1 christos #define AR_RX_ERROR_FCS (1 << 3)
181 1.1 christos #define AR_RX_ERROR_BAD_RA (1 << 4)
182 1.1 christos #define AR_RX_ERROR_PLCP (1 << 5)
183 1.1 christos #define AR_RX_ERROR_MMIC (1 << 6)
184 1.1 christos
185 1.1 christos uint8_t status;
186 1.1 christos /* Modulation type (same as AR_TX_PHY_MT). */
187 1.1 christos #define AR_RX_STATUS_MT_MASK 0x3
188 1.1 christos #define AR_RX_STATUS_MT_CCK 0
189 1.1 christos #define AR_RX_STATUS_MT_OFDM 1
190 1.1 christos #define AR_RX_STATUS_MT_HT 2
191 1.1 christos #define AR_RX_STATUS_SHPREAMBLE (1 << 3)
192 1.1 christos } __packed;
193 1.1 christos
194 1.1 christos #define AR_PLCP_HDR_LEN 12
195 1.1 christos /* Magic PLCP header for firmware notifications through Rx bulk pipe. */
196 1.1 christos static uint8_t AR_PLCP_HDR_INTR[] = {
197 1.1 christos 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
198 1.1 christos 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
199 1.1 christos };
200 1.1 christos
201 1.1 christos /* Firmware command/reply header. */
202 1.1 christos struct ar_cmd_hdr {
203 1.1 christos uint8_t len;
204 1.1 christos uint8_t code;
205 1.1 christos #define AR_CMD_RREG 0x00
206 1.1 christos #define AR_CMD_WREG 0x01
207 1.1 christos #define AR_CMD_RMEM 0x02
208 1.1 christos #define AR_CMD_WMEM 0x03
209 1.1 christos #define AR_CMD_BITAND 0x04
210 1.1 christos #define AR_CMD_BITOR 0x05
211 1.1 christos #define AR_CMD_EKEY 0x28
212 1.1 christos #define AR_CMD_DKEY 0x29
213 1.1 christos #define AR_CMD_FREQUENCY 0x30
214 1.1 christos #define AR_CMD_RF_INIT 0x31
215 1.1 christos #define AR_CMD_SYNTH 0x32
216 1.1 christos #define AR_CMD_FREQ_STRAT 0x33
217 1.1 christos #define AR_CMD_ECHO 0x80
218 1.1 christos #define AR_CMD_TALLY 0x81
219 1.1 christos #define AR_CMD_TALLY_APD 0x82
220 1.1 christos #define AR_CMD_CONFIG 0x83
221 1.1 christos #define AR_CMD_RESET 0x90
222 1.1 christos #define AR_CMD_DKRESET 0x91
223 1.1 christos #define AR_CMD_DKTX_STATUS 0x92
224 1.1 christos #define AR_CMD_FDC 0xa0
225 1.1 christos #define AR_CMD_WREEPROM 0xb0
226 1.1 christos #define AR_CMD_WFLASH AR_CMD_WREEPROM
227 1.1 christos #define AR_CMD_FLASH_ERASE 0xb1
228 1.1 christos #define AR_CMD_FLASH_PROG 0xb2
229 1.1 christos #define AR_CMD_FLASH_CHKSUM 0xb3
230 1.1 christos #define AR_CMD_FLASH_READ 0xb4
231 1.1 christos #define AR_CMD_FW_DL_INIT 0xb5
232 1.1 christos #define AR_CMD_MEM_WREEPROM 0xbb
233 1.1 christos /* Those have the 2 MSB set to 1. */
234 1.1 christos #define AR_EVT_BEACON 0x00
235 1.1 christos #define AR_EVT_TX_COMP 0x01
236 1.1 christos #define AR_EVT_TBTT 0x02
237 1.1 christos #define AR_EVT_ATIM 0x03
238 1.1 christos
239 1.1 christos uint16_t token; /* Driver private data. */
240 1.1 christos } __packed;
241 1.1 christos
242 1.1 christos /* Structure for command AR_CMD_RF_INIT/AR_CMD_FREQUENCY. */
243 1.1 christos struct ar_cmd_frequency {
244 1.1 christos uint32_t freq;
245 1.1 christos uint32_t dynht2040;
246 1.1 christos uint32_t htena;
247 1.1 christos uint32_t dsc_exp;
248 1.1 christos uint32_t dsc_man;
249 1.1 christos uint32_t dsc_shgi_exp;
250 1.1 christos uint32_t dsc_shgi_man;
251 1.1 christos uint32_t check_loop_count;
252 1.1 christos } __packed;
253 1.1 christos
254 1.1 christos /* Firmware reply for command AR_CMD_FREQUENCY. */
255 1.1 christos struct ar_rsp_frequency {
256 1.1 christos uint32_t status;
257 1.1 christos #define AR_CAL_ERR_AGC (1 << 0) /* AGC cal unfinished. */
258 1.1 christos #define AR_CAL_ERR_NF (1 << 1) /* Noise cal unfinished. */
259 1.1 christos #define AR_CAL_ERR_NF_VAL (1 << 2) /* NF value unexpected. */
260 1.1 christos
261 1.1 christos uint32_t nf[3]; /* Noisefloor. */
262 1.1 christos uint32_t nf_ext[3]; /* Noisefloor ext. */
263 1.1 christos } __packed;
264 1.1 christos
265 1.1 christos /* Structure for command AR_CMD_EKEY. */
266 1.1 christos struct ar_cmd_ekey {
267 1.1 christos uint16_t uid; /* user ID */
268 1.1 christos uint16_t kix;
269 1.1 christos uint16_t cipher;
270 1.1 christos #define AR_CIPHER_NONE 0
271 1.1 christos #define AR_CIPHER_WEP64 1
272 1.1 christos #define AR_CIPHER_TKIP 2
273 1.1 christos #define AR_CIPHER_AES 4
274 1.1 christos #define AR_CIPHER_WEP128 5
275 1.1 christos #define AR_CIPHER_WEP256 6
276 1.1 christos #define AR_CIPHER_CENC 7
277 1.1 christos
278 1.1 christos uint8_t macaddr[IEEE80211_ADDR_LEN];
279 1.1 christos uint8_t key[16];
280 1.1 christos } __packed;
281 1.1 christos
282 1.1 christos /* Structure for event AR_EVT_TX_COMP. */
283 1.1 christos struct ar_evt_tx_comp {
284 1.1 christos uint8_t macaddr[IEEE80211_ADDR_LEN];
285 1.1 christos uint32_t phy;
286 1.1 christos uint16_t status;
287 1.1 christos #define AR_TX_STATUS_COMP 0
288 1.1 christos #define AR_TX_STATUS_RETRY_COMP 1
289 1.1 christos #define AR_TX_STATUS_FAILED 2
290 1.1 christos } __packed;
291 1.1 christos
292 1.1 christos /*
293 1.1 christos * EEPROM.
294 1.1 christos */
295 1.1 christos /* Possible flags for opCapFlags. */
296 1.1 christos #define AR5416_OPFLAGS_11A 0x01
297 1.1 christos #define AR5416_OPFLAGS_11G 0x02
298 1.1 christos #define AR5416_OPFLAGS_5G_HT40 0x04
299 1.1 christos #define AR5416_OPFLAGS_2G_HT40 0x08
300 1.1 christos #define AR5416_OPFLAGS_5G_HT20 0x10
301 1.1 christos #define AR5416_OPFLAGS_2G_HT20 0x20
302 1.1 christos
303 1.1 christos #define AR5416_NUM_5G_CAL_PIERS 8
304 1.1 christos #define AR5416_NUM_2G_CAL_PIERS 4
305 1.1 christos #define AR5416_NUM_5G_20_TARGET_POWERS 8
306 1.1 christos #define AR5416_NUM_5G_40_TARGET_POWERS 8
307 1.1 christos #define AR5416_NUM_2G_CCK_TARGET_POWERS 3
308 1.1 christos #define AR5416_NUM_2G_20_TARGET_POWERS 4
309 1.1 christos #define AR5416_NUM_2G_40_TARGET_POWERS 4
310 1.1 christos #define AR5416_NUM_CTLS 24
311 1.1 christos #define AR5416_NUM_BAND_EDGES 8
312 1.1 christos #define AR5416_NUM_PD_GAINS 4
313 1.1 christos #define AR5416_PD_GAIN_ICEPTS 5
314 1.1 christos #define AR5416_EEPROM_MODAL_SPURS 5
315 1.1 christos #define AR5416_MAX_CHAINS 2
316 1.1 christos
317 1.1 christos typedef struct BaseEepHeader {
318 1.1 christos uint16_t length;
319 1.1 christos uint16_t checksum;
320 1.1 christos uint16_t version;
321 1.1 christos uint8_t opCapFlags;
322 1.1 christos uint8_t eepMisc;
323 1.1 christos uint16_t regDmn[2];
324 1.1 christos uint8_t macAddr[6];
325 1.1 christos uint8_t rxMask;
326 1.1 christos uint8_t txMask;
327 1.1 christos uint16_t rfSilent;
328 1.1 christos uint16_t blueToothOptions;
329 1.1 christos uint16_t deviceCap;
330 1.1 christos uint32_t binBuildNumber;
331 1.1 christos uint8_t deviceType;
332 1.1 christos uint8_t futureBase[33];
333 1.1 christos } __packed BASE_EEP_HEADER;
334 1.1 christos
335 1.1 christos typedef struct spurChanStruct {
336 1.1 christos uint16_t spurChan;
337 1.1 christos uint8_t spurRangeLow;
338 1.1 christos uint8_t spurRangeHigh;
339 1.1 christos } __packed SPUR_CHAN;
340 1.1 christos
341 1.1 christos typedef struct ModalEepHeader {
342 1.1 christos uint32_t antCtrlChain[AR5416_MAX_CHAINS];
343 1.1 christos uint32_t antCtrlCommon;
344 1.1 christos int8_t antennaGainCh[AR5416_MAX_CHAINS];
345 1.1 christos uint8_t switchSettling;
346 1.1 christos uint8_t txRxAttenCh[AR5416_MAX_CHAINS];
347 1.1 christos uint8_t rxTxMarginCh[AR5416_MAX_CHAINS];
348 1.1 christos uint8_t adcDesiredSize;
349 1.1 christos int8_t pgaDesiredSize;
350 1.1 christos uint8_t xlnaGainCh[AR5416_MAX_CHAINS];
351 1.1 christos uint8_t txEndToXpaOff;
352 1.1 christos uint8_t txEndToRxOn;
353 1.1 christos uint8_t txFrameToXpaOn;
354 1.1 christos uint8_t thresh62;
355 1.1 christos uint8_t noiseFloorThreshCh[AR5416_MAX_CHAINS];
356 1.1 christos uint8_t xpdGain;
357 1.1 christos uint8_t xpd;
358 1.1 christos int8_t iqCalICh[AR5416_MAX_CHAINS];
359 1.1 christos int8_t iqCalQCh[AR5416_MAX_CHAINS];
360 1.1 christos uint8_t pdGainOverlap;
361 1.1 christos uint8_t ob;
362 1.1 christos uint8_t db;
363 1.1 christos uint8_t xpaBiasLvl;
364 1.1 christos uint8_t pwrDecreaseFor2Chain;
365 1.1 christos uint8_t pwrDecreaseFor3Chain;
366 1.1 christos uint8_t txFrameToDataStart;
367 1.1 christos uint8_t txFrameToPaOn;
368 1.1 christos uint8_t ht40PowerIncForPdadc;
369 1.1 christos uint8_t bswAtten[AR5416_MAX_CHAINS];
370 1.1 christos uint8_t bswMargin[AR5416_MAX_CHAINS];
371 1.1 christos uint8_t swSettleHt40;
372 1.1 christos uint8_t futureModal[22];
373 1.1 christos SPUR_CHAN spurChans[AR5416_EEPROM_MODAL_SPURS];
374 1.1 christos } __packed MODAL_EEP_HEADER;
375 1.1 christos
376 1.1 christos typedef struct calDataPerFreq {
377 1.1 christos uint8_t pwrPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
378 1.1 christos uint8_t vpdPdg[AR5416_NUM_PD_GAINS][AR5416_PD_GAIN_ICEPTS];
379 1.1 christos } __packed CAL_DATA_PER_FREQ;
380 1.1 christos
381 1.1 christos typedef struct CalTargetPowerLegacy {
382 1.1 christos uint8_t bChannel;
383 1.1 christos uint8_t tPow2x[4];
384 1.1 christos } __packed CAL_TARGET_POWER_LEG;
385 1.1 christos
386 1.1 christos typedef struct CalTargetPowerHt {
387 1.1 christos uint8_t bChannel;
388 1.1 christos uint8_t tPow2x[8];
389 1.1 christos } __packed CAL_TARGET_POWER_HT;
390 1.1 christos
391 1.1 christos typedef struct CalCtlEdges {
392 1.1 christos uint8_t bChannel;
393 1.1 christos uint8_t tPowerFlag;
394 1.1 christos } __packed CAL_CTL_EDGES;
395 1.1 christos
396 1.1 christos typedef struct CalCtlData {
397 1.1 christos CAL_CTL_EDGES ctlEdges[AR5416_MAX_CHAINS][AR5416_NUM_BAND_EDGES];
398 1.1 christos } __packed CAL_CTL_DATA;
399 1.1 christos
400 1.1 christos typedef struct ar5416eeprom {
401 1.1 christos BASE_EEP_HEADER baseEepHeader;
402 1.1 christos uint8_t custData[64];
403 1.1 christos MODAL_EEP_HEADER modalHeader[2];
404 1.1 christos uint8_t calFreqPier5G[AR5416_NUM_5G_CAL_PIERS];
405 1.1 christos uint8_t calFreqPier2G[AR5416_NUM_2G_CAL_PIERS];
406 1.1 christos CAL_DATA_PER_FREQ calPierData5G[AR5416_MAX_CHAINS]
407 1.1 christos [AR5416_NUM_5G_CAL_PIERS];
408 1.1 christos CAL_DATA_PER_FREQ calPierData2G[AR5416_MAX_CHAINS]
409 1.1 christos [AR5416_NUM_2G_CAL_PIERS];
410 1.1 christos CAL_TARGET_POWER_LEG calTPow5G[AR5416_NUM_5G_20_TARGET_POWERS];
411 1.1 christos CAL_TARGET_POWER_HT calTPow5GHT20[AR5416_NUM_5G_20_TARGET_POWERS];
412 1.1 christos CAL_TARGET_POWER_HT calTPow5GHT40[AR5416_NUM_5G_40_TARGET_POWERS];
413 1.1 christos CAL_TARGET_POWER_LEG calTPowCck[AR5416_NUM_2G_CCK_TARGET_POWERS];
414 1.1 christos CAL_TARGET_POWER_LEG calTPow2G[AR5416_NUM_2G_20_TARGET_POWERS];
415 1.1 christos CAL_TARGET_POWER_HT calTPow2GHT20[AR5416_NUM_2G_20_TARGET_POWERS];
416 1.1 christos CAL_TARGET_POWER_HT calTPow2GHT40[AR5416_NUM_2G_40_TARGET_POWERS];
417 1.1 christos uint8_t ctlIndex[AR5416_NUM_CTLS];
418 1.1 christos CAL_CTL_DATA ctlData[AR5416_NUM_CTLS];
419 1.2 christos uint8_t padding[3];
420 1.1 christos } __packed AR5416_EEPROM;
421 1.3 christos #endif /* _IF_OTUSREG_H_ */
422