Home | History | Annotate | Line # | Download | only in usb
if_atureg.h revision 1.3
      1  1.3  dyoung /*	$NetBSD: if_atureg.h,v 1.3 2005/06/22 06:16:02 dyoung Exp $ */
      2  1.1    joff /*	$OpenBSD: if_atureg.h,v 1.21 2004/12/23 13:19:38 dlg Exp $ */
      3  1.1    joff /*
      4  1.1    joff  * Copyright (c) 2003
      5  1.1    joff  *	Daan Vreeken <Danovitsch (at) Vitsch.net>.  All rights reserved.
      6  1.1    joff  *
      7  1.1    joff  * Redistribution and use in source and binary forms, with or without
      8  1.1    joff  * modification, are permitted provided that the following conditions
      9  1.1    joff  * are met:
     10  1.1    joff  * 1. Redistributions of source code must retain the above copyright
     11  1.1    joff  *    notice, this list of conditions and the following disclaimer.
     12  1.1    joff  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1    joff  *    notice, this list of conditions and the following disclaimer in the
     14  1.1    joff  *    documentation and/or other materials provided with the distribution.
     15  1.1    joff  * 3. All advertising materials mentioning features or use of this software
     16  1.1    joff  *    must display the following acknowledgement:
     17  1.1    joff  *	This product includes software developed by Daan Vreeken.
     18  1.1    joff  * 4. Neither the name of the author nor the names of any co-contributors
     19  1.1    joff  *    may be used to endorse or promote products derived from this software
     20  1.1    joff  *    without specific prior written permission.
     21  1.1    joff  *
     22  1.1    joff  * THIS SOFTWARE IS PROVIDED BY DAAN VREEKEN AND CONTRIBUTORS ``AS IS'' AND
     23  1.1    joff  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  1.1    joff  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  1.1    joff  * ARE DISCLAIMED.  IN NO EVENT SHALL Daan Vreeken OR THE VOICES IN HIS HEAD
     26  1.1    joff  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     27  1.1    joff  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     28  1.1    joff  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     29  1.1    joff  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     30  1.1    joff  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     31  1.1    joff  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     32  1.1    joff  * THE POSSIBILITY OF SUCH DAMAGE.
     33  1.1    joff  *
     34  1.1    joff  */
     35  1.1    joff 
     36  1.1    joff #define ATU_CONFIG_NO		1
     37  1.1    joff #define ATU_IFACE_IDX		0
     38  1.1    joff 
     39  1.1    joff /* the number of simultaniuously requested RX transfers */
     40  1.1    joff #define ATU_RX_LIST_CNT	1
     41  1.1    joff 
     42  1.1    joff /*
     43  1.1    joff  * the number of simultaniously started TX transfers
     44  1.1    joff  * my measurements :
     45  1.1    joff  * 1		430.82 KB/sec
     46  1.1    joff  * 2		534.66 KB/sec
     47  1.1    joff  * 3		536.23 KB/sec
     48  1.1    joff  * 4		537.80 KB/sec
     49  1.1    joff  * 6		537.30 KB/sec
     50  1.1    joff  * 8		535.31 KB/sec
     51  1.1    joff  * 16		535.68 KB/sec
     52  1.1    joff  * 128		535.67 KB/sec (before you ask : yes, 128 is silly :)
     53  1.1    joff  * (+/- 24% increase)
     54  1.1    joff  */
     55  1.1    joff #define ATU_TX_LIST_CNT	8
     56  1.1    joff 
     57  1.1    joff /*
     58  1.1    joff  * According to the 802.11 spec (7.1.2) the frame body can be up to 2312 bytes
     59  1.1    joff  */
     60  1.1    joff #define ATU_RX_BUFSZ		(ATU_RX_HDRLEN + \
     61  1.1    joff 				 sizeof(struct ieee80211_frame_addr4) + 2312 + 4)
     62  1.1    joff /* BE CAREFULL! should add ATU_TX_PADDING */
     63  1.1    joff #define ATU_TX_BUFSZ		(ATU_TX_HDRLEN + \
     64  1.1    joff 				 sizeof(struct ieee80211_frame_addr4) + 2312)
     65  1.1    joff 
     66  1.1    joff #define ATU_MIN_FRAMELEN	60
     67  1.1    joff 
     68  1.1    joff /*
     69  1.1    joff  * Sending packets of more than 1500 bytes confuses some access points, so the
     70  1.1    joff  * default MTU is set to 1500 but can be increased up to 2310 bytes using
     71  1.1    joff  * ifconfig
     72  1.1    joff  */
     73  1.1    joff #define ATU_DEFAULT_MTU	1500
     74  1.1    joff #define ATU_MAX_MTU		(2312 - 2)
     75  1.1    joff 
     76  1.1    joff #define ATU_ENDPT_RX		0x0
     77  1.1    joff #define ATU_ENDPT_TX		0x1
     78  1.1    joff #define ATU_ENDPT_MAX		0x2
     79  1.1    joff 
     80  1.1    joff #define ATU_TX_TIMEOUT		10000
     81  1.1    joff #define ATU_JOIN_TIMEOUT	2000
     82  1.1    joff 
     83  1.1    joff #define ATU_NO_QUIRK		0x0000
     84  1.1    joff #define ATU_QUIRK_NO_REMAP	0x0001
     85  1.1    joff #define ATU_QUIRK_FW_DELAY	0x0002
     86  1.1    joff 
     87  1.1    joff #define ATU_DEFAULT_SSID	""
     88  1.1    joff #define ATU_DEFAULT_CHANNEL	10
     89  1.1    joff 
     90  1.1    joff enum atu_radio_type {
     91  1.1    joff 	RadioRFMD = 0,
     92  1.1    joff 	RadioRFMD2958,
     93  1.1    joff 	RadioRFMD2958_SMC,
     94  1.1    joff 	RadioIntersil
     95  1.1    joff };
     96  1.1    joff 
     97  1.1    joff struct atu_type {
     98  1.1    joff 	u_int16_t		atu_vid;
     99  1.1    joff 	u_int16_t		atu_pid;
    100  1.1    joff 	enum atu_radio_type	atu_radio;
    101  1.1    joff 	u_int16_t		atu_quirk;
    102  1.1    joff };
    103  1.1    joff 
    104  1.1    joff struct atu_softc;
    105  1.1    joff 
    106  1.1    joff struct atu_chain {
    107  1.1    joff 	struct atu_softc	*atu_sc;
    108  1.1    joff 	usbd_xfer_handle	atu_xfer;
    109  1.1    joff 	char			*atu_buf;
    110  1.1    joff 	struct mbuf		*atu_mbuf;
    111  1.1    joff 	u_int8_t		atu_idx;
    112  1.1    joff 	u_int16_t		atu_length;
    113  1.1    joff 	int			atu_in_xfer;
    114  1.1    joff 	SLIST_ENTRY(atu_chain)	atu_list;
    115  1.1    joff };
    116  1.1    joff 
    117  1.1    joff struct atu_cdata {
    118  1.1    joff 	struct atu_chain	atu_tx_chain[ATU_TX_LIST_CNT];
    119  1.1    joff 	struct atu_chain	atu_rx_chain[ATU_RX_LIST_CNT];
    120  1.1    joff 
    121  1.1    joff 	SLIST_HEAD(atu_list_head, atu_chain)	atu_rx_free;
    122  1.1    joff 	struct atu_list_head	atu_tx_free;
    123  1.1    joff 
    124  1.1    joff 	u_int8_t		atu_tx_inuse;
    125  1.2   perry 	u_int8_t		atu_tx_last_idx;
    126  1.1    joff };
    127  1.1    joff 
    128  1.1    joff #define MAX_SSID_LEN		32
    129  1.1    joff #define ATU_AVG_TIME		20
    130  1.1    joff 
    131  1.1    joff struct atu_softc {
    132  1.1    joff 	USBBASEDEVICE           atu_dev;
    133  1.3  dyoung 	struct ethercom		sc_ec;
    134  1.1    joff 	struct ieee80211com	sc_ic;
    135  1.1    joff 	int			(*sc_newstate)(struct ieee80211com *,
    136  1.1    joff 				    enum ieee80211_state, int);
    137  1.1    joff 
    138  1.1    joff 	char			sc_state;
    139  1.1    joff #define ATU_S_DEAD		0
    140  1.1    joff #define ATU_S_OK		1
    141  1.1    joff #define ATU_S_UNCONFIG		2
    142  1.1    joff 	char			sc_cmd;
    143  1.1    joff #define ATU_C_NONE		0
    144  1.1    joff #define ATU_C_SCAN		1
    145  1.1    joff #define ATU_C_JOIN		2
    146  1.1    joff 	struct usb_task		sc_task;
    147  1.1    joff 
    148  1.1    joff 	usbd_device_handle	atu_udev;
    149  1.1    joff 	usbd_interface_handle	atu_iface;
    150  1.1    joff 	struct ethercom		atu_ec;
    151  1.1    joff 	struct ifmedia		atu_media;
    152  1.1    joff 	int			atu_ed[ATU_ENDPT_MAX];
    153  1.1    joff 	usbd_pipe_handle	atu_ep[ATU_ENDPT_MAX];
    154  1.1    joff 	int			atu_unit;
    155  1.1    joff 	int			atu_if_flags;
    156  1.1    joff 
    157  1.1    joff 	struct atu_cdata	atu_cdata;
    158  1.1    joff 
    159  1.1    joff 	struct timeval		atu_rx_notice;
    160  1.2   perry 
    161  1.1    joff 	u_int8_t		atu_bssid[ETHER_ADDR_LEN];
    162  1.1    joff 	enum atu_radio_type	atu_radio;
    163  1.1    joff 	u_int16_t		atu_quirk;
    164  1.2   perry 
    165  1.1    joff 	u_int8_t		atu_ssid[MAX_SSID_LEN];
    166  1.1    joff 	u_int8_t		atu_ssidlen;
    167  1.1    joff 	u_int8_t		atu_channel;
    168  1.1    joff 	u_int16_t		atu_desired_channel;
    169  1.1    joff 	u_int8_t		atu_mode;
    170  1.1    joff #define NO_MODE_YET		0
    171  1.1    joff #define AD_HOC_MODE		1
    172  1.1    joff #define INFRASTRUCTURE_MODE	2
    173  1.1    joff 
    174  1.1    joff 	u_int8_t		atu_radio_on;
    175  1.1    joff 	u_int8_t		atu_encrypt;
    176  1.1    joff #define ATU_WEP_RX		0x01
    177  1.1    joff #define ATU_WEP_TX		0x02
    178  1.1    joff #define ATU_WEP_TXRX		(ATU_WEP_RX | ATU_WEP_TX)
    179  1.1    joff 	int			atu_wepkey;
    180  1.1    joff 	int			atu_wepkeylen;
    181  1.1    joff 	u_int8_t		atu_wepkeys[4][13];
    182  1.1    joff };
    183  1.1    joff 
    184  1.3  dyoung #define	sc_if	sc_ec.ec_if
    185  1.3  dyoung 
    186  1.1    joff /* Commands for uploading the firmware (standard DFU interface) */
    187  1.1    joff #define DFU_DNLOAD		UT_WRITE_CLASS_INTERFACE, 0x01
    188  1.1    joff #define DFU_GETSTATUS		UT_READ_CLASS_INTERFACE, 0x03
    189  1.1    joff #define DFU_GETSTATE		UT_READ_CLASS_INTERFACE, 0x05
    190  1.1    joff #define DFU_REMAP		UT_WRITE_VENDOR_INTERFACE, 0x0a
    191  1.1    joff 
    192  1.1    joff /* DFU states */
    193  1.1    joff #define DFUState_AppIdle	0
    194  1.1    joff #define DFUState_AppDetach	1
    195  1.1    joff #define DFUState_DFUIdle	2
    196  1.1    joff #define DFUState_DnLoadSync	3
    197  1.1    joff #define DFUState_DnLoadBusy	4
    198  1.1    joff #define DFUState_DnLoadIdle	5
    199  1.1    joff #define DFUState_ManifestSync	6
    200  1.1    joff #define DFUState_Manifest	7
    201  1.1    joff #define DFUState_ManifestWait	8
    202  1.1    joff #define DFUState_UploadIdle	9
    203  1.1    joff #define DFUState_DFUError	10
    204  1.1    joff 
    205  1.1    joff #define DFU_MaxBlockSize	1024
    206  1.1    joff 
    207  1.1    joff /* AT76c503 operating modes */
    208  1.1    joff #define MODE_NONE			0x00
    209  1.1    joff #define MODE_NETCARD			0x01
    210  1.1    joff #define MODE_CONFIG			0x02
    211  1.1    joff #define MODE_DFU			0x03
    212  1.1    joff #define MODE_NOFLASHNETCARD		0x04
    213  1.1    joff 
    214  1.1    joff /* AT76c503 commands */
    215  1.1    joff #define CMD_SET_MIB			0x01
    216  1.1    joff #define CMD_START_SCAN			0x03
    217  1.1    joff #define CMD_JOIN			0x04
    218  1.1    joff #define CMD_START_IBSS			0x05
    219  1.1    joff #define CMD_RADIO			0x06
    220  1.1    joff #define CMD_RADIO_ON			0x06
    221  1.1    joff #define CMD_RADIO_OFF			0x07
    222  1.1    joff #define CMD_STARTUP			0x0b
    223  1.1    joff 
    224  1.1    joff /* AT76c503 status messages -  used in atu_wait_completion */
    225  1.1    joff #define STATUS_IDLE			0x00
    226  1.1    joff #define STATUS_COMPLETE			0x01
    227  1.1    joff #define STATUS_UNKNOWN			0x02
    228  1.1    joff #define STATUS_INVALID_PARAMETER	0x03
    229  1.1    joff #define STATUS_FUNCTION_NOT_SUPPORTED	0x04
    230  1.1    joff #define STATUS_TIME_OUT			0x07
    231  1.1    joff #define STATUS_IN_PROGRESS		0x08
    232  1.1    joff #define STATUS_HOST_FAILURE		0xff
    233  1.1    joff #define STATUS_SCAN_FAILED		0xf0
    234  1.1    joff 
    235  1.1    joff /* AT76c503 command header */
    236  1.1    joff struct atu_cmd {
    237  1.1    joff 	uByte			Cmd;
    238  1.1    joff 	uByte			Reserved;
    239  1.1    joff 	uWord			Size;
    240  1.1    joff } UPACKED;
    241  1.1    joff 
    242  1.1    joff /* CMD_SET_MIB command (0x01) */
    243  1.1    joff struct atu_cmd_set_mib {
    244  1.1    joff 	/* AT76c503 command header */
    245  1.1    joff 	uByte		AtCmd;
    246  1.1    joff 	uByte		AtReserved;
    247  1.1    joff 	uWord		AtSize;
    248  1.1    joff 
    249  1.1    joff 	/* MIB header */
    250  1.1    joff 	uByte		MIBType;
    251  1.1    joff 	uByte		MIBSize;
    252  1.1    joff 	uByte		MIBIndex;
    253  1.1    joff 	uByte		MIBReserved;
    254  1.1    joff 
    255  1.1    joff 	/* MIB data */
    256  1.1    joff 	uByte		data[72];
    257  1.1    joff } UPACKED;
    258  1.1    joff 
    259  1.1    joff /* CMD_STARTUP command (0x0b) */
    260  1.1    joff struct atu_cmd_card_config {
    261  1.1    joff 	uByte			Cmd;
    262  1.1    joff 	uByte			Reserved;
    263  1.1    joff 	uWord			Size;
    264  1.2   perry 
    265  1.1    joff 	uByte			ExcludeUnencrypted;
    266  1.1    joff 	uByte			PromiscuousMode;
    267  1.1    joff 	uByte			ShortRetryLimit;
    268  1.1    joff 	uByte			EncryptionType;
    269  1.1    joff 	uWord			RTS_Threshold;
    270  1.1    joff 	uWord			FragThreshold;		/* 256 .. 2346 */
    271  1.1    joff 	uByte			BasicRateSet[4];
    272  1.1    joff 	uByte			AutoRateFallback;
    273  1.1    joff 	uByte			Channel;
    274  1.1    joff 	uByte			PrivacyInvoked;		/* wep */
    275  1.1    joff 	uByte			WEP_DefaultKeyID;	/* 0 .. 3 */
    276  1.1    joff 	uByte			SSID[MAX_SSID_LEN];
    277  1.1    joff 	uByte			WEP_DefaultKey[4][13];
    278  1.1    joff 	uByte			SSID_Len;
    279  1.1    joff 	uByte			ShortPreamble;
    280  1.1    joff 	uWord			BeaconPeriod;
    281  1.1    joff } UPACKED;
    282  1.1    joff 
    283  1.1    joff /* CMD_SCAN command (0x03) */
    284  1.1    joff struct atu_cmd_do_scan {
    285  1.1    joff 	uByte			Cmd;
    286  1.1    joff 	uByte			Reserved;
    287  1.1    joff 	uWord			Size;
    288  1.2   perry 
    289  1.1    joff 	uByte			BSSID[ETHER_ADDR_LEN];
    290  1.1    joff 	uByte			SSID[MAX_SSID_LEN];
    291  1.1    joff 	uByte			ScanType;
    292  1.1    joff 	uByte			Channel;
    293  1.1    joff 	uWord			ProbeDelay;
    294  1.1    joff 	uWord			MinChannelTime;
    295  1.1    joff 	uWord			MaxChannelTime;
    296  1.1    joff 	uByte			SSID_Len;
    297  1.2   perry 	uByte			InternationalScan;
    298  1.1    joff } UPACKED;
    299  1.1    joff 
    300  1.1    joff #define ATU_SCAN_ACTIVE		0x00
    301  1.1    joff #define ATU_SCAN_PASSIVE	0x01
    302  1.1    joff 
    303  1.1    joff /* CMD_JOIN command (0x04) */
    304  1.1    joff struct atu_cmd_join {
    305  1.1    joff 	uByte			Cmd;
    306  1.1    joff 	uByte			Reserved;
    307  1.1    joff 	uWord			Size;
    308  1.2   perry 
    309  1.1    joff 	uByte			bssid[ETHER_ADDR_LEN];
    310  1.1    joff 	uByte			essid[32];
    311  1.1    joff 	uByte			bss_type;
    312  1.1    joff 	uByte			channel;
    313  1.1    joff 	uWord			timeout;
    314  1.1    joff 	uByte			essid_size;
    315  1.1    joff 	uByte			reserved;
    316  1.1    joff } UPACKED;
    317  1.1    joff 
    318  1.1    joff /* CMD_START_IBSS (0x05) */
    319  1.1    joff struct atu_cmd_start_ibss {
    320  1.1    joff 	uByte		Cmd;
    321  1.1    joff 	uByte		Reserved;
    322  1.1    joff 	uWord		Size;
    323  1.2   perry 
    324  1.1    joff 	uByte		BSSID[ETHER_ADDR_LEN];
    325  1.1    joff 	uByte		SSID[32];
    326  1.2   perry 	uByte		BSSType;
    327  1.2   perry 	uByte		Channel;
    328  1.1    joff 	uByte		SSIDSize;
    329  1.2   perry 	uByte		Res[3];
    330  1.1    joff } UPACKED;
    331  1.1    joff 
    332  1.1    joff /*
    333  1.1    joff  * The At76c503 adapters come with different types of radios on them.
    334  1.1    joff  * At this moment the driver supports adapters with RFMD and Intersil radios.
    335  1.1    joff  */
    336  1.1    joff 
    337  1.1    joff /* The config structure of an RFMD radio */
    338  1.1    joff struct atu_rfmd_conf {
    339  1.1    joff 	u_int8_t		CR20[14];
    340  1.1    joff 	u_int8_t		CR21[14];
    341  1.1    joff 	u_int8_t		BB_CR[14];
    342  1.1    joff 	u_int8_t		PidVid[4];
    343  1.1    joff 	u_int8_t		MACAddr[ETHER_ADDR_LEN];
    344  1.1    joff 	u_int8_t		RegulatoryDomain;
    345  1.1    joff 	u_int8_t		LowPowerValues[14];
    346  1.1    joff 	u_int8_t		NormalPowerValues[14];
    347  1.1    joff 	u_int8_t		Reserved[3];
    348  1.1    joff 	/* then we have 84 bytes, somehow Windows reads 95?? */
    349  1.1    joff 	u_int8_t		Rest[11];
    350  1.1    joff } UPACKED;
    351  1.1    joff 
    352  1.1    joff /* The config structure of an Intersil radio */
    353  1.1    joff struct atu_intersil_conf {
    354  1.1    joff 	u_int8_t		MACAddr[ETHER_ADDR_LEN];
    355  1.1    joff 	/* From the HFA3861B manual : */
    356  1.1    joff 	/* Manual TX power control (7bit : -64 to 63) */
    357  1.1    joff 	u_int8_t		CR31[14];
    358  1.1    joff 	/* TX power measurement */
    359  1.1    joff 	u_int8_t		CR58[14];
    360  1.1    joff 	u_int8_t		PidVid[4];
    361  1.1    joff 	u_int8_t		RegulatoryDomain;
    362  1.1    joff 	u_int8_t		Reserved[1];
    363  1.1    joff } UPACKED;
    364  1.1    joff 
    365  1.1    joff 
    366  1.1    joff /* Firmware information request */
    367  1.1    joff struct atu_fw {
    368  1.1    joff 	u_int8_t		major;
    369  1.1    joff 	u_int8_t		minor;
    370  1.1    joff 	u_int8_t		patch;
    371  1.1    joff 	u_int8_t		build;
    372  1.1    joff } UPACKED;
    373  1.2   perry 
    374  1.1    joff /*
    375  1.1    joff  * The header the AT76c503 puts in front of RX packets (for both managment &
    376  1.1    joff  * data)
    377  1.1    joff  */
    378  1.1    joff struct atu_rx_hdr {
    379  1.1    joff 	uWord			length;
    380  1.1    joff 	uByte			rx_rate;
    381  1.1    joff 	uByte			newbss;
    382  1.1    joff 	uByte			fragmentation;
    383  1.1    joff 	uByte			rssi;
    384  1.1    joff 	uByte			link_quality;
    385  1.1    joff 	uByte			noise_level;
    386  1.1    joff 	uDWord			rx_time;
    387  1.1    joff } UPACKED;
    388  1.1    joff #define ATU_RX_HDRLEN sizeof(struct atu_rx_hdr)
    389  1.1    joff 
    390  1.1    joff /*
    391  1.1    joff  * The header we have to put in front of a TX packet before sending it to the
    392  1.1    joff  * AT76c503
    393  1.1    joff  */
    394  1.1    joff struct atu_tx_hdr {
    395  1.1    joff 	uWord				length;
    396  1.1    joff 	uByte				tx_rate;
    397  1.1    joff 	uByte				padding;
    398  1.1    joff 	uByte				reserved[4];
    399  1.1    joff } UPACKED;
    400  1.1    joff #define ATU_TX_HDRLEN sizeof(struct atu_tx_hdr)
    401  1.1    joff 
    402  1.1    joff #define NR(x)		(void *)((long)x)
    403  1.1    joff 
    404  1.1    joff /*
    405  1.1    joff  * The linux driver uses seperate routines for every mib request they do
    406  1.1    joff  * (eg. set_radio / set_preamble / set_frag / etc etc )
    407  1.1    joff  * We just define a list of types, sizes and offsets and use those
    408  1.1    joff  */
    409  1.1    joff 
    410  1.1    joff /*	Name				Type		Size	Index	*/
    411  1.1    joff #define MIB_LOCAL			0x01
    412  1.1    joff #define  MIB_LOCAL__BEACON_ENABLE	MIB_LOCAL,	1,	2
    413  1.1    joff #define  MIB_LOCAL__AUTO_RATE_FALLBACK	MIB_LOCAL,	1,	3
    414  1.1    joff #define  MIB_LOCAL__SSID_SIZE		MIB_LOCAL,	1,	5
    415  1.1    joff #define  MIB_LOCAL__PREAMBLE		MIB_LOCAL,	1,	9
    416  1.1    joff #define MIB_MAC_ADDR			0x02
    417  1.1    joff #define  MIB_MAC_ADDR__ADDR		MIB_MAC_ADDR,	6,	0
    418  1.1    joff #define MIB_MAC				0x03
    419  1.1    joff #define  MIB_MAC__FRAG			MIB_MAC,	2,	8
    420  1.1    joff #define  MIB_MAC__RTS			MIB_MAC,	2,	10
    421  1.1    joff #define  MIB_MAC__DESIRED_SSID		MIB_MAC,	32,	28
    422  1.1    joff #define MIB_MAC_MGMT			0x05
    423  1.1    joff #define  MIB_MAC_MGMT__BEACON_PERIOD	MIB_MAC_MGMT,	2,	0
    424  1.1    joff #define  MIB_MAC_MGMT__CURRENT_BSSID	MIB_MAC_MGMT,	6,	14
    425  1.1    joff #define  MIB_MAC_MGMT__CURRENT_ESSID	MIB_MAC_MGMT,	32,	20
    426  1.1    joff #define  MIB_MAC_MGMT__POWER_MODE	MIB_MAC_MGMT,	1,	53
    427  1.1    joff #define  MIB_MAC_MGMT__IBSS_CHANGE	MIB_MAC_MGMT,	1,	54
    428  1.1    joff #define MIB_MAC_WEP			0x06
    429  1.1    joff #define  MIB_MAC_WEP__PRIVACY_INVOKED	MIB_MAC_WEP,	1,	0
    430  1.1    joff #define  MIB_MAC_WEP__KEY_ID		MIB_MAC_WEP,	1,	1
    431  1.1    joff #define  MIB_MAC_WEP__ICV_ERROR_COUNT	MIB_MAC_WEP,	4,	4
    432  1.1    joff #define  MIB_MAC_WEP__EXCLUDED_COUNT	MIB_MAC_WEP,	4,	8
    433  1.1    joff #define  MIB_MAC_WEP__KEYS(nr)		MIB_MAC_WEP,	13,	12+(nr)*13
    434  1.1    joff #define  MIB_MAC_WEP__ENCR_LEVEL	MIB_MAC_WEP,	1,	64
    435  1.1    joff #define MIB_PHY				0x07
    436  1.1    joff #define  MIB_PHY__CHANNEL		MIB_PHY,	1,	20
    437  1.1    joff #define  MIB_PHY__REG_DOMAIN		MIB_PHY,	1,	23
    438  1.1    joff #define MIB_FW_VERSION			0x08
    439  1.1    joff #define MIB_DOMAIN			0x09
    440  1.1    joff #define  MIB_DOMAIN__POWER_LEVELS	MIB_DOMAIN,	14,	0
    441  1.1    joff #define  MIB_DOMAIN__CHANNELS		MIB_DOMAIN,	14,	14
    442  1.1    joff 
    443  1.1    joff #define ATU_WEP_OFF			0
    444  1.1    joff #define ATU_WEP_40BITS			1
    445  1.1    joff #define ATU_WEP_104BITS			2
    446  1.1    joff 
    447  1.1    joff #define POWER_MODE_ACTIVE		1
    448  1.1    joff #define POWER_MODE_SAVE			2
    449  1.1    joff #define POWER_MODE_SMART		3
    450  1.1    joff 
    451  1.1    joff #define PREAMBLE_SHORT			1
    452  1.1    joff #define PREAMBLE_LONG			0
    453