Home | History | Annotate | Line # | Download | only in ic
anreg.h revision 1.3
      1  1.3  onoe /*	$NetBSD: anreg.h,v 1.3 2000/12/12 05:11:15 onoe Exp $	*/
      2  1.1  onoe /*
      3  1.1  onoe  * Copyright (c) 1997, 1998, 1999
      4  1.1  onoe  *	Bill Paul <wpaul (at) ctr.columbia.edu>.  All rights reserved.
      5  1.1  onoe  *
      6  1.1  onoe  * Redistribution and use in source and binary forms, with or without
      7  1.1  onoe  * modification, are permitted provided that the following conditions
      8  1.1  onoe  * are met:
      9  1.1  onoe  * 1. Redistributions of source code must retain the above copyright
     10  1.1  onoe  *    notice, this list of conditions and the following disclaimer.
     11  1.1  onoe  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1  onoe  *    notice, this list of conditions and the following disclaimer in the
     13  1.1  onoe  *    documentation and/or other materials provided with the distribution.
     14  1.1  onoe  * 3. All advertising materials mentioning features or use of this software
     15  1.1  onoe  *    must display the following acknowledgement:
     16  1.1  onoe  *	This product includes software developed by Bill Paul.
     17  1.1  onoe  * 4. Neither the name of the author nor the names of any co-contributors
     18  1.1  onoe  *    may be used to endorse or promote products derived from this software
     19  1.1  onoe  *    without specific prior written permission.
     20  1.1  onoe  *
     21  1.1  onoe  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
     22  1.1  onoe  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23  1.1  onoe  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24  1.1  onoe  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
     25  1.1  onoe  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26  1.1  onoe  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27  1.1  onoe  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28  1.1  onoe  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29  1.1  onoe  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30  1.1  onoe  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31  1.1  onoe  * THE POSSIBILITY OF SUCH DAMAGE.
     32  1.1  onoe  *
     33  1.1  onoe  * $FreeBSD: src/sys/dev/an/if_anreg.h,v 1.3 2000/11/13 23:04:12 wpaul Exp $
     34  1.1  onoe  */
     35  1.1  onoe 
     36  1.3  onoe #ifndef _DEV_IC_ANREG_H
     37  1.3  onoe #define	_DEV_IC_ANREG_H
     38  1.1  onoe 
     39  1.1  onoe /*
     40  1.1  onoe  * Size of Aironet I/O space.
     41  1.1  onoe  */
     42  1.1  onoe #define AN_IOSIZ		0x40
     43  1.1  onoe 
     44  1.1  onoe /*
     45  1.1  onoe  * Hermes register definitions and what little I know about them.
     46  1.1  onoe  */
     47  1.1  onoe 
     48  1.1  onoe /* Hermes command/status registers. */
     49  1.1  onoe #define AN_COMMAND		0x00
     50  1.1  onoe #define AN_PARAM0		0x02
     51  1.1  onoe #define AN_PARAM1		0x04
     52  1.1  onoe #define AN_PARAM2		0x06
     53  1.1  onoe #define AN_STATUS		0x08
     54  1.1  onoe #define AN_RESP0		0x0A
     55  1.1  onoe #define AN_RESP1		0x0C
     56  1.1  onoe #define AN_RESP2		0x0E
     57  1.1  onoe #define AN_LINKSTAT		0x10
     58  1.1  onoe 
     59  1.1  onoe /* Command register */
     60  1.1  onoe #define AN_CMD_BUSY		0x8000 /* busy bit */
     61  1.1  onoe #define AN_CMD_NO_ACK		0x0080 /* don't acknowledge command */
     62  1.1  onoe #define AN_CMD_CODE_MASK	0x003F
     63  1.1  onoe #define AN_CMD_QUAL_MASK	0x7F00
     64  1.1  onoe 
     65  1.1  onoe /* Command codes */
     66  1.1  onoe #define AN_CMD_NOOP		0x0000 /* no-op */
     67  1.1  onoe #define AN_CMD_ENABLE		0x0001 /* enable */
     68  1.1  onoe #define AN_CMD_DISABLE		0x0002 /* disable */
     69  1.1  onoe #define AN_CMD_FORCE_SYNCLOSS	0x0003 /* force loss of sync */
     70  1.1  onoe #define AN_CMD_FW_RESTART	0x0004 /* firmware resrart */
     71  1.1  onoe #define AN_CMD_HOST_SLEEP	0x0005
     72  1.1  onoe #define AN_CMD_MAGIC_PKT	0x0006
     73  1.1  onoe #define AN_CMD_READCFG		0x0008
     74  1.1  onoe #define AN_CMD_ALLOC_MEM	0x000A /* allocate NIC memory */
     75  1.1  onoe #define AN_CMD_TX		0x000B /* transmit */
     76  1.1  onoe #define AN_CMD_DEALLOC_MEM	0x000C
     77  1.1  onoe #define AN_CMD_NOOP2		0x0010
     78  1.1  onoe #define AN_CMD_ACCESS		0x0021
     79  1.1  onoe #define AN_CMD_ALLOC_BUF	0x0028
     80  1.1  onoe #define AN_CMD_PSP_NODES	0x0030
     81  1.1  onoe #define AN_CMD_SET_PHYREG	0x003E
     82  1.1  onoe #define AN_CMD_TX_TEST		0x003F
     83  1.1  onoe #define AN_CMD_SLEEP		0x0085
     84  1.1  onoe #define AN_CMD_SAVECFG		0x0108
     85  1.1  onoe 
     86  1.1  onoe /*
     87  1.1  onoe  * Reclaim qualifier bit, applicable to the
     88  1.1  onoe  * TX command.
     89  1.1  onoe  */
     90  1.1  onoe #define AN_RECLAIM		0x0100 /* reclaim NIC memory */
     91  1.1  onoe 
     92  1.1  onoe /*
     93  1.1  onoe  * ACCESS command qualifier bits.
     94  1.1  onoe  */
     95  1.1  onoe #define AN_ACCESS_READ		0x0000
     96  1.1  onoe #define AN_ACCESS_WRITE		0x0100
     97  1.1  onoe 
     98  1.1  onoe /*
     99  1.1  onoe  * PROGRAM command qualifier bits.
    100  1.1  onoe  */
    101  1.1  onoe #define AN_PROGRAM_DISABLE	0x0000
    102  1.1  onoe #define AN_PROGRAM_ENABLE_RAM	0x0100
    103  1.1  onoe #define AN_PROGRAM_ENABLE_NVRAM	0x0200
    104  1.1  onoe #define AN_PROGRAM_NVRAM	0x0300
    105  1.1  onoe 
    106  1.1  onoe /* Status register values */
    107  1.1  onoe #define AN_STAT_CMD_CODE	0x003F
    108  1.1  onoe #define AN_STAT_CMD_RESULT	0x7F00
    109  1.1  onoe 
    110  1.1  onoe /* Linkstat register */
    111  1.1  onoe #define AN_LINKSTAT_ASSOCIATED		0x0400
    112  1.1  onoe #define AN_LINKSTAT_AUTHFAIL		0x0300
    113  1.1  onoe #define AN_LINKSTAT_ASSOC_FAIL		0x8400
    114  1.1  onoe #define AN_LINKSTAT_DISASSOC		0x8200
    115  1.1  onoe #define AN_LINKSTAT_DEAUTH		0x8100
    116  1.1  onoe #define AN_LINKSTAT_SYNCLOST_TSF	0x8004
    117  1.1  onoe #define AN_LINKSTAT_SYNCLOST_HOSTREQ	0x8003
    118  1.1  onoe #define AN_LINKSTAT_SYNCLOST_AVGRETRY	0x8002
    119  1.1  onoe #define AN_LINKSTAT_SYNCLOST_MAXRETRY	0x8001
    120  1.1  onoe #define AN_LINKSTAT_SYNCLOST_MISSBEACON	0x8000
    121  1.1  onoe 
    122  1.1  onoe /* memory handle management registers */
    123  1.1  onoe #define AN_RX_FID		0x20
    124  1.1  onoe #define AN_ALLOC_FID		0x22
    125  1.1  onoe #define AN_TX_CMP_FID		0x24
    126  1.1  onoe 
    127  1.1  onoe /*
    128  1.1  onoe  * Buffer Access Path (BAP) registers.
    129  1.1  onoe  * These are I/O channels. I believe you can use each one for
    130  1.1  onoe  * any desired purpose independently of the other. In general
    131  1.1  onoe  * though, we use BAP1 for reading and writing LTV records and
    132  1.1  onoe  * reading received data frames, and BAP0 for writing transmit
    133  1.1  onoe  * frames. This is a convention though, not a rule.
    134  1.1  onoe  */
    135  1.1  onoe #define AN_SEL0			0x18
    136  1.1  onoe #define AN_SEL1			0x1A
    137  1.1  onoe #define AN_OFF0			0x1C
    138  1.1  onoe #define AN_OFF1			0x1E
    139  1.1  onoe #define AN_DATA0		0x36
    140  1.1  onoe #define AN_DATA1		0x38
    141  1.1  onoe #define AN_BAP0			AN_DATA0
    142  1.1  onoe #define AN_BAP1			AN_DATA1
    143  1.1  onoe 
    144  1.1  onoe #define AN_OFF_BUSY		0x8000
    145  1.1  onoe #define AN_OFF_ERR		0x4000
    146  1.1  onoe #define AN_OFF_DONE		0x2000
    147  1.1  onoe #define AN_OFF_DATAOFF		0x0FFF
    148  1.1  onoe 
    149  1.1  onoe /* Event registers */
    150  1.1  onoe #define AN_EVENT_STAT		0x30	/* Event status */
    151  1.1  onoe #define AN_INT_EN		0x32	/* Interrupt enable/disable */
    152  1.1  onoe #define AN_EVENT_ACK		0x34	/* Ack event */
    153  1.1  onoe 
    154  1.1  onoe /* Events */
    155  1.1  onoe #define AN_EV_CLR_STUCK_BUSY	0x4000	/* clear stuck busy bit */
    156  1.1  onoe #define AN_EV_WAKEREQUEST	0x2000	/* awaken from PSP mode */
    157  1.1  onoe #define AN_EV_AWAKE		0x0100	/* station woke up from PSP mode*/
    158  1.1  onoe #define AN_EV_LINKSTAT		0x0080	/* link status available */
    159  1.1  onoe #define AN_EV_CMD		0x0010	/* command completed */
    160  1.1  onoe #define AN_EV_ALLOC		0x0008	/* async alloc/reclaim completed */
    161  1.1  onoe #define AN_EV_TX_EXC		0x0004	/* async xmit completed with failure */
    162  1.1  onoe #define AN_EV_TX		0x0002	/* async xmit completed succesfully */
    163  1.1  onoe #define AN_EV_RX		0x0001	/* async rx completed */
    164  1.1  onoe 
    165  1.1  onoe #define AN_INTRS	\
    166  1.1  onoe 	(AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC|AN_EV_LINKSTAT)
    167  1.1  onoe 
    168  1.1  onoe /* Host software registers */
    169  1.1  onoe #define AN_SW0			0x28
    170  1.1  onoe #define AN_SW1			0x2A
    171  1.1  onoe #define AN_SW2			0x2C
    172  1.1  onoe #define AN_SW3			0x2E
    173  1.1  onoe 
    174  1.1  onoe #define AN_CNTL			0x14
    175  1.1  onoe 
    176  1.1  onoe #define AN_CNTL_AUX_ENA		0xC000
    177  1.1  onoe #define AN_CNTL_AUX_ENA_STAT	0xC000
    178  1.1  onoe #define AN_CNTL_AUX_DIS_STAT	0x0000
    179  1.1  onoe #define AN_CNTL_AUX_ENA_CNTL	0x8000
    180  1.1  onoe #define AN_CNTL_AUX_DIS_CNTL	0x4000
    181  1.1  onoe 
    182  1.1  onoe #define AN_AUX_PAGE		0x3A
    183  1.1  onoe #define AN_AUX_OFFSET		0x3C
    184  1.1  onoe #define AN_AUX_DATA		0x3E
    185  1.1  onoe 
    186  1.1  onoe /*
    187  1.1  onoe  * Length, Type, Value (LTV) record definitions and RID values.
    188  1.1  onoe  */
    189  1.1  onoe struct an_ltv_gen {
    190  1.1  onoe 	u_int16_t		an_len;
    191  1.1  onoe 	u_int16_t		an_type;
    192  1.1  onoe 	u_int16_t		an_val;
    193  1.1  onoe };
    194  1.1  onoe 
    195  1.1  onoe /*
    196  1.1  onoe  * General configuration information.
    197  1.1  onoe  */
    198  1.1  onoe #define AN_RID_GENCONFIG	0xFF10
    199  1.1  onoe struct an_ltv_genconfig {
    200  1.1  onoe 	/* General configuration. */
    201  1.1  onoe 	u_int16_t		an_len;			/* 0x00 */
    202  1.1  onoe 	u_int16_t		an_type;		/* XXXX */
    203  1.1  onoe 	u_int16_t		an_opmode;		/* 0x02 */
    204  1.1  onoe 	u_int16_t		an_rxmode;		/* 0x04 */
    205  1.1  onoe 	u_int16_t		an_fragthresh;		/* 0x06 */
    206  1.1  onoe 	u_int16_t		an_rtsthresh;		/* 0x08 */
    207  1.1  onoe 	u_int8_t		an_macaddr[6];		/* 0x0A */
    208  1.1  onoe 	u_int8_t		an_rates[8];		/* 0x10 */
    209  1.1  onoe 	u_int16_t		an_shortretry_limit;	/* 0x18 */
    210  1.1  onoe 	u_int16_t		an_longretry_limit;	/* 0x1A */
    211  1.1  onoe 	u_int16_t		an_tx_msdu_lifetime;	/* 0x1C */
    212  1.1  onoe 	u_int16_t		an_rx_msdu_lifetime;	/* 0x1E */
    213  1.1  onoe 	u_int16_t		an_stationary;		/* 0x20 */
    214  1.1  onoe 	u_int16_t		an_ordering;		/* 0x22 */
    215  1.1  onoe 	u_int16_t		an_devtype;		/* 0x24 */
    216  1.1  onoe 	u_int16_t		an_rsvd0[5];		/* 0x26 */
    217  1.1  onoe 	/* Scanning associating. */
    218  1.1  onoe 	u_int16_t		an_scanmode;		/* 0x30 */
    219  1.1  onoe 	u_int16_t		an_probedelay;		/* 0x32 */
    220  1.1  onoe 	u_int16_t		an_probe_energy_timeout;/* 0x34 */
    221  1.1  onoe 	u_int16_t		an_probe_response_timeout;/*0x36 */
    222  1.1  onoe 	u_int16_t		an_beacon_listen_timeout;/*0x38 */
    223  1.1  onoe 	u_int16_t		an_ibss_join_net_timeout;/*0x3A */
    224  1.1  onoe 	u_int16_t		an_auth_timeout;	/* 0x3C */
    225  1.1  onoe 	u_int16_t		an_authtype;		/* 0x3E */
    226  1.1  onoe 	u_int16_t		an_assoc_timeout;	/* 0x40 */
    227  1.1  onoe 	u_int16_t		an_specified_ap_timeout;/* 0x42 */
    228  1.1  onoe 	u_int16_t		an_offline_scan_interval;/*0x44 */
    229  1.1  onoe 	u_int16_t		an_offline_scan_duration;/*0x46 */
    230  1.1  onoe 	u_int16_t		an_link_loss_delay;	/* 0x48 */
    231  1.1  onoe 	u_int16_t		an_max_beacon_lost_time;/* 0x4A */
    232  1.1  onoe 	u_int16_t		an_refresh_interval;	/* 0x4C */
    233  1.1  onoe 	u_int16_t		an_rsvd1;		/* 0x4E */
    234  1.1  onoe 	/* Power save operation */
    235  1.1  onoe 	u_int16_t		an_psave_mode;		/* 0x50 */
    236  1.1  onoe 	u_int16_t		an_sleep_for_dtims;	/* 0x52 */
    237  1.1  onoe 	u_int16_t		an_listen_interval;	/* 0x54 */
    238  1.1  onoe 	u_int16_t		an_fast_listen_interval;/* 0x56 */
    239  1.1  onoe 	u_int16_t		an_listen_decay;	/* 0x58 */
    240  1.1  onoe 	u_int16_t		an_fast_listen_decay;	/* 0x5A */
    241  1.1  onoe 	u_int16_t		an_rsvd2[2];		/* 0x5C */
    242  1.1  onoe 	/* Ad-hoc (or AP) operation. */
    243  1.1  onoe 	u_int16_t		an_beacon_period;	/* 0x60 */
    244  1.1  onoe 	u_int16_t		an_atim_duration;	/* 0x62 */
    245  1.1  onoe 	u_int16_t		an_rsvd3;		/* 0x64 */
    246  1.1  onoe 	u_int16_t		an_ds_channel;		/* 0x66 */
    247  1.1  onoe 	u_int16_t		an_rsvd4;		/* 0x68 */
    248  1.1  onoe 	u_int16_t		an_dtim_period;		/* 0x6A */
    249  1.1  onoe 	u_int16_t		an_rsvd5[2];		/* 0x6C */
    250  1.1  onoe 	/* Radio operation. */
    251  1.1  onoe 	u_int16_t		an_radiotype;		/* 0x70 */
    252  1.1  onoe 	u_int16_t		an_diversity;		/* 0x72 */
    253  1.1  onoe 	u_int16_t		an_tx_power;		/* 0x74 */
    254  1.1  onoe 	u_int16_t		an_rss_thresh;		/* 0x76 */
    255  1.1  onoe 	u_int16_t		an_modulation_type;	/* 0x78 */
    256  1.1  onoe 	u_int16_t		an_short_preamble;	/* 0x7A */
    257  1.1  onoe 	u_int16_t		an_home_product;	/* 0x7C */
    258  1.1  onoe 	u_int16_t		an_rsvd6;		/* 0x7E */
    259  1.1  onoe 	/* Aironet extensions. */
    260  1.1  onoe 	u_int8_t		an_nodename[16];	/* 0x80 */
    261  1.1  onoe 	u_int16_t		an_arl_thresh;		/* 0x90 */
    262  1.1  onoe 	u_int16_t		an_arl_decay;		/* 0x92 */
    263  1.1  onoe 	u_int16_t		an_arl_delay;		/* 0x94 */
    264  1.1  onoe 	u_int8_t		an_rsvd7;		/* 0x96 */
    265  1.1  onoe 	u_int8_t		an_rsvd8;		/* 0x97 */
    266  1.1  onoe 	u_int8_t		an_magic_packet_action;	/* 0x98 */
    267  1.1  onoe 	u_int8_t		an_magic_packet_ctl;	/* 0x99 */
    268  1.1  onoe 	u_int16_t		an_rsvd9;
    269  1.1  onoe };
    270  1.1  onoe 
    271  1.1  onoe #define AN_OPMODE_IBSS_ADHOC			0x0000
    272  1.1  onoe #define AN_OPMODE_INFRASTRUCTURE_STATION	0x0001
    273  1.1  onoe #define AN_OPMODE_AP				0x0002
    274  1.1  onoe #define AN_OPMODE_AP_REPEATER			0x0003
    275  1.1  onoe #define AN_OPMODE_UNMODIFIED_PAYLOAD		0x0100
    276  1.1  onoe #define AN_OPMODE_AIRONET_EXTENSIONS		0x0200
    277  1.1  onoe #define AN_OPMODE_AP_EXTENSIONS			0x0400
    278  1.1  onoe 
    279  1.1  onoe #define AN_RXMODE_BC_MC_ADDR			0x0000
    280  1.1  onoe #define AN_RXMODE_BC_ADDR			0x0001
    281  1.1  onoe #define AN_RXMODE_ADDR				0x0002
    282  1.1  onoe #define AN_RXMODE_80211_MONITOR_CURBSS		0x0003
    283  1.1  onoe #define AN_RXMODE_80211_MONITOR_ANYBSS		0x0004
    284  1.1  onoe #define AN_RXMODE_LAN_MONITOR_CURBSS		0x0005
    285  1.1  onoe #define AN_RXMODE_NO_8023_HEADER		0x0100
    286  1.1  onoe 
    287  1.1  onoe #define AN_RATE_1MBPS				0x0002
    288  1.1  onoe #define AN_RATE_2MBPS				0x0004
    289  1.1  onoe #define AN_RATE_5_5MBPS				0x000B
    290  1.1  onoe #define AN_RATE_11MBPS				0x0016
    291  1.1  onoe 
    292  1.1  onoe #define AN_DEVTYPE_PC4500			0x0065
    293  1.1  onoe #define AN_DEVTYPE_PC4800			0x006D
    294  1.1  onoe 
    295  1.1  onoe #define AN_SCANMODE_ACTIVE			0x0000
    296  1.1  onoe #define AN_SCANMODE_PASSIVE			0x0001
    297  1.1  onoe #define AN_SCANMODE_AIRONET_ACTIVE		0x0002
    298  1.1  onoe 
    299  1.1  onoe #define AN_AUTHTYPE_NONE			0x0000
    300  1.1  onoe #define AN_AUTHTYPE_OPEN			0x0001
    301  1.1  onoe #define AN_AUTHTYPE_SHAREDKEY			0x0002
    302  1.1  onoe #define AN_AUTHTYPE_EXCLUDE_UNENCRYPTED		0x0004
    303  1.3  onoe #define	AN_AUTHTYPE_MASK			0x00ff
    304  1.1  onoe 
    305  1.1  onoe #define AN_PSAVE_NONE				0x0000
    306  1.1  onoe #define AN_PSAVE_CAM				0x0001
    307  1.1  onoe #define AN_PSAVE_PSP				0x0002
    308  1.1  onoe #define AN_PSAVE_PSP_CAM			0x0003
    309  1.1  onoe 
    310  1.1  onoe #define AN_RADIOTYPE_80211_FH			0x0001
    311  1.1  onoe #define AN_RADIOTYPE_80211_DS			0x0002
    312  1.1  onoe #define AN_RADIOTYPE_LM2000_DS			0x0004
    313  1.1  onoe 
    314  1.1  onoe #define AN_DIVERSITY_FACTORY_DEFAULT		0x0000
    315  1.1  onoe #define AN_DIVERSITY_ANTENNA_1_ONLY		0x0001
    316  1.1  onoe #define AN_DIVERSITY_ANTENNA_2_ONLY		0x0002
    317  1.1  onoe #define AN_DIVERSITY_ANTENNA_1_AND_2		0x0003
    318  1.1  onoe 
    319  1.1  onoe #define AN_TXPOWER_FACTORY_DEFAULT		0x0000
    320  1.1  onoe #define AN_TXPOWER_50MW				50
    321  1.1  onoe #define AN_TXPOWER_100MW			100
    322  1.1  onoe #define AN_TXPOWER_250MW			250
    323  1.1  onoe 
    324  1.1  onoe /*
    325  1.1  onoe  * Valid SSID list. You can specify up to three SSIDs denoting
    326  1.1  onoe  * the service sets that you want to join. The first SSID always
    327  1.1  onoe  * defaults to "tsunami" which is a handy way to detect the
    328  1.1  onoe  * card.
    329  1.1  onoe  */
    330  1.1  onoe #define AN_RID_SSIDLIST		0xFF11
    331  1.1  onoe struct an_ltv_ssidlist {
    332  1.1  onoe 	u_int16_t		an_len;
    333  1.1  onoe 	u_int16_t		an_type;
    334  1.1  onoe 	u_int16_t		an_ssid1_len;
    335  1.1  onoe 	char			an_ssid1[32];
    336  1.1  onoe 	u_int16_t		an_ssid2_len;
    337  1.1  onoe 	char			an_ssid2[32];
    338  1.1  onoe 	u_int16_t		an_ssid3_len;
    339  1.1  onoe 	char			an_ssid3[32];
    340  1.1  onoe };
    341  1.1  onoe 
    342  1.1  onoe #define AN_DEF_SSID_LEN		7
    343  1.1  onoe #define AN_DEF_SSID		"tsunami"
    344  1.1  onoe 
    345  1.1  onoe /*
    346  1.1  onoe  * Valid AP list.
    347  1.1  onoe  */
    348  1.1  onoe #define AN_RID_APLIST		0xFF12
    349  1.1  onoe struct an_ltv_aplist {
    350  1.1  onoe 	u_int16_t		an_len;
    351  1.1  onoe 	u_int16_t		an_type;
    352  1.1  onoe 	u_int8_t		an_ap1[8];
    353  1.1  onoe 	u_int8_t		an_ap2[8];
    354  1.1  onoe 	u_int8_t		an_ap3[8];
    355  1.1  onoe 	u_int8_t		an_ap4[8];
    356  1.1  onoe };
    357  1.1  onoe 
    358  1.1  onoe /*
    359  1.1  onoe  * Driver name.
    360  1.1  onoe  */
    361  1.1  onoe #define AN_RID_DRVNAME		0xFF13
    362  1.1  onoe struct an_ltv_drvname {
    363  1.1  onoe 	u_int16_t		an_len;
    364  1.1  onoe 	u_int16_t		an_type;
    365  1.1  onoe 	u_int8_t		an_drvname[16];
    366  1.1  onoe };
    367  1.1  onoe 
    368  1.1  onoe /*
    369  1.1  onoe  * Frame encapsulation.
    370  1.1  onoe  */
    371  1.1  onoe #define AN_RID_ENCAP		0xFF14
    372  1.1  onoe struct an_rid_encap {
    373  1.1  onoe 	u_int16_t		an_len;
    374  1.1  onoe 	u_int16_t		an_type;
    375  1.1  onoe 	u_int16_t		an_ethertype_default;
    376  1.1  onoe 	u_int16_t		an_action_default;
    377  1.1  onoe 	u_int16_t		an_ethertype0;
    378  1.1  onoe 	u_int16_t		an_action0;
    379  1.1  onoe 	u_int16_t		an_ethertype1;
    380  1.1  onoe 	u_int16_t		an_action1;
    381  1.1  onoe 	u_int16_t		an_ethertype2;
    382  1.1  onoe 	u_int16_t		an_action2;
    383  1.1  onoe 	u_int16_t		an_ethertype3;
    384  1.1  onoe 	u_int16_t		an_action3;
    385  1.1  onoe 	u_int16_t		an_ethertype4;
    386  1.1  onoe 	u_int16_t		an_action4;
    387  1.1  onoe 	u_int16_t		an_ethertype5;
    388  1.1  onoe 	u_int16_t		an_action5;
    389  1.1  onoe 	u_int16_t		an_ethertype6;
    390  1.1  onoe 	u_int16_t		an_action6;
    391  1.1  onoe };
    392  1.1  onoe 
    393  1.1  onoe #define AN_ENCAP_ACTION_RX	0x0001
    394  1.1  onoe #define AN_ENCAP_ACTION_TX	0x0002
    395  1.1  onoe 
    396  1.1  onoe #define AN_RXENCAP_NONE		0x0000
    397  1.1  onoe #define AN_RXENCAP_RFC1024	0x0001
    398  1.1  onoe 
    399  1.1  onoe #define AN_TXENCAP_RFC1024	0x0000
    400  1.1  onoe #define AN_TXENCAP_80211	0x0002
    401  1.1  onoe 
    402  1.1  onoe /*
    403  1.1  onoe  * Actual config, same structure as general config (read only).
    404  1.1  onoe  */
    405  1.1  onoe #define AN_RID_ACTUALCFG	0xFF20
    406  1.1  onoe 
    407  1.1  onoe /*
    408  1.1  onoe  * Card capabilities (read only).
    409  1.1  onoe  */
    410  1.1  onoe #define AN_RID_CAPABILITIES	0xFF00
    411  1.1  onoe struct an_ltv_caps {
    412  1.1  onoe 	u_int16_t		an_len;			/* 0x00 */
    413  1.1  onoe 	u_int16_t		an_type;		/* XXXX */
    414  1.1  onoe 	u_int8_t		an_oui[3];		/* 0x02 */
    415  1.1  onoe 	u_int8_t		an_rsvd0;		/* 0x05 */
    416  1.1  onoe 	u_int16_t		an_prodnum;		/* 0x06 */
    417  1.1  onoe 	u_int8_t		an_manufname[32];	/* 0x08 */
    418  1.1  onoe 	u_int8_t		an_prodname[16];	/* 0x28 */
    419  1.1  onoe 	u_int8_t		an_prodvers[8];		/* 0x38 */
    420  1.1  onoe 	u_int8_t		an_oemaddr[6];		/* 0x40 */
    421  1.1  onoe 	u_int8_t		an_aironetaddr[6];	/* 0x46 */
    422  1.1  onoe 	u_int16_t		an_radiotype;		/* 0x4C */
    423  1.1  onoe 	u_int16_t		an_regdomain;		/* 0x4E */
    424  1.1  onoe 	u_int8_t		an_callid[6];		/* 0x50 */
    425  1.1  onoe 	u_int8_t		an_rates[8];		/* 0x56 */
    426  1.1  onoe 	u_int8_t		an_rx_diversity;	/* 0x5E */
    427  1.1  onoe 	u_int8_t		an_tx_diversity;	/* 0x5F */
    428  1.1  onoe 	u_int16_t		an_tx_powerlevels[8];	/* 0x60 */
    429  1.1  onoe 	u_int16_t		an_hwrev;		/* 0x70 */
    430  1.1  onoe 	u_int16_t		an_hwcaps;		/* 0x72 */
    431  1.1  onoe 	u_int16_t		an_temprange;		/* 0x74 */
    432  1.1  onoe 	u_int16_t		an_fwrev;		/* 0x76 */
    433  1.1  onoe 	u_int16_t		an_fwsubrev;		/* 0x78 */
    434  1.1  onoe 	u_int16_t		an_ifacerev;		/* 0x7A */
    435  1.1  onoe 	u_int16_t		an_softcaps;		/* 0x7C */
    436  1.1  onoe 	u_int16_t		an_bootblockrev;	/* 0x7E */
    437  1.1  onoe 	u_int16_t		an_req_hw_support;	/* 0x80 */
    438  1.1  onoe };
    439  1.1  onoe 
    440  1.1  onoe /*
    441  1.1  onoe  * Access point (read only)
    442  1.1  onoe  */
    443  1.1  onoe #define AN_RID_APINFO		0xFF01
    444  1.1  onoe struct an_ltv_apinfo {
    445  1.1  onoe 	u_int16_t		an_len;
    446  1.1  onoe 	u_int16_t		an_type;
    447  1.1  onoe 	u_int16_t		an_tim_addr;
    448  1.1  onoe 	u_int16_t		an_airo_addr;
    449  1.1  onoe };
    450  1.1  onoe 
    451  1.1  onoe /*
    452  1.1  onoe  * Radio info (read only).
    453  1.1  onoe  */
    454  1.1  onoe #define AN_RID_RADIOINFO	0xFF02
    455  1.1  onoe struct an_ltv_radioinfo {
    456  1.1  onoe 	u_int16_t		an_len;
    457  1.1  onoe 	u_int16_t		an_type;
    458  1.1  onoe 	/* ??? */
    459  1.1  onoe };
    460  1.1  onoe 
    461  1.1  onoe /*
    462  1.1  onoe  * Status (read only). Note: the manual claims this RID is 108 bytes
    463  1.1  onoe  * long (0x6A is the last datum, which is 2 bytes long) however when
    464  1.1  onoe  * this RID is read from the NIC, it returns a length of 110. To be
    465  1.1  onoe  * on the safe side, this structure is padded with an extra 16-bit
    466  1.1  onoe  * word. (There is a misprint in the manual which says the macaddr
    467  1.1  onoe  * field is 8 bytes long.)
    468  1.1  onoe  *
    469  1.1  onoe  * Also, the channel_set and current_channel fields appear to be
    470  1.1  onoe  * reversed. Either that, or the hop_period field is unused.
    471  1.1  onoe  */
    472  1.1  onoe #define AN_RID_STATUS		0xFF50
    473  1.1  onoe struct an_ltv_status {
    474  1.1  onoe 	u_int16_t		an_len;			/* 0x00 */
    475  1.1  onoe 	u_int16_t		an_type;		/* 0xXX */
    476  1.1  onoe 	u_int8_t		an_macaddr[6];		/* 0x02 */
    477  1.1  onoe 	u_int16_t		an_opmode;		/* 0x08 */
    478  1.1  onoe 	u_int16_t		an_errcode;		/* 0x0A */
    479  1.1  onoe 	u_int16_t		an_cur_signal_strength;	/* 0x0C */
    480  1.1  onoe 	u_int16_t		an_ssidlen;		/* 0x0E */
    481  1.1  onoe 	u_int8_t		an_ssid[32];		/* 0x10 */
    482  1.1  onoe 	u_int8_t		an_ap_name[16];		/* 0x30 */
    483  1.1  onoe 	u_int8_t		an_cur_bssid[6];	/* 0x40 */
    484  1.1  onoe 	u_int8_t		an_prev_bssid1[6];	/* 0x46 */
    485  1.1  onoe 	u_int8_t		an_prev_bssid2[6];	/* 0x4C */
    486  1.1  onoe 	u_int8_t		an_prev_bssid3[6];	/* 0x52 */
    487  1.1  onoe 	u_int16_t		an_beacon_period;	/* 0x58 */
    488  1.1  onoe 	u_int16_t		an_dtim_period;		/* 0x5A */
    489  1.1  onoe 	u_int16_t		an_atim_duration;	/* 0x5C */
    490  1.1  onoe 	u_int16_t		an_hop_period;		/* 0x5E */
    491  1.1  onoe 	u_int16_t		an_cur_channel;		/* 0x62 */
    492  1.1  onoe 	u_int16_t		an_channel_set;		/* 0x60 */
    493  1.1  onoe 	u_int16_t		an_hops_to_backbone;	/* 0x64 */
    494  1.1  onoe 	u_int16_t		an_ap_total_load;	/* 0x66 */
    495  1.1  onoe 	u_int16_t		an_our_generated_load;	/* 0x68 */
    496  1.1  onoe 	u_int16_t		an_accumulated_arl;	/* 0x6A */
    497  1.1  onoe 	u_int16_t		an_cur_signal_quality;	/* 0x6C */
    498  1.1  onoe 	u_int16_t		an_current_tx_rate;	/* 0x6E */
    499  1.1  onoe 	u_int16_t		an_ap_device;		/* 0x70 */
    500  1.1  onoe 	u_int16_t		an_normalized_rssi;	/* 0x72 */
    501  1.1  onoe 	u_int16_t		an_short_pre_in_use;	/* 0x74 */
    502  1.1  onoe 	u_int8_t		an_ap_ip_addr[4];	/* 0x76 */
    503  1.1  onoe 	u_int16_t		an_max_noise_prev_sec;	/* 0x7A */
    504  1.1  onoe 	u_int16_t		an_avg_noise_prev_min;	/* 0x7C */
    505  1.1  onoe 	u_int16_t		an_max_noise_prev_min;	/* 0x7E */
    506  1.1  onoe 	u_int16_t		an_spare[2];
    507  1.1  onoe };
    508  1.1  onoe 
    509  1.1  onoe #define AN_STATUS_OPMODE_CONFIGURED		0x0001
    510  1.1  onoe #define AN_STATUS_OPMODE_MAC_ENABLED		0x0002
    511  1.1  onoe #define AN_STATUS_OPMODE_RX_ENABLED		0x0004
    512  1.1  onoe #define AN_STATUS_OPMODE_IN_SYNC		0x0010
    513  1.1  onoe #define AN_STATUS_OPMODE_ASSOCIATED		0x0020
    514  1.1  onoe #define AN_STATUS_OPMODE_ERROR			0x8000
    515  1.1  onoe 
    516  1.1  onoe 
    517  1.1  onoe /*
    518  1.1  onoe  * Statistics
    519  1.1  onoe  */
    520  1.1  onoe #define AN_RID_16BITS_CUM	0xFF60	/* Cumulative 16-bit stats counters */
    521  1.1  onoe #define AN_RID_16BITS_DELTA	0xFF61	/* 16-bit stats (since last clear) */
    522  1.1  onoe #define AN_RID_16BITS_DELTACLR	0xFF62	/* 16-bit stats, clear on read */
    523  1.1  onoe #define AN_RID_32BITS_CUM	0xFF68	/* Cumulative 32-bit stats counters */
    524  1.1  onoe #define AN_RID_32BITS_DELTA	0xFF69	/* 32-bit stats (since last clear) */
    525  1.1  onoe #define AN_RID_32BITS_DELTACLR	0xFF6A	/* 32-bit stats, clear on read */
    526  1.1  onoe 
    527  1.1  onoe /*
    528  1.1  onoe  * Grrr. The manual says the statistics record is 384 bytes in length,
    529  1.1  onoe  * but the card says the record is 404 bytes. There's some padding left
    530  1.1  onoe  * at the end of this structure to account for any discrepancies.
    531  1.1  onoe  */
    532  1.1  onoe struct an_ltv_stats {
    533  1.1  onoe 	u_int16_t		an_fudge;
    534  1.1  onoe 	u_int16_t		an_len;			/* 0x00 */
    535  1.1  onoe 	u_int16_t		an_type;		/* 0xXX */
    536  1.1  onoe 	u_int16_t		an_spacer;		/* 0x02 */
    537  1.1  onoe 	u_int32_t		an_rx_overruns;		/* 0x04 */
    538  1.1  onoe 	u_int32_t		an_rx_plcp_csum_errs;	/* 0x08 */
    539  1.1  onoe 	u_int32_t		an_rx_plcp_format_errs;	/* 0x0C */
    540  1.1  onoe 	u_int32_t		an_rx_plcp_len_errs;	/* 0x10 */
    541  1.1  onoe 	u_int32_t		an_rx_mac_crc_errs;	/* 0x14 */
    542  1.1  onoe 	u_int32_t		an_rx_mac_crc_ok;	/* 0x18 */
    543  1.1  onoe 	u_int32_t		an_rx_wep_errs;		/* 0x1C */
    544  1.1  onoe 	u_int32_t		an_rx_wep_ok;		/* 0x20 */
    545  1.1  onoe 	u_int32_t		an_retry_long;		/* 0x24 */
    546  1.1  onoe 	u_int32_t		an_retry_short;		/* 0x28 */
    547  1.1  onoe 	u_int32_t		an_retry_max;		/* 0x2C */
    548  1.1  onoe 	u_int32_t		an_no_ack;		/* 0x30 */
    549  1.1  onoe 	u_int32_t		an_no_cts;		/* 0x34 */
    550  1.1  onoe 	u_int32_t		an_rx_ack_ok;		/* 0x38 */
    551  1.1  onoe 	u_int32_t		an_rx_cts_ok;		/* 0x3C */
    552  1.1  onoe 	u_int32_t		an_tx_ack_ok;		/* 0x40 */
    553  1.1  onoe 	u_int32_t		an_tx_rts_ok;		/* 0x44 */
    554  1.1  onoe 	u_int32_t		an_tx_cts_ok;		/* 0x48 */
    555  1.1  onoe 	u_int32_t		an_tx_lmac_mcasts;	/* 0x4C */
    556  1.1  onoe 	u_int32_t		an_tx_lmac_bcasts;	/* 0x50 */
    557  1.1  onoe 	u_int32_t		an_tx_lmac_ucast_frags;	/* 0x54 */
    558  1.1  onoe 	u_int32_t		an_tx_lmac_ucasts;	/* 0x58 */
    559  1.1  onoe 	u_int32_t		an_tx_beacons;		/* 0x5C */
    560  1.1  onoe 	u_int32_t		an_rx_beacons;		/* 0x60 */
    561  1.1  onoe 	u_int32_t		an_tx_single_cols;	/* 0x64 */
    562  1.1  onoe 	u_int32_t		an_tx_multi_cols;	/* 0x68 */
    563  1.1  onoe 	u_int32_t		an_tx_defers_no;	/* 0x6C */
    564  1.1  onoe 	u_int32_t		an_tx_defers_prot;	/* 0x70 */
    565  1.1  onoe 	u_int32_t		an_tx_defers_energy;	/* 0x74 */
    566  1.1  onoe 	u_int32_t		an_rx_dups;		/* 0x78 */
    567  1.1  onoe 	u_int32_t		an_rx_partial;		/* 0x7C */
    568  1.1  onoe 	u_int32_t		an_tx_too_old;		/* 0x80 */
    569  1.1  onoe 	u_int32_t		an_rx_too_old;		/* 0x84 */
    570  1.1  onoe 	u_int32_t		an_lostsync_max_retries;/* 0x88 */
    571  1.1  onoe 	u_int32_t		an_lostsync_missed_beacons;/* 0x8C */
    572  1.1  onoe 	u_int32_t		an_lostsync_arl_exceeded;/*0x90 */
    573  1.1  onoe 	u_int32_t		an_lostsync_deauthed;	/* 0x94 */
    574  1.1  onoe 	u_int32_t		an_lostsync_disassociated;/*0x98 */
    575  1.1  onoe 	u_int32_t		an_lostsync_tsf_timing;	/* 0x9C */
    576  1.1  onoe 	u_int32_t		an_tx_host_mcasts;	/* 0xA0 */
    577  1.1  onoe 	u_int32_t		an_tx_host_bcasts;	/* 0xA4 */
    578  1.1  onoe 	u_int32_t		an_tx_host_ucasts;	/* 0xA8 */
    579  1.1  onoe 	u_int32_t		an_tx_host_failed;	/* 0xAC */
    580  1.1  onoe 	u_int32_t		an_rx_host_mcasts;	/* 0xB0 */
    581  1.1  onoe 	u_int32_t		an_rx_host_bcasts;	/* 0xB4 */
    582  1.1  onoe 	u_int32_t		an_rx_host_ucasts;	/* 0xB8 */
    583  1.1  onoe 	u_int32_t		an_rx_host_discarded;	/* 0xBC */
    584  1.1  onoe 	u_int32_t		an_tx_hmac_mcasts;	/* 0xC0 */
    585  1.1  onoe 	u_int32_t		an_tx_hmac_bcasts;	/* 0xC4 */
    586  1.1  onoe 	u_int32_t		an_tx_hmac_ucasts;	/* 0xC8 */
    587  1.1  onoe 	u_int32_t		an_tx_hmac_failed;	/* 0xCC */
    588  1.1  onoe 	u_int32_t		an_rx_hmac_mcasts;	/* 0xD0 */
    589  1.1  onoe 	u_int32_t		an_rx_hmac_bcasts;	/* 0xD4 */
    590  1.1  onoe 	u_int32_t		an_rx_hmac_ucasts;	/* 0xD8 */
    591  1.1  onoe 	u_int32_t		an_rx_hmac_discarded;	/* 0xDC */
    592  1.1  onoe 	u_int32_t		an_tx_hmac_accepted;	/* 0xE0 */
    593  1.1  onoe 	u_int32_t		an_ssid_mismatches;	/* 0xE4 */
    594  1.1  onoe 	u_int32_t		an_ap_mismatches;	/* 0xE8 */
    595  1.1  onoe 	u_int32_t		an_rates_mismatches;	/* 0xEC */
    596  1.1  onoe 	u_int32_t		an_auth_rejects;	/* 0xF0 */
    597  1.1  onoe 	u_int32_t		an_auth_timeouts;	/* 0xF4 */
    598  1.1  onoe 	u_int32_t		an_assoc_rejects;	/* 0xF8 */
    599  1.1  onoe 	u_int32_t		an_assoc_timeouts;	/* 0xFC */
    600  1.1  onoe 	u_int32_t		an_reason_outside_table;/* 0x100 */
    601  1.1  onoe 	u_int32_t		an_reason1;		/* 0x104 */
    602  1.1  onoe 	u_int32_t		an_reason2;		/* 0x108 */
    603  1.1  onoe 	u_int32_t		an_reason3;		/* 0x10C */
    604  1.1  onoe 	u_int32_t		an_reason4;		/* 0x110 */
    605  1.1  onoe 	u_int32_t		an_reason5;		/* 0x114 */
    606  1.1  onoe 	u_int32_t		an_reason6;		/* 0x118 */
    607  1.1  onoe 	u_int32_t		an_reason7;		/* 0x11C */
    608  1.1  onoe 	u_int32_t		an_reason8;		/* 0x120 */
    609  1.1  onoe 	u_int32_t		an_reason9;		/* 0x124 */
    610  1.1  onoe 	u_int32_t		an_reason10;		/* 0x128 */
    611  1.1  onoe 	u_int32_t		an_reason11;		/* 0x12C */
    612  1.1  onoe 	u_int32_t		an_reason12;		/* 0x130 */
    613  1.1  onoe 	u_int32_t		an_reason13;		/* 0x134 */
    614  1.1  onoe 	u_int32_t		an_reason14;		/* 0x138 */
    615  1.1  onoe 	u_int32_t		an_reason15;		/* 0x13C */
    616  1.1  onoe 	u_int32_t		an_reason16;		/* 0x140 */
    617  1.1  onoe 	u_int32_t		an_reason17;		/* 0x144 */
    618  1.1  onoe 	u_int32_t		an_reason18;		/* 0x148 */
    619  1.1  onoe 	u_int32_t		an_reason19;		/* 0x14C */
    620  1.1  onoe 	u_int32_t		an_rx_mgmt_pkts;	/* 0x150 */
    621  1.1  onoe 	u_int32_t		an_tx_mgmt_pkts;	/* 0x154 */
    622  1.1  onoe 	u_int32_t		an_rx_refresh_pkts;	/* 0x158 */
    623  1.1  onoe 	u_int32_t		an_tx_refresh_pkts;	/* 0x15C */
    624  1.1  onoe 	u_int32_t		an_rx_poll_pkts;	/* 0x160 */
    625  1.1  onoe 	u_int32_t		an_tx_poll_pkts;	/* 0x164 */
    626  1.1  onoe 	u_int32_t		an_host_retries;	/* 0x168 */
    627  1.1  onoe 	u_int32_t		an_lostsync_hostreq;	/* 0x16C */
    628  1.1  onoe 	u_int32_t		an_host_tx_bytes;	/* 0x170 */
    629  1.1  onoe 	u_int32_t		an_host_rx_bytes;	/* 0x174 */
    630  1.1  onoe 	u_int32_t		an_uptime_usecs;	/* 0x178 */
    631  1.1  onoe 	u_int32_t		an_uptime_secs;		/* 0x17C */
    632  1.1  onoe 	u_int32_t		an_lostsync_better_ap;	/* 0x180 */
    633  1.1  onoe 	u_int32_t		an_rsvd[10];
    634  1.1  onoe };
    635  1.1  onoe 
    636  1.1  onoe /*
    637  1.1  onoe  * Volatile WEP Key
    638  1.1  onoe  */
    639  1.1  onoe #define AN_RID_WEP_VOLATILE	0xFF15	/* Volatile WEP Key */
    640  1.1  onoe struct an_ltv_wepkey {
    641  1.1  onoe 	u_int16_t		an_len;			/* 0x00 */
    642  1.1  onoe 	u_int16_t		an_type;		/* 0xXX */
    643  1.1  onoe 	u_int16_t		an_key_index;		/* 0x02 */
    644  1.1  onoe 	u_int8_t		an_mac_addr[6];		/* 0x04 */
    645  1.1  onoe 	u_int16_t		an_key_len;		/* 0x0A */
    646  1.1  onoe 	u_int8_t		an_key[13];		/* 0x0C */
    647  1.1  onoe };
    648  1.1  onoe 
    649  1.1  onoe /*
    650  1.1  onoe  * Persistent WEP Key
    651  1.1  onoe  */
    652  1.1  onoe #define AN_RID_WEP_PERSISTENT	0xFF16	/* Persistent WEP Key */
    653  1.1  onoe 
    654  1.1  onoe 
    655  1.1  onoe /*
    656  1.1  onoe  * Receive frame structure.
    657  1.1  onoe  */
    658  1.1  onoe struct an_rxframe {
    659  1.1  onoe 	u_int32_t		an_rx_time;		/* 0x00 */
    660  1.1  onoe 	u_int16_t		an_rx_status;		/* 0x04 */
    661  1.1  onoe 	u_int16_t		an_rx_payload_len;	/* 0x06 */
    662  1.1  onoe 	u_int8_t		an_rsvd0;		/* 0x08 */
    663  1.1  onoe 	u_int8_t		an_rx_signal_strength;	/* 0x09 */
    664  1.1  onoe 	u_int8_t		an_rx_rate;		/* 0x0A */
    665  1.1  onoe 	u_int8_t		an_rx_chan;		/* 0x0B */
    666  1.1  onoe 	u_int8_t		an_rx_assoc_cnt;	/* 0x0C */
    667  1.1  onoe 	u_int8_t		an_rsvd1[3];		/* 0x0D */
    668  1.1  onoe 	u_int8_t		an_plcp_hdr[4];		/* 0x10 */
    669  1.1  onoe 	u_int16_t		an_frame_ctl;		/* 0x14 */
    670  1.1  onoe 	u_int16_t		an_duration;		/* 0x16 */
    671  1.1  onoe 	u_int8_t		an_addr1[6];		/* 0x18 */
    672  1.1  onoe 	u_int8_t		an_addr2[6];		/* 0x1E */
    673  1.1  onoe 	u_int8_t		an_addr3[6];		/* 0x24 */
    674  1.1  onoe 	u_int16_t		an_seq_ctl;		/* 0x2A */
    675  1.1  onoe 	u_int8_t		an_addr4[6];		/* 0x2C */
    676  1.1  onoe 	u_int16_t		an_gaplen;		/* 0x32 */
    677  1.1  onoe };
    678  1.1  onoe 
    679  1.1  onoe #define AN_RXGAP_MAX	8
    680  1.1  onoe 
    681  1.1  onoe /*
    682  1.1  onoe  * Transmit frame structure.
    683  1.1  onoe  */
    684  1.1  onoe struct an_txframe {
    685  1.1  onoe 	u_int32_t		an_tx_sw;		/* 0x00 */
    686  1.1  onoe 	u_int16_t		an_tx_status;		/* 0x04 */
    687  1.1  onoe 	u_int16_t		an_tx_payload_len;	/* 0x06 */
    688  1.1  onoe 	u_int16_t		an_tx_ctl;		/* 0x08 */
    689  1.1  onoe 	u_int16_t		an_tx_assoc_id;		/* 0x0A */
    690  1.1  onoe 	u_int16_t		an_tx_retry;		/* 0x0C */
    691  1.1  onoe 	u_int8_t		an_tx_assoc_cnt;	/* 0x0E */
    692  1.1  onoe 	u_int8_t		an_tx_rate;		/* 0x0F */
    693  1.1  onoe 	u_int8_t		an_tx_max_long_retries;	/* 0x10 */
    694  1.1  onoe 	u_int8_t		an_tx_max_short_retries; /*0x11 */
    695  1.1  onoe 	u_int8_t		an_rsvd0[2];		/* 0x12 */
    696  1.1  onoe 	u_int16_t		an_frame_ctl;		/* 0x14 */
    697  1.1  onoe 	u_int16_t		an_duration;		/* 0x16 */
    698  1.1  onoe 	u_int8_t		an_addr1[6];		/* 0x18 */
    699  1.1  onoe 	u_int8_t		an_addr2[6];		/* 0x1E */
    700  1.1  onoe 	u_int8_t		an_addr3[6];		/* 0x24 */
    701  1.1  onoe 	u_int16_t		an_seq_ctl;		/* 0x2A */
    702  1.1  onoe 	u_int8_t		an_addr4[6];		/* 0x2C */
    703  1.1  onoe 	u_int16_t		an_gaplen;		/* 0x32 */
    704  1.1  onoe };
    705  1.1  onoe 
    706  1.1  onoe struct an_rxframe_802_3 {
    707  1.1  onoe         u_int16_t		an_rx_802_3_status;     /* 0x34 */
    708  1.1  onoe 	u_int16_t		an_rx_802_3_payload_len;/* 0x36 */
    709  1.1  onoe 	u_int8_t		an_rx_dst_addr[6];      /* 0x38 */
    710  1.1  onoe 	u_int8_t		an_rx_src_addr[6];      /* 0x3E */
    711  1.1  onoe };
    712  1.1  onoe #define AN_RXGAP_MAX	8
    713  1.1  onoe 
    714  1.1  onoe struct an_txframe_802_3 {
    715  1.1  onoe /*
    716  1.1  onoe  * Transmit 802.3 header structure.
    717  1.1  onoe  */
    718  1.1  onoe         u_int16_t		an_tx_802_3_status;     /* 0x34 */
    719  1.1  onoe 	u_int16_t		an_tx_802_3_payload_len;/* 0x36 */
    720  1.1  onoe 	u_int8_t		an_tx_dst_addr[6];      /* 0x38 */
    721  1.1  onoe 	u_int8_t		an_tx_src_addr[6];      /* 0x3E */
    722  1.1  onoe };
    723  1.1  onoe 
    724  1.1  onoe #define AN_TXSTAT_EXCESS_RETRY	0x0002
    725  1.1  onoe #define AN_TXSTAT_LIFE_EXCEEDED	0x0004
    726  1.1  onoe #define AN_TXSTAT_AID_FAIL	0x0008
    727  1.1  onoe #define AN_TXSTAT_MAC_DISABLED	0x0010
    728  1.1  onoe #define AN_TXSTAT_ASSOC_LOST	0x0020
    729  1.1  onoe 
    730  1.1  onoe #define AN_TXCTL_RSVD		0x0001
    731  1.1  onoe #define AN_TXCTL_TXOK_INTR	0x0002
    732  1.1  onoe #define AN_TXCTL_TXERR_INTR	0x0004
    733  1.1  onoe #define AN_TXCTL_HEADER_TYPE	0x0008
    734  1.1  onoe #define AN_TXCTL_PAYLOAD_TYPE	0x0010
    735  1.1  onoe #define AN_TXCTL_NORELEASE	0x0020
    736  1.1  onoe #define AN_TXCTL_NORETRIES	0x0040
    737  1.1  onoe #define AN_TXCTL_CLEAR_AID	0x0080
    738  1.1  onoe #define AN_TXCTL_STRICT_ORDER	0x0100
    739  1.1  onoe #define AN_TXCTL_USE_RTS	0x0200
    740  1.1  onoe 
    741  1.1  onoe #define AN_HEADERTYPE_8023	0x0000
    742  1.1  onoe #define AN_HEADERTYPE_80211	0x0008
    743  1.1  onoe 
    744  1.1  onoe #define AN_PAYLOADTYPE_ETHER	0x0000
    745  1.1  onoe #define AN_PAYLOADTYPE_LLC	0x0010
    746  1.1  onoe 
    747  1.1  onoe #define AN_TXCTL_80211	\
    748  1.1  onoe 	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211|	\
    749  1.1  onoe 	AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE)
    750  1.1  onoe 
    751  1.1  onoe #define AN_TXCTL_8023	\
    752  1.1  onoe 	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|	\
    753  1.1  onoe 	AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
    754  1.1  onoe 
    755  1.1  onoe #define AN_802_3_OFFSET		0x2E
    756  1.1  onoe #define AN_802_11_OFFSET	0x44
    757  1.1  onoe #define AN_802_11_OFFSET_RAW	0x3C
    758  1.1  onoe 
    759  1.1  onoe #define AN_STAT_BADCRC		0x0001
    760  1.1  onoe #define AN_STAT_UNDECRYPTABLE	0x0002
    761  1.1  onoe #define AN_STAT_ERRSTAT		0x0003
    762  1.1  onoe #define AN_STAT_MAC_PORT	0x0700
    763  1.1  onoe #define AN_STAT_1042		0x2000	/* RFC1042 encoded */
    764  1.1  onoe #define AN_STAT_TUNNEL		0x4000	/* Bridge-tunnel encoded */
    765  1.1  onoe #define AN_STAT_WMP_MSG		0x6000	/* WaveLAN-II management protocol */
    766  1.1  onoe #define AN_RXSTAT_MSG_TYPE	0xE000
    767  1.1  onoe 
    768  1.1  onoe #define AN_ENC_TX_802_3		0x00
    769  1.1  onoe #define AN_ENC_TX_802_11	0x11
    770  1.1  onoe #define AN_ENC_TX_E_II		0x0E
    771  1.1  onoe 
    772  1.1  onoe #define AN_ENC_TX_1042		0x00
    773  1.1  onoe #define AN_ENC_TX_TUNNEL	0xF8
    774  1.1  onoe 
    775  1.1  onoe #define AN_TXCNTL_MACPORT	0x00FF
    776  1.1  onoe #define AN_TXCNTL_STRUCTTYPE	0xFF00
    777  1.1  onoe 
    778  1.3  onoe #endif	/* _DEV_IC_ANREG_H */
    779