Home | History | Annotate | Line # | Download | only in usb
if_atureg.h revision 1.4.6.1
      1  1.4.6.1  kardel /*	$NetBSD: if_atureg.h,v 1.4.6.1 2006/06/01 22:37:41 kardel 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_channel;
    166      1.1    joff 	u_int16_t		atu_desired_channel;
    167      1.1    joff 	u_int8_t		atu_mode;
    168      1.1    joff #define NO_MODE_YET		0
    169      1.1    joff #define AD_HOC_MODE		1
    170      1.1    joff #define INFRASTRUCTURE_MODE	2
    171      1.1    joff 
    172      1.1    joff 	u_int8_t		atu_radio_on;
    173      1.1    joff 	u_int8_t		atu_encrypt;
    174      1.1    joff #define ATU_WEP_RX		0x01
    175      1.1    joff #define ATU_WEP_TX		0x02
    176      1.1    joff #define ATU_WEP_TXRX		(ATU_WEP_RX | ATU_WEP_TX)
    177      1.1    joff 	int			atu_wepkey;
    178      1.1    joff 	int			atu_wepkeylen;
    179      1.1    joff 	u_int8_t		atu_wepkeys[4][13];
    180      1.1    joff };
    181      1.1    joff 
    182      1.3  dyoung #define	sc_if	sc_ec.ec_if
    183      1.3  dyoung 
    184      1.1    joff /* Commands for uploading the firmware (standard DFU interface) */
    185      1.1    joff #define DFU_DNLOAD		UT_WRITE_CLASS_INTERFACE, 0x01
    186      1.1    joff #define DFU_GETSTATUS		UT_READ_CLASS_INTERFACE, 0x03
    187      1.1    joff #define DFU_GETSTATE		UT_READ_CLASS_INTERFACE, 0x05
    188      1.1    joff #define DFU_REMAP		UT_WRITE_VENDOR_INTERFACE, 0x0a
    189      1.1    joff 
    190      1.1    joff /* DFU states */
    191      1.1    joff #define DFUState_AppIdle	0
    192      1.1    joff #define DFUState_AppDetach	1
    193      1.1    joff #define DFUState_DFUIdle	2
    194      1.1    joff #define DFUState_DnLoadSync	3
    195      1.1    joff #define DFUState_DnLoadBusy	4
    196      1.1    joff #define DFUState_DnLoadIdle	5
    197      1.1    joff #define DFUState_ManifestSync	6
    198      1.1    joff #define DFUState_Manifest	7
    199      1.1    joff #define DFUState_ManifestWait	8
    200      1.1    joff #define DFUState_UploadIdle	9
    201      1.1    joff #define DFUState_DFUError	10
    202      1.1    joff 
    203      1.1    joff #define DFU_MaxBlockSize	1024
    204      1.1    joff 
    205      1.1    joff /* AT76c503 operating modes */
    206      1.1    joff #define MODE_NONE			0x00
    207      1.1    joff #define MODE_NETCARD			0x01
    208      1.1    joff #define MODE_CONFIG			0x02
    209      1.1    joff #define MODE_DFU			0x03
    210      1.1    joff #define MODE_NOFLASHNETCARD		0x04
    211      1.1    joff 
    212      1.1    joff /* AT76c503 commands */
    213      1.1    joff #define CMD_SET_MIB			0x01
    214      1.1    joff #define CMD_START_SCAN			0x03
    215      1.1    joff #define CMD_JOIN			0x04
    216      1.1    joff #define CMD_START_IBSS			0x05
    217      1.1    joff #define CMD_RADIO			0x06
    218      1.1    joff #define CMD_RADIO_ON			0x06
    219      1.1    joff #define CMD_RADIO_OFF			0x07
    220      1.1    joff #define CMD_STARTUP			0x0b
    221      1.1    joff 
    222      1.1    joff /* AT76c503 status messages -  used in atu_wait_completion */
    223      1.1    joff #define STATUS_IDLE			0x00
    224      1.1    joff #define STATUS_COMPLETE			0x01
    225      1.1    joff #define STATUS_UNKNOWN			0x02
    226      1.1    joff #define STATUS_INVALID_PARAMETER	0x03
    227      1.1    joff #define STATUS_FUNCTION_NOT_SUPPORTED	0x04
    228      1.1    joff #define STATUS_TIME_OUT			0x07
    229      1.1    joff #define STATUS_IN_PROGRESS		0x08
    230      1.1    joff #define STATUS_HOST_FAILURE		0xff
    231      1.1    joff #define STATUS_SCAN_FAILED		0xf0
    232      1.1    joff 
    233      1.1    joff /* AT76c503 command header */
    234      1.1    joff struct atu_cmd {
    235      1.1    joff 	uByte			Cmd;
    236      1.1    joff 	uByte			Reserved;
    237      1.1    joff 	uWord			Size;
    238      1.1    joff } UPACKED;
    239      1.1    joff 
    240      1.1    joff /* CMD_SET_MIB command (0x01) */
    241      1.1    joff struct atu_cmd_set_mib {
    242      1.1    joff 	/* AT76c503 command header */
    243      1.1    joff 	uByte		AtCmd;
    244      1.1    joff 	uByte		AtReserved;
    245      1.1    joff 	uWord		AtSize;
    246      1.1    joff 
    247      1.1    joff 	/* MIB header */
    248      1.1    joff 	uByte		MIBType;
    249      1.1    joff 	uByte		MIBSize;
    250      1.1    joff 	uByte		MIBIndex;
    251      1.1    joff 	uByte		MIBReserved;
    252      1.1    joff 
    253      1.1    joff 	/* MIB data */
    254      1.1    joff 	uByte		data[72];
    255      1.1    joff } UPACKED;
    256      1.1    joff 
    257      1.1    joff /* CMD_STARTUP command (0x0b) */
    258      1.1    joff struct atu_cmd_card_config {
    259      1.1    joff 	uByte			Cmd;
    260      1.1    joff 	uByte			Reserved;
    261      1.1    joff 	uWord			Size;
    262      1.2   perry 
    263      1.1    joff 	uByte			ExcludeUnencrypted;
    264      1.1    joff 	uByte			PromiscuousMode;
    265      1.1    joff 	uByte			ShortRetryLimit;
    266      1.1    joff 	uByte			EncryptionType;
    267      1.1    joff 	uWord			RTS_Threshold;
    268      1.1    joff 	uWord			FragThreshold;		/* 256 .. 2346 */
    269      1.1    joff 	uByte			BasicRateSet[4];
    270      1.1    joff 	uByte			AutoRateFallback;
    271      1.1    joff 	uByte			Channel;
    272      1.1    joff 	uByte			PrivacyInvoked;		/* wep */
    273      1.1    joff 	uByte			WEP_DefaultKeyID;	/* 0 .. 3 */
    274      1.1    joff 	uByte			SSID[MAX_SSID_LEN];
    275      1.1    joff 	uByte			WEP_DefaultKey[4][13];
    276      1.1    joff 	uByte			SSID_Len;
    277      1.1    joff 	uByte			ShortPreamble;
    278      1.1    joff 	uWord			BeaconPeriod;
    279      1.1    joff } UPACKED;
    280      1.1    joff 
    281      1.1    joff /* CMD_SCAN command (0x03) */
    282      1.1    joff struct atu_cmd_do_scan {
    283      1.1    joff 	uByte			Cmd;
    284      1.1    joff 	uByte			Reserved;
    285      1.1    joff 	uWord			Size;
    286      1.2   perry 
    287      1.1    joff 	uByte			BSSID[ETHER_ADDR_LEN];
    288      1.1    joff 	uByte			SSID[MAX_SSID_LEN];
    289      1.1    joff 	uByte			ScanType;
    290      1.1    joff 	uByte			Channel;
    291      1.1    joff 	uWord			ProbeDelay;
    292      1.1    joff 	uWord			MinChannelTime;
    293      1.1    joff 	uWord			MaxChannelTime;
    294      1.1    joff 	uByte			SSID_Len;
    295      1.2   perry 	uByte			InternationalScan;
    296      1.1    joff } UPACKED;
    297      1.1    joff 
    298      1.1    joff #define ATU_SCAN_ACTIVE		0x00
    299      1.1    joff #define ATU_SCAN_PASSIVE	0x01
    300      1.1    joff 
    301      1.1    joff /* CMD_JOIN command (0x04) */
    302      1.1    joff struct atu_cmd_join {
    303      1.1    joff 	uByte			Cmd;
    304      1.1    joff 	uByte			Reserved;
    305      1.1    joff 	uWord			Size;
    306      1.2   perry 
    307      1.1    joff 	uByte			bssid[ETHER_ADDR_LEN];
    308      1.1    joff 	uByte			essid[32];
    309      1.1    joff 	uByte			bss_type;
    310      1.1    joff 	uByte			channel;
    311      1.1    joff 	uWord			timeout;
    312      1.1    joff 	uByte			essid_size;
    313      1.1    joff 	uByte			reserved;
    314      1.1    joff } UPACKED;
    315      1.1    joff 
    316      1.1    joff /* CMD_START_IBSS (0x05) */
    317      1.1    joff struct atu_cmd_start_ibss {
    318      1.1    joff 	uByte		Cmd;
    319      1.1    joff 	uByte		Reserved;
    320      1.1    joff 	uWord		Size;
    321      1.2   perry 
    322      1.1    joff 	uByte		BSSID[ETHER_ADDR_LEN];
    323      1.1    joff 	uByte		SSID[32];
    324      1.2   perry 	uByte		BSSType;
    325      1.2   perry 	uByte		Channel;
    326      1.1    joff 	uByte		SSIDSize;
    327      1.2   perry 	uByte		Res[3];
    328      1.1    joff } UPACKED;
    329      1.1    joff 
    330      1.1    joff /*
    331      1.1    joff  * The At76c503 adapters come with different types of radios on them.
    332      1.1    joff  * At this moment the driver supports adapters with RFMD and Intersil radios.
    333      1.1    joff  */
    334      1.1    joff 
    335      1.1    joff /* The config structure of an RFMD radio */
    336      1.1    joff struct atu_rfmd_conf {
    337      1.1    joff 	u_int8_t		CR20[14];
    338      1.1    joff 	u_int8_t		CR21[14];
    339      1.1    joff 	u_int8_t		BB_CR[14];
    340      1.1    joff 	u_int8_t		PidVid[4];
    341      1.1    joff 	u_int8_t		MACAddr[ETHER_ADDR_LEN];
    342      1.1    joff 	u_int8_t		RegulatoryDomain;
    343      1.1    joff 	u_int8_t		LowPowerValues[14];
    344      1.1    joff 	u_int8_t		NormalPowerValues[14];
    345      1.1    joff 	u_int8_t		Reserved[3];
    346      1.1    joff 	/* then we have 84 bytes, somehow Windows reads 95?? */
    347      1.1    joff 	u_int8_t		Rest[11];
    348      1.1    joff } UPACKED;
    349      1.1    joff 
    350      1.1    joff /* The config structure of an Intersil radio */
    351      1.1    joff struct atu_intersil_conf {
    352      1.1    joff 	u_int8_t		MACAddr[ETHER_ADDR_LEN];
    353      1.1    joff 	/* From the HFA3861B manual : */
    354      1.1    joff 	/* Manual TX power control (7bit : -64 to 63) */
    355      1.1    joff 	u_int8_t		CR31[14];
    356      1.1    joff 	/* TX power measurement */
    357      1.1    joff 	u_int8_t		CR58[14];
    358      1.1    joff 	u_int8_t		PidVid[4];
    359      1.1    joff 	u_int8_t		RegulatoryDomain;
    360      1.1    joff 	u_int8_t		Reserved[1];
    361      1.1    joff } UPACKED;
    362      1.1    joff 
    363      1.1    joff 
    364      1.1    joff /* Firmware information request */
    365      1.1    joff struct atu_fw {
    366      1.1    joff 	u_int8_t		major;
    367      1.1    joff 	u_int8_t		minor;
    368      1.1    joff 	u_int8_t		patch;
    369      1.1    joff 	u_int8_t		build;
    370      1.1    joff } UPACKED;
    371      1.2   perry 
    372      1.1    joff /*
    373      1.1    joff  * The header the AT76c503 puts in front of RX packets (for both managment &
    374      1.1    joff  * data)
    375      1.1    joff  */
    376      1.1    joff struct atu_rx_hdr {
    377      1.1    joff 	uWord			length;
    378      1.1    joff 	uByte			rx_rate;
    379      1.1    joff 	uByte			newbss;
    380      1.1    joff 	uByte			fragmentation;
    381      1.1    joff 	uByte			rssi;
    382      1.1    joff 	uByte			link_quality;
    383      1.1    joff 	uByte			noise_level;
    384      1.1    joff 	uDWord			rx_time;
    385      1.1    joff } UPACKED;
    386      1.1    joff #define ATU_RX_HDRLEN sizeof(struct atu_rx_hdr)
    387      1.1    joff 
    388      1.1    joff /*
    389      1.1    joff  * The header we have to put in front of a TX packet before sending it to the
    390      1.1    joff  * AT76c503
    391      1.1    joff  */
    392      1.1    joff struct atu_tx_hdr {
    393      1.1    joff 	uWord				length;
    394      1.1    joff 	uByte				tx_rate;
    395      1.1    joff 	uByte				padding;
    396      1.1    joff 	uByte				reserved[4];
    397      1.1    joff } UPACKED;
    398      1.1    joff #define ATU_TX_HDRLEN sizeof(struct atu_tx_hdr)
    399      1.1    joff 
    400      1.1    joff #define NR(x)		(void *)((long)x)
    401      1.1    joff 
    402      1.1    joff /*
    403      1.1    joff  * The linux driver uses seperate routines for every mib request they do
    404      1.1    joff  * (eg. set_radio / set_preamble / set_frag / etc etc )
    405      1.1    joff  * We just define a list of types, sizes and offsets and use those
    406      1.1    joff  */
    407      1.1    joff 
    408      1.1    joff /*	Name				Type		Size	Index	*/
    409      1.1    joff #define MIB_LOCAL			0x01
    410      1.1    joff #define  MIB_LOCAL__BEACON_ENABLE	MIB_LOCAL,	1,	2
    411      1.1    joff #define  MIB_LOCAL__AUTO_RATE_FALLBACK	MIB_LOCAL,	1,	3
    412      1.1    joff #define  MIB_LOCAL__SSID_SIZE		MIB_LOCAL,	1,	5
    413      1.1    joff #define  MIB_LOCAL__PREAMBLE		MIB_LOCAL,	1,	9
    414      1.1    joff #define MIB_MAC_ADDR			0x02
    415      1.1    joff #define  MIB_MAC_ADDR__ADDR		MIB_MAC_ADDR,	6,	0
    416      1.1    joff #define MIB_MAC				0x03
    417      1.1    joff #define  MIB_MAC__FRAG			MIB_MAC,	2,	8
    418      1.1    joff #define  MIB_MAC__RTS			MIB_MAC,	2,	10
    419      1.1    joff #define  MIB_MAC__DESIRED_SSID		MIB_MAC,	32,	28
    420      1.1    joff #define MIB_MAC_MGMT			0x05
    421      1.1    joff #define  MIB_MAC_MGMT__BEACON_PERIOD	MIB_MAC_MGMT,	2,	0
    422      1.1    joff #define  MIB_MAC_MGMT__CURRENT_BSSID	MIB_MAC_MGMT,	6,	14
    423      1.1    joff #define  MIB_MAC_MGMT__CURRENT_ESSID	MIB_MAC_MGMT,	32,	20
    424      1.1    joff #define  MIB_MAC_MGMT__POWER_MODE	MIB_MAC_MGMT,	1,	53
    425      1.1    joff #define  MIB_MAC_MGMT__IBSS_CHANGE	MIB_MAC_MGMT,	1,	54
    426      1.1    joff #define MIB_MAC_WEP			0x06
    427      1.1    joff #define  MIB_MAC_WEP__PRIVACY_INVOKED	MIB_MAC_WEP,	1,	0
    428      1.1    joff #define  MIB_MAC_WEP__KEY_ID		MIB_MAC_WEP,	1,	1
    429      1.1    joff #define  MIB_MAC_WEP__ICV_ERROR_COUNT	MIB_MAC_WEP,	4,	4
    430      1.1    joff #define  MIB_MAC_WEP__EXCLUDED_COUNT	MIB_MAC_WEP,	4,	8
    431      1.1    joff #define  MIB_MAC_WEP__KEYS(nr)		MIB_MAC_WEP,	13,	12+(nr)*13
    432      1.1    joff #define  MIB_MAC_WEP__ENCR_LEVEL	MIB_MAC_WEP,	1,	64
    433      1.1    joff #define MIB_PHY				0x07
    434      1.1    joff #define  MIB_PHY__CHANNEL		MIB_PHY,	1,	20
    435      1.1    joff #define  MIB_PHY__REG_DOMAIN		MIB_PHY,	1,	23
    436      1.1    joff #define MIB_FW_VERSION			0x08
    437      1.1    joff #define MIB_DOMAIN			0x09
    438      1.1    joff #define  MIB_DOMAIN__POWER_LEVELS	MIB_DOMAIN,	14,	0
    439      1.1    joff #define  MIB_DOMAIN__CHANNELS		MIB_DOMAIN,	14,	14
    440      1.1    joff 
    441      1.1    joff #define ATU_WEP_OFF			0
    442      1.1    joff #define ATU_WEP_40BITS			1
    443      1.1    joff #define ATU_WEP_104BITS			2
    444      1.1    joff 
    445      1.1    joff #define POWER_MODE_ACTIVE		1
    446      1.1    joff #define POWER_MODE_SAVE			2
    447      1.1    joff #define POWER_MODE_SMART		3
    448      1.1    joff 
    449      1.1    joff #define PREAMBLE_SHORT			1
    450      1.1    joff #define PREAMBLE_LONG			0
    451