device.h revision 193a823caaf0e2a79a447014be00a6b70ed216a2
192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond/*
292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * All rights reserved.
492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * This program is free software; you can redistribute it and/or modify
692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * it under the terms of the GNU General Public License as published by
792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * the Free Software Foundation; either version 2 of the License, or
892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * (at your option) any later version.
992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
1092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * This program is distributed in the hope that it will be useful,
1192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * but WITHOUT ANY WARRANTY; without even the implied warranty of
1292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * GNU General Public License for more details.
1492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
1592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * You should have received a copy of the GNU General Public License along
1692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * with this program; if not, write to the Free Software Foundation, Inc.,
1792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
1992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * File: device.h
2092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
2192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * Purpose: MAC Data structure
2292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
2392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * Author: Tevin Chen
2492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
2592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * Date: Mar 17, 1997
2692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond *
2792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond */
2892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
2992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifndef __DEVICE_H__
3092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define __DEVICE_H__
3192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
3292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef MODULE
3392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef MODVERSIONS
3492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/modversions.h>
3592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif /* MODVERSIONS */
3692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/module.h>
3792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif /* MODULE */
3892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
3992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/types.h>
4092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/init.h>
4192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/mm.h>
4292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/errno.h>
4392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/ioport.h>
4492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/pci.h>
4592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/kernel.h>
4692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/netdevice.h>
4792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/etherdevice.h>
4892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/skbuff.h>
4992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/delay.h>
5092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/timer.h>
5192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/slab.h>
5292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/interrupt.h>
5392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/version.h>
5492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/string.h>
5592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/wait.h>
5692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/if_arp.h>
5792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/sched.h>
5892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/if.h>
5992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/rtnetlink.h>//James
6092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/proc_fs.h>
6192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/inetdevice.h>
6292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/reboot.h>
6392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/usb.h>
6492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/signal.h>
6592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <asm/io.h>
6692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <asm/uaccess.h>
6792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef SIOCETHTOOL
6892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DEVICE_ETHTOOL_IOCTL_SUPPORT
6992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/ethtool.h>
7092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#else
7192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#undef DEVICE_ETHTOOL_IOCTL_SUPPORT
7292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
7392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond/* Include Wireless Extension definition and check version - Jean II */
7492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/wireless.h>
7592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <net/iw_handler.h>	// New driver API
7692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
7792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
7892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
7992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
8092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
8192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//2007-0920-01<Add>by MikeLiu
8292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifndef SndEvt_ToAPI
8392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define SndEvt_ToAPI
8492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//please copy below macro to driver_event.c for API
8592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RT_INSMOD_EVENT_FLAG                             0x0101
8692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RT_UPDEV_EVENT_FLAG                               0x0102
8792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RT_DISCONNECTED_EVENT_FLAG               0x0103
8892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RT_WPACONNECTED_EVENT_FLAG             0x0104
8992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RT_DOWNDEV_EVENT_FLAG                        0x0105
9092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RT_RMMOD_EVENT_FLAG                              0x0106
9192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
9292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
9392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//
9492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// device specific
9592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//
9692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
9792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(_KCOMPAT_H)
9892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "kcompat.h"
9992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
10092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
10192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__DEVICE_CONFIG_H)
10292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "device_cfg.h"
10392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
10492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
10592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__TTYPE_H__)
10692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "ttype.h"
10792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
10892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__80211HDR_H__)
10992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "80211hdr.h"
11092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
11192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__TETHER_H__)
11292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "tether.h"
11392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
11492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__WMGR_H__)
11592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "wmgr.h"
11692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
11792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__WCMD_H__)
11892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "wcmd.h"
11992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
12092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__MIB_H__)
12192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "mib.h"
12292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
12392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__SROM_H__)
12492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "srom.h"
12592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
12692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__RC4_H__)
12792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "rc4.h"
12892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
12992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__TPCI_H__)
13092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "tpci.h"
13192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
13292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__DESC_H__)
13392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "desc.h"
13492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
13592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__KEY_H__)
13692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "key.h"
13792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
13892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#if !defined(__CARD_H__)
13992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "card.h"
14092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
14192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
14292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond/*---------------------  Export Definitions -------------------------*/
14392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define VNT_USB_VENDOR_ID                     0x160A
14492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define VNT_USB_PRODUCT_ID                    0x3184
14592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
14692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MAC_MAX_CONTEXT_REG     (256+128)
14792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
14892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MAX_MULTICAST_ADDRESS_NUM       32
14992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MULTICAST_ADDRESS_LIST_SIZE     (MAX_MULTICAST_ADDRESS_NUM * U_ETHER_ADDR_LEN)
15092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
15192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
15292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//#define OP_MODE_INFRASTRUCTURE  0
15392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//#define OP_MODE_ADHOC           1
15492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//#define OP_MODE_AP              2
15592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
15692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DUPLICATE_RX_CACHE_LENGTH       5
15792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
15892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define NUM_KEY_ENTRY                   11
15992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
16092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_WEP_NONE                     0
16192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_WEP_OTF                      1
16292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_WEP_SW                       2
16392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_WEP_SWOTP                    3
16492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_WEP_OTPSW                    4
16592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_WEP_SW232                    5
16692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
16792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define KEYSEL_WEP40                    0
16892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define KEYSEL_WEP104                   1
16992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define KEYSEL_TKIP                     2
17092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define KEYSEL_CCMP                     3
17192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
17292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
17392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
17492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define AUTO_FB_NONE            0
17592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define AUTO_FB_0               1
17692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define AUTO_FB_1               2
17792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
17892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define FB_RATE0                0
17992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define FB_RATE1                1
18092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
18192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// Antenna Mode
18292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_A                   0
18392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_B                   1
18492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_DIVERSITY           2
18592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXD_TXA             3
18692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXD_TXB             4
18792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_UNKNOWN             0xFF
18892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_TXA                 0
18992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_TXB                 1
19092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXA                 2
19192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXB                 3
19292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
19392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
19492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MAXCHECKHANGCNT         4
19592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
19692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//Packet type
19792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_PKT_UNI              0x00
19892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_PKT_MULTI            0x01
19992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define TX_PKT_BROAD            0x02
20092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
20192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define BB_VGA_LEVEL            4
20292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define BB_VGA_CHANGE_THRESHOLD 3
20392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
20492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
20592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
20692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifndef RUN_AT
20792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RUN_AT(x)                       (jiffies+(x))
20892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
20992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
21092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// DMA related
21192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define RESERV_AC0DMA                   4
21292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
21392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define PRIVATE_Message                 0
21492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
21592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond/*---------------------  Export Types  ------------------------------*/
21692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
21792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DBG_PRT(l, p, args...) {if (l<=msglevel) printk( p ,##args);}
21892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define PRINT_K(p, args...) {if (PRIVATE_Message) printk( p ,##args);}
21992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
22092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum __device_msg_level {
22192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    MSG_LEVEL_ERR=0,            //Errors that will cause abnormal operation.
22292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    MSG_LEVEL_NOTICE=1,         //Some errors need users to be notified.
22392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    MSG_LEVEL_INFO=2,           //Normal message.
22492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    MSG_LEVEL_VERBOSE=3,        //Will report all trival errors.
22592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    MSG_LEVEL_DEBUG=4           //Only for debug purpose.
22692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} DEVICE_MSG_LEVEL, *PDEVICE_MSG_LEVEL;
22792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
22892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum __device_init_type {
22992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DEVICE_INIT_COLD=0,         // cold init
23092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DEVICE_INIT_RESET,          // reset init or Dx to D0 power remain init
23192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DEVICE_INIT_DXPL            // Dx to D0 power lost init
23292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} DEVICE_INIT_TYPE, *PDEVICE_INIT_TYPE;
23392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
23492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
23592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//USB
23692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
23792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//
23892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// Enum of context types for SendPacket
23992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//
24092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum _CONTEXT_TYPE {
24192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CONTEXT_DATA_PACKET = 1,
24292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CONTEXT_MGMT_PACKET
24392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} CONTEXT_TYPE;
24492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
24592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
24692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
24792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
24892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// RCB (Receive Control Block)
24992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct _RCB
25092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
25192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PVOID                   Next;
25292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    LONG                    Ref;
25392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PVOID                   pDevice;
25492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct urb              *pUrb;
25592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SRxMgmtPacket           sMngPacket;
25692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct sk_buff*         skb;
25792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bBoolInUse;
25892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
25992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} RCB, *PRCB;
26092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
26192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
26292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// used to track bulk out irps
26392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct _USB_SEND_CONTEXT {
26492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PVOID           pDevice;
26592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct sk_buff *pPacket;
26692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct urb      *pUrb;
26792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT            uBufLen;
26892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CONTEXT_TYPE    Type;
26992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SEthernetHeader sEthHeader;
27092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PVOID           Next;
27192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL            bBoolInUse;
27292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UCHAR           Data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
27392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} USB_SEND_CONTEXT, *PUSB_SEND_CONTEXT;
27492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
27592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
27692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//structure got from configuration file as user desired default setting.
27792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct _DEFAULT_CONFIG{
27892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT    ZoneType;
27992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT    eConfigMode;
28092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT    eAuthenMode;    //open/wep/wpa
28192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT    bShareKeyAlgorithm;  //open-open/open-sharekey/wep-sharekey
28292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT    keyidx;               //wepkey index
28392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT    eEncryptionStatus;
28492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
28592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond}DEFAULT_CONFIG,*PDEFAULT_CONFIG;
28692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
28792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//
28892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// Structure to keep track of usb interrupt packets
28992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//
29092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct {
29192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT            uDataLen;
29292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PBYTE           pDataBuf;
29392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//    struct urb      *pUrb;
29492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL            bInUse;
29592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} INT_BUFFER, *PINT_BUFFER;
29692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
29792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
29892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
29992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//0:11A 1:11B 2:11G
30092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum _VIA_BB_TYPE
30192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
30292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BB_TYPE_11A=0,
30392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BB_TYPE_11B,
30492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BB_TYPE_11G
30592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} VIA_BB_TYPE, *PVIA_BB_TYPE;
30692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
30792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
30892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum _VIA_PKT_TYPE
30992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
31092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PK_TYPE_11A=0,
31192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PK_TYPE_11B,
31292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PK_TYPE_11GB,
31392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PK_TYPE_11GA
31492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} VIA_PKT_TYPE, *PVIA_PKT_TYPE;
31592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
31692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
31792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
31892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
31992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//++ NDIS related
32092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
32192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define NDIS_STATUS     int
32292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define NTSTATUS        int
32392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
32492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum __DEVICE_NDIS_STATUS {
32592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    STATUS_SUCCESS=0,
32692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    STATUS_FAILURE,
32792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    STATUS_RESOURCES,
32892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    STATUS_PENDING,
32992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} DEVICE_NDIS_STATUS, *PDEVICE_NDIS_STATUS;
33092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
33192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
33292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MAX_BSSIDINFO_4_PMKID   16
33392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MAX_PMKIDLIST           5
33492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//Flags for PMKID Candidate list structure
33592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED	0x01
33692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
33792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// PMKID Structures
33892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef UCHAR   NDIS_802_11_PMKID_VALUE[16];
33992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
34092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
34192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum _NDIS_802_11_WEP_STATUS
34292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
34392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11WEPEnabled,
34492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
34592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11WEPDisabled,
34692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
34792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11WEPKeyAbsent,
34892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
34992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11WEPNotSupported,
35092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
35192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11Encryption2Enabled,
35292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11Encryption2KeyAbsent,
35392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11Encryption3Enabled,
35492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11Encryption3KeyAbsent
35592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
35692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond  NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
35792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
35892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
35992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef enum _NDIS_802_11_STATUS_TYPE
36092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
36192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11StatusType_Authentication,
36292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11StatusType_MediaStreamMode,
36392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11StatusType_PMKID_CandidateList,
36492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Ndis802_11StatusTypeMax    // not a real type, defined as an upper bound
36592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
36692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
36792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//Added new types for PMKID Candidate lists.
36892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct _PMKID_CANDIDATE {
36992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    NDIS_802_11_MAC_ADDRESS BSSID;
37092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG Flags;
37192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
37292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
37392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
37492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct _BSSID_INFO
37592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
37692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    NDIS_802_11_MAC_ADDRESS BSSID;
37792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    NDIS_802_11_PMKID_VALUE PMKID;
37892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} BSSID_INFO, *PBSSID_INFO;
37992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
38092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct tagSPMKID {
38192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG Length;
38292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG BSSIDInfoCount;
38392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BSSID_INFO BSSIDInfo[MAX_BSSIDINFO_4_PMKID];
38492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} SPMKID, *PSPMKID;
38592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
38692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct tagSPMKIDCandidateEvent {
38792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    NDIS_802_11_STATUS_TYPE     StatusType;
38892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG Version;       // Version of the structure
38992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG NumCandidates; // No. of pmkid candidates
39092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
391193a823caaf0e2a79a447014be00a6b70ed216a2Jim Lieb} SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
39292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
39392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//--
39492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
39592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//++ 802.11h related
39692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MAX_QUIET_COUNT     8
39792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
39892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct tagSQuietControl {
39992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL        bEnable;
40092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD       dwStartTime;
40192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE        byPeriod;
40292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD        wDuration;
403193a823caaf0e2a79a447014be00a6b70ed216a2Jim Lieb} SQuietControl, *PSQuietControl;
40492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
40592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//--
40692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
40792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
40892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// The receive duplicate detection cache entry
40992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct tagSCacheEntry{
41092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD        wFmSequence;
41192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE        abyAddr2[U_ETHER_ADDR_LEN];
41292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD        wFrameCtl;
41392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} SCacheEntry, *PSCacheEntry;
41492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
41592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct tagSCache{
41692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond/* The receive cache is updated circularly.  The next entry to be written is
41792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond * indexed by the "InPtr".
41892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond*/
41992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT            uInPtr;         // Place to use next
42092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SCacheEntry     asCacheEntry[DUPLICATE_RX_CACHE_LENGTH];
42192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} SCache, *PSCache;
42292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
42392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define CB_MAX_RX_FRAG                 64
42492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// DeFragment Control Block, used for collecting fragments prior to reassembly
42592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct tagSDeFragControlBlock
42692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{
42792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD            wSequence;
42892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD            wFragNum;
42992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE            abyAddr2[U_ETHER_ADDR_LEN];
43092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	UINT            uLifetime;
43192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct sk_buff* skb;
43292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PBYTE           pbyRxBuffer;
43392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT            cbFrameLength;
43492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL            bInUse;
435193a823caaf0e2a79a447014be00a6b70ed216a2Jim Lieb} SDeFragControlBlock, *PSDeFragControlBlock;
43692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
43792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
43892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
43992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//flags for options
44092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_UNPLUG          0x00000001UL
44192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_PREAMBLE_TYPE   0x00000002UL
44292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_OP_MODE         0x00000004UL
44392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_PS_MODE         0x00000008UL
44492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define		DEVICE_FLAGS_80211h_MODE	 0x00000010UL
44592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
44692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//flags for driver status
44792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_OPENED          0x00010000UL
44892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_WOL_ENABLED     0x00080000UL
44992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//flags for capbilities
45092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_TX_ALIGN        0x01000000UL
45192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_HAVE_CAM        0x02000000UL
45292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FLAGS_FLOW_CTRL       0x04000000UL
45392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
45492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//flags for MII status
45592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_LINK_FAIL             0x00000001UL
45692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_SPEED_10              0x00000002UL
45792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_SPEED_100             0x00000004UL
45892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_SPEED_1000            0x00000008UL
45992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_DUPLEX_FULL           0x00000010UL
46092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_AUTONEG_ENABLE        0x00000020UL
46192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_FORCED_BY_EEPROM      0x00000040UL
46292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//for device_set_media_duplex
46392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define     DEVICE_LINK_CHANGE           0x00000001UL
46492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
46592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
46692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct __device_opt {
46792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         nRxDescs0;    //Number of RX descriptors0
46892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         nTxDescs0;    //Number of TX descriptors 0, 1, 2, 3
46992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         rts_thresh;   //rts threshold
47092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         frag_thresh;
47192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         OpMode;
47292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         data_rate;
47392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         channel_num;
47492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         short_retry;
47592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         long_retry;
47692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int         bbp_type;
47792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    U32         flags;
47892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} OPTIONS, *POPTIONS;
47992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
48092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
48192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bondtypedef struct __device_info {
48292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
48392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond// netdev
48492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct usb_device*          usb;
48592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct net_device*          dev;
48692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct net_device_stats     stats;
48792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
48892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    OPTIONS                     sOpts;
48992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
49092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct tasklet_struct       CmdWorkItem;
49192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct tasklet_struct       EventWorkItem;
49292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct tasklet_struct       ReadWorkItem;
49392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct tasklet_struct       RxMngWorkItem;
49492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
49592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    U32                         rx_buf_sz;
49692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    int                         multicast_limit;
49792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRxMode;
49892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
49992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    spinlock_t                  lock;
50092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
50192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    U32                         rx_bytes;
50292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
50392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRevId;
50492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
50592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    U32                         flags;
50692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       Flags;
50792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
50892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SCache                      sDupRxCache;
50992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
51092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SDeFragControlBlock         sRxDFCB[CB_MAX_RX_FRAG];
51192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        cbDFCB;
51292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        cbFreeDFCB;
51392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uCurrentDFCBIdx;
51492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
51592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // +++USB
51692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
51792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct urb                  *pControlURB;
51892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct urb                  *pInterruptURB;
51992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct usb_ctrlrequest      sUsbCtlRequest;
52092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
52192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        int_interval;
52292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
52392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Variables to track resources for the BULK In Pipe
52492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
52592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB                        pRCBMem;
52692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB                        apRCB[CB_MAX_RX_DESC];
52792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        cbRD;
52892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB                        FirstRecvFreeList;
52992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB                        LastRecvFreeList;
53092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        NumRecvFreeList;
53192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB                        FirstRecvMngList;
53292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB                        LastRecvMngList;
53392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        NumRecvMngList;
53492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bIsRxWorkItemQueued;
53592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bIsRxMngWorkItemQueued;
53692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulRcvRefCount;      // number of packets that have not been returned back
53792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
53892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
53992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //  Variables to track resources for the BULK Out Pipe
54092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
54192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
54292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PUSB_SEND_CONTEXT           apTD[CB_MAX_TX_DESC];
54392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        cbTD;
54492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
54592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
54692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //  Variables to track resources for the Interript In Pipe
54792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
54892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    INT_BUFFER                  intBuf;
54992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        fKillEventPollingThread;
55092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bEventAvailable;
55192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
55292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
55392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond  //default config from file by user setting
55492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DEFAULT_CONFIG    config_file;
55592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
55692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
55792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
55892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Statistic for USB
55992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // protect with spinlock
56092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkInPosted;
56192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkInError;
56292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkInContCRCError;
56392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkInBytesRead;
56492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
56592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkOutPosted;
56692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkOutError;
56792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkOutContCRCError;
56892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulBulkOutBytesWrite;
56992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
57092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulIntInPosted;
57192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulIntInError;
57292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulIntInContCRCError;
57392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulIntInBytesRead;
57492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
57592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
57692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Version control
57792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wFirmwareVersion;
57892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byLocalID;
57992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRFType;
58092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byBBRxConf;
58192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
58292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
58392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byZoneType;
58492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bZoneRegExist;
58592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
58692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byOriginalZonetype;
58792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
58892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bLinkPass;          // link status: OK or fail
58992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyCurrentNetAddr[U_ETHER_ADDR_LEN];
59092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyPermanentNetAddr[U_ETHER_ADDR_LEN];
59192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // SW network address
59292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//    BYTE                        abySoftwareNetAddr[U_ETHER_ADDR_LEN];
59392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bExistSWNetAddr;
59492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
59592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Adapter statistics
59692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SStatCounter                scStatistic;
59792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // 802.11 counter
59892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SDot11Counters              s802_11Counter;
59992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
60092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
60192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Maintain statistical debug info.
60292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //
60392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       packetsReceived;
60492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       packetsReceivedDropped;
60592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       packetsReceivedOverflow;
60692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       packetsSent;
60792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       packetsSentDropped;
60892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       SendContextsInUse;
60992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       RcvBuffersInUse;
61092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
61192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
61292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // 802.11 management
61392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SMgmtObject                 sMgmtObj;
61492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
61592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    QWORD                       qwCurrTSF;
61692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        cbBulkInMax;
61792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bPSRxBeacon;
61892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
61992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // 802.11 MAC specific
62092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uCurrRSSI;
62192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byCurrSQ;
62292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
62392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
62492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //Antenna Diversity
62592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bTxRxAntInv;
62692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwRxAntennaSel;
62792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwTxAntennaSel;
62892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byAntennaCount;
62992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRxAntennaMode;
63092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byTxAntennaMode;
63192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRadioCtl;
63292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        bHWRadioOff;
63392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
63492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //SQ3 functions for antenna diversity
63592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct timer_list           TimerSQ3Tmax1;
63692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct timer_list           TimerSQ3Tmax2;
63792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct timer_list           TimerSQ3Tmax3;
63892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
63992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bDiversityRegCtlON;
64092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bDiversityEnable;
64192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulDiversityNValue;
64292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulDiversityMValue;
64392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byTMax;
64492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byTMax2;
64592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byTMax3;
64692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulSQ3TH;
64792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
64892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       uDiversityCnt;
64992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byAntennaState;
65092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulRatio_State0;
65192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulRatio_State1;
65292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulSQ3_State0;
65392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulSQ3_State1;
65492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
65592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       aulSQ3Val[MAX_RATE];
65692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       aulPktNum[MAX_RATE];
65792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
65892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // IFS & Cw
65992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uSIFS;    //Current SIFS
66092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uDIFS;    //Current DIFS
66192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uEIFS;    //Current EIFS
66292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uSlot;    //Current SlotTime
66392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uCwMin;   //Current CwMin
66492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uCwMax;   //CwMax is fixed on 1023.
66592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // PHY parameter
66692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        bySIFS;
66792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byDIFS;
66892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byEIFS;
66992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        bySlot;
67092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byCWMaxMin;
67192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
67292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Rate
67392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    VIA_BB_TYPE                 byBBType; //0: 11A, 1:11B, 2:11G
67492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    VIA_PKT_TYPE                byPacketType; //0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
67592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wBasicRate;
67692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byACKRate;
67792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byTopOFDMBasicRate;
67892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byTopCCKBasicRate;
67992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
68092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
68192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwAotoRateTxOkCnt;
68292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwAotoRateTxFailCnt;
68392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwErrorRateThreshold[13];
68492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwTPTable[MAX_RATE];
68592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyEEPROM[EEP_MAX_CONTEXT_SIZE];  //DWORD alignment
68692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
68792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byMinChannel;
68892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byMaxChannel;
68992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                        uConnectionRate;
69092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
69192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byPreambleType;
69292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byShortPreamble;
69392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // CARD_PHY_TYPE
69492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        eConfigPHYMode;
69592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
69692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // For RF Power table
69792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byCCKPwr;
69892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byOFDMPwrG;
69992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byOFDMPwrA;
70092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byCurPwr;
70192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyCCKPwrTbl[14];
70292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyOFDMPwrTbl[14];
70392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyOFDMAPwrTbl[42];
70492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
70592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wCurrentRate;
70692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wRTSThreshold;
70792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wFragmentationThreshold;
70892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byShortRetryLimit;
70992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byLongRetryLimit;
71092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CARD_OP_MODE                eOPMode;
71192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bBSSIDFilter;
71292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wMaxTransmitMSDULifetime;
71392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyBSSID[U_ETHER_ADDR_LEN];
71492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        abyDesireBSSID[U_ETHER_ADDR_LEN];
71592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wCTSDuration;       // update while speed change
71692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wACKDuration;       // update while speed change
71792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wRTSTransmitLen;    // update while speed change
71892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRTSServiceField;  // update while speed change
71992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byRTSSignalField;   // update while speed change
72092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
72192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                       dwMaxReceiveLifetime;       // dot11MaxReceiveLifetime
72292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
72392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bCCK;
72492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bEncryptionEnable;
72592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bLongHeader;
72692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bSoftwareGenCrcErr;
72792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bShortSlotTime;
72892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bProtectMode;
72992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bNonERPPresent;
73092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bBarkerPreambleMd;
73192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
73292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                        byERPFlag;
73392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wUseProtectCntDown;
73492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
73592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bRadioControlOff;
73692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bRadioOff;
73792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
73892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Power save
73992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bEnablePSMode;
74092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                        wListenInterval;
74192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bPWBitOn;
74292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WMAC_POWER_MODE             ePSMode;
74392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                       ulPSModeWaitTx;
74492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                        bPSModeTxBurst;
74592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
74692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Beacon releated
74792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    WORD                    wSeqCounter;
74892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bBeaconBufReady;
74992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bBeaconSent;
75092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bFixRate;
75192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byCurrentCh;
75292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uScanTime;
75392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
75492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CMD_STATE               eCommandState;
75592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
75692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CMD_CODE                eCommand;
75792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bBeaconTx;
75892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byScanBBType;
75992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
76092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bStopBeacon;
76192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bStopDataPkt;
76292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bStopTx0Pkt;
76392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uAutoReConnectTime;
76492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uIsroamingTime;
76592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
76692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // 802.11 counter
76792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
76892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    CMD_ITEM                eCmdQueue[CMD_Q_SIZE];
76992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uCmdDequeueIdx;
77092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uCmdEnqueueIdx;
77192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    cbFreeCmdQueue;
77292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bCmdRunning;
77392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bCmdClear;
77492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bNeedRadioOFF;
77592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
77692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bEnableRoaming;  //DavidWang
77792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bIsRoaming;  //DavidWang
77892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bFastRoaming;  //DavidWang
77992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    bSameBSSMaxNum;  //Davidwang
78092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    bSameBSSCurNum;  //DavidWang
78192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bRoaming;
78292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    b11hEable;
78392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    ULONG                   ulTxPower;
78492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
78592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Encryption
78692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    NDIS_802_11_WEP_STATUS  eEncryptionStatus;
78792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bTransmitKey;
78892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
78992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//2007-0925-01<Add>by MikeLiu
79092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//mike add :save old Encryption
79192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    NDIS_802_11_WEP_STATUS  eOldEncryptionStatus;
79292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
79392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SKeyManagement          sKey;
79492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                   dwIVCounter;
79592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
79692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
79792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    RC4Ext                  SBox;
79892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    abyPRNG[WLAN_WEPMAX_KEYLEN+3];
79992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byKeyIndex;
80092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
80192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bAES;
80292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byCntMeasure;
80392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
80492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uKeyLength;
80592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    abyKey[WLAN_WEP232_KEYLEN];
80692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
80792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // for AP mode
80892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uAssocCount;
80992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bMoreData;
81092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
81192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // QoS
81292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bGrpAckPolicy;
81392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
81492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
81592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byAutoFBCtrl;
81692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
81792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bTxMICFail;
81892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bRxMICFail;
81992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
82092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
82192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // For Update BaseBand VGA Gain Offset
82292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bUpdateBBVGA;
82392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uBBVGADiffCount;
82492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBVGANew;
82592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBVGACurrent;
82692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    abyBBVGA[BB_VGA_LEVEL];
82792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    LONG                    ldBmThreshold[BB_VGA_LEVEL];
82892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
82992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBPreEDRSSI;
83092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBPreEDIndex;
83192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
83292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
83392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bRadioCmd;
83492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    DWORD                   dwDiagRefCount;
83592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
83692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // For FOE Tuning
83792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byFOETuning;
83892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
83992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // For Auto Power Tunning
84092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
84192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byAutoPwrTunning;
84292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
84392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // BaseBand Loopback Use
84492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBCR4d;
84592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBCRc9;
84692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBCR88;
84792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byBBCR09;
84892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
84992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // command timer
85092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct timer_list       sTimerCommand;
85192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
85292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//2007-0115-01<Add>by MikeLiu
85392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef TxInSleep
85492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond     struct timer_list       sTimerTxData;
85592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond     ULONG                       nTxDataTimeCout;
85692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond     BOOL  fTxDataInSleep;
85792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond     BOOL  IsTxDataTrigger;
85892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
85992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
86092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef WPA_SM_Transtatus
86192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL  fWPA_Authened;           //is WPA/WPA-PSK or WPA2/WPA2-PSK authen??
86292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
86392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE            byReAssocCount;   //mike add:re-association retry times!
86492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE            byLinkWaitCount;
86592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
86692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SEthernetHeader         sTxEthHeader;
86792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SEthernetHeader         sRxEthHeader;
86892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    abyBroadcastAddr[U_ETHER_ADDR_LEN];
86992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    abySNAP_RFC1042[U_ETHER_ADDR_LEN];
87092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    abySNAP_Bridgetunnel[U_ETHER_ADDR_LEN];
87192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
87292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // Pre-Authentication & PMK cache
87392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SPMKID                  gsPMKID;
87492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    SPMKIDCandidateEvent    gsPMKIDCandidate;
87592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
87692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
87792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // for 802.11h
87892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    b11hEnable;
87992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
88092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bChannelSwitch;
88192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byNewChannel;
88292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BYTE                    byChannelSwitchCount;
88392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
88492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //WPA supplicant daemon
88592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct net_device       *wpadev;
88692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	BOOL                    bWPADEVUp;
88792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    struct sk_buff          *skb;
88892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    //--
88992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
89092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
89192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        BOOL                 bwextstep0;
89292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        BOOL                 bwextstep1;
89392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        BOOL                 bwextstep2;
89492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        BOOL                 bwextstep3;
89592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        BOOL                 bWPASuppWextEnabled;
89692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
89792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
89892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef HOSTAP
89992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    // user space daemon: hostapd, is used for HOSTAP
90092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	BOOL                    bEnableHostapd;
90192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	BOOL                    bEnable8021x;
90292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	BOOL                    bEnableHostWEP;
90392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct net_device       *apdev;
90492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	int (*tx_80211)(struct sk_buff *skb, struct net_device *dev);
90592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
90692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    UINT                    uChannel;
90792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
90892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond	struct iw_statistics	wstats;		// wireless stats
90992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    BOOL                    bCommit;
91092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
91192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} DEVICE_INFO, *PSDevice;
91292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
91392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
91492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
91592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
91692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define EnqueueRCB(_Head, _Tail, _RCB)                  \
91792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{                                                       \
91892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    if (!_Head) {                                       \
91992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        _Head = _RCB;                                   \
92092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    }                                                   \
92192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    else {                                              \
92292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        _Tail->Next = _RCB;                             \
92392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    }                                                   \
92492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    _RCB->Next = NULL;                                  \
92592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    _Tail = _RCB;                                       \
92692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond}
92792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
92892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DequeueRCB(Head, Tail)                          \
92992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond{                                                       \
93092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    PRCB   RCB = Head;                                  \
93192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    if (!RCB->Next) {                                   \
93292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        Tail = NULL;                                    \
93392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    }                                                   \
93492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    Head = RCB->Next;                                   \
93592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond}
93692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
93792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
93892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) {   \
93992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    if ((uVar) >= ((uModulo) - 1))                  \
94092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        (uVar) = 0;                                 \
94192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond    else                                            \
94292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond        (uVar)++;                                   \
94392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond}
94492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
94592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
94692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_RESET_IN_PROGRESS               0x00000001
94792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_DISCONNECTED                    0x00000002
94892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_HALT_IN_PROGRESS                0x00000004
94992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_SURPRISE_REMOVED                0x00000008
95092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_RECV_LOOKASIDE                  0x00000010
95192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_INIT_IN_PROGRESS                0x00000020
95292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_SEND_SIDE_RESOURCE_ALLOCATED    0x00000040
95392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_RECV_SIDE_RESOURCE_ALLOCATED    0x00000080
95492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_POST_READS                      0x00000100
95592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_POST_WRITES                     0x00000200
95692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_CONTROL_READS                   0x00000400
95792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_CONTROL_WRITES                  0x00000800
95892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
95992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
96092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
96192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_SET_FLAG(_M, _F)             ((_M)->Flags |= (_F))
96292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_CLEAR_FLAG(_M, _F)            ((_M)->Flags &= ~(_F))
96392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_TEST_FLAG(_M, _F)            (((_M)->Flags & (_F)) != 0)
96492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_TEST_FLAGS(_M, _F)            (((_M)->Flags & (_F)) == (_F))
96592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
96692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_IS_READY(_M)        (((_M)->Flags & \
96792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond                                 (fMP_DISCONNECTED | fMP_RESET_IN_PROGRESS | fMP_HALT_IN_PROGRESS | fMP_INIT_IN_PROGRESS | fMP_SURPRISE_REMOVED)) == 0)
96892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
96992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond/*---------------------  Export Functions  --------------------------*/
97092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
97192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond//BOOL device_dma0_xmit(PSDevice pDevice, struct sk_buff *skb, UINT uNodeIndex);
97292b96797118e5836294a6d42a5a8e10b86f50e3fForest BondBOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF);
97392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
97492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif
97592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
97692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond
977