Home | History | Annotate | Line # | Download | only in usb
if_atureg.h revision 1.10.12.1
      1  1.10.12.1      snj /*	$NetBSD: if_atureg.h,v 1.10.12.1 2017/04/05 19:54:19 snj 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.9  msaitoh /* the number of simultaneously requested RX transfers */
     40        1.1     joff #define ATU_RX_LIST_CNT	1
     41        1.1     joff 
     42        1.1     joff /*
     43        1.9  msaitoh  * the number of simultaneously 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.10      chs 	RadioIntersil,
     95       1.10      chs 	AT76C503_i3863,
     96       1.10      chs 	AT76C503_rfmd_acc,
     97       1.10      chs 	AT76C505_rfmd
     98        1.1     joff };
     99        1.1     joff 
    100        1.1     joff struct atu_type {
    101  1.10.12.1      snj 	uint16_t		atu_vid;
    102  1.10.12.1      snj 	uint16_t		atu_pid;
    103        1.1     joff 	enum atu_radio_type	atu_radio;
    104  1.10.12.1      snj 	uint16_t		atu_quirk;
    105        1.1     joff };
    106        1.1     joff 
    107        1.1     joff struct atu_softc;
    108        1.1     joff 
    109        1.1     joff struct atu_chain {
    110        1.1     joff 	struct atu_softc	*atu_sc;
    111  1.10.12.1      snj 	struct usbd_xfer	*atu_xfer;
    112        1.1     joff 	char			*atu_buf;
    113        1.1     joff 	struct mbuf		*atu_mbuf;
    114  1.10.12.1      snj 	uint8_t			atu_idx;
    115  1.10.12.1      snj 	uint16_t		atu_length;
    116        1.1     joff 	int			atu_in_xfer;
    117        1.1     joff 	SLIST_ENTRY(atu_chain)	atu_list;
    118        1.1     joff };
    119        1.1     joff 
    120        1.1     joff struct atu_cdata {
    121        1.1     joff 	struct atu_chain	atu_tx_chain[ATU_TX_LIST_CNT];
    122        1.1     joff 	struct atu_chain	atu_rx_chain[ATU_RX_LIST_CNT];
    123        1.1     joff 
    124        1.1     joff 	SLIST_HEAD(atu_list_head, atu_chain)	atu_rx_free;
    125        1.1     joff 	struct atu_list_head	atu_tx_free;
    126        1.1     joff 
    127  1.10.12.1      snj 	uint8_t			atu_tx_inuse;
    128  1.10.12.1      snj 	uint8_t			atu_tx_last_idx;
    129        1.1     joff };
    130        1.1     joff 
    131        1.1     joff #define MAX_SSID_LEN		32
    132        1.1     joff #define ATU_AVG_TIME		20
    133        1.1     joff 
    134        1.1     joff struct atu_softc {
    135        1.8   dyoung 	device_t atu_dev;
    136        1.3   dyoung 	struct ethercom		sc_ec;
    137        1.1     joff 	struct ieee80211com	sc_ic;
    138        1.1     joff 	int			(*sc_newstate)(struct ieee80211com *,
    139        1.1     joff 				    enum ieee80211_state, int);
    140        1.1     joff 
    141        1.1     joff 	char			sc_state;
    142        1.1     joff #define ATU_S_DEAD		0
    143        1.1     joff #define ATU_S_OK		1
    144        1.1     joff #define ATU_S_UNCONFIG		2
    145        1.1     joff 	char			sc_cmd;
    146        1.1     joff #define ATU_C_NONE		0
    147        1.1     joff #define ATU_C_SCAN		1
    148        1.1     joff #define ATU_C_JOIN		2
    149        1.1     joff 	struct usb_task		sc_task;
    150        1.1     joff 
    151  1.10.12.1      snj 	struct usbd_device	*atu_udev;
    152  1.10.12.1      snj 	struct usbd_interface	*atu_iface;
    153        1.1     joff 	struct ethercom		atu_ec;
    154        1.1     joff 	struct ifmedia		atu_media;
    155        1.1     joff 	int			atu_ed[ATU_ENDPT_MAX];
    156  1.10.12.1      snj 	struct usbd_pipe	*atu_ep[ATU_ENDPT_MAX];
    157        1.1     joff 	int			atu_unit;
    158        1.1     joff 	int			atu_if_flags;
    159        1.1     joff 
    160        1.1     joff 	struct atu_cdata	atu_cdata;
    161        1.1     joff 
    162        1.1     joff 	struct timeval		atu_rx_notice;
    163        1.2    perry 
    164  1.10.12.1      snj 	uint8_t			atu_bssid[ETHER_ADDR_LEN];
    165        1.1     joff 	enum atu_radio_type	atu_radio;
    166  1.10.12.1      snj 	uint16_t		atu_quirk;
    167        1.2    perry 
    168  1.10.12.1      snj 	uint8_t			atu_channel;
    169  1.10.12.1      snj 	uint16_t		atu_desired_channel;
    170  1.10.12.1      snj 	uint8_t			atu_mode;
    171        1.1     joff #define NO_MODE_YET		0
    172        1.1     joff #define AD_HOC_MODE		1
    173        1.1     joff #define INFRASTRUCTURE_MODE	2
    174        1.1     joff 
    175  1.10.12.1      snj 	uint8_t			atu_radio_on;
    176  1.10.12.1      snj 	uint8_t			atu_encrypt;
    177        1.1     joff #define ATU_WEP_RX		0x01
    178        1.1     joff #define ATU_WEP_TX		0x02
    179        1.1     joff #define ATU_WEP_TXRX		(ATU_WEP_RX | ATU_WEP_TX)
    180        1.1     joff 	int			atu_wepkey;
    181        1.1     joff 	int			atu_wepkeylen;
    182  1.10.12.1      snj 	uint8_t			atu_wepkeys[4][13];
    183        1.1     joff };
    184        1.1     joff 
    185        1.3   dyoung #define	sc_if	sc_ec.ec_if
    186        1.3   dyoung 
    187        1.1     joff /* Commands for uploading the firmware (standard DFU interface) */
    188        1.1     joff #define DFU_DNLOAD		UT_WRITE_CLASS_INTERFACE, 0x01
    189        1.1     joff #define DFU_GETSTATUS		UT_READ_CLASS_INTERFACE, 0x03
    190        1.1     joff #define DFU_GETSTATE		UT_READ_CLASS_INTERFACE, 0x05
    191        1.1     joff #define DFU_REMAP		UT_WRITE_VENDOR_INTERFACE, 0x0a
    192        1.1     joff 
    193        1.1     joff /* DFU states */
    194        1.1     joff #define DFUState_AppIdle	0
    195        1.1     joff #define DFUState_AppDetach	1
    196        1.1     joff #define DFUState_DFUIdle	2
    197        1.1     joff #define DFUState_DnLoadSync	3
    198        1.1     joff #define DFUState_DnLoadBusy	4
    199        1.1     joff #define DFUState_DnLoadIdle	5
    200        1.1     joff #define DFUState_ManifestSync	6
    201        1.1     joff #define DFUState_Manifest	7
    202        1.1     joff #define DFUState_ManifestWait	8
    203        1.1     joff #define DFUState_UploadIdle	9
    204        1.1     joff #define DFUState_DFUError	10
    205        1.1     joff 
    206        1.1     joff #define DFU_MaxBlockSize	1024
    207        1.1     joff 
    208        1.1     joff /* AT76c503 operating modes */
    209        1.1     joff #define MODE_NONE			0x00
    210        1.1     joff #define MODE_NETCARD			0x01
    211        1.1     joff #define MODE_CONFIG			0x02
    212        1.1     joff #define MODE_DFU			0x03
    213        1.1     joff #define MODE_NOFLASHNETCARD		0x04
    214        1.1     joff 
    215        1.1     joff /* AT76c503 commands */
    216        1.1     joff #define CMD_SET_MIB			0x01
    217        1.1     joff #define CMD_START_SCAN			0x03
    218        1.1     joff #define CMD_JOIN			0x04
    219        1.1     joff #define CMD_START_IBSS			0x05
    220        1.1     joff #define CMD_RADIO			0x06
    221        1.1     joff #define CMD_RADIO_ON			0x06
    222        1.1     joff #define CMD_RADIO_OFF			0x07
    223        1.1     joff #define CMD_STARTUP			0x0b
    224        1.1     joff 
    225        1.1     joff /* AT76c503 status messages -  used in atu_wait_completion */
    226        1.1     joff #define STATUS_IDLE			0x00
    227        1.1     joff #define STATUS_COMPLETE			0x01
    228        1.1     joff #define STATUS_UNKNOWN			0x02
    229        1.1     joff #define STATUS_INVALID_PARAMETER	0x03
    230        1.1     joff #define STATUS_FUNCTION_NOT_SUPPORTED	0x04
    231        1.1     joff #define STATUS_TIME_OUT			0x07
    232        1.1     joff #define STATUS_IN_PROGRESS		0x08
    233        1.1     joff #define STATUS_HOST_FAILURE		0xff
    234        1.1     joff #define STATUS_SCAN_FAILED		0xf0
    235        1.1     joff 
    236        1.1     joff /* AT76c503 command header */
    237        1.1     joff struct atu_cmd {
    238        1.1     joff 	uByte			Cmd;
    239        1.1     joff 	uByte			Reserved;
    240        1.1     joff 	uWord			Size;
    241        1.1     joff } UPACKED;
    242        1.1     joff 
    243        1.1     joff /* CMD_SET_MIB command (0x01) */
    244        1.1     joff struct atu_cmd_set_mib {
    245        1.1     joff 	/* AT76c503 command header */
    246        1.1     joff 	uByte		AtCmd;
    247        1.1     joff 	uByte		AtReserved;
    248        1.1     joff 	uWord		AtSize;
    249        1.1     joff 
    250        1.1     joff 	/* MIB header */
    251        1.1     joff 	uByte		MIBType;
    252        1.1     joff 	uByte		MIBSize;
    253        1.1     joff 	uByte		MIBIndex;
    254        1.1     joff 	uByte		MIBReserved;
    255        1.1     joff 
    256        1.1     joff 	/* MIB data */
    257        1.1     joff 	uByte		data[72];
    258        1.1     joff } UPACKED;
    259        1.1     joff 
    260        1.1     joff /* CMD_STARTUP command (0x0b) */
    261        1.1     joff struct atu_cmd_card_config {
    262        1.1     joff 	uByte			Cmd;
    263        1.1     joff 	uByte			Reserved;
    264        1.1     joff 	uWord			Size;
    265        1.2    perry 
    266        1.1     joff 	uByte			ExcludeUnencrypted;
    267        1.1     joff 	uByte			PromiscuousMode;
    268        1.1     joff 	uByte			ShortRetryLimit;
    269        1.1     joff 	uByte			EncryptionType;
    270        1.1     joff 	uWord			RTS_Threshold;
    271        1.1     joff 	uWord			FragThreshold;		/* 256 .. 2346 */
    272        1.1     joff 	uByte			BasicRateSet[4];
    273        1.1     joff 	uByte			AutoRateFallback;
    274        1.1     joff 	uByte			Channel;
    275        1.1     joff 	uByte			PrivacyInvoked;		/* wep */
    276        1.1     joff 	uByte			WEP_DefaultKeyID;	/* 0 .. 3 */
    277        1.1     joff 	uByte			SSID[MAX_SSID_LEN];
    278        1.1     joff 	uByte			WEP_DefaultKey[4][13];
    279        1.1     joff 	uByte			SSID_Len;
    280        1.1     joff 	uByte			ShortPreamble;
    281        1.1     joff 	uWord			BeaconPeriod;
    282        1.1     joff } UPACKED;
    283        1.1     joff 
    284        1.1     joff /* CMD_SCAN command (0x03) */
    285        1.1     joff struct atu_cmd_do_scan {
    286        1.1     joff 	uByte			Cmd;
    287        1.1     joff 	uByte			Reserved;
    288        1.1     joff 	uWord			Size;
    289        1.2    perry 
    290        1.1     joff 	uByte			BSSID[ETHER_ADDR_LEN];
    291        1.1     joff 	uByte			SSID[MAX_SSID_LEN];
    292        1.1     joff 	uByte			ScanType;
    293        1.1     joff 	uByte			Channel;
    294        1.1     joff 	uWord			ProbeDelay;
    295        1.1     joff 	uWord			MinChannelTime;
    296        1.1     joff 	uWord			MaxChannelTime;
    297        1.1     joff 	uByte			SSID_Len;
    298        1.2    perry 	uByte			InternationalScan;
    299        1.1     joff } UPACKED;
    300        1.1     joff 
    301        1.1     joff #define ATU_SCAN_ACTIVE		0x00
    302        1.1     joff #define ATU_SCAN_PASSIVE	0x01
    303        1.1     joff 
    304        1.1     joff /* CMD_JOIN command (0x04) */
    305        1.1     joff struct atu_cmd_join {
    306        1.1     joff 	uByte			Cmd;
    307        1.1     joff 	uByte			Reserved;
    308        1.1     joff 	uWord			Size;
    309        1.2    perry 
    310        1.1     joff 	uByte			bssid[ETHER_ADDR_LEN];
    311        1.1     joff 	uByte			essid[32];
    312        1.1     joff 	uByte			bss_type;
    313        1.1     joff 	uByte			channel;
    314        1.1     joff 	uWord			timeout;
    315        1.1     joff 	uByte			essid_size;
    316        1.1     joff 	uByte			reserved;
    317        1.1     joff } UPACKED;
    318        1.1     joff 
    319        1.1     joff /* CMD_START_IBSS (0x05) */
    320        1.1     joff struct atu_cmd_start_ibss {
    321        1.1     joff 	uByte		Cmd;
    322        1.1     joff 	uByte		Reserved;
    323        1.1     joff 	uWord		Size;
    324        1.2    perry 
    325        1.1     joff 	uByte		BSSID[ETHER_ADDR_LEN];
    326        1.1     joff 	uByte		SSID[32];
    327        1.2    perry 	uByte		BSSType;
    328        1.2    perry 	uByte		Channel;
    329        1.1     joff 	uByte		SSIDSize;
    330        1.2    perry 	uByte		Res[3];
    331        1.1     joff } UPACKED;
    332        1.1     joff 
    333        1.1     joff /*
    334        1.1     joff  * The At76c503 adapters come with different types of radios on them.
    335        1.1     joff  * At this moment the driver supports adapters with RFMD and Intersil radios.
    336        1.1     joff  */
    337        1.1     joff 
    338        1.1     joff /* The config structure of an RFMD radio */
    339        1.1     joff struct atu_rfmd_conf {
    340  1.10.12.1      snj 	uint8_t		CR20[14];
    341  1.10.12.1      snj 	uint8_t		CR21[14];
    342  1.10.12.1      snj 	uint8_t		BB_CR[14];
    343  1.10.12.1      snj 	uint8_t		PidVid[4];
    344  1.10.12.1      snj 	uint8_t		MACAddr[ETHER_ADDR_LEN];
    345  1.10.12.1      snj 	uint8_t		RegulatoryDomain;
    346  1.10.12.1      snj 	uint8_t		LowPowerValues[14];
    347  1.10.12.1      snj 	uint8_t		NormalPowerValues[14];
    348  1.10.12.1      snj 	uint8_t		Reserved[3];
    349        1.1     joff 	/* then we have 84 bytes, somehow Windows reads 95?? */
    350  1.10.12.1      snj 	uint8_t		Rest[11];
    351        1.1     joff } UPACKED;
    352        1.1     joff 
    353        1.1     joff /* The config structure of an Intersil radio */
    354        1.1     joff struct atu_intersil_conf {
    355  1.10.12.1      snj 	uint8_t		MACAddr[ETHER_ADDR_LEN];
    356        1.1     joff 	/* From the HFA3861B manual : */
    357        1.1     joff 	/* Manual TX power control (7bit : -64 to 63) */
    358  1.10.12.1      snj 	uint8_t		CR31[14];
    359        1.1     joff 	/* TX power measurement */
    360  1.10.12.1      snj 	uint8_t		CR58[14];
    361  1.10.12.1      snj 	uint8_t		PidVid[4];
    362  1.10.12.1      snj 	uint8_t		RegulatoryDomain;
    363  1.10.12.1      snj 	uint8_t		Reserved[1];
    364        1.1     joff } UPACKED;
    365        1.1     joff 
    366        1.1     joff 
    367        1.1     joff /* Firmware information request */
    368        1.1     joff struct atu_fw {
    369  1.10.12.1      snj 	uint8_t		major;
    370  1.10.12.1      snj 	uint8_t		minor;
    371  1.10.12.1      snj 	uint8_t		patch;
    372  1.10.12.1      snj 	uint8_t		build;
    373        1.1     joff } UPACKED;
    374        1.2    perry 
    375        1.1     joff /*
    376        1.1     joff  * The header the AT76c503 puts in front of RX packets (for both managment &
    377        1.1     joff  * data)
    378        1.1     joff  */
    379        1.1     joff struct atu_rx_hdr {
    380        1.1     joff 	uWord			length;
    381        1.1     joff 	uByte			rx_rate;
    382        1.1     joff 	uByte			newbss;
    383        1.1     joff 	uByte			fragmentation;
    384        1.1     joff 	uByte			rssi;
    385        1.1     joff 	uByte			link_quality;
    386        1.1     joff 	uByte			noise_level;
    387        1.1     joff 	uDWord			rx_time;
    388        1.1     joff } UPACKED;
    389        1.1     joff #define ATU_RX_HDRLEN sizeof(struct atu_rx_hdr)
    390        1.1     joff 
    391        1.1     joff /*
    392        1.1     joff  * The header we have to put in front of a TX packet before sending it to the
    393        1.1     joff  * AT76c503
    394        1.1     joff  */
    395        1.1     joff struct atu_tx_hdr {
    396        1.1     joff 	uWord				length;
    397        1.1     joff 	uByte				tx_rate;
    398        1.1     joff 	uByte				padding;
    399        1.1     joff 	uByte				reserved[4];
    400        1.1     joff } UPACKED;
    401        1.1     joff #define ATU_TX_HDRLEN sizeof(struct atu_tx_hdr)
    402        1.1     joff 
    403        1.1     joff #define NR(x)		(void *)((long)x)
    404        1.1     joff 
    405        1.1     joff /*
    406        1.6      wiz  * The linux driver uses separate routines for every mib request they do
    407        1.1     joff  * (eg. set_radio / set_preamble / set_frag / etc etc )
    408        1.1     joff  * We just define a list of types, sizes and offsets and use those
    409        1.1     joff  */
    410        1.1     joff 
    411        1.1     joff /*	Name				Type		Size	Index	*/
    412        1.1     joff #define MIB_LOCAL			0x01
    413        1.1     joff #define  MIB_LOCAL__BEACON_ENABLE	MIB_LOCAL,	1,	2
    414        1.1     joff #define  MIB_LOCAL__AUTO_RATE_FALLBACK	MIB_LOCAL,	1,	3
    415        1.1     joff #define  MIB_LOCAL__SSID_SIZE		MIB_LOCAL,	1,	5
    416        1.1     joff #define  MIB_LOCAL__PREAMBLE		MIB_LOCAL,	1,	9
    417        1.1     joff #define MIB_MAC_ADDR			0x02
    418        1.1     joff #define  MIB_MAC_ADDR__ADDR		MIB_MAC_ADDR,	6,	0
    419        1.1     joff #define MIB_MAC				0x03
    420        1.1     joff #define  MIB_MAC__FRAG			MIB_MAC,	2,	8
    421        1.1     joff #define  MIB_MAC__RTS			MIB_MAC,	2,	10
    422        1.1     joff #define  MIB_MAC__DESIRED_SSID		MIB_MAC,	32,	28
    423        1.1     joff #define MIB_MAC_MGMT			0x05
    424        1.1     joff #define  MIB_MAC_MGMT__BEACON_PERIOD	MIB_MAC_MGMT,	2,	0
    425        1.1     joff #define  MIB_MAC_MGMT__CURRENT_BSSID	MIB_MAC_MGMT,	6,	14
    426        1.1     joff #define  MIB_MAC_MGMT__CURRENT_ESSID	MIB_MAC_MGMT,	32,	20
    427        1.1     joff #define  MIB_MAC_MGMT__POWER_MODE	MIB_MAC_MGMT,	1,	53
    428        1.1     joff #define  MIB_MAC_MGMT__IBSS_CHANGE	MIB_MAC_MGMT,	1,	54
    429        1.1     joff #define MIB_MAC_WEP			0x06
    430        1.1     joff #define  MIB_MAC_WEP__PRIVACY_INVOKED	MIB_MAC_WEP,	1,	0
    431        1.1     joff #define  MIB_MAC_WEP__KEY_ID		MIB_MAC_WEP,	1,	1
    432        1.1     joff #define  MIB_MAC_WEP__ICV_ERROR_COUNT	MIB_MAC_WEP,	4,	4
    433        1.1     joff #define  MIB_MAC_WEP__EXCLUDED_COUNT	MIB_MAC_WEP,	4,	8
    434        1.1     joff #define  MIB_MAC_WEP__KEYS(nr)		MIB_MAC_WEP,	13,	12+(nr)*13
    435        1.1     joff #define  MIB_MAC_WEP__ENCR_LEVEL	MIB_MAC_WEP,	1,	64
    436        1.1     joff #define MIB_PHY				0x07
    437        1.1     joff #define  MIB_PHY__CHANNEL		MIB_PHY,	1,	20
    438        1.1     joff #define  MIB_PHY__REG_DOMAIN		MIB_PHY,	1,	23
    439        1.1     joff #define MIB_FW_VERSION			0x08
    440        1.1     joff #define MIB_DOMAIN			0x09
    441        1.1     joff #define  MIB_DOMAIN__POWER_LEVELS	MIB_DOMAIN,	14,	0
    442        1.1     joff #define  MIB_DOMAIN__CHANNELS		MIB_DOMAIN,	14,	14
    443        1.1     joff 
    444        1.1     joff #define ATU_WEP_OFF			0
    445        1.1     joff #define ATU_WEP_40BITS			1
    446        1.1     joff #define ATU_WEP_104BITS			2
    447        1.1     joff 
    448        1.1     joff #define POWER_MODE_ACTIVE		1
    449        1.1     joff #define POWER_MODE_SAVE			2
    450        1.1     joff #define POWER_MODE_SMART		3
    451        1.1     joff 
    452        1.1     joff #define PREAMBLE_SHORT			1
    453        1.1     joff #define PREAMBLE_LONG			0
    454