xref: /freebsd/sys/dev/usb/wlan/if_zydreg.h (revision 760bc48e7ee4471fe04fa5fee89d00bf7d698ddb)
102ac6454SAndrew Thompson /*	$OpenBSD: if_zydreg.h,v 1.19 2006/11/30 19:28:07 damien Exp $	*/
202ac6454SAndrew Thompson /*	$NetBSD: if_zydreg.h,v 1.2 2007/06/16 11:18:45 kiyohara Exp $	*/
302ac6454SAndrew Thompson /*	$FreeBSD$	*/
402ac6454SAndrew Thompson 
502ac6454SAndrew Thompson /*-
602ac6454SAndrew Thompson  * Copyright (c) 2006 by Damien Bergamini <damien.bergamini@free.fr>
702ac6454SAndrew Thompson  * Copyright (c) 2006 by Florian Stoehr <ich@florian-stoehr.de>
802ac6454SAndrew Thompson  *
902ac6454SAndrew Thompson  * Permission to use, copy, modify, and distribute this software for any
1002ac6454SAndrew Thompson  * purpose with or without fee is hereby granted, provided that the above
1102ac6454SAndrew Thompson  * copyright notice and this permission notice appear in all copies.
1202ac6454SAndrew Thompson  *
1302ac6454SAndrew Thompson  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1402ac6454SAndrew Thompson  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1502ac6454SAndrew Thompson  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1602ac6454SAndrew Thompson  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1702ac6454SAndrew Thompson  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1802ac6454SAndrew Thompson  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1902ac6454SAndrew Thompson  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2002ac6454SAndrew Thompson  */
2102ac6454SAndrew Thompson 
2202ac6454SAndrew Thompson /*
2302ac6454SAndrew Thompson  * ZyDAS ZD1211/ZD1211B USB WLAN driver.
2402ac6454SAndrew Thompson  */
2502ac6454SAndrew Thompson 
2602ac6454SAndrew Thompson #define ZYD_CR_GPI_EN		0x9418
2702ac6454SAndrew Thompson #define ZYD_CR_RADIO_PD		0x942c
2802ac6454SAndrew Thompson #define ZYD_CR_RF2948_PD	0x942c
2902ac6454SAndrew Thompson #define ZYD_CR_EN_PS_MANUAL_AGC	0x943c
3002ac6454SAndrew Thompson #define ZYD_CR_CONFIG_PHILIPS	0x9440
3102ac6454SAndrew Thompson #define ZYD_CR_I2C_WRITE	0x9444
3202ac6454SAndrew Thompson #define ZYD_CR_SA2400_SER_RP	0x9448
3302ac6454SAndrew Thompson #define ZYD_CR_RADIO_PE		0x9458
3402ac6454SAndrew Thompson #define ZYD_CR_RST_BUS_MASTER	0x945c
3502ac6454SAndrew Thompson #define ZYD_CR_RFCFG		0x9464
3602ac6454SAndrew Thompson #define ZYD_CR_HSTSCHG		0x946c
3702ac6454SAndrew Thompson #define ZYD_CR_PHY_ON		0x9474
3802ac6454SAndrew Thompson #define ZYD_CR_RX_DELAY		0x9478
3902ac6454SAndrew Thompson #define ZYD_CR_RX_PE_DELAY	0x947c
4002ac6454SAndrew Thompson #define ZYD_CR_GPIO_1		0x9490
4102ac6454SAndrew Thompson #define ZYD_CR_GPIO_2		0x9494
4202ac6454SAndrew Thompson #define ZYD_CR_EnZYD_CRyBufMux	0x94a8
4302ac6454SAndrew Thompson #define ZYD_CR_PS_CTRL		0x9500
4402ac6454SAndrew Thompson #define ZYD_CR_ADDA_PWR_DWN	0x9504
4502ac6454SAndrew Thompson #define ZYD_CR_ADDA_MBIAS_WT	0x9508
4602ac6454SAndrew Thompson #define ZYD_CR_INTERRUPT	0x9510
4702ac6454SAndrew Thompson #define ZYD_CR_MAC_PS_STATE	0x950c
4802ac6454SAndrew Thompson #define ZYD_CR_ATIM_WND_PERIOD	0x951c
4902ac6454SAndrew Thompson #define ZYD_CR_BCN_INTERVAL	0x9520
5002ac6454SAndrew Thompson #define ZYD_CR_PRE_TBTT		0x9524
5102ac6454SAndrew Thompson 
5202ac6454SAndrew Thompson /*
5302ac6454SAndrew Thompson  * MAC registers.
5402ac6454SAndrew Thompson  */
5502ac6454SAndrew Thompson #define ZYD_MAC_MACADRL		0x9610 /* MAC address (low) */
5602ac6454SAndrew Thompson #define ZYD_MAC_MACADRH		0x9614 /* MAC address (high) */
5702ac6454SAndrew Thompson #define ZYD_MAC_BSSADRL		0x9618 /* BSS address (low) */
5802ac6454SAndrew Thompson #define ZYD_MAC_BSSADRH		0x961c /* BSS address (high) */
5902ac6454SAndrew Thompson #define ZYD_MAC_BCNCFG		0x9620 /* BCN configuration */
6002ac6454SAndrew Thompson #define ZYD_MAC_GHTBL		0x9624 /* Group hash table (low) */
6102ac6454SAndrew Thompson #define ZYD_MAC_GHTBH		0x9628 /* Group hash table (high) */
6202ac6454SAndrew Thompson #define ZYD_MAC_RX_TIMEOUT	0x962c /* Rx timeout value */
6302ac6454SAndrew Thompson #define ZYD_MAC_BAS_RATE	0x9630 /* Basic rate setting */
6402ac6454SAndrew Thompson #define ZYD_MAC_MAN_RATE	0x9634 /* Mandatory rate setting */
6502ac6454SAndrew Thompson #define ZYD_MAC_RTSCTSRATE	0x9638 /* RTS CTS rate */
6602ac6454SAndrew Thompson #define ZYD_MAC_BACKOFF_PROTECT	0x963c /* Backoff protection */
6702ac6454SAndrew Thompson #define ZYD_MAC_RX_THRESHOLD	0x9640 /* Rx threshold */
6802ac6454SAndrew Thompson #define ZYD_MAC_TX_PE_CONTROL	0x9644 /* Tx_PE control */
6902ac6454SAndrew Thompson #define ZYD_MAC_AFTER_PNP	0x9648 /* After PnP */
7002ac6454SAndrew Thompson #define ZYD_MAC_RX_PE_DELAY	0x964c /* Rx_pe delay */
7102ac6454SAndrew Thompson #define ZYD_MAC_RX_ADDR2_L	0x9650 /* RX address2 (low)    */
7202ac6454SAndrew Thompson #define ZYD_MAC_RX_ADDR2_H	0x9654 /* RX address2 (high) */
7302ac6454SAndrew Thompson #define ZYD_MAC_SIFS_ACK_TIME	0x9658 /* Dynamic SIFS ack time */
7402ac6454SAndrew Thompson #define ZYD_MAC_PHY_DELAY	0x9660 /* PHY delay */
7502ac6454SAndrew Thompson #define ZYD_MAC_PHY_DELAY2	0x966c /* PHY delay */
7602ac6454SAndrew Thompson #define ZYD_MAC_BCNFIFO		0x9670 /* Beacon FIFO I/O port */
7702ac6454SAndrew Thompson #define ZYD_MAC_SNIFFER		0x9674 /* Sniffer on/off */
7802ac6454SAndrew Thompson #define ZYD_MAC_ENCRYPTION_TYPE 0x9678 /* Encryption type */
7902ac6454SAndrew Thompson #define ZYD_MAC_RETRY		0x967c /* Retry time */
8002ac6454SAndrew Thompson #define ZYD_MAC_MISC		0x9680 /* Misc */
8102ac6454SAndrew Thompson #define ZYD_MAC_STMACHINESTAT	0x9684 /* State machine status */
8202ac6454SAndrew Thompson #define ZYD_MAC_TX_UNDERRUN_CNT	0x9688 /* TX underrun counter */
8302ac6454SAndrew Thompson #define ZYD_MAC_RXFILTER	0x968c /* Send to host settings */
8402ac6454SAndrew Thompson #define ZYD_MAC_ACK_EXT		0x9690 /* Acknowledge extension */
8502ac6454SAndrew Thompson #define ZYD_MAC_BCNFIFOST	0x9694 /* BCN FIFO set and status */
8602ac6454SAndrew Thompson #define ZYD_MAC_DIFS_EIFS_SIFS	0x9698 /* DIFS, EIFS & SIFS settings */
8702ac6454SAndrew Thompson #define ZYD_MAC_RX_TIMEOUT_CNT	0x969c /* RX timeout count */
8802ac6454SAndrew Thompson #define ZYD_MAC_RX_TOTAL_FRAME	0x96a0 /* RX total frame count */
8902ac6454SAndrew Thompson #define ZYD_MAC_RX_CRC32_CNT	0x96a4 /* RX CRC32 frame count */
9002ac6454SAndrew Thompson #define ZYD_MAC_RX_CRC16_CNT	0x96a8 /* RX CRC16 frame count */
9102ac6454SAndrew Thompson #define ZYD_MAC_RX_UDEC		0x96ac /* RX unicast decr. error count */
9202ac6454SAndrew Thompson #define ZYD_MAC_RX_OVERRUN_CNT	0x96b0 /* RX FIFO overrun count */
9302ac6454SAndrew Thompson #define ZYD_MAC_RX_MDEC		0x96bc /* RX multicast decr. err. cnt. */
9402ac6454SAndrew Thompson #define ZYD_MAC_NAV_TCR		0x96c4 /* NAV timer count read */
9502ac6454SAndrew Thompson #define ZYD_MAC_BACKOFF_ST_RD	0x96c8 /* Backoff status read */
9602ac6454SAndrew Thompson #define ZYD_MAC_DM_RETRY_CNT_RD	0x96cc /* DM retry count read */
9702ac6454SAndrew Thompson #define ZYD_MAC_RX_ACR		0x96d0 /* RX arbitration count read    */
9802ac6454SAndrew Thompson #define ZYD_MAC_TX_CCR		0x96d4 /* Tx complete count read */
9902ac6454SAndrew Thompson #define ZYD_MAC_TCB_ADDR	0x96e8 /* Current PCI process TCP addr */
10002ac6454SAndrew Thompson #define ZYD_MAC_RCB_ADDR	0x96ec /* Next RCB address */
10102ac6454SAndrew Thompson #define ZYD_MAC_CONT_WIN_LIMIT	0x96f0 /* Contention window limit */
10202ac6454SAndrew Thompson #define ZYD_MAC_TX_PKT		0x96f4 /* Tx total packet count read */
10302ac6454SAndrew Thompson #define ZYD_MAC_DL_CTRL		0x96f8 /* Download control */
10402ac6454SAndrew Thompson #define ZYD_MAC_CAM_MODE	0x9700 /* CAM: Continuous Access Mode */
10502ac6454SAndrew Thompson #define ZYD_MACB_TXPWR_CTL1	0x9b00
10602ac6454SAndrew Thompson #define ZYD_MACB_TXPWR_CTL2	0x9b04
10702ac6454SAndrew Thompson #define ZYD_MACB_TXPWR_CTL3	0x9b08
10802ac6454SAndrew Thompson #define ZYD_MACB_TXPWR_CTL4	0x9b0c
10902ac6454SAndrew Thompson #define ZYD_MACB_AIFS_CTL1	0x9b10
11002ac6454SAndrew Thompson #define ZYD_MACB_AIFS_CTL2	0x9b14
11102ac6454SAndrew Thompson #define ZYD_MACB_TXOP		0x9b20
11202ac6454SAndrew Thompson #define ZYD_MACB_MAX_RETRY	0x9b28
11302ac6454SAndrew Thompson 
11402ac6454SAndrew Thompson /*
11502ac6454SAndrew Thompson  * Miscellanous registers.
11602ac6454SAndrew Thompson  */
11702ac6454SAndrew Thompson #define ZYD_FIRMWARE_START_ADDR	0xee00
11802ac6454SAndrew Thompson #define ZYD_FIRMWARE_BASE_ADDR	0xee1d /* Firmware base address */
11902ac6454SAndrew Thompson 
12002ac6454SAndrew Thompson /*
12102ac6454SAndrew Thompson  * EEPROM registers.
12202ac6454SAndrew Thompson  */
12302ac6454SAndrew Thompson #define ZYD_EEPROM_START_HEAD	0xf800 /* EEPROM start */
12402ac6454SAndrew Thompson #define ZYD_EEPROM_SUBID	0xf817
12502ac6454SAndrew Thompson #define ZYD_EEPROM_POD		0xf819
12602ac6454SAndrew Thompson #define ZYD_EEPROM_MAC_ADDR_P1	0xf81b /* Part 1 of the MAC address */
12702ac6454SAndrew Thompson #define ZYD_EEPROM_MAC_ADDR_P2	0xf81d /* Part 2 of the MAC address */
12802ac6454SAndrew Thompson #define ZYD_EEPROM_PWR_CAL	0xf81f /* Calibration */
12902ac6454SAndrew Thompson #define ZYD_EEPROM_PWR_INT	0xf827 /* Calibration */
13002ac6454SAndrew Thompson #define ZYD_EEPROM_ALLOWEDCHAN	0xf82f /* Allowed CH mask, 1 bit each */
13102ac6454SAndrew Thompson #define ZYD_EEPROM_DEVICE_VER	0xf837 /* Device version */
13202ac6454SAndrew Thompson #define ZYD_EEPROM_PHY_REG	0xf83c /* PHY registers */
13302ac6454SAndrew Thompson #define ZYD_EEPROM_36M_CAL	0xf83f /* Calibration */
13402ac6454SAndrew Thompson #define ZYD_EEPROM_11A_INT	0xf847 /* Interpolation */
13502ac6454SAndrew Thompson #define ZYD_EEPROM_48M_CAL	0xf84f /* Calibration */
13602ac6454SAndrew Thompson #define ZYD_EEPROM_48M_INT	0xf857 /* Interpolation */
13702ac6454SAndrew Thompson #define ZYD_EEPROM_54M_CAL	0xf85f /* Calibration */
13802ac6454SAndrew Thompson #define ZYD_EEPROM_54M_INT	0xf867 /* Interpolation */
13902ac6454SAndrew Thompson 
14002ac6454SAndrew Thompson /*
14102ac6454SAndrew Thompson  * Firmware registers offsets (relative to fwbase).
14202ac6454SAndrew Thompson  */
14302ac6454SAndrew Thompson #define ZYD_FW_FIRMWARE_REV	0x0000 /* Firmware version */
14402ac6454SAndrew Thompson #define ZYD_FW_USB_SPEED	0x0001 /* USB speed (!=0 if highspeed) */
14502ac6454SAndrew Thompson #define ZYD_FW_FIX_TX_RATE	0x0002 /* Fixed TX rate */
14602ac6454SAndrew Thompson #define ZYD_FW_LINK_STATUS	0x0003
14702ac6454SAndrew Thompson #define ZYD_FW_SOFT_RESET	0x0004
14802ac6454SAndrew Thompson #define ZYD_FW_FLASH_CHK	0x0005
14902ac6454SAndrew Thompson 
15002ac6454SAndrew Thompson /* possible flags for register ZYD_FW_LINK_STATUS */
15102ac6454SAndrew Thompson #define ZYD_LED1		(1 << 8)
15202ac6454SAndrew Thompson #define ZYD_LED2		(1 << 9)
15302ac6454SAndrew Thompson 
15402ac6454SAndrew Thompson /*
15502ac6454SAndrew Thompson  * RF IDs.
15602ac6454SAndrew Thompson  */
15702ac6454SAndrew Thompson #define ZYD_RF_UW2451		0x2	/* not supported yet */
15802ac6454SAndrew Thompson #define ZYD_RF_UCHIP		0x3	/* not supported yet */
15902ac6454SAndrew Thompson #define ZYD_RF_AL2230		0x4
16002ac6454SAndrew Thompson #define ZYD_RF_AL7230B		0x5
16102ac6454SAndrew Thompson #define ZYD_RF_THETA		0x6	/* not supported yet */
16202ac6454SAndrew Thompson #define ZYD_RF_AL2210		0x7
16302ac6454SAndrew Thompson #define ZYD_RF_MAXIM_NEW	0x8
16402ac6454SAndrew Thompson #define ZYD_RF_GCT		0x9
16502ac6454SAndrew Thompson #define ZYD_RF_AL2230S		0xa	/* not supported yet */
16602ac6454SAndrew Thompson #define ZYD_RF_RALINK		0xb	/* not supported yet */
16702ac6454SAndrew Thompson #define ZYD_RF_INTERSIL		0xc	/* not supported yet */
16802ac6454SAndrew Thompson #define ZYD_RF_RFMD		0xd
16902ac6454SAndrew Thompson #define ZYD_RF_MAXIM_NEW2	0xe
17002ac6454SAndrew Thompson #define ZYD_RF_PHILIPS		0xf	/* not supported yet */
17102ac6454SAndrew Thompson 
17202ac6454SAndrew Thompson /*
17302ac6454SAndrew Thompson  * PHY registers (8 bits, not documented).
17402ac6454SAndrew Thompson  */
17502ac6454SAndrew Thompson #define ZYD_CR0			0x9000
17602ac6454SAndrew Thompson #define ZYD_CR1			0x9004
17702ac6454SAndrew Thompson #define ZYD_CR2			0x9008
17802ac6454SAndrew Thompson #define ZYD_CR3			0x900c
17902ac6454SAndrew Thompson #define ZYD_CR5			0x9010
18002ac6454SAndrew Thompson #define ZYD_CR6			0x9014
18102ac6454SAndrew Thompson #define ZYD_CR7			0x9018
18202ac6454SAndrew Thompson #define ZYD_CR8			0x901c
18302ac6454SAndrew Thompson #define ZYD_CR4			0x9020
18402ac6454SAndrew Thompson #define ZYD_CR9			0x9024
18502ac6454SAndrew Thompson #define ZYD_CR10		0x9028
18602ac6454SAndrew Thompson #define ZYD_CR11		0x902c
18702ac6454SAndrew Thompson #define ZYD_CR12		0x9030
18802ac6454SAndrew Thompson #define ZYD_CR13		0x9034
18902ac6454SAndrew Thompson #define ZYD_CR14		0x9038
19002ac6454SAndrew Thompson #define ZYD_CR15		0x903c
19102ac6454SAndrew Thompson #define ZYD_CR16		0x9040
19202ac6454SAndrew Thompson #define ZYD_CR17		0x9044
19302ac6454SAndrew Thompson #define ZYD_CR18		0x9048
19402ac6454SAndrew Thompson #define ZYD_CR19		0x904c
19502ac6454SAndrew Thompson #define ZYD_CR20		0x9050
19602ac6454SAndrew Thompson #define ZYD_CR21		0x9054
19702ac6454SAndrew Thompson #define ZYD_CR22		0x9058
19802ac6454SAndrew Thompson #define ZYD_CR23		0x905c
19902ac6454SAndrew Thompson #define ZYD_CR24		0x9060
20002ac6454SAndrew Thompson #define ZYD_CR25		0x9064
20102ac6454SAndrew Thompson #define ZYD_CR26		0x9068
20202ac6454SAndrew Thompson #define ZYD_CR27		0x906c
20302ac6454SAndrew Thompson #define ZYD_CR28		0x9070
20402ac6454SAndrew Thompson #define ZYD_CR29		0x9074
20502ac6454SAndrew Thompson #define ZYD_CR30		0x9078
20602ac6454SAndrew Thompson #define ZYD_CR31		0x907c
20702ac6454SAndrew Thompson #define ZYD_CR32		0x9080
20802ac6454SAndrew Thompson #define ZYD_CR33		0x9084
20902ac6454SAndrew Thompson #define ZYD_CR34		0x9088
21002ac6454SAndrew Thompson #define ZYD_CR35		0x908c
21102ac6454SAndrew Thompson #define ZYD_CR36		0x9090
21202ac6454SAndrew Thompson #define ZYD_CR37		0x9094
21302ac6454SAndrew Thompson #define ZYD_CR38		0x9098
21402ac6454SAndrew Thompson #define ZYD_CR39		0x909c
21502ac6454SAndrew Thompson #define ZYD_CR40		0x90a0
21602ac6454SAndrew Thompson #define ZYD_CR41		0x90a4
21702ac6454SAndrew Thompson #define ZYD_CR42		0x90a8
21802ac6454SAndrew Thompson #define ZYD_CR43		0x90ac
21902ac6454SAndrew Thompson #define ZYD_CR44		0x90b0
22002ac6454SAndrew Thompson #define ZYD_CR45		0x90b4
22102ac6454SAndrew Thompson #define ZYD_CR46		0x90b8
22202ac6454SAndrew Thompson #define ZYD_CR47		0x90bc
22302ac6454SAndrew Thompson #define ZYD_CR48		0x90c0
22402ac6454SAndrew Thompson #define ZYD_CR49		0x90c4
22502ac6454SAndrew Thompson #define ZYD_CR50		0x90c8
22602ac6454SAndrew Thompson #define ZYD_CR51		0x90cc
22702ac6454SAndrew Thompson #define ZYD_CR52		0x90d0
22802ac6454SAndrew Thompson #define ZYD_CR53		0x90d4
22902ac6454SAndrew Thompson #define ZYD_CR54		0x90d8
23002ac6454SAndrew Thompson #define ZYD_CR55		0x90dc
23102ac6454SAndrew Thompson #define ZYD_CR56		0x90e0
23202ac6454SAndrew Thompson #define ZYD_CR57		0x90e4
23302ac6454SAndrew Thompson #define ZYD_CR58		0x90e8
23402ac6454SAndrew Thompson #define ZYD_CR59		0x90ec
23502ac6454SAndrew Thompson #define ZYD_CR60		0x90f0
23602ac6454SAndrew Thompson #define ZYD_CR61		0x90f4
23702ac6454SAndrew Thompson #define ZYD_CR62		0x90f8
23802ac6454SAndrew Thompson #define ZYD_CR63		0x90fc
23902ac6454SAndrew Thompson #define ZYD_CR64		0x9100
24002ac6454SAndrew Thompson #define ZYD_CR65		0x9104
24102ac6454SAndrew Thompson #define ZYD_CR66		0x9108
24202ac6454SAndrew Thompson #define ZYD_CR67		0x910c
24302ac6454SAndrew Thompson #define ZYD_CR68		0x9110
24402ac6454SAndrew Thompson #define ZYD_CR69		0x9114
24502ac6454SAndrew Thompson #define ZYD_CR70		0x9118
24602ac6454SAndrew Thompson #define ZYD_CR71		0x911c
24702ac6454SAndrew Thompson #define ZYD_CR72		0x9120
24802ac6454SAndrew Thompson #define ZYD_CR73		0x9124
24902ac6454SAndrew Thompson #define ZYD_CR74		0x9128
25002ac6454SAndrew Thompson #define ZYD_CR75		0x912c
25102ac6454SAndrew Thompson #define ZYD_CR76		0x9130
25202ac6454SAndrew Thompson #define ZYD_CR77		0x9134
25302ac6454SAndrew Thompson #define ZYD_CR78		0x9138
25402ac6454SAndrew Thompson #define ZYD_CR79		0x913c
25502ac6454SAndrew Thompson #define ZYD_CR80		0x9140
25602ac6454SAndrew Thompson #define ZYD_CR81		0x9144
25702ac6454SAndrew Thompson #define ZYD_CR82		0x9148
25802ac6454SAndrew Thompson #define ZYD_CR83		0x914c
25902ac6454SAndrew Thompson #define ZYD_CR84		0x9150
26002ac6454SAndrew Thompson #define ZYD_CR85		0x9154
26102ac6454SAndrew Thompson #define ZYD_CR86		0x9158
26202ac6454SAndrew Thompson #define ZYD_CR87		0x915c
26302ac6454SAndrew Thompson #define ZYD_CR88		0x9160
26402ac6454SAndrew Thompson #define ZYD_CR89		0x9164
26502ac6454SAndrew Thompson #define ZYD_CR90		0x9168
26602ac6454SAndrew Thompson #define ZYD_CR91		0x916c
26702ac6454SAndrew Thompson #define ZYD_CR92		0x9170
26802ac6454SAndrew Thompson #define ZYD_CR93		0x9174
26902ac6454SAndrew Thompson #define ZYD_CR94		0x9178
27002ac6454SAndrew Thompson #define ZYD_CR95		0x917c
27102ac6454SAndrew Thompson #define ZYD_CR96		0x9180
27202ac6454SAndrew Thompson #define ZYD_CR97		0x9184
27302ac6454SAndrew Thompson #define ZYD_CR98		0x9188
27402ac6454SAndrew Thompson #define ZYD_CR99		0x918c
27502ac6454SAndrew Thompson #define ZYD_CR100		0x9190
27602ac6454SAndrew Thompson #define ZYD_CR101		0x9194
27702ac6454SAndrew Thompson #define ZYD_CR102		0x9198
27802ac6454SAndrew Thompson #define ZYD_CR103		0x919c
27902ac6454SAndrew Thompson #define ZYD_CR104		0x91a0
28002ac6454SAndrew Thompson #define ZYD_CR105		0x91a4
28102ac6454SAndrew Thompson #define ZYD_CR106		0x91a8
28202ac6454SAndrew Thompson #define ZYD_CR107		0x91ac
28302ac6454SAndrew Thompson #define ZYD_CR108		0x91b0
28402ac6454SAndrew Thompson #define ZYD_CR109		0x91b4
28502ac6454SAndrew Thompson #define ZYD_CR110		0x91b8
28602ac6454SAndrew Thompson #define ZYD_CR111		0x91bc
28702ac6454SAndrew Thompson #define ZYD_CR112		0x91c0
28802ac6454SAndrew Thompson #define ZYD_CR113		0x91c4
28902ac6454SAndrew Thompson #define ZYD_CR114		0x91c8
29002ac6454SAndrew Thompson #define ZYD_CR115		0x91cc
29102ac6454SAndrew Thompson #define ZYD_CR116		0x91d0
29202ac6454SAndrew Thompson #define ZYD_CR117		0x91d4
29302ac6454SAndrew Thompson #define ZYD_CR118		0x91d8
29402ac6454SAndrew Thompson #define ZYD_CR119		0x91dc
29502ac6454SAndrew Thompson #define ZYD_CR120		0x91e0
29602ac6454SAndrew Thompson #define ZYD_CR121		0x91e4
29702ac6454SAndrew Thompson #define ZYD_CR122		0x91e8
29802ac6454SAndrew Thompson #define ZYD_CR123		0x91ec
29902ac6454SAndrew Thompson #define ZYD_CR124		0x91f0
30002ac6454SAndrew Thompson #define ZYD_CR125		0x91f4
30102ac6454SAndrew Thompson #define ZYD_CR126		0x91f8
30202ac6454SAndrew Thompson #define ZYD_CR127		0x91fc
30302ac6454SAndrew Thompson #define ZYD_CR128		0x9200
30402ac6454SAndrew Thompson #define ZYD_CR129		0x9204
30502ac6454SAndrew Thompson #define ZYD_CR130		0x9208
30602ac6454SAndrew Thompson #define ZYD_CR131		0x920c
30702ac6454SAndrew Thompson #define ZYD_CR132		0x9210
30802ac6454SAndrew Thompson #define ZYD_CR133		0x9214
30902ac6454SAndrew Thompson #define ZYD_CR134		0x9218
31002ac6454SAndrew Thompson #define ZYD_CR135		0x921c
31102ac6454SAndrew Thompson #define ZYD_CR136		0x9220
31202ac6454SAndrew Thompson #define ZYD_CR137		0x9224
31302ac6454SAndrew Thompson #define ZYD_CR138		0x9228
31402ac6454SAndrew Thompson #define ZYD_CR139		0x922c
31502ac6454SAndrew Thompson #define ZYD_CR140		0x9230
31602ac6454SAndrew Thompson #define ZYD_CR141		0x9234
31702ac6454SAndrew Thompson #define ZYD_CR142		0x9238
31802ac6454SAndrew Thompson #define ZYD_CR143		0x923c
31902ac6454SAndrew Thompson #define ZYD_CR144		0x9240
32002ac6454SAndrew Thompson #define ZYD_CR145		0x9244
32102ac6454SAndrew Thompson #define ZYD_CR146		0x9248
32202ac6454SAndrew Thompson #define ZYD_CR147		0x924c
32302ac6454SAndrew Thompson #define ZYD_CR148		0x9250
32402ac6454SAndrew Thompson #define ZYD_CR149		0x9254
32502ac6454SAndrew Thompson #define ZYD_CR150		0x9258
32602ac6454SAndrew Thompson #define ZYD_CR151		0x925c
32702ac6454SAndrew Thompson #define ZYD_CR152		0x9260
32802ac6454SAndrew Thompson #define ZYD_CR153		0x9264
32902ac6454SAndrew Thompson #define ZYD_CR154		0x9268
33002ac6454SAndrew Thompson #define ZYD_CR155		0x926c
33102ac6454SAndrew Thompson #define ZYD_CR156		0x9270
33202ac6454SAndrew Thompson #define ZYD_CR157		0x9274
33302ac6454SAndrew Thompson #define ZYD_CR158		0x9278
33402ac6454SAndrew Thompson #define ZYD_CR159		0x927c
33502ac6454SAndrew Thompson #define ZYD_CR160		0x9280
33602ac6454SAndrew Thompson #define ZYD_CR161		0x9284
33702ac6454SAndrew Thompson #define ZYD_CR162		0x9288
33802ac6454SAndrew Thompson #define ZYD_CR163		0x928c
33902ac6454SAndrew Thompson #define ZYD_CR164		0x9290
34002ac6454SAndrew Thompson #define ZYD_CR165		0x9294
34102ac6454SAndrew Thompson #define ZYD_CR166		0x9298
34202ac6454SAndrew Thompson #define ZYD_CR167		0x929c
34302ac6454SAndrew Thompson #define ZYD_CR168		0x92a0
34402ac6454SAndrew Thompson #define ZYD_CR169		0x92a4
34502ac6454SAndrew Thompson #define ZYD_CR170		0x92a8
34602ac6454SAndrew Thompson #define ZYD_CR171		0x92ac
34702ac6454SAndrew Thompson #define ZYD_CR172		0x92b0
34802ac6454SAndrew Thompson #define ZYD_CR173		0x92b4
34902ac6454SAndrew Thompson #define ZYD_CR174		0x92b8
35002ac6454SAndrew Thompson #define ZYD_CR175		0x92bc
35102ac6454SAndrew Thompson #define ZYD_CR176		0x92c0
35202ac6454SAndrew Thompson #define ZYD_CR177		0x92c4
35302ac6454SAndrew Thompson #define ZYD_CR178		0x92c8
35402ac6454SAndrew Thompson #define ZYD_CR179		0x92cc
35502ac6454SAndrew Thompson #define ZYD_CR180		0x92d0
35602ac6454SAndrew Thompson #define ZYD_CR181		0x92d4
35702ac6454SAndrew Thompson #define ZYD_CR182		0x92d8
35802ac6454SAndrew Thompson #define ZYD_CR183		0x92dc
35902ac6454SAndrew Thompson #define ZYD_CR184		0x92e0
36002ac6454SAndrew Thompson #define ZYD_CR185		0x92e4
36102ac6454SAndrew Thompson #define ZYD_CR186		0x92e8
36202ac6454SAndrew Thompson #define ZYD_CR187		0x92ec
36302ac6454SAndrew Thompson #define ZYD_CR188		0x92f0
36402ac6454SAndrew Thompson #define ZYD_CR189		0x92f4
36502ac6454SAndrew Thompson #define ZYD_CR190		0x92f8
36602ac6454SAndrew Thompson #define ZYD_CR191		0x92fc
36702ac6454SAndrew Thompson #define ZYD_CR192		0x9300
36802ac6454SAndrew Thompson #define ZYD_CR193		0x9304
36902ac6454SAndrew Thompson #define ZYD_CR194		0x9308
37002ac6454SAndrew Thompson #define ZYD_CR195		0x930c
37102ac6454SAndrew Thompson #define ZYD_CR196		0x9310
37202ac6454SAndrew Thompson #define ZYD_CR197		0x9314
37302ac6454SAndrew Thompson #define ZYD_CR198		0x9318
37402ac6454SAndrew Thompson #define ZYD_CR199		0x931c
37502ac6454SAndrew Thompson #define ZYD_CR200		0x9320
37602ac6454SAndrew Thompson #define ZYD_CR201		0x9324
37702ac6454SAndrew Thompson #define ZYD_CR202		0x9328
37802ac6454SAndrew Thompson #define ZYD_CR203		0x932c
37902ac6454SAndrew Thompson #define ZYD_CR204		0x9330
38002ac6454SAndrew Thompson #define ZYD_CR205		0x9334
38102ac6454SAndrew Thompson #define ZYD_CR206		0x9338
38202ac6454SAndrew Thompson #define ZYD_CR207		0x933c
38302ac6454SAndrew Thompson #define ZYD_CR208		0x9340
38402ac6454SAndrew Thompson #define ZYD_CR209		0x9344
38502ac6454SAndrew Thompson #define ZYD_CR210		0x9348
38602ac6454SAndrew Thompson #define ZYD_CR211		0x934c
38702ac6454SAndrew Thompson #define ZYD_CR212		0x9350
38802ac6454SAndrew Thompson #define ZYD_CR213		0x9354
38902ac6454SAndrew Thompson #define ZYD_CR214		0x9358
39002ac6454SAndrew Thompson #define ZYD_CR215		0x935c
39102ac6454SAndrew Thompson #define ZYD_CR216		0x9360
39202ac6454SAndrew Thompson #define ZYD_CR217		0x9364
39302ac6454SAndrew Thompson #define ZYD_CR218		0x9368
39402ac6454SAndrew Thompson #define ZYD_CR219		0x936c
39502ac6454SAndrew Thompson #define ZYD_CR220		0x9370
39602ac6454SAndrew Thompson #define ZYD_CR221		0x9374
39702ac6454SAndrew Thompson #define ZYD_CR222		0x9378
39802ac6454SAndrew Thompson #define ZYD_CR223		0x937c
39902ac6454SAndrew Thompson #define ZYD_CR224		0x9380
40002ac6454SAndrew Thompson #define ZYD_CR225		0x9384
40102ac6454SAndrew Thompson #define ZYD_CR226		0x9388
40202ac6454SAndrew Thompson #define ZYD_CR227		0x938c
40302ac6454SAndrew Thompson #define ZYD_CR228		0x9390
40402ac6454SAndrew Thompson #define ZYD_CR229		0x9394
40502ac6454SAndrew Thompson #define ZYD_CR230		0x9398
40602ac6454SAndrew Thompson #define ZYD_CR231		0x939c
40702ac6454SAndrew Thompson #define ZYD_CR232		0x93a0
40802ac6454SAndrew Thompson #define ZYD_CR233		0x93a4
40902ac6454SAndrew Thompson #define ZYD_CR234		0x93a8
41002ac6454SAndrew Thompson #define ZYD_CR235		0x93ac
41102ac6454SAndrew Thompson #define ZYD_CR236		0x93b0
41202ac6454SAndrew Thompson #define ZYD_CR240		0x93c0
41302ac6454SAndrew Thompson #define ZYD_CR241		0x93c4
41402ac6454SAndrew Thompson #define ZYD_CR242		0x93c8
41502ac6454SAndrew Thompson #define ZYD_CR243		0x93cc
41602ac6454SAndrew Thompson #define ZYD_CR244		0x93d0
41702ac6454SAndrew Thompson #define ZYD_CR245		0x93d4
41802ac6454SAndrew Thompson #define ZYD_CR251		0x93ec
41902ac6454SAndrew Thompson #define ZYD_CR252		0x93f0
42002ac6454SAndrew Thompson #define ZYD_CR253		0x93f4
42102ac6454SAndrew Thompson #define ZYD_CR254		0x93f8
42202ac6454SAndrew Thompson #define ZYD_CR255		0x93fc
42302ac6454SAndrew Thompson 
42402ac6454SAndrew Thompson /* copied nearly verbatim from the Linux driver rewrite */
42502ac6454SAndrew Thompson #define	ZYD_DEF_PHY							\
42602ac6454SAndrew Thompson {									\
42702ac6454SAndrew Thompson 	{ ZYD_CR0,   0x0a }, { ZYD_CR1,   0x06 }, { ZYD_CR2,   0x26 },	\
42802ac6454SAndrew Thompson 	{ ZYD_CR3,   0x38 }, { ZYD_CR4,   0x80 }, { ZYD_CR9,   0xa0 },	\
42902ac6454SAndrew Thompson 	{ ZYD_CR10,  0x81 }, { ZYD_CR11,  0x00 }, { ZYD_CR12,  0x7f },	\
43002ac6454SAndrew Thompson 	{ ZYD_CR13,  0x8c }, { ZYD_CR14,  0x80 }, { ZYD_CR15,  0x3d },	\
43102ac6454SAndrew Thompson 	{ ZYD_CR16,  0x20 }, { ZYD_CR17,  0x1e }, { ZYD_CR18,  0x0a },	\
43202ac6454SAndrew Thompson 	{ ZYD_CR19,  0x48 }, { ZYD_CR20,  0x0c }, { ZYD_CR21,  0x0c },	\
43302ac6454SAndrew Thompson 	{ ZYD_CR22,  0x23 }, { ZYD_CR23,  0x90 }, { ZYD_CR24,  0x14 },	\
43402ac6454SAndrew Thompson 	{ ZYD_CR25,  0x40 }, { ZYD_CR26,  0x10 }, { ZYD_CR27,  0x19 },	\
43502ac6454SAndrew Thompson 	{ ZYD_CR28,  0x7f }, { ZYD_CR29,  0x80 }, { ZYD_CR30,  0x4b },	\
43602ac6454SAndrew Thompson 	{ ZYD_CR31,  0x60 }, { ZYD_CR32,  0x43 }, { ZYD_CR33,  0x08 },	\
43702ac6454SAndrew Thompson 	{ ZYD_CR34,  0x06 }, { ZYD_CR35,  0x0a }, { ZYD_CR36,  0x00 },	\
43802ac6454SAndrew Thompson 	{ ZYD_CR37,  0x00 }, { ZYD_CR38,  0x38 }, { ZYD_CR39,  0x0c },	\
43902ac6454SAndrew Thompson 	{ ZYD_CR40,  0x84 }, { ZYD_CR41,  0x2a }, { ZYD_CR42,  0x80 },	\
44002ac6454SAndrew Thompson 	{ ZYD_CR43,  0x10 }, { ZYD_CR44,  0x12 }, { ZYD_CR46,  0xff },	\
44102ac6454SAndrew Thompson 	{ ZYD_CR47,  0x1e }, { ZYD_CR48,  0x26 }, { ZYD_CR49,  0x5b },	\
44202ac6454SAndrew Thompson 	{ ZYD_CR64,  0xd0 }, { ZYD_CR65,  0x04 }, { ZYD_CR66,  0x58 },	\
44302ac6454SAndrew Thompson 	{ ZYD_CR67,  0xc9 }, { ZYD_CR68,  0x88 }, { ZYD_CR69,  0x41 },	\
44402ac6454SAndrew Thompson 	{ ZYD_CR70,  0x23 }, { ZYD_CR71,  0x10 }, { ZYD_CR72,  0xff },	\
44502ac6454SAndrew Thompson 	{ ZYD_CR73,  0x32 }, { ZYD_CR74,  0x30 }, { ZYD_CR75,  0x65 },	\
44602ac6454SAndrew Thompson 	{ ZYD_CR76,  0x41 }, { ZYD_CR77,  0x1b }, { ZYD_CR78,  0x30 },	\
44702ac6454SAndrew Thompson 	{ ZYD_CR79,  0x68 }, { ZYD_CR80,  0x64 }, { ZYD_CR81,  0x64 },	\
44802ac6454SAndrew Thompson 	{ ZYD_CR82,  0x00 }, { ZYD_CR83,  0x00 }, { ZYD_CR84,  0x00 },	\
44902ac6454SAndrew Thompson 	{ ZYD_CR85,  0x02 }, { ZYD_CR86,  0x00 }, { ZYD_CR87,  0x00 },	\
45002ac6454SAndrew Thompson 	{ ZYD_CR88,  0xff }, { ZYD_CR89,  0xfc }, { ZYD_CR90,  0x00 },	\
45102ac6454SAndrew Thompson 	{ ZYD_CR91,  0x00 }, { ZYD_CR92,  0x00 }, { ZYD_CR93,  0x08 },	\
45202ac6454SAndrew Thompson 	{ ZYD_CR94,  0x00 }, { ZYD_CR95,  0x00 }, { ZYD_CR96,  0xff },	\
45302ac6454SAndrew Thompson 	{ ZYD_CR97,  0xe7 }, { ZYD_CR98,  0x00 }, { ZYD_CR99,  0x00 },	\
45402ac6454SAndrew Thompson 	{ ZYD_CR100, 0x00 }, { ZYD_CR101, 0xae }, { ZYD_CR102, 0x02 },	\
45502ac6454SAndrew Thompson 	{ ZYD_CR103, 0x00 }, { ZYD_CR104, 0x03 }, { ZYD_CR105, 0x65 },	\
45602ac6454SAndrew Thompson 	{ ZYD_CR106, 0x04 }, { ZYD_CR107, 0x00 }, { ZYD_CR108, 0x0a },	\
45702ac6454SAndrew Thompson 	{ ZYD_CR109, 0xaa }, { ZYD_CR110, 0xaa }, { ZYD_CR111, 0x25 },	\
45802ac6454SAndrew Thompson 	{ ZYD_CR112, 0x25 }, { ZYD_CR113, 0x00 }, { ZYD_CR119, 0x1e },	\
45902ac6454SAndrew Thompson 	{ ZYD_CR125, 0x90 }, { ZYD_CR126, 0x00 }, { ZYD_CR127, 0x00 },	\
46002ac6454SAndrew Thompson 	{ ZYD_CR5,   0x00 }, { ZYD_CR6,   0x00 }, { ZYD_CR7,   0x00 },	\
46102ac6454SAndrew Thompson 	{ ZYD_CR8,   0x00 }, { ZYD_CR9,   0x20 }, { ZYD_CR12,  0xf0 },	\
46202ac6454SAndrew Thompson 	{ ZYD_CR20,  0x0e }, { ZYD_CR21,  0x0e }, { ZYD_CR27,  0x10 },	\
46302ac6454SAndrew Thompson 	{ ZYD_CR44,  0x33 }, { ZYD_CR47,  0x1E }, { ZYD_CR83,  0x24 },	\
46402ac6454SAndrew Thompson 	{ ZYD_CR84,  0x04 }, { ZYD_CR85,  0x00 }, { ZYD_CR86,  0x0C },	\
46502ac6454SAndrew Thompson 	{ ZYD_CR87,  0x12 }, { ZYD_CR88,  0x0C }, { ZYD_CR89,  0x00 },	\
46602ac6454SAndrew Thompson 	{ ZYD_CR90,  0x10 }, { ZYD_CR91,  0x08 }, { ZYD_CR93,  0x00 },	\
46702ac6454SAndrew Thompson 	{ ZYD_CR94,  0x01 }, { ZYD_CR95,  0x00 }, { ZYD_CR96,  0x50 },	\
46802ac6454SAndrew Thompson 	{ ZYD_CR97,  0x37 }, { ZYD_CR98,  0x35 }, { ZYD_CR101, 0x13 },	\
46902ac6454SAndrew Thompson 	{ ZYD_CR102, 0x27 }, { ZYD_CR103, 0x27 }, { ZYD_CR104, 0x18 },	\
47002ac6454SAndrew Thompson 	{ ZYD_CR105, 0x12 }, { ZYD_CR109, 0x27 }, { ZYD_CR110, 0x27 },	\
47102ac6454SAndrew Thompson 	{ ZYD_CR111, 0x27 }, { ZYD_CR112, 0x27 }, { ZYD_CR113, 0x27 },	\
47202ac6454SAndrew Thompson 	{ ZYD_CR114, 0x27 }, { ZYD_CR115, 0x26 }, { ZYD_CR116, 0x24 },	\
47302ac6454SAndrew Thompson 	{ ZYD_CR117, 0xfc }, { ZYD_CR118, 0xfa }, { ZYD_CR120, 0x4f },	\
47402ac6454SAndrew Thompson 	{ ZYD_CR125, 0xaa }, { ZYD_CR127, 0x03 }, { ZYD_CR128, 0x14 },	\
47502ac6454SAndrew Thompson 	{ ZYD_CR129, 0x12 }, { ZYD_CR130, 0x10 }, { ZYD_CR131, 0x0C },	\
47602ac6454SAndrew Thompson 	{ ZYD_CR136, 0xdf }, { ZYD_CR137, 0x40 }, { ZYD_CR138, 0xa0 },	\
47702ac6454SAndrew Thompson 	{ ZYD_CR139, 0xb0 }, { ZYD_CR140, 0x99 }, { ZYD_CR141, 0x82 },	\
47802ac6454SAndrew Thompson 	{ ZYD_CR142, 0x54 }, { ZYD_CR143, 0x1c }, { ZYD_CR144, 0x6c },	\
47902ac6454SAndrew Thompson 	{ ZYD_CR147, 0x07 }, { ZYD_CR148, 0x4c }, { ZYD_CR149, 0x50 },	\
48002ac6454SAndrew Thompson 	{ ZYD_CR150, 0x0e }, { ZYD_CR151, 0x18 }, { ZYD_CR160, 0xfe },	\
48102ac6454SAndrew Thompson 	{ ZYD_CR161, 0xee }, { ZYD_CR162, 0xaa }, { ZYD_CR163, 0xfa },	\
48202ac6454SAndrew Thompson 	{ ZYD_CR164, 0xfa }, { ZYD_CR165, 0xea }, { ZYD_CR166, 0xbe },	\
48302ac6454SAndrew Thompson 	{ ZYD_CR167, 0xbe }, { ZYD_CR168, 0x6a }, { ZYD_CR169, 0xba },	\
48402ac6454SAndrew Thompson 	{ ZYD_CR170, 0xba }, { ZYD_CR171, 0xba }, { ZYD_CR204, 0x7d },	\
48502ac6454SAndrew Thompson 	{ ZYD_CR203, 0x30 }, { 0, 0}					\
48602ac6454SAndrew Thompson }
48702ac6454SAndrew Thompson 
48802ac6454SAndrew Thompson #define ZYD_DEF_PHYB							\
48902ac6454SAndrew Thompson {									\
49002ac6454SAndrew Thompson 	{ ZYD_CR0,   0x14 }, { ZYD_CR1,   0x06 }, { ZYD_CR2,   0x26 },	\
49102ac6454SAndrew Thompson 	{ ZYD_CR3,   0x38 }, { ZYD_CR4,   0x80 }, { ZYD_CR9,   0xe0 },	\
49202ac6454SAndrew Thompson 	{ ZYD_CR10,  0x81 }, { ZYD_CR11,  0x00 }, { ZYD_CR12,  0xf0 },	\
49302ac6454SAndrew Thompson 	{ ZYD_CR13,  0x8c }, { ZYD_CR14,  0x80 }, { ZYD_CR15,  0x3d },	\
49402ac6454SAndrew Thompson 	{ ZYD_CR16,  0x20 }, { ZYD_CR17,  0x1e }, { ZYD_CR18,  0x0a },	\
49502ac6454SAndrew Thompson 	{ ZYD_CR19,  0x48 }, { ZYD_CR20,  0x10 }, { ZYD_CR21,  0x0e },	\
49602ac6454SAndrew Thompson 	{ ZYD_CR22,  0x23 }, { ZYD_CR23,  0x90 }, { ZYD_CR24,  0x14 },	\
49702ac6454SAndrew Thompson 	{ ZYD_CR25,  0x40 }, { ZYD_CR26,  0x10 }, { ZYD_CR27,  0x10 },	\
49802ac6454SAndrew Thompson 	{ ZYD_CR28,  0x7f }, { ZYD_CR29,  0x80 }, { ZYD_CR30,  0x4b },	\
49902ac6454SAndrew Thompson 	{ ZYD_CR31,  0x60 }, { ZYD_CR32,  0x43 }, { ZYD_CR33,  0x08 },	\
50002ac6454SAndrew Thompson 	{ ZYD_CR34,  0x06 }, { ZYD_CR35,  0x0a }, { ZYD_CR36,  0x00 },	\
50102ac6454SAndrew Thompson 	{ ZYD_CR37,  0x00 }, { ZYD_CR38,  0x38 }, { ZYD_CR39,  0x0c },	\
50202ac6454SAndrew Thompson 	{ ZYD_CR40,  0x84 }, { ZYD_CR41,  0x2a }, { ZYD_CR42,  0x80 },	\
50302ac6454SAndrew Thompson 	{ ZYD_CR43,  0x10 }, { ZYD_CR44,  0x33 }, { ZYD_CR46,  0xff },	\
50402ac6454SAndrew Thompson 	{ ZYD_CR47,  0x1E }, { ZYD_CR48,  0x26 }, { ZYD_CR49,  0x5b },	\
50502ac6454SAndrew Thompson 	{ ZYD_CR64,  0xd0 }, { ZYD_CR65,  0x04 }, { ZYD_CR66,  0x58 },	\
50602ac6454SAndrew Thompson 	{ ZYD_CR67,  0xc9 }, { ZYD_CR68,  0x88 }, { ZYD_CR69,  0x41 },	\
50702ac6454SAndrew Thompson 	{ ZYD_CR70,  0x23 }, { ZYD_CR71,  0x10 }, { ZYD_CR72,  0xff },	\
50802ac6454SAndrew Thompson 	{ ZYD_CR73,  0x32 }, { ZYD_CR74,  0x30 }, { ZYD_CR75,  0x65 },	\
50902ac6454SAndrew Thompson 	{ ZYD_CR76,  0x41 }, { ZYD_CR77,  0x1b }, { ZYD_CR78,  0x30 },	\
51002ac6454SAndrew Thompson 	{ ZYD_CR79,  0xf0 }, { ZYD_CR80,  0x64 }, { ZYD_CR81,  0x64 },	\
51102ac6454SAndrew Thompson 	{ ZYD_CR82,  0x00 }, { ZYD_CR83,  0x24 }, { ZYD_CR84,  0x04 },	\
51202ac6454SAndrew Thompson 	{ ZYD_CR85,  0x00 }, { ZYD_CR86,  0x0c }, { ZYD_CR87,  0x12 },	\
51302ac6454SAndrew Thompson 	{ ZYD_CR88,  0x0c }, { ZYD_CR89,  0x00 }, { ZYD_CR90,  0x58 },	\
51402ac6454SAndrew Thompson 	{ ZYD_CR91,  0x04 }, { ZYD_CR92,  0x00 }, { ZYD_CR93,  0x00 },	\
51502ac6454SAndrew Thompson 	{ ZYD_CR94,  0x01 }, { ZYD_CR95,  0x20 }, { ZYD_CR96,  0x50 },	\
51602ac6454SAndrew Thompson 	{ ZYD_CR97,  0x37 }, { ZYD_CR98,  0x35 }, { ZYD_CR99,  0x00 },	\
51702ac6454SAndrew Thompson 	{ ZYD_CR100, 0x01 }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
51802ac6454SAndrew Thompson 	{ ZYD_CR103, 0x27 }, { ZYD_CR104, 0x18 }, { ZYD_CR105, 0x12 },	\
51902ac6454SAndrew Thompson 	{ ZYD_CR106, 0x04 }, { ZYD_CR107, 0x00 }, { ZYD_CR108, 0x0a },	\
52002ac6454SAndrew Thompson 	{ ZYD_CR109, 0x27 }, { ZYD_CR110, 0x27 }, { ZYD_CR111, 0x27 },	\
52102ac6454SAndrew Thompson 	{ ZYD_CR112, 0x27 }, { ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 },	\
52202ac6454SAndrew Thompson 	{ ZYD_CR115, 0x26 }, { ZYD_CR116, 0x24 }, { ZYD_CR117, 0xfc },	\
52302ac6454SAndrew Thompson 	{ ZYD_CR118, 0xfa }, { ZYD_CR119, 0x1e }, { ZYD_CR125, 0x90 },	\
52402ac6454SAndrew Thompson 	{ ZYD_CR126, 0x00 }, { ZYD_CR127, 0x00 }, { ZYD_CR128, 0x14 },	\
52502ac6454SAndrew Thompson 	{ ZYD_CR129, 0x12 }, { ZYD_CR130, 0x10 }, { ZYD_CR131, 0x0c },	\
52602ac6454SAndrew Thompson 	{ ZYD_CR136, 0xdf }, { ZYD_CR137, 0xa0 }, { ZYD_CR138, 0xa8 },	\
52702ac6454SAndrew Thompson 	{ ZYD_CR139, 0xb4 }, { ZYD_CR140, 0x98 }, { ZYD_CR141, 0x82 },	\
52802ac6454SAndrew Thompson 	{ ZYD_CR142, 0x53 }, { ZYD_CR143, 0x1c }, { ZYD_CR144, 0x6c },	\
52902ac6454SAndrew Thompson 	{ ZYD_CR147, 0x07 }, { ZYD_CR148, 0x40 }, { ZYD_CR149, 0x40 },	\
53002ac6454SAndrew Thompson 	{ ZYD_CR150, 0x14 }, { ZYD_CR151, 0x18 }, { ZYD_CR159, 0x70 },	\
53102ac6454SAndrew Thompson 	{ ZYD_CR160, 0xfe }, { ZYD_CR161, 0xee }, { ZYD_CR162, 0xaa },	\
53202ac6454SAndrew Thompson 	{ ZYD_CR163, 0xfa }, { ZYD_CR164, 0xfa }, { ZYD_CR165, 0xea },	\
53302ac6454SAndrew Thompson 	{ ZYD_CR166, 0xbe }, { ZYD_CR167, 0xbe }, { ZYD_CR168, 0x6a },	\
53402ac6454SAndrew Thompson 	{ ZYD_CR169, 0xba }, { ZYD_CR170, 0xba }, { ZYD_CR171, 0xba },	\
53502ac6454SAndrew Thompson 	{ ZYD_CR204, 0x7d }, { ZYD_CR203, 0x30 },			\
53602ac6454SAndrew Thompson 	{ 0, 0 }							\
53702ac6454SAndrew Thompson }
53802ac6454SAndrew Thompson 
53902ac6454SAndrew Thompson #define ZYD_RFMD_PHY							\
54002ac6454SAndrew Thompson {									\
54102ac6454SAndrew Thompson 	{ ZYD_CR2,   0x1e }, { ZYD_CR9,   0x20 }, { ZYD_CR10,  0x89 },	\
54202ac6454SAndrew Thompson 	{ ZYD_CR11,  0x00 }, { ZYD_CR15,  0xd0 }, { ZYD_CR17,  0x68 },	\
54302ac6454SAndrew Thompson 	{ ZYD_CR19,  0x4a }, { ZYD_CR20,  0x0c }, { ZYD_CR21,  0x0e },	\
54402ac6454SAndrew Thompson 	{ ZYD_CR23,  0x48 }, { ZYD_CR24,  0x14 }, { ZYD_CR26,  0x90 },	\
54502ac6454SAndrew Thompson 	{ ZYD_CR27,  0x30 }, { ZYD_CR29,  0x20 }, { ZYD_CR31,  0xb2 },	\
54602ac6454SAndrew Thompson 	{ ZYD_CR32,  0x43 }, { ZYD_CR33,  0x28 }, { ZYD_CR38,  0x30 },	\
54702ac6454SAndrew Thompson 	{ ZYD_CR34,  0x0f }, { ZYD_CR35,  0xf0 }, { ZYD_CR41,  0x2a },	\
54802ac6454SAndrew Thompson 	{ ZYD_CR46,  0x7f }, { ZYD_CR47,  0x1e }, { ZYD_CR51,  0xc5 },	\
54902ac6454SAndrew Thompson 	{ ZYD_CR52,  0xc5 }, { ZYD_CR53,  0xc5 }, { ZYD_CR79,  0x58 },	\
55002ac6454SAndrew Thompson 	{ ZYD_CR80,  0x30 }, { ZYD_CR81,  0x30 }, { ZYD_CR82,  0x00 },	\
55102ac6454SAndrew Thompson 	{ ZYD_CR83,  0x24 }, { ZYD_CR84,  0x04 }, { ZYD_CR85,  0x00 },	\
55202ac6454SAndrew Thompson 	{ ZYD_CR86,  0x10 }, { ZYD_CR87,  0x2a }, { ZYD_CR88,  0x10 },	\
55302ac6454SAndrew Thompson 	{ ZYD_CR89,  0x24 }, { ZYD_CR90,  0x18 }, { ZYD_CR91,  0x00 },	\
55402ac6454SAndrew Thompson 	{ ZYD_CR92,  0x0a }, { ZYD_CR93,  0x00 }, { ZYD_CR94,  0x01 },	\
55502ac6454SAndrew Thompson 	{ ZYD_CR95,  0x00 }, { ZYD_CR96,  0x40 }, { ZYD_CR97,  0x37 },	\
55602ac6454SAndrew Thompson 	{ ZYD_CR98,  0x05 }, { ZYD_CR99,  0x28 }, { ZYD_CR100, 0x00 },	\
55702ac6454SAndrew Thompson 	{ ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 }, { ZYD_CR103, 0x27 },	\
55802ac6454SAndrew Thompson 	{ ZYD_CR104, 0x18 }, { ZYD_CR105, 0x12 }, { ZYD_CR106, 0x1a },	\
55902ac6454SAndrew Thompson 	{ ZYD_CR107, 0x24 }, { ZYD_CR108, 0x0a }, { ZYD_CR109, 0x13 },	\
56002ac6454SAndrew Thompson 	{ ZYD_CR110, 0x2f }, { ZYD_CR111, 0x27 }, { ZYD_CR112, 0x27 },	\
56102ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x40 },	\
56202ac6454SAndrew Thompson 	{ ZYD_CR116, 0x40 }, { ZYD_CR117, 0xf0 }, { ZYD_CR118, 0xf0 },	\
56302ac6454SAndrew Thompson 	{ ZYD_CR119, 0x16 }, { ZYD_CR122, 0x00 }, { ZYD_CR127, 0x03 },	\
56402ac6454SAndrew Thompson 	{ ZYD_CR131, 0x08 }, { ZYD_CR138, 0x28 }, { ZYD_CR148, 0x44 },	\
56502ac6454SAndrew Thompson 	{ ZYD_CR150, 0x10 }, { ZYD_CR169, 0xbb }, { ZYD_CR170, 0xbb }	\
56602ac6454SAndrew Thompson }
56702ac6454SAndrew Thompson 
56802ac6454SAndrew Thompson #define ZYD_RFMD_RF							\
56902ac6454SAndrew Thompson {									\
57002ac6454SAndrew Thompson 	0x000007, 0x07dd43, 0x080959, 0x0e6666, 0x116a57, 0x17dd43,	\
57102ac6454SAndrew Thompson 	0x1819f9, 0x1e6666, 0x214554, 0x25e7fa, 0x27fffa, 0x294128,	\
57202ac6454SAndrew Thompson 	0x2c0000, 0x300000, 0x340000, 0x381e0f, 0x6c180f		\
57302ac6454SAndrew Thompson }
57402ac6454SAndrew Thompson 
57502ac6454SAndrew Thompson #define ZYD_RFMD_CHANTABLE	\
57602ac6454SAndrew Thompson {				\
57702ac6454SAndrew Thompson 	{ 0x181979, 0x1e6666 },	\
57802ac6454SAndrew Thompson 	{ 0x181989, 0x1e6666 },	\
57902ac6454SAndrew Thompson 	{ 0x181999, 0x1e6666 },	\
58002ac6454SAndrew Thompson 	{ 0x1819a9, 0x1e6666 },	\
58102ac6454SAndrew Thompson 	{ 0x1819b9, 0x1e6666 },	\
58202ac6454SAndrew Thompson 	{ 0x1819c9, 0x1e6666 },	\
58302ac6454SAndrew Thompson 	{ 0x1819d9, 0x1e6666 },	\
58402ac6454SAndrew Thompson 	{ 0x1819e9, 0x1e6666 },	\
58502ac6454SAndrew Thompson 	{ 0x1819f9, 0x1e6666 },	\
58602ac6454SAndrew Thompson 	{ 0x181a09, 0x1e6666 },	\
58702ac6454SAndrew Thompson 	{ 0x181a19, 0x1e6666 },	\
58802ac6454SAndrew Thompson 	{ 0x181a29, 0x1e6666 },	\
58902ac6454SAndrew Thompson 	{ 0x181a39, 0x1e6666 },	\
59002ac6454SAndrew Thompson 	{ 0x181a60, 0x1c0000 }	\
59102ac6454SAndrew Thompson }
59202ac6454SAndrew Thompson 
59302ac6454SAndrew Thompson #define ZYD_AL2230_PHY							\
59402ac6454SAndrew Thompson {									\
59502ac6454SAndrew Thompson 	{ ZYD_CR15,  0x20 }, { ZYD_CR23,  0x40 }, { ZYD_CR24,  0x20 },	\
59602ac6454SAndrew Thompson 	{ ZYD_CR26,  0x11 }, { ZYD_CR28,  0x3e }, { ZYD_CR29,  0x00 },	\
59702ac6454SAndrew Thompson 	{ ZYD_CR44,  0x33 }, { ZYD_CR106, 0x2a }, { ZYD_CR107, 0x1a },	\
59802ac6454SAndrew Thompson 	{ ZYD_CR109, 0x09 }, { ZYD_CR110, 0x27 }, { ZYD_CR111, 0x2b },	\
59902ac6454SAndrew Thompson 	{ ZYD_CR112, 0x2b }, { ZYD_CR119, 0x0a }, { ZYD_CR10,  0x89 },	\
60002ac6454SAndrew Thompson 	{ ZYD_CR17,  0x28 }, { ZYD_CR26,  0x93 }, { ZYD_CR34,  0x30 },	\
60102ac6454SAndrew Thompson 	{ ZYD_CR35,  0x3e }, { ZYD_CR41,  0x24 }, { ZYD_CR44,  0x32 },	\
60202ac6454SAndrew Thompson 	{ ZYD_CR46,  0x96 }, { ZYD_CR47,  0x1e }, { ZYD_CR79,  0x58 },	\
60302ac6454SAndrew Thompson 	{ ZYD_CR80,  0x30 }, { ZYD_CR81,  0x30 }, { ZYD_CR87,  0x0a },	\
60402ac6454SAndrew Thompson 	{ ZYD_CR89,  0x04 }, { ZYD_CR92,  0x0a }, { ZYD_CR99,  0x28 },	\
60502ac6454SAndrew Thompson 	{ ZYD_CR100, 0x00 }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
60602ac6454SAndrew Thompson 	{ ZYD_CR106, 0x24 }, { ZYD_CR107, 0x2a }, { ZYD_CR109, 0x09 },	\
60702ac6454SAndrew Thompson 	{ ZYD_CR110, 0x13 }, { ZYD_CR111, 0x1f }, { ZYD_CR112, 0x1f },	\
60802ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 },	\
60902ac6454SAndrew Thompson 	{ ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0xfc },	\
61002ac6454SAndrew Thompson 	{ ZYD_CR119, 0x10 }, { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x77 },	\
61102ac6454SAndrew Thompson 	{ ZYD_CR122, 0xe0 }, { ZYD_CR137, 0x88 }, { ZYD_CR252, 0xff },	\
61202ac6454SAndrew Thompson 	{ ZYD_CR253, 0xff }, { ZYD_CR251, 0x2f }, { ZYD_CR251, 0x3f },	\
61302ac6454SAndrew Thompson 	{ ZYD_CR138, 0x28 }, { ZYD_CR203, 0x06 } 			\
61402ac6454SAndrew Thompson }
61502ac6454SAndrew Thompson 
61602ac6454SAndrew Thompson #define ZYD_AL2230_PHY_B						\
61702ac6454SAndrew Thompson {									\
61802ac6454SAndrew Thompson 	{ ZYD_CR10,  0x89 }, { ZYD_CR15,  0x20 }, { ZYD_CR17,  0x2B },	\
61902ac6454SAndrew Thompson 	{ ZYD_CR23,  0x40 }, { ZYD_CR24,  0x20 }, { ZYD_CR26,  0x93 },	\
62002ac6454SAndrew Thompson 	{ ZYD_CR28,  0x3e }, { ZYD_CR29,  0x00 }, { ZYD_CR33,  0x28 },	\
62102ac6454SAndrew Thompson 	{ ZYD_CR34,  0x30 }, { ZYD_CR35,  0x3e }, { ZYD_CR41,  0x24 },	\
62202ac6454SAndrew Thompson 	{ ZYD_CR44,  0x32 }, { ZYD_CR46,  0x99 }, { ZYD_CR47,  0x1e },	\
62302ac6454SAndrew Thompson 	{ ZYD_CR48,  0x06 }, { ZYD_CR49,  0xf9 }, { ZYD_CR51,  0x01 },	\
62402ac6454SAndrew Thompson 	{ ZYD_CR52,  0x80 }, { ZYD_CR53,  0x7e }, { ZYD_CR65,  0x00 },	\
62502ac6454SAndrew Thompson 	{ ZYD_CR66,  0x00 }, { ZYD_CR67,  0x00 }, { ZYD_CR68,  0x00 },	\
62602ac6454SAndrew Thompson 	{ ZYD_CR69,  0x28 }, { ZYD_CR79,  0x58 }, { ZYD_CR80,  0x30 },	\
62702ac6454SAndrew Thompson 	{ ZYD_CR81,  0x30 }, { ZYD_CR87,  0x0a }, { ZYD_CR89,  0x04 },	\
62802ac6454SAndrew Thompson 	{ ZYD_CR91,  0x00 }, { ZYD_CR92,  0x0a }, { ZYD_CR98,  0x8d },	\
62902ac6454SAndrew Thompson 	{ ZYD_CR99,  0x00 }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
63002ac6454SAndrew Thompson 	{ ZYD_CR106, 0x24 }, { ZYD_CR107, 0x2a }, { ZYD_CR109, 0x13 },	\
63102ac6454SAndrew Thompson 	{ ZYD_CR110, 0x1f }, { ZYD_CR111, 0x1f }, { ZYD_CR112, 0x1f },	\
63202ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x26 },	\
63302ac6454SAndrew Thompson 	{ ZYD_CR116, 0x24 }, { ZYD_CR117, 0xfa }, { ZYD_CR118, 0xfa },	\
63402ac6454SAndrew Thompson 	{ ZYD_CR119, 0x10 }, { ZYD_CR120, 0x4f }, { ZYD_CR121, 0x6c },	\
63502ac6454SAndrew Thompson 	{ ZYD_CR122, 0xfc }, { ZYD_CR123, 0x57 }, { ZYD_CR125, 0xad },	\
63602ac6454SAndrew Thompson 	{ ZYD_CR126, 0x6c }, { ZYD_CR127, 0x03 }, { ZYD_CR137, 0x50 },	\
63702ac6454SAndrew Thompson 	{ ZYD_CR138, 0xa8 }, { ZYD_CR144, 0xac }, { ZYD_CR150, 0x0d },	\
63802ac6454SAndrew Thompson 	{ ZYD_CR252, 0x34 }, { ZYD_CR253, 0x34 }			\
63902ac6454SAndrew Thompson }
64002ac6454SAndrew Thompson 
64102ac6454SAndrew Thompson #define ZYD_AL2230_PHY_PART1						\
64202ac6454SAndrew Thompson {									\
64302ac6454SAndrew Thompson 	{ ZYD_CR240, 0x57 }, { ZYD_CR9,   0xe0 }			\
64402ac6454SAndrew Thompson }
64502ac6454SAndrew Thompson 
64602ac6454SAndrew Thompson #define ZYD_AL2230_PHY_PART2						\
64702ac6454SAndrew Thompson {									\
64802ac6454SAndrew Thompson 	{ ZYD_CR251, 0x2f }, { ZYD_CR251, 0x7f },			\
64902ac6454SAndrew Thompson }
65002ac6454SAndrew Thompson 
65102ac6454SAndrew Thompson #define ZYD_AL2230_PHY_PART3						\
65202ac6454SAndrew Thompson {									\
65302ac6454SAndrew Thompson 	{ ZYD_CR128, 0x14 }, { ZYD_CR129, 0x12 }, { ZYD_CR130, 0x10 },	\
65402ac6454SAndrew Thompson }
65502ac6454SAndrew Thompson 
65602ac6454SAndrew Thompson #define	ZYD_AL2230S_PHY_INIT						\
65702ac6454SAndrew Thompson {									\
65802ac6454SAndrew Thompson 	{ ZYD_CR47,  0x1e }, { ZYD_CR106, 0x22 }, { ZYD_CR107, 0x2a },	\
65902ac6454SAndrew Thompson 	{ ZYD_CR109, 0x13 }, { ZYD_CR118, 0xf8 }, { ZYD_CR119, 0x12 },	\
66002ac6454SAndrew Thompson 	{ ZYD_CR122, 0xe0 }, { ZYD_CR128, 0x10 }, { ZYD_CR129, 0x0e },	\
66102ac6454SAndrew Thompson 	{ ZYD_CR130, 0x10 }						\
66202ac6454SAndrew Thompson }
66302ac6454SAndrew Thompson 
66402ac6454SAndrew Thompson #define	ZYD_AL2230_PHY_FINI_PART1					\
66502ac6454SAndrew Thompson {									\
66602ac6454SAndrew Thompson 	{ ZYD_CR80,  0x30 }, { ZYD_CR81,  0x30 }, { ZYD_CR79,  0x58 },	\
66702ac6454SAndrew Thompson 	{ ZYD_CR12,  0xf0 }, { ZYD_CR77,  0x1b }, { ZYD_CR78,  0x58 },	\
66802ac6454SAndrew Thompson 	{ ZYD_CR203, 0x06 }, { ZYD_CR240, 0x80 },			\
66902ac6454SAndrew Thompson }
67002ac6454SAndrew Thompson 
67102ac6454SAndrew Thompson #define ZYD_AL2230_RF_PART1						\
67202ac6454SAndrew Thompson {									\
67302ac6454SAndrew Thompson 	0x03f790, 0x033331, 0x00000d, 0x0b3331, 0x03b812, 0x00fff3	\
67402ac6454SAndrew Thompson }
67502ac6454SAndrew Thompson 
67602ac6454SAndrew Thompson #define ZYD_AL2230_RF_PART2						\
67702ac6454SAndrew Thompson {									\
67802ac6454SAndrew Thompson 	0x000da4, 0x0f4dc5, 0x0805b6, 0x011687, 0x000688, 0x0403b9,	\
67902ac6454SAndrew Thompson 	0x00dbba, 0x00099b, 0x0bdffc, 0x00000d, 0x00500f		\
68002ac6454SAndrew Thompson }
68102ac6454SAndrew Thompson 
68202ac6454SAndrew Thompson #define ZYD_AL2230_RF_PART3						\
68302ac6454SAndrew Thompson {									\
68402ac6454SAndrew Thompson 	0x00d00f, 0x004c0f, 0x00540f, 0x00700f, 0x00500f		\
68502ac6454SAndrew Thompson }
68602ac6454SAndrew Thompson 
68702ac6454SAndrew Thompson #define ZYD_AL2230_RF_B							\
68802ac6454SAndrew Thompson {									\
68902ac6454SAndrew Thompson 	0x03f790, 0x033331, 0x00000d, 0x0b3331, 0x03b812, 0x00fff3,	\
69002ac6454SAndrew Thompson 	0x0005a4, 0x0f4dc5, 0x0805b6, 0x0146c7, 0x000688, 0x0403b9,	\
69102ac6454SAndrew Thompson 	0x00dbba, 0x00099b, 0x0bdffc, 0x00000d, 0x00580f		\
69202ac6454SAndrew Thompson }
69302ac6454SAndrew Thompson 
69402ac6454SAndrew Thompson #define ZYD_AL2230_RF_B_PART1						\
69502ac6454SAndrew Thompson {									\
69602ac6454SAndrew Thompson 	0x8cccd0, 0x481dc0, 0xcfff00, 0x25a000				\
69702ac6454SAndrew Thompson }
69802ac6454SAndrew Thompson 
69902ac6454SAndrew Thompson #define ZYD_AL2230_RF_B_PART2						\
70002ac6454SAndrew Thompson {									\
70102ac6454SAndrew Thompson 	0x25a000, 0xa3b2f0, 0x6da010, 0xe36280, 0x116000, 0x9dc020,	\
70202ac6454SAndrew Thompson 	0x5ddb00, 0xd99000, 0x3ffbd0, 0xb00000, 0xf01a00		\
70302ac6454SAndrew Thompson }
70402ac6454SAndrew Thompson 
70502ac6454SAndrew Thompson #define ZYD_AL2230_RF_B_PART3						\
70602ac6454SAndrew Thompson {									\
70702ac6454SAndrew Thompson 	0xf01b00, 0xf01e00, 0xf01a00					\
70802ac6454SAndrew Thompson }
70902ac6454SAndrew Thompson 
71002ac6454SAndrew Thompson #define ZYD_AL2230_CHANTABLE			\
71102ac6454SAndrew Thompson {						\
71202ac6454SAndrew Thompson 	{ 0x03f790, 0x033331, 0x00000d },	\
71302ac6454SAndrew Thompson 	{ 0x03f790, 0x0b3331, 0x00000d },	\
71402ac6454SAndrew Thompson 	{ 0x03e790, 0x033331, 0x00000d },	\
71502ac6454SAndrew Thompson 	{ 0x03e790, 0x0b3331, 0x00000d },	\
71602ac6454SAndrew Thompson 	{ 0x03f7a0, 0x033331, 0x00000d },	\
71702ac6454SAndrew Thompson 	{ 0x03f7a0, 0x0b3331, 0x00000d },	\
71802ac6454SAndrew Thompson 	{ 0x03e7a0, 0x033331, 0x00000d },	\
71902ac6454SAndrew Thompson 	{ 0x03e7a0, 0x0b3331, 0x00000d },	\
72002ac6454SAndrew Thompson 	{ 0x03f7b0, 0x033331, 0x00000d },	\
72102ac6454SAndrew Thompson 	{ 0x03f7b0, 0x0b3331, 0x00000d },	\
72202ac6454SAndrew Thompson 	{ 0x03e7b0, 0x033331, 0x00000d },	\
72302ac6454SAndrew Thompson 	{ 0x03e7b0, 0x0b3331, 0x00000d },	\
72402ac6454SAndrew Thompson 	{ 0x03f7c0, 0x033331, 0x00000d },	\
72502ac6454SAndrew Thompson 	{ 0x03e7c0, 0x066661, 0x00000d }	\
72602ac6454SAndrew Thompson }
72702ac6454SAndrew Thompson 
72802ac6454SAndrew Thompson #define ZYD_AL2230_CHANTABLE_B			\
72902ac6454SAndrew Thompson {						\
73002ac6454SAndrew Thompson 	{ 0x09efc0, 0x8cccc0, 0xb00000 },	\
73102ac6454SAndrew Thompson 	{ 0x09efc0, 0x8cccd0, 0xb00000 },	\
73202ac6454SAndrew Thompson 	{ 0x09e7c0, 0x8cccc0, 0xb00000 },	\
73302ac6454SAndrew Thompson 	{ 0x09e7c0, 0x8cccd0, 0xb00000 },	\
73402ac6454SAndrew Thompson 	{ 0x05efc0, 0x8cccc0, 0xb00000 },	\
73502ac6454SAndrew Thompson 	{ 0x05efc0, 0x8cccd0, 0xb00000 },	\
73602ac6454SAndrew Thompson 	{ 0x05e7c0, 0x8cccc0, 0xb00000 },	\
73702ac6454SAndrew Thompson 	{ 0x05e7c0, 0x8cccd0, 0xb00000 },	\
73802ac6454SAndrew Thompson 	{ 0x0defc0, 0x8cccc0, 0xb00000 },	\
73902ac6454SAndrew Thompson 	{ 0x0defc0, 0x8cccd0, 0xb00000 },	\
74002ac6454SAndrew Thompson 	{ 0x0de7c0, 0x8cccc0, 0xb00000 },	\
74102ac6454SAndrew Thompson 	{ 0x0de7c0, 0x8cccd0, 0xb00000 },	\
74202ac6454SAndrew Thompson 	{ 0x03efc0, 0x8cccc0, 0xb00000 },	\
74302ac6454SAndrew Thompson 	{ 0x03e7c0, 0x866660, 0xb00000 }	\
74402ac6454SAndrew Thompson }
74502ac6454SAndrew Thompson 
74602ac6454SAndrew Thompson #define ZYD_AL7230B_PHY_1							\
74702ac6454SAndrew Thompson {									\
74802ac6454SAndrew Thompson 	{ ZYD_CR240, 0x57 }, { ZYD_CR15,  0x20 }, { ZYD_CR23,  0x40 },	\
74902ac6454SAndrew Thompson 	{ ZYD_CR24,  0x20 }, { ZYD_CR26,  0x11 }, { ZYD_CR28,  0x3e },	\
75002ac6454SAndrew Thompson 	{ ZYD_CR29,  0x00 }, { ZYD_CR44,  0x33 }, { ZYD_CR106, 0x22 },	\
75102ac6454SAndrew Thompson 	{ ZYD_CR107, 0x1a }, { ZYD_CR109, 0x09 }, { ZYD_CR110, 0x27 },	\
75202ac6454SAndrew Thompson 	{ ZYD_CR111, 0x2b }, { ZYD_CR112, 0x2b }, { ZYD_CR119, 0x0a },	\
75302ac6454SAndrew Thompson 	{ ZYD_CR122, 0xfc }, { ZYD_CR10,  0x89 }, { ZYD_CR17,  0x28 },	\
75402ac6454SAndrew Thompson 	{ ZYD_CR26,  0x93 }, { ZYD_CR34,  0x30 }, { ZYD_CR35,  0x3e },	\
75502ac6454SAndrew Thompson 	{ ZYD_CR41,  0x24 }, { ZYD_CR44,  0x32 }, { ZYD_CR46,  0x96 },	\
75602ac6454SAndrew Thompson 	{ ZYD_CR47,  0x1e }, { ZYD_CR79,  0x58 }, { ZYD_CR80,  0x30 },	\
75702ac6454SAndrew Thompson 	{ ZYD_CR81,  0x30 }, { ZYD_CR87,  0x0a }, { ZYD_CR89,  0x04 },	\
75802ac6454SAndrew Thompson 	{ ZYD_CR92,  0x0a }, { ZYD_CR99,  0x28 }, { ZYD_CR100, 0x02 },	\
75902ac6454SAndrew Thompson 	{ ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 }, { ZYD_CR106, 0x22 },	\
76002ac6454SAndrew Thompson 	{ ZYD_CR107, 0x3f }, { ZYD_CR109, 0x09 }, { ZYD_CR110, 0x1f },	\
76102ac6454SAndrew Thompson 	{ ZYD_CR111, 0x1f }, { ZYD_CR112, 0x1f }, { ZYD_CR113, 0x27 },	\
76202ac6454SAndrew Thompson 	{ ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 }, { ZYD_CR116, 0x3f },	\
76302ac6454SAndrew Thompson 	{ ZYD_CR117, 0xfa }, { ZYD_CR118, 0xfc }, { ZYD_CR119, 0x10 },	\
76402ac6454SAndrew Thompson 	{ ZYD_CR120, 0x4f }, { ZYD_CR121, 0x77 }, { ZYD_CR137, 0x88 },	\
76502ac6454SAndrew Thompson 	{ ZYD_CR138, 0xa8 }, { ZYD_CR252, 0x34 }, { ZYD_CR253, 0x34 },	\
76602ac6454SAndrew Thompson 	{ ZYD_CR251, 0x2f }						\
76702ac6454SAndrew Thompson }
76802ac6454SAndrew Thompson 
76902ac6454SAndrew Thompson #define ZYD_AL7230B_PHY_2						\
77002ac6454SAndrew Thompson {									\
77102ac6454SAndrew Thompson 	{ ZYD_CR251, 0x3f }, { ZYD_CR128, 0x14 }, { ZYD_CR129, 0x12 },	\
77202ac6454SAndrew Thompson 	{ ZYD_CR130, 0x10 }, { ZYD_CR38,  0x38 }, { ZYD_CR136, 0xdf }	\
77302ac6454SAndrew Thompson }
77402ac6454SAndrew Thompson 
77502ac6454SAndrew Thompson #define ZYD_AL7230B_PHY_3						\
77602ac6454SAndrew Thompson {									\
77702ac6454SAndrew Thompson 	{ ZYD_CR203, 0x06 }, { ZYD_CR240, 0x80 }			\
77802ac6454SAndrew Thompson }
77902ac6454SAndrew Thompson 
78002ac6454SAndrew Thompson #define ZYD_AL7230B_RF_1						\
78102ac6454SAndrew Thompson {									\
78202ac6454SAndrew Thompson 	0x09ec04, 0x8cccc8, 0x4ff821, 0xc5fbfc, 0x21ebfe, 0xafd401,	\
78302ac6454SAndrew Thompson 	0x6cf56a, 0xe04073, 0x193d76, 0x9dd844, 0x500007, 0xd8c010,	\
78402ac6454SAndrew Thompson 	0x3c9000, 0xbfffff, 0x700000, 0xf15d58				\
78502ac6454SAndrew Thompson }
78602ac6454SAndrew Thompson 
78702ac6454SAndrew Thompson #define ZYD_AL7230B_RF_2						\
78802ac6454SAndrew Thompson {									\
78902ac6454SAndrew Thompson 	0xf15d59, 0xf15d5c, 0xf15d58					\
79002ac6454SAndrew Thompson }
79102ac6454SAndrew Thompson 
79202ac6454SAndrew Thompson #define ZYD_AL7230B_RF_SETCHANNEL					\
79302ac6454SAndrew Thompson {									\
79402ac6454SAndrew Thompson 	0x4ff821, 0xc5fbfc, 0x21ebfe, 0xafd401, 0x6cf56a, 0xe04073,	\
79502ac6454SAndrew Thompson 	0x193d76, 0x9dd844, 0x500007, 0xd8c010, 0x3c9000, 0xf15d58	\
79602ac6454SAndrew Thompson }
79702ac6454SAndrew Thompson 
79802ac6454SAndrew Thompson #define ZYD_AL7230B_CHANTABLE	\
79902ac6454SAndrew Thompson {				\
80002ac6454SAndrew Thompson 	{ 0x09ec00, 0x8cccc8 },	\
80102ac6454SAndrew Thompson 	{ 0x09ec00, 0x8cccd8 },	\
80202ac6454SAndrew Thompson 	{ 0x09ec00, 0x8cccc0 },	\
80302ac6454SAndrew Thompson 	{ 0x09ec00, 0x8cccd0 },	\
80402ac6454SAndrew Thompson 	{ 0x05ec00, 0x8cccc8 },	\
80502ac6454SAndrew Thompson 	{ 0x05ec00, 0x8cccd8 },	\
80602ac6454SAndrew Thompson 	{ 0x05ec00, 0x8cccc0 },	\
80702ac6454SAndrew Thompson 	{ 0x05ec00, 0x8cccd0 },	\
80802ac6454SAndrew Thompson 	{ 0x0dec00, 0x8cccc8 },	\
80902ac6454SAndrew Thompson 	{ 0x0dec00, 0x8cccd8 },	\
81002ac6454SAndrew Thompson 	{ 0x0dec00, 0x8cccc0 },	\
81102ac6454SAndrew Thompson 	{ 0x0dec00, 0x8cccd0 },	\
81202ac6454SAndrew Thompson 	{ 0x03ec00, 0x8cccc8 },	\
81302ac6454SAndrew Thompson 	{ 0x03ec00, 0x866660 }	\
81402ac6454SAndrew Thompson }
81502ac6454SAndrew Thompson 
81602ac6454SAndrew Thompson #define ZYD_AL2210_PHY							\
81702ac6454SAndrew Thompson {									\
81802ac6454SAndrew Thompson 	{ ZYD_CR9,   0xe0 }, { ZYD_CR10, 0x91 }, { ZYD_CR12,  0x90 },	\
81902ac6454SAndrew Thompson 	{ ZYD_CR15,  0xd0 }, { ZYD_CR16, 0x40 }, { ZYD_CR17,  0x58 },	\
82002ac6454SAndrew Thompson 	{ ZYD_CR18,  0x04 }, { ZYD_CR23, 0x66 }, { ZYD_CR24,  0x14 },	\
82102ac6454SAndrew Thompson 	{ ZYD_CR26,  0x90 }, { ZYD_CR31, 0x80 }, { ZYD_CR34,  0x06 },	\
82202ac6454SAndrew Thompson 	{ ZYD_CR35,  0x3e }, { ZYD_CR38, 0x38 }, { ZYD_CR46,  0x90 },	\
82302ac6454SAndrew Thompson 	{ ZYD_CR47,  0x1e }, { ZYD_CR64, 0x64 }, { ZYD_CR79,  0xb5 },	\
82402ac6454SAndrew Thompson 	{ ZYD_CR80,  0x38 }, { ZYD_CR81, 0x30 }, { ZYD_CR113, 0xc0 },	\
82502ac6454SAndrew Thompson 	{ ZYD_CR127, 0x03 }						\
82602ac6454SAndrew Thompson }
82702ac6454SAndrew Thompson 
82802ac6454SAndrew Thompson #define ZYD_AL2210_RF							\
82902ac6454SAndrew Thompson {									\
83002ac6454SAndrew Thompson 	0x2396c0, 0x00fcb1, 0x358132, 0x0108b3, 0xc77804, 0x456415,	\
83102ac6454SAndrew Thompson 	0xff2226, 0x806667, 0x7860f8, 0xbb01c9, 0x00000a, 0x00000b	\
83202ac6454SAndrew Thompson }
83302ac6454SAndrew Thompson 
83402ac6454SAndrew Thompson #define ZYD_AL2210_CHANTABLE						\
83502ac6454SAndrew Thompson {									\
83602ac6454SAndrew Thompson 	0x0196c0, 0x019710, 0x019760, 0x0197b0,	0x019800, 0x019850,	\
83702ac6454SAndrew Thompson 	0x0198a0, 0x0198f0, 0x019940, 0x019990, 0x0199e0, 0x019a30,	\
83802ac6454SAndrew Thompson 	0x019a80, 0x019b40 						\
83902ac6454SAndrew Thompson }
84002ac6454SAndrew Thompson 
84102ac6454SAndrew Thompson #define ZYD_GCT_PHY							\
84202ac6454SAndrew Thompson {									\
84302ac6454SAndrew Thompson 	{ ZYD_CR47,  0x1e }, { ZYD_CR15, 0xdc }, { ZYD_CR113, 0xc0 },	\
84402ac6454SAndrew Thompson 	{ ZYD_CR20,  0x0c }, { ZYD_CR17, 0x65 }, { ZYD_CR34,  0x04 },	\
84502ac6454SAndrew Thompson 	{ ZYD_CR35,  0x35 }, { ZYD_CR24, 0x20 }, { ZYD_CR9,   0xe0 },	\
84602ac6454SAndrew Thompson 	{ ZYD_CR127, 0x02 }, { ZYD_CR10, 0x91 }, { ZYD_CR23,  0x7f },	\
84702ac6454SAndrew Thompson 	{ ZYD_CR27,  0x10 }, { ZYD_CR28, 0x7a }, { ZYD_CR79,  0xb5 },	\
84802ac6454SAndrew Thompson 	{ ZYD_CR64,  0x80 }, { ZYD_CR33, 0x28 }, { ZYD_CR38,  0x30 }	\
84902ac6454SAndrew Thompson }
85002ac6454SAndrew Thompson 
85102ac6454SAndrew Thompson #define ZYD_GCT_RF							\
85202ac6454SAndrew Thompson {									\
85302ac6454SAndrew Thompson 	0x1f0000, 0x1f0000, 0x1f0200, 0x1f0600, 0x1f8600, 0x1f8600,	\
85402ac6454SAndrew Thompson 	0x002050, 0x1f8000, 0x1f8200, 0x1f8600, 0x1c0000, 0x10c458,	\
85502ac6454SAndrew Thompson 	0x088e92, 0x187b82, 0x0401b4, 0x140816, 0x0c7000, 0x1c0000,	\
85602ac6454SAndrew Thompson 	0x02ccae, 0x128023, 0x0a0000, 0x1a0000, 0x06e380, 0x16cb94,	\
85702ac6454SAndrew Thompson 	0x0e1740, 0x014980, 0x116240, 0x090000, 0x192304, 0x05112f,	\
85802ac6454SAndrew Thompson 	0x0d54a8, 0x0f8000, 0x1c0008, 0x1c0000, 0x1a0000, 0x1c0008,	\
85902ac6454SAndrew Thompson 	0x150000, 0x0c7000, 0x150800, 0x150000				\
86002ac6454SAndrew Thompson }
86102ac6454SAndrew Thompson 
86202ac6454SAndrew Thompson #define ZYD_GCT_CHANTABLE						\
86302ac6454SAndrew Thompson {									\
86402ac6454SAndrew Thompson 	0x1a0000, 0x1a8000, 0x1a4000, 0x1ac000,	0x1a2000, 0x1aa000,	\
86502ac6454SAndrew Thompson 	0x1a6000, 0x1ae000, 0x1a1000, 0x1a9000, 0x1a5000, 0x1ad000,	\
86602ac6454SAndrew Thompson 	0x1a3000, 0x1ab000						\
86702ac6454SAndrew Thompson }
86802ac6454SAndrew Thompson 
86902ac6454SAndrew Thompson #define ZYD_MAXIM_PHY							\
87002ac6454SAndrew Thompson {									\
87102ac6454SAndrew Thompson 	{ ZYD_CR23,  0x40 }, { ZYD_CR15,  0x20 }, { ZYD_CR28,  0x3e },	\
87202ac6454SAndrew Thompson 	{ ZYD_CR29,  0x00 }, { ZYD_CR26,  0x11 }, { ZYD_CR44,  0x33 },	\
87302ac6454SAndrew Thompson 	{ ZYD_CR106, 0x2a }, { ZYD_CR107, 0x1a }, { ZYD_CR109, 0x2b },	\
87402ac6454SAndrew Thompson 	{ ZYD_CR110, 0x2b }, { ZYD_CR111, 0x2b }, { ZYD_CR112, 0x2b },	\
87502ac6454SAndrew Thompson 	{ ZYD_CR10,  0x89 }, { ZYD_CR17,  0x20 }, { ZYD_CR26,  0x93 },	\
87602ac6454SAndrew Thompson 	{ ZYD_CR34,  0x30 }, { ZYD_CR35,  0x40 }, { ZYD_CR41,  0x24 },	\
87702ac6454SAndrew Thompson 	{ ZYD_CR44,  0x32 }, { ZYD_CR46,  0x90 }, { ZYD_CR89,  0x18 },	\
87802ac6454SAndrew Thompson 	{ ZYD_CR92,  0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
87902ac6454SAndrew Thompson 	{ ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x09 },	\
88002ac6454SAndrew Thompson 	{ ZYD_CR110, 0x13 }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x13 },	\
88102ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 },	\
88202ac6454SAndrew Thompson 	{ ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0xfa },	\
88302ac6454SAndrew Thompson 	{ ZYD_CR120, 0x4f }, { ZYD_CR121, 0x77 }, { ZYD_CR122, 0xfe },	\
88402ac6454SAndrew Thompson 	{ ZYD_CR10,  0x89 }, { ZYD_CR17,  0x20 }, { ZYD_CR26,  0x93 },	\
88502ac6454SAndrew Thompson 	{ ZYD_CR34,  0x30 }, { ZYD_CR35,  0x40 }, { ZYD_CR41,  0x24 },	\
88602ac6454SAndrew Thompson 	{ ZYD_CR44,  0x32 }, { ZYD_CR46,  0x90 }, { ZYD_CR89,  0x18 },	\
88702ac6454SAndrew Thompson 	{ ZYD_CR92,  0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
88802ac6454SAndrew Thompson 	{ ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x13 },	\
88902ac6454SAndrew Thompson 	{ ZYD_CR110, 0x27 }, { ZYD_CR111, 0x27 }, { ZYD_CR112, 0x13 },	\
89002ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 },	\
89102ac6454SAndrew Thompson 	{ ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0x00 },	\
89202ac6454SAndrew Thompson 	{ ZYD_CR120, 0x4f }, { ZYD_CR121, 0x06 }, { ZYD_CR122, 0xfe },	\
89302ac6454SAndrew Thompson 	{ ZYD_CR150, 0x0d }						\
89402ac6454SAndrew Thompson }
89502ac6454SAndrew Thompson 
89602ac6454SAndrew Thompson #define ZYD_MAXIM_RF							\
89702ac6454SAndrew Thompson {									\
89802ac6454SAndrew Thompson 	0x00ccd4, 0x030a03, 0x000400, 0x000ca1, 0x010072, 0x018645,	\
89902ac6454SAndrew Thompson 	0x004006, 0x0000a7, 0x008258, 0x003fc9, 0x00040a, 0x00000b,	\
90002ac6454SAndrew Thompson 	0x00026c							\
90102ac6454SAndrew Thompson }
90202ac6454SAndrew Thompson 
90302ac6454SAndrew Thompson #define ZYD_MAXIM_CHANTABLE	\
90402ac6454SAndrew Thompson {				\
90502ac6454SAndrew Thompson 	{ 0x0ccd4, 0x30a03 },	\
90602ac6454SAndrew Thompson 	{ 0x22224, 0x00a13 },	\
90702ac6454SAndrew Thompson 	{ 0x37774, 0x10a13 },	\
90802ac6454SAndrew Thompson 	{ 0x0ccd4, 0x30a13 },	\
90902ac6454SAndrew Thompson 	{ 0x22224, 0x00a23 },	\
91002ac6454SAndrew Thompson 	{ 0x37774, 0x10a23 },	\
91102ac6454SAndrew Thompson 	{ 0x0ccd4, 0x30a23 },	\
91202ac6454SAndrew Thompson 	{ 0x22224, 0x00a33 },	\
91302ac6454SAndrew Thompson 	{ 0x37774, 0x10a33 },	\
91402ac6454SAndrew Thompson 	{ 0x0ccd4, 0x30a33 },	\
91502ac6454SAndrew Thompson 	{ 0x22224, 0x00a43 },	\
91602ac6454SAndrew Thompson 	{ 0x37774, 0x10a43 },	\
91702ac6454SAndrew Thompson 	{ 0x0ccd4, 0x30a43 },	\
91802ac6454SAndrew Thompson 	{ 0x199a4, 0x20a53 }	\
91902ac6454SAndrew Thompson }
92002ac6454SAndrew Thompson 
92102ac6454SAndrew Thompson #define ZYD_MAXIM2_PHY							\
92202ac6454SAndrew Thompson {									\
92302ac6454SAndrew Thompson 	{ ZYD_CR23,  0x40 }, { ZYD_CR15,  0x20 }, { ZYD_CR28,  0x3e },	\
92402ac6454SAndrew Thompson 	{ ZYD_CR29,  0x00 }, { ZYD_CR26,  0x11 }, { ZYD_CR44,  0x33 },	\
92502ac6454SAndrew Thompson 	{ ZYD_CR106, 0x2a }, { ZYD_CR107, 0x1a }, { ZYD_CR109, 0x2b },	\
92602ac6454SAndrew Thompson 	{ ZYD_CR110, 0x2b }, { ZYD_CR111, 0x2b }, { ZYD_CR112, 0x2b },	\
92702ac6454SAndrew Thompson 	{ ZYD_CR10,  0x89 }, { ZYD_CR17,  0x20 }, { ZYD_CR26,  0x93 },	\
92802ac6454SAndrew Thompson 	{ ZYD_CR34,  0x30 }, { ZYD_CR35,  0x40 }, { ZYD_CR41,  0x24 },	\
92902ac6454SAndrew Thompson 	{ ZYD_CR44,  0x32 }, { ZYD_CR46,  0x90 }, { ZYD_CR89,  0x18 },	\
93002ac6454SAndrew Thompson 	{ ZYD_CR92,  0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
93102ac6454SAndrew Thompson 	{ ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x09 },	\
93202ac6454SAndrew Thompson 	{ ZYD_CR110, 0x13 }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x13 },	\
93302ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 },	\
93402ac6454SAndrew Thompson 	{ ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0xfa },	\
93502ac6454SAndrew Thompson 	{ ZYD_CR120, 0x4f }, { ZYD_CR121, 0x77 }, { ZYD_CR122, 0xfe },	\
93602ac6454SAndrew Thompson 	{ ZYD_CR10,  0x89 }, { ZYD_CR17,  0x20 }, { ZYD_CR26,  0x93 },	\
93702ac6454SAndrew Thompson 	{ ZYD_CR34,  0x30 }, { ZYD_CR35,  0x40 }, { ZYD_CR41,  0x24 },	\
93802ac6454SAndrew Thompson 	{ ZYD_CR44,  0x32 }, { ZYD_CR46,  0x90 }, { ZYD_CR79,  0x58 },	\
93902ac6454SAndrew Thompson 	{ ZYD_CR80,  0x30 }, { ZYD_CR81,  0x30 }, { ZYD_CR89,  0x18 },	\
94002ac6454SAndrew Thompson 	{ ZYD_CR92,  0x0a }, { ZYD_CR101, 0x13 }, { ZYD_CR102, 0x27 },	\
94102ac6454SAndrew Thompson 	{ ZYD_CR106, 0x20 }, { ZYD_CR107, 0x24 }, { ZYD_CR109, 0x09 },	\
94202ac6454SAndrew Thompson 	{ ZYD_CR110, 0x13 }, { ZYD_CR111, 0x13 }, { ZYD_CR112, 0x13 },	\
94302ac6454SAndrew Thompson 	{ ZYD_CR113, 0x27 }, { ZYD_CR114, 0x27 }, { ZYD_CR115, 0x24 },	\
94402ac6454SAndrew Thompson 	{ ZYD_CR116, 0x24 }, { ZYD_CR117, 0xf4 }, { ZYD_CR118, 0x00 },	\
94502ac6454SAndrew Thompson 	{ ZYD_CR120, 0x4f }, { ZYD_CR121, 0x06 }, { ZYD_CR122, 0xfe }	\
94602ac6454SAndrew Thompson }
94702ac6454SAndrew Thompson 
94802ac6454SAndrew Thompson #define ZYD_MAXIM2_RF							\
94902ac6454SAndrew Thompson {									\
95002ac6454SAndrew Thompson 	0x33334, 0x10a03, 0x00400, 0x00ca1, 0x10072, 0x18645, 0x04006,	\
95102ac6454SAndrew Thompson 	0x000a7, 0x08258, 0x03fc9, 0x0040a, 0x0000b, 0x0026c		\
95202ac6454SAndrew Thompson }
95302ac6454SAndrew Thompson 
95402ac6454SAndrew Thompson #define ZYD_MAXIM2_CHANTABLE_F						\
95502ac6454SAndrew Thompson {									\
95602ac6454SAndrew Thompson 	0x33334, 0x08884, 0x1ddd4, 0x33334, 0x08884, 0x1ddd4, 0x33334,	\
95702ac6454SAndrew Thompson 	0x08884, 0x1ddd4, 0x33334, 0x08884, 0x1ddd4, 0x33334, 0x26664	\
95802ac6454SAndrew Thompson }
95902ac6454SAndrew Thompson 
96002ac6454SAndrew Thompson #define ZYD_MAXIM2_CHANTABLE	\
96102ac6454SAndrew Thompson {				\
96202ac6454SAndrew Thompson 	{ 0x33334, 0x10a03 },	\
96302ac6454SAndrew Thompson 	{ 0x08884, 0x20a13 },	\
96402ac6454SAndrew Thompson 	{ 0x1ddd4, 0x30a13 },	\
96502ac6454SAndrew Thompson 	{ 0x33334, 0x10a13 },	\
96602ac6454SAndrew Thompson 	{ 0x08884, 0x20a23 },	\
96702ac6454SAndrew Thompson 	{ 0x1ddd4, 0x30a23 },	\
96802ac6454SAndrew Thompson 	{ 0x33334, 0x10a23 },	\
96902ac6454SAndrew Thompson 	{ 0x08884, 0x20a33 },	\
97002ac6454SAndrew Thompson 	{ 0x1ddd4, 0x30a33 },	\
97102ac6454SAndrew Thompson 	{ 0x33334, 0x10a33 },	\
97202ac6454SAndrew Thompson 	{ 0x08884, 0x20a43 },	\
97302ac6454SAndrew Thompson 	{ 0x1ddd4, 0x30a43 },	\
97402ac6454SAndrew Thompson 	{ 0x33334, 0x10a43 },	\
97502ac6454SAndrew Thompson 	{ 0x26664, 0x20a53 }	\
97602ac6454SAndrew Thompson }
97702ac6454SAndrew Thompson 
97802ac6454SAndrew Thompson /*
97902ac6454SAndrew Thompson  * Control pipe requests.
98002ac6454SAndrew Thompson  */
98102ac6454SAndrew Thompson #define ZYD_DOWNLOADREQ		0x30
98202ac6454SAndrew Thompson #define ZYD_DOWNLOADSTS		0x31
98302ac6454SAndrew Thompson #define	ZYD_READFWDATAREQ	0x32
98402ac6454SAndrew Thompson 
98502ac6454SAndrew Thompson /* possible values for register ZYD_CR_INTERRUPT */
98602ac6454SAndrew Thompson #define ZYD_HWINT_MASK		0x004f0000
98702ac6454SAndrew Thompson 
98802ac6454SAndrew Thompson /* possible values for register ZYD_MAC_MISC */
98902ac6454SAndrew Thompson #define ZYD_UNLOCK_PHY_REGS	0x80
99002ac6454SAndrew Thompson 
99102ac6454SAndrew Thompson /* possible values for register ZYD_MAC_ENCRYPTION_TYPE */
99202ac6454SAndrew Thompson #define ZYD_ENC_SNIFFER		8
99302ac6454SAndrew Thompson 
99402ac6454SAndrew Thompson /* flags for register ZYD_MAC_RXFILTER */
99502ac6454SAndrew Thompson #define ZYD_FILTER_ASS_REQ	(1 << 0)
99602ac6454SAndrew Thompson #define ZYD_FILTER_ASS_RSP	(1 << 1)
99702ac6454SAndrew Thompson #define ZYD_FILTER_REASS_REQ	(1 << 2)
99802ac6454SAndrew Thompson #define ZYD_FILTER_REASS_RSP	(1 << 3)
99902ac6454SAndrew Thompson #define ZYD_FILTER_PRB_REQ	(1 << 4)
100002ac6454SAndrew Thompson #define ZYD_FILTER_PRB_RSP	(1 << 5)
100102ac6454SAndrew Thompson #define ZYD_FILTER_BCN		(1 << 8)
100202ac6454SAndrew Thompson #define ZYD_FILTER_ATIM		(1 << 9)
100302ac6454SAndrew Thompson #define ZYD_FILTER_DEASS	(1 << 10)
100402ac6454SAndrew Thompson #define ZYD_FILTER_AUTH		(1 << 11)
100502ac6454SAndrew Thompson #define ZYD_FILTER_DEAUTH	(1 << 12)
100602ac6454SAndrew Thompson #define ZYD_FILTER_PS_POLL	(1 << 26)
100702ac6454SAndrew Thompson #define ZYD_FILTER_RTS		(1 << 27)
100802ac6454SAndrew Thompson #define ZYD_FILTER_CTS		(1 << 28)
100902ac6454SAndrew Thompson #define ZYD_FILTER_ACK		(1 << 29)
101002ac6454SAndrew Thompson #define ZYD_FILTER_CFE		(1 << 30)
101102ac6454SAndrew Thompson #define ZYD_FILTER_CFE_A	(1 << 31)
101202ac6454SAndrew Thompson 
101302ac6454SAndrew Thompson /* helpers for register ZYD_MAC_RXFILTER */
101402ac6454SAndrew Thompson #define ZYD_FILTER_MONITOR	0xffffffff
101502ac6454SAndrew Thompson #define ZYD_FILTER_BSS							\
101602ac6454SAndrew Thompson 	(ZYD_FILTER_ASS_REQ | ZYD_FILTER_ASS_RSP |			\
101702ac6454SAndrew Thompson 	 ZYD_FILTER_REASS_REQ | ZYD_FILTER_REASS_RSP |			\
101802ac6454SAndrew Thompson 	 ZYD_FILTER_PRB_REQ | ZYD_FILTER_PRB_RSP |			\
101902ac6454SAndrew Thompson 	 (0x3 << 6) |							\
102002ac6454SAndrew Thompson 	 ZYD_FILTER_BCN | ZYD_FILTER_ATIM | ZYD_FILTER_DEASS |		\
102102ac6454SAndrew Thompson 	 ZYD_FILTER_AUTH | ZYD_FILTER_DEAUTH |				\
102202ac6454SAndrew Thompson 	 (0x7 << 13) |							\
102302ac6454SAndrew Thompson 	 ZYD_FILTER_PS_POLL | ZYD_FILTER_ACK)
102402ac6454SAndrew Thompson #define ZYD_FILTER_HOSTAP						\
102502ac6454SAndrew Thompson 	(ZYD_FILTER_ASS_REQ | ZYD_FILTER_REASS_REQ |			\
102602ac6454SAndrew Thompson 	 ZYD_FILTER_PRB_REQ | ZYD_FILTER_DEASS | ZYD_FILTER_AUTH |	\
102702ac6454SAndrew Thompson 	 ZYD_FILTER_DEAUTH | ZYD_FILTER_PS_POLL)
102802ac6454SAndrew Thompson 
102902ac6454SAndrew Thompson struct zyd_tx_desc {
103002ac6454SAndrew Thompson 	uint8_t			phy;
103102ac6454SAndrew Thompson #define ZYD_TX_PHY_SIGNAL(x)	((x) & 0xf)
103202ac6454SAndrew Thompson #define ZYD_TX_PHY_OFDM		(1 << 4)
103302ac6454SAndrew Thompson #define ZYD_TX_PHY_SHPREAMBLE	(1 << 5)	/* CCK */
103402ac6454SAndrew Thompson #define ZYD_TX_PHY_5GHZ		(1 << 5)	/* OFDM */
103502ac6454SAndrew Thompson 	uint16_t		len;
103602ac6454SAndrew Thompson 	uint8_t			flags;
103702ac6454SAndrew Thompson #define ZYD_TX_FLAG_BACKOFF	(1 << 0)
103802ac6454SAndrew Thompson #define ZYD_TX_FLAG_MULTICAST	(1 << 1)
103902ac6454SAndrew Thompson #define ZYD_TX_FLAG_TYPE(x)	(((x) & 0x3) << 2)
104002ac6454SAndrew Thompson #define ZYD_TX_TYPE_DATA	0
104102ac6454SAndrew Thompson #define ZYD_TX_TYPE_PS_POLL	1
104202ac6454SAndrew Thompson #define ZYD_TX_TYPE_MGMT	2
104302ac6454SAndrew Thompson #define ZYD_TX_TYPE_CTL		3
104402ac6454SAndrew Thompson #define ZYD_TX_FLAG_WAKEUP	(1 << 4)
104502ac6454SAndrew Thompson #define ZYD_TX_FLAG_RTS		(1 << 5)
104602ac6454SAndrew Thompson #define ZYD_TX_FLAG_ENCRYPT	(1 << 6)
104702ac6454SAndrew Thompson #define ZYD_TX_FLAG_CTS_TO_SELF	(1 << 7)
104802ac6454SAndrew Thompson 	uint16_t		pktlen;
104902ac6454SAndrew Thompson 	uint16_t		plcp_length;
105002ac6454SAndrew Thompson 	uint8_t			plcp_service;
105102ac6454SAndrew Thompson #define ZYD_PLCP_LENGEXT	0x80
105202ac6454SAndrew Thompson 	uint16_t		nextlen;
105302ac6454SAndrew Thompson } __packed;
105402ac6454SAndrew Thompson 
105502ac6454SAndrew Thompson struct zyd_plcphdr {
105602ac6454SAndrew Thompson 	uint8_t			signal;
105702ac6454SAndrew Thompson 	uint8_t			reserved[2];
105802ac6454SAndrew Thompson 	uint16_t		service;	/* unaligned! */
105902ac6454SAndrew Thompson } __packed;
106002ac6454SAndrew Thompson 
106102ac6454SAndrew Thompson struct zyd_rx_stat {
106202ac6454SAndrew Thompson 	uint8_t			signal_cck;
106302ac6454SAndrew Thompson 	uint8_t			rssi;
106402ac6454SAndrew Thompson 	uint8_t			signal_ofdm;
106502ac6454SAndrew Thompson 	uint8_t			cipher;
106602ac6454SAndrew Thompson #define ZYD_RX_CIPHER_WEP64	1
106702ac6454SAndrew Thompson #define ZYD_RX_CIPHER_TKIP	2
106802ac6454SAndrew Thompson #define ZYD_RX_CIPHER_AES	4
106902ac6454SAndrew Thompson #define ZYD_RX_CIPHER_WEP128	5
107002ac6454SAndrew Thompson #define ZYD_RX_CIPHER_WEP256	6
107102ac6454SAndrew Thompson #define ZYD_RX_CIPHER_WEP	\
107202ac6454SAndrew Thompson 	(ZYD_RX_CIPHER_WEP64 | ZYD_RX_CIPHER_WEP128 | ZYD_RX_CIPHER_WEP256)
107302ac6454SAndrew Thompson 	uint8_t			flags;
107402ac6454SAndrew Thompson #define ZYD_RX_OFDM		(1 << 0)
107502ac6454SAndrew Thompson #define ZYD_RX_TIMEOUT		(1 << 1)
107602ac6454SAndrew Thompson #define ZYD_RX_OVERRUN		(1 << 2)
107702ac6454SAndrew Thompson #define ZYD_RX_DECRYPTERR	(1 << 3)
107802ac6454SAndrew Thompson #define ZYD_RX_BADCRC32		(1 << 4)
107902ac6454SAndrew Thompson #define ZYD_RX_NOT2ME		(1 << 5)
108002ac6454SAndrew Thompson #define ZYD_RX_BADCRC16		(1 << 6)
108102ac6454SAndrew Thompson #define ZYD_RX_ERROR		(1 << 7)
108202ac6454SAndrew Thompson } __packed;
108302ac6454SAndrew Thompson 
108402ac6454SAndrew Thompson /* this structure may be unaligned */
108502ac6454SAndrew Thompson struct zyd_rx_desc {
108602ac6454SAndrew Thompson #define ZYD_MAX_RXFRAMECNT	3
108702ac6454SAndrew Thompson 	uWord			len[ZYD_MAX_RXFRAMECNT];
108802ac6454SAndrew Thompson 	uWord			tag;
108902ac6454SAndrew Thompson #define ZYD_TAG_MULTIFRAME	0x697e
109002ac6454SAndrew Thompson } __packed;
109102ac6454SAndrew Thompson 
109202ac6454SAndrew Thompson /* I2C bus alike */
109302ac6454SAndrew Thompson struct zyd_rfwrite_cmd {
109402ac6454SAndrew Thompson 	uint16_t		code;
109502ac6454SAndrew Thompson 	uint16_t		width;
109602ac6454SAndrew Thompson 	uint16_t		bit[32];
109702ac6454SAndrew Thompson #define ZYD_RF_IF_LE		(1 << 1)
109802ac6454SAndrew Thompson #define ZYD_RF_CLK		(1 << 2)
109902ac6454SAndrew Thompson #define ZYD_RF_DATA		(1 << 3)
110002ac6454SAndrew Thompson } __packed;
110102ac6454SAndrew Thompson 
110202ac6454SAndrew Thompson struct zyd_cmd {
110302ac6454SAndrew Thompson 	uint16_t		code;
110402ac6454SAndrew Thompson #define ZYD_CMD_IOWR		0x0021	/* write HMAC or PHY register */
110502ac6454SAndrew Thompson #define ZYD_CMD_IORD		0x0022	/* read HMAC or PHY register */
110602ac6454SAndrew Thompson #define ZYD_CMD_RFCFG		0x0023	/* write RF register */
110702ac6454SAndrew Thompson #define ZYD_NOTIF_IORD		0x9001	/* response for ZYD_CMD_IORD */
110802ac6454SAndrew Thompson #define ZYD_NOTIF_MACINTR	0x9001	/* interrupt notification */
110902ac6454SAndrew Thompson #define ZYD_NOTIF_RETRYSTATUS	0xa001	/* Tx retry notification */
111002ac6454SAndrew Thompson 	uint8_t			data[64];
111102ac6454SAndrew Thompson } __packed;
111202ac6454SAndrew Thompson 
111302ac6454SAndrew Thompson /* structure for command ZYD_CMD_IOWR */
111402ac6454SAndrew Thompson struct zyd_pair {
111502ac6454SAndrew Thompson 	uint16_t		reg;
111602ac6454SAndrew Thompson /* helpers macros to read/write 32-bit registers */
111702ac6454SAndrew Thompson #define ZYD_REG32_LO(reg)	(reg)
111802ac6454SAndrew Thompson #define ZYD_REG32_HI(reg)	\
111902ac6454SAndrew Thompson 	((reg) + ((((reg) & 0xf000) == 0x9000) ? 2 : 1))
112002ac6454SAndrew Thompson 	uint16_t		val;
112102ac6454SAndrew Thompson } __packed;
112202ac6454SAndrew Thompson 
112302ac6454SAndrew Thompson /* structure for notification ZYD_NOTIF_RETRYSTATUS */
112402ac6454SAndrew Thompson struct zyd_notif_retry {
112502ac6454SAndrew Thompson 	uint16_t		rate;
112602ac6454SAndrew Thompson 	uint8_t			macaddr[IEEE80211_ADDR_LEN];
112702ac6454SAndrew Thompson 	uint16_t		count;
112802ac6454SAndrew Thompson } __packed;
112902ac6454SAndrew Thompson 
113002ac6454SAndrew Thompson #define ZYD_CONFIG_INDEX	0
113102ac6454SAndrew Thompson #define ZYD_IFACE_INDEX		0
113202ac6454SAndrew Thompson 
113302ac6454SAndrew Thompson #define ZYD_INTR_TIMEOUT	1000
113402ac6454SAndrew Thompson #define ZYD_TX_TIMEOUT		10000
113502ac6454SAndrew Thompson 
113602ac6454SAndrew Thompson #define ZYD_MAX_TXBUFSZ	\
113702ac6454SAndrew Thompson 	(sizeof(struct zyd_tx_desc) + MCLBYTES)
113802ac6454SAndrew Thompson #define ZYD_MIN_FRAGSZ							\
113902ac6454SAndrew Thompson 	(sizeof(struct zyd_plcphdr) + IEEE80211_MIN_LEN + 		\
114002ac6454SAndrew Thompson 	 sizeof(struct zyd_rx_stat))
114102ac6454SAndrew Thompson #define ZYD_MIN_RXBUFSZ	ZYD_MIN_FRAGSZ
114202ac6454SAndrew Thompson #define ZYX_MAX_RXBUFSZ							\
114302ac6454SAndrew Thompson 	((sizeof (struct zyd_plcphdr) + IEEE80211_MAX_LEN +		\
114402ac6454SAndrew Thompson 	  sizeof (struct zyd_rx_stat)) * ZYD_MAX_RXFRAMECNT + 		\
114502ac6454SAndrew Thompson 	 sizeof (struct zyd_rx_desc))
114602ac6454SAndrew Thompson #define ZYD_TX_DESC_SIZE	(sizeof (struct zyd_tx_desc))
114702ac6454SAndrew Thompson 
114802ac6454SAndrew Thompson #define ZYD_RX_LIST_CNT		1
114902ac6454SAndrew Thompson #define ZYD_TX_LIST_CNT		5
115002ac6454SAndrew Thompson #define ZYD_CMD_FLAG_READ	(1 << 0)
115102ac6454SAndrew Thompson #define ZYD_CMD_FLAG_SENT	(1 << 1)
115202ac6454SAndrew Thompson 
115302ac6454SAndrew Thompson /* quickly determine if a given rate is CCK or OFDM */
115402ac6454SAndrew Thompson #define ZYD_RATE_IS_OFDM(rate)	((rate) >= 12 && (rate) != 22)
115502ac6454SAndrew Thompson 
115602ac6454SAndrew Thompson struct zyd_phy_pair {
115702ac6454SAndrew Thompson 	uint16_t		reg;
115802ac6454SAndrew Thompson 	uint8_t			val;
115902ac6454SAndrew Thompson };
116002ac6454SAndrew Thompson 
116102ac6454SAndrew Thompson struct zyd_mac_pair {
116202ac6454SAndrew Thompson 	uint16_t		reg;
116302ac6454SAndrew Thompson 	uint32_t		val;
116402ac6454SAndrew Thompson };
116502ac6454SAndrew Thompson 
116602ac6454SAndrew Thompson struct zyd_tx_data {
116702ac6454SAndrew Thompson 	STAILQ_ENTRY(zyd_tx_data)	next;
116802ac6454SAndrew Thompson 	struct zyd_softc		*sc;
116902ac6454SAndrew Thompson 	struct zyd_tx_desc		desc;
117002ac6454SAndrew Thompson 	struct mbuf			*m;
117102ac6454SAndrew Thompson 	struct ieee80211_node		*ni;
117202ac6454SAndrew Thompson 	int				rate;
117302ac6454SAndrew Thompson };
117402ac6454SAndrew Thompson typedef STAILQ_HEAD(, zyd_tx_data) zyd_txdhead;
117502ac6454SAndrew Thompson 
117602ac6454SAndrew Thompson struct zyd_rx_data {
117702ac6454SAndrew Thompson 	struct mbuf			*m;
117802ac6454SAndrew Thompson 	int				rssi;
117902ac6454SAndrew Thompson };
118002ac6454SAndrew Thompson 
118102ac6454SAndrew Thompson struct zyd_node {
118202ac6454SAndrew Thompson 	struct ieee80211_node	ni;	/* must be the first */
118302ac6454SAndrew Thompson 	struct ieee80211_amrr_node	amn;
118402ac6454SAndrew Thompson };
118502ac6454SAndrew Thompson #define	ZYD_NODE(ni)	((struct zyd_node *)(ni))
118602ac6454SAndrew Thompson 
118702ac6454SAndrew Thompson struct zyd_rx_radiotap_header {
118802ac6454SAndrew Thompson 	struct ieee80211_radiotap_header wr_ihdr;
118902ac6454SAndrew Thompson 	uint8_t			wr_flags;
119002ac6454SAndrew Thompson 	uint8_t			wr_rate;
119102ac6454SAndrew Thompson 	uint16_t		wr_chan_freq;
119202ac6454SAndrew Thompson 	uint16_t		wr_chan_flags;
119302ac6454SAndrew Thompson 	int8_t			wr_antsignal;
119402ac6454SAndrew Thompson 	int8_t			wr_antnoise;
119502ac6454SAndrew Thompson } __packed;
119602ac6454SAndrew Thompson 
119702ac6454SAndrew Thompson #define ZYD_RX_RADIOTAP_PRESENT						\
119802ac6454SAndrew Thompson 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\
119902ac6454SAndrew Thompson 	 (1 << IEEE80211_RADIOTAP_RATE) |				\
120002ac6454SAndrew Thompson 	 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |			\
120102ac6454SAndrew Thompson 	 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |			\
120202ac6454SAndrew Thompson 	 (1 << IEEE80211_RADIOTAP_CHANNEL))
120302ac6454SAndrew Thompson 
120402ac6454SAndrew Thompson struct zyd_tx_radiotap_header {
120502ac6454SAndrew Thompson 	struct ieee80211_radiotap_header wt_ihdr;
120602ac6454SAndrew Thompson 	uint8_t			wt_flags;
120702ac6454SAndrew Thompson 	uint8_t			wt_rate;
120802ac6454SAndrew Thompson 	uint16_t		wt_chan_freq;
120902ac6454SAndrew Thompson 	uint16_t		wt_chan_flags;
121002ac6454SAndrew Thompson } __packed;
121102ac6454SAndrew Thompson 
121202ac6454SAndrew Thompson #define ZYD_TX_RADIOTAP_PRESENT						\
121302ac6454SAndrew Thompson 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\
121402ac6454SAndrew Thompson 	 (1 << IEEE80211_RADIOTAP_RATE) |				\
121502ac6454SAndrew Thompson 	 (1 << IEEE80211_RADIOTAP_CHANNEL))
121602ac6454SAndrew Thompson 
121702ac6454SAndrew Thompson struct zyd_softc;	/* forward declaration */
121802ac6454SAndrew Thompson 
121902ac6454SAndrew Thompson struct zyd_rf {
122002ac6454SAndrew Thompson 	/* RF methods */
122102ac6454SAndrew Thompson 	int			(*init)(struct zyd_rf *);
122202ac6454SAndrew Thompson 	int			(*switch_radio)(struct zyd_rf *, int);
122302ac6454SAndrew Thompson 	int			(*set_channel)(struct zyd_rf *, uint8_t);
122402ac6454SAndrew Thompson 	int			(*bandedge6)(struct zyd_rf *,
122502ac6454SAndrew Thompson 				    struct ieee80211_channel *);
122602ac6454SAndrew Thompson 	/* RF attributes */
122702ac6454SAndrew Thompson 	struct zyd_softc	*rf_sc;	/* back-pointer */
122802ac6454SAndrew Thompson 	int			width;
122902ac6454SAndrew Thompson };
123002ac6454SAndrew Thompson 
123102ac6454SAndrew Thompson struct zyd_rq {
123202ac6454SAndrew Thompson 	struct zyd_cmd		*cmd;
123302ac6454SAndrew Thompson 	const uint16_t		*idata;
123402ac6454SAndrew Thompson 	struct zyd_pair		*odata;
123502ac6454SAndrew Thompson 	int			ilen;
123602ac6454SAndrew Thompson 	int			olen;
123702ac6454SAndrew Thompson 	int			flags;
123802ac6454SAndrew Thompson 	STAILQ_ENTRY(zyd_rq)	rq;
123902ac6454SAndrew Thompson };
124002ac6454SAndrew Thompson 
124102ac6454SAndrew Thompson struct zyd_vap {
124202ac6454SAndrew Thompson 	struct ieee80211vap	vap;
124302ac6454SAndrew Thompson 	int			(*newstate)(struct ieee80211vap *,
124402ac6454SAndrew Thompson 				    enum ieee80211_state, int);
124502ac6454SAndrew Thompson 	struct ieee80211_amrr	amrr;
124602ac6454SAndrew Thompson };
124702ac6454SAndrew Thompson #define	ZYD_VAP(vap)	((struct zyd_vap *)(vap))
124802ac6454SAndrew Thompson 
124902ac6454SAndrew Thompson enum {
125002ac6454SAndrew Thompson 	ZYD_BULK_WR,
125102ac6454SAndrew Thompson 	ZYD_BULK_RD,
125202ac6454SAndrew Thompson 	ZYD_INTR_WR,
125302ac6454SAndrew Thompson 	ZYD_INTR_RD,
125402ac6454SAndrew Thompson 	ZYD_N_TRANSFER = 4,
125502ac6454SAndrew Thompson };
125602ac6454SAndrew Thompson 
125702ac6454SAndrew Thompson struct zyd_softc {
125802ac6454SAndrew Thompson 	struct ifnet		*sc_ifp;
125902ac6454SAndrew Thompson 	device_t		sc_dev;
1260760bc48eSAndrew Thompson 	struct usb_device	*sc_udev;
126102ac6454SAndrew Thompson 
1262760bc48eSAndrew Thompson 	struct usb_xfer	*sc_xfer[ZYD_N_TRANSFER];
126302ac6454SAndrew Thompson 
126402ac6454SAndrew Thompson 	int			sc_flags;
126502ac6454SAndrew Thompson #define	ZYD_FLAG_FWLOADED		(1 << 0)
126602ac6454SAndrew Thompson #define	ZYD_FLAG_INITONCE		(1 << 1)
126702ac6454SAndrew Thompson #define	ZYD_FLAG_INITDONE		(1 << 2)
126802ac6454SAndrew Thompson 
126902ac6454SAndrew Thompson 	struct zyd_rf		sc_rf;
127002ac6454SAndrew Thompson 
127102ac6454SAndrew Thompson 	STAILQ_HEAD(, zyd_rq)	sc_rtx;
127202ac6454SAndrew Thompson 	STAILQ_HEAD(, zyd_rq)	sc_rqh;
127302ac6454SAndrew Thompson 
127402ac6454SAndrew Thompson 	uint8_t			sc_bssid[IEEE80211_ADDR_LEN];
127502ac6454SAndrew Thompson 	uint16_t		sc_fwbase;
127602ac6454SAndrew Thompson 	uint8_t			sc_regdomain;
127702ac6454SAndrew Thompson 	uint8_t			sc_macrev;
127802ac6454SAndrew Thompson 	uint16_t		sc_fwrev;
127902ac6454SAndrew Thompson 	uint8_t			sc_rfrev;
128002ac6454SAndrew Thompson 	uint8_t			sc_parev;
128102ac6454SAndrew Thompson 	uint8_t			sc_al2230s;
128202ac6454SAndrew Thompson 	uint8_t			sc_bandedge6;
128302ac6454SAndrew Thompson 	uint8_t			sc_newphy;
128402ac6454SAndrew Thompson 	uint8_t			sc_cckgain;
128502ac6454SAndrew Thompson 	uint8_t			sc_fix_cr157;
128602ac6454SAndrew Thompson 	uint8_t			sc_ledtype;
128702ac6454SAndrew Thompson 	uint8_t			sc_txled;
128802ac6454SAndrew Thompson 
128902ac6454SAndrew Thompson 	uint32_t		sc_atim_wnd;
129002ac6454SAndrew Thompson 	uint32_t		sc_pre_tbtt;
129102ac6454SAndrew Thompson 	uint32_t		sc_bcn_int;
129202ac6454SAndrew Thompson 
129302ac6454SAndrew Thompson 	uint8_t			sc_pwrcal[14];
129402ac6454SAndrew Thompson 	uint8_t			sc_pwrint[14];
129502ac6454SAndrew Thompson 	uint8_t			sc_ofdm36_cal[14];
129602ac6454SAndrew Thompson 	uint8_t			sc_ofdm48_cal[14];
129702ac6454SAndrew Thompson 	uint8_t			sc_ofdm54_cal[14];
129802ac6454SAndrew Thompson 
129902ac6454SAndrew Thompson 	struct mtx		sc_mtx;
130002ac6454SAndrew Thompson 	struct zyd_tx_data	tx_data[ZYD_TX_LIST_CNT];
130102ac6454SAndrew Thompson 	zyd_txdhead		tx_q;
130202ac6454SAndrew Thompson 	zyd_txdhead		tx_free;
130302ac6454SAndrew Thompson 	int			tx_nfree;
130402ac6454SAndrew Thompson 	struct zyd_rx_desc	sc_rx_desc;
130502ac6454SAndrew Thompson 	struct zyd_rx_data	sc_rx_data[ZYD_MAX_RXFRAMECNT];
130602ac6454SAndrew Thompson 	int			sc_rx_count;
130702ac6454SAndrew Thompson 
130802ac6454SAndrew Thompson 	struct zyd_cmd		sc_ibuf;
130902ac6454SAndrew Thompson 
131002ac6454SAndrew Thompson 	struct zyd_rx_radiotap_header	sc_rxtap;
131102ac6454SAndrew Thompson 	int			sc_rxtap_len;
131202ac6454SAndrew Thompson 	struct zyd_tx_radiotap_header	sc_txtap;
131302ac6454SAndrew Thompson 	int			sc_txtap_len;
131402ac6454SAndrew Thompson };
131502ac6454SAndrew Thompson 
131602ac6454SAndrew Thompson #define	ZYD_LOCK(sc)		mtx_lock(&(sc)->sc_mtx)
131702ac6454SAndrew Thompson #define	ZYD_UNLOCK(sc)		mtx_unlock(&(sc)->sc_mtx)
131802ac6454SAndrew Thompson #define	ZYD_LOCK_ASSERT(sc, t)	mtx_assert(&(sc)->sc_mtx, t)
131902ac6454SAndrew Thompson 
1320