device.h revision 125cfc634403f7715e9fcd0780995d395ab266c5
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#include <linux/module.h> 3392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/kernel.h> 3492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/slab.h> 3511d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley#include <linux/delay.h> 3611d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley#include <linux/device.h> 3711d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley#include <linux/firmware.h> 3811d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley#include <linux/suspend.h> 3992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/if_arp.h> 4011d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley#include <linux/wireless.h> 4111d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley#include <linux/timer.h> 4292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/usb.h> 43f0fde117c12692f76887e09944f4d923a5470bddMalcolm Priestley#include <linux/crc32.h> 4463b9907f58f1c1b718cd37eeaec074692f00492dMalcolm Priestley#include <net/mac80211.h> 4511d404cb56ecd53bb23499897fbe7be1a9ac4827Malcolm Priestley 4692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#ifdef SIOCETHTOOL 4792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DEVICE_ETHTOOL_IOCTL_SUPPORT 4892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include <linux/ethtool.h> 4992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#else 5092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#undef DEVICE_ETHTOOL_IOCTL_SUPPORT 5192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif 5292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 53f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_1M 0 54f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_2M 1 55f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_5M 2 56f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_11M 3 57f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_6M 4 58f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_9M 5 59f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_12M 6 60f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_18M 7 61f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_24M 8 62f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_36M 9 63f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_48M 10 64f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_54M 11 65f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley#define RATE_AUTO 12 66f07e9fb23d119dabb7e377cf592bfc584a31da30Malcolm Priestley 674aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define MAX_RATE 12 684aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley 69d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* 70d3e2395154499a846b3210b45b046e9f0d3a5044Andres More * device specific 71d3e2395154499a846b3210b45b046e9f0d3a5044Andres More */ 7292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 7392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "wcmd.h" 7492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "desc.h" 7592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "key.h" 7692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#include "card.h" 7792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 785008c456c1cdcb8ef7265dcb6d20317f54d3e8eeOtavio Salvador#define VNT_USB_VENDOR_ID 0x160a 7992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define VNT_USB_PRODUCT_ID 0x3184 8092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 814aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define DEVICE_NAME "vt6656" 824aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define DEVICE_FULL_DRV_NAM "VIA Networking Wireless LAN USB Driver" 834aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley 844aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define DEVICE_VERSION "1.19_12" 854aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley 864aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define CONFIG_PATH "/etc/vntconfiguration.dat" 874aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley 884aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define MAX_UINTS 8 894aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley#define OPTION_DEFAULT { [0 ... MAX_UINTS-1] = -1} 904aeaf1538f7179edefcc6e35203828c7cc4f85a5Malcolm Priestley 9192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DUPLICATE_RX_CACHE_LENGTH 5 9292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 9392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define AUTO_FB_NONE 0 9492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define AUTO_FB_0 1 9592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define AUTO_FB_1 2 9692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 9792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define FB_RATE0 0 9892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define FB_RATE1 1 9992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 100d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* Antenna Mode */ 10192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_A 0 10292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_B 1 10392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_DIVERSITY 2 10492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXD_TXA 3 10592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXD_TXB 4 10692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_UNKNOWN 0xFF 10792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_TXA 0 10892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_TXB 1 10992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXA 2 11092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define ANT_RXB 3 11192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 11292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define BB_VGA_LEVEL 4 11392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define BB_VGA_CHANGE_THRESHOLD 3 11492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 11515baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_MAX_CONTEXT_SIZE 256 11615baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 11715baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley/* Contents in the EEPROM */ 11815baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_PAR 0x0 11915baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_ANTENNA 0x17 12015baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_RADIOCTL 0x18 12115baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_RFTYPE 0x1b 12215baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_MINCHANNEL 0x1c 12315baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_MAXCHANNEL 0x1d 12415baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_SIGNATURE 0x1e 12515baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_ZONETYPE 0x1f 12615baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_RFTABLE 0x20 12715baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_PWR_CCK 0x20 12815baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_SETPT_CCK 0x21 12915baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_PWR_OFDMG 0x23 13015baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 13115baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_CALIB_TX_IQ 0x24 13215baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_CALIB_TX_DC 0x25 13315baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_CALIB_RX_IQ 0x26 13415baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 13515baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_MAJOR_VER 0x2e 13615baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_MINOR_VER 0x2f 13715baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 13815baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_CCK_PWR_TBL 0x30 13915baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_OFDM_PWR_TBL 0x40 14015baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_OFS_OFDMA_PWR_TBL 0x50 14115baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 14215baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley/* Bits in EEP_OFS_ANTENNA */ 14315baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_ANTENNA_MAIN 0x1 14415baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_ANTENNA_AUX 0x2 14515baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_ANTINV 0x4 14615baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 14715baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley/* Bits in EEP_OFS_RADIOCTL */ 14815baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley#define EEP_RADIOCTL_ENABLE 0x80 14915baf4ff626c2f89104f93197e1495b87618189fMalcolm Priestley 15060f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley/* control commands */ 15160f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_READ 0x1 15260f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_WRITE 0x0 15360f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_LOCK_OR 0x2 15460f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_LOCK_AND 0x3 15560f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_WRITE_MASK 0x4 15660f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_CARDINIT 0x5 15760f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_INIT_RSP 0x6 15860f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_MACSHUTDOWN 0x7 15960f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_SETKEY 0x8 16060f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_CLRKEYENTRY 0x9 16160f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_WRITE_MISCFF 0xa 16260f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_SET_ANTMD 0xb 16360f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_SELECT_CHANNLE 0xc 16460f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_SET_TSFTBTT 0xd 16560f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_SET_SSTIFS 0xe 16660f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_CHANGE_BBTYPE 0xf 16760f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_DISABLE_PS 0x10 16860f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_TYPE_WRITE_IFRF 0x11 16960f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley 17060f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley/* command read/write(index) */ 17160f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_MEM 0x1 17260f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_BBREG 0x2 17360f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_MACREG 0x3 17460f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_EEPROM 0x4 17560f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_TSF 0x5 17660f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_TBTT 0x6 17760f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_BBAGC 0x7 17860f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_VERSION 0x8 17960f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_RF_INIT 0x9 18060f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_RF_INIT2 0xa 18160f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_RF_CH0 0xb 18260f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_RF_CH1 0xc 18360f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define MESSAGE_REQUEST_RF_CH2 0xd 18460f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley 18560f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley/* USB registers */ 18660f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley#define USB_REG4 0x604 18760f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley 188302433daf47aeb7d21d66e55fb84d6a8fffd4aedMalcolm Priestley#define DEVICE_INIT_COLD 0x0 /* cold init */ 189302433daf47aeb7d21d66e55fb84d6a8fffd4aedMalcolm Priestley#define DEVICE_INIT_RESET 0x1 /* reset init or Dx to D0 power remain */ 190302433daf47aeb7d21d66e55fb84d6a8fffd4aedMalcolm Priestley#define DEVICE_INIT_DXPL 0x2 /* Dx to D0 power lost init */ 19192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 19260f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley/* Device init */ 19360f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestleystruct vnt_cmd_card_init { 19460f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 init_class; 19560f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 exist_sw_net_addr; 19660f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 sw_net_addr[6]; 19760f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 short_retry_limit; 19860f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 long_retry_limit; 19960f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley}; 20060f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley 20160f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestleystruct vnt_rsp_card_init { 20260f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 status; 20360f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 net_addr[6]; 20460f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 rf_type; 20560f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 min_channel; 20660f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley u8 max_channel; 20760f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley}; 20860f8ce8dd6feb2d921a5513e79eaf9d6884abc09Malcolm Priestley 209d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* USB */ 21092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 211d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* 212d3e2395154499a846b3210b45b046e9f0d3a5044Andres More * Enum of context types for SendPacket 213d3e2395154499a846b3210b45b046e9f0d3a5044Andres More */ 2141450ba62db65db9ad8696e369a67f5dc963a98b1Malcolm Priestleyenum { 2151450ba62db65db9ad8696e369a67f5dc963a98b1Malcolm Priestley CONTEXT_DATA_PACKET = 1, 216d38b13aa7884021ddb06fb6f248da265b8a6fbeeMalcolm Priestley CONTEXT_MGMT_PACKET, 217d38b13aa7884021ddb06fb6f248da265b8a6fbeeMalcolm Priestley CONTEXT_BEACON_PACKET 2181450ba62db65db9ad8696e369a67f5dc963a98b1Malcolm Priestley}; 21992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 220d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* RCB (Receive Control Block) */ 221115cac2e7a8d06aa347bf233b4cb94828eb0509aMalcolm Priestleystruct vnt_rcb { 222325de98424fd5f6bf7e12f598dc1c54b4595a760Malcolm Priestley void *priv; 223325de98424fd5f6bf7e12f598dc1c54b4595a760Malcolm Priestley struct urb *urb; 224dd0a774fc727ee793780197beb3f2cf80bfefa99Malcolm Priestley struct sk_buff *skb; 225325de98424fd5f6bf7e12f598dc1c54b4595a760Malcolm Priestley int in_use; 226115cac2e7a8d06aa347bf233b4cb94828eb0509aMalcolm Priestley}; 22792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 228d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* used to track bulk out irps */ 229dcdf1d0323a4eea3bc0a1131057f78234d082079Malcolm Priestleystruct vnt_usb_send_context { 23030a05b397ce410685532120e97c6cc378dd31a1fMalcolm Priestley void *priv; 23130a05b397ce410685532120e97c6cc378dd31a1fMalcolm Priestley struct sk_buff *skb; 23230a05b397ce410685532120e97c6cc378dd31a1fMalcolm Priestley struct urb *urb; 2331622c8fc5c88d64599130710537fe20977637962Malcolm Priestley struct ieee80211_hdr *hdr; 23430a05b397ce410685532120e97c6cc378dd31a1fMalcolm Priestley unsigned int buf_len; 2351622c8fc5c88d64599130710537fe20977637962Malcolm Priestley u16 tx_hdr_size; 2361450ba62db65db9ad8696e369a67f5dc963a98b1Malcolm Priestley u8 type; 23771d764aefeb6010b496f2c47ea06d9389fa9b780Malcolm Priestley u8 pkt_no; 23871d764aefeb6010b496f2c47ea06d9389fa9b780Malcolm Priestley u8 fb_option; 23930a05b397ce410685532120e97c6cc378dd31a1fMalcolm Priestley bool in_use; 24030a05b397ce410685532120e97c6cc378dd31a1fMalcolm Priestley unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS]; 241dcdf1d0323a4eea3bc0a1131057f78234d082079Malcolm Priestley}; 24292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 243d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* 244d3e2395154499a846b3210b45b046e9f0d3a5044Andres More * Structure to keep track of USB interrupt packets 245d3e2395154499a846b3210b45b046e9f0d3a5044Andres More */ 246f764e00d16495800526fbfb4dc03160e64c9081aMalcolm Priestleystruct vnt_interrupt_buffer { 247f764e00d16495800526fbfb4dc03160e64c9081aMalcolm Priestley u8 *data_buf; 248f764e00d16495800526fbfb4dc03160e64c9081aMalcolm Priestley bool in_use; 249f764e00d16495800526fbfb4dc03160e64c9081aMalcolm Priestley}; 25092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 251d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/*++ NDIS related */ 25292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 253879be45aeaa433daa5b848e5c3bc66f85ed6bf4aPeter Senna Tschudinenum { 254879be45aeaa433daa5b848e5c3bc66f85ed6bf4aPeter Senna Tschudin STATUS_SUCCESS = 0, 255879be45aeaa433daa5b848e5c3bc66f85ed6bf4aPeter Senna Tschudin STATUS_FAILURE, 256879be45aeaa433daa5b848e5c3bc66f85ed6bf4aPeter Senna Tschudin STATUS_RESOURCES, 257879be45aeaa433daa5b848e5c3bc66f85ed6bf4aPeter Senna Tschudin STATUS_PENDING, 258879be45aeaa433daa5b848e5c3bc66f85ed6bf4aPeter Senna Tschudin}; 25992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 260d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* flags for options */ 26192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DEVICE_FLAGS_UNPLUG 0x00000001UL 26292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 263d3e2395154499a846b3210b45b046e9f0d3a5044Andres More/* flags for driver status */ 26492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define DEVICE_FLAGS_OPENED 0x00010000UL 26592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 26614c5ef57714d21ff8234aa9a756765e9cb38f837Malcolm Priestleystruct vnt_private { 26763b9907f58f1c1b718cd37eeaec074692f00492dMalcolm Priestley /* mac80211 */ 26863b9907f58f1c1b718cd37eeaec074692f00492dMalcolm Priestley struct ieee80211_hw *hw; 269db8f37fa3355f249e34446eac0d08c1b89c2ed77Malcolm Priestley struct ieee80211_vif *vif; 27030816f838a6589a76bca6d2afd73cafd02343429Malcolm Priestley u8 mac_hw; 27161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* netdev */ 27261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley struct usb_device *usb; 27392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 27463b9907f58f1c1b718cd37eeaec074692f00492dMalcolm Priestley u64 tsf_time; 27563b9907f58f1c1b718cd37eeaec074692f00492dMalcolm Priestley u8 rx_rate; 27663b9907f58f1c1b718cd37eeaec074692f00492dMalcolm Priestley 27761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 rx_buf_sz; 278db8f37fa3355f249e34446eac0d08c1b89c2ed77Malcolm Priestley int mc_list_count; 27992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 28061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley spinlock_t lock; 281c91b1869fb6f6d58f6321b8a88bd39577b0413a7Malcolm Priestley struct mutex usb_lock; 28292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 28361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 flags; 28461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley unsigned long Flags; 28592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 28661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* USB */ 2873d582487beb83d650fbd25cb65688b0fbedc97f1Malcolm Priestley struct urb *interrupt_urb; 28861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 int_interval; 28992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 29061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Variables to track resources for the BULK In Pipe */ 2918577011c7a97df032e2a08f3b00296c4a7f3a12eMalcolm Priestley struct vnt_rcb *rcb[CB_MAX_RX_DESC]; 2926da4738f068cbf826104ef5e8971c255d6d6d437Malcolm Priestley u32 num_rcb; 29392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 29461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Variables to track resources for the BULK Out Pipe */ 295f7e4a8f45c133f4deefef9656e93222c0431caa1Malcolm Priestley struct vnt_usb_send_context *tx_context[CB_MAX_TX_DESC]; 29603b7e3548c2a327c287e0fcb1908e4f7b013ab13Malcolm Priestley u32 num_tx_context; 29792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 29861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Variables to track resources for the Interrupt In Pipe */ 299f764e00d16495800526fbfb4dc03160e64c9081aMalcolm Priestley struct vnt_interrupt_buffer int_buf; 30092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 30161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Version control */ 3028a73f9da4803721fd96d99d686430ee303486d49Malcolm Priestley u16 firmware_version; 303f1945a15d6ace5420a55d14ba60a2bcdc3653b50Malcolm Priestley u8 local_id; 3046242ecaeb6e3b6e3a864e9e6878817e3f5c0cb84Malcolm Priestley u8 rf_type; 305cd5856aee597892073a95fbd7ae4d2709ace043cMalcolm Priestley u8 bb_rx_conf; 30692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 307748bf69c155607b6413206fcbce4d90097bac723Malcolm Priestley struct vnt_cmd_card_init init_command; 308748bf69c155607b6413206fcbce4d90097bac723Malcolm Priestley struct vnt_rsp_card_init init_response; 309ebf9b312389a01763ae7388ff3e8f37e82261a92Malcolm Priestley u8 current_net_addr[ETH_ALEN]; 31041e8321a6d3b775a05e94fecd4ea5b4711e12729Malcolm Priestley u8 permanent_net_addr[ETH_ALEN]; 31192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 31235cc8f94e6e4841c6dd2e8d8fd8d49ebddd56859Malcolm Priestley u8 exist_sw_net_addr; 31392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 314113f0b915b387debd0bf797f1d527da467984ebaMalcolm Priestley u64 current_tsf; 31561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 31661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* 802.11 MAC specific */ 317125cfc634403f7715e9fcd0780995d395ab266c5Malcolm Priestley u32 current_rssi; 31861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 31961462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Antenna Diversity */ 32061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley int bTxRxAntInv; 32161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 dwRxAntennaSel; 32261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 dwTxAntennaSel; 32361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byAntennaCount; 32461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byRxAntennaMode; 32561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byTxAntennaMode; 32661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byRadioCtl; 32761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 328cc856e61ee4ffb150ff352e3d6940978a2f819e8Andres More /* IFS & Cw */ 32961462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 uSIFS; /* Current SIFS */ 33061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 uDIFS; /* Current DIFS */ 33161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 uEIFS; /* Current EIFS */ 33261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 uSlot; /* Current SlotTime */ 33361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 uCwMin; /* Current CwMin */ 33461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u32 uCwMax; /* CwMax is fixed on 1023 */ 33561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 33661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Rate */ 337a9052bc9b3bc7140325a5e936ede4e1f92037c1bMalcolm Priestley u8 byBBType; /* 0: 11A, 1:11B, 2:11G */ 338bf1c820fcbdf3bb23c4846bdb48a191e710cb841Malcolm Priestley u8 byPacketType; /* 0:11a 1:11b 2:11gb 3:11ga */ 339ee61fde2074fbcc7575e52206aba67853e0e56ccMalcolm Priestley u32 wBasicRate; 34061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byTopOFDMBasicRate; 34161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byTopCCKBasicRate; 34261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 34361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /*u32 alignment */ 34461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 34561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byPreambleType; 34661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 34761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* For RF Power table */ 34861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byCCKPwr; 34961462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byOFDMPwrG; 35061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byOFDMPwrA; 35161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byCurPwr; 35261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 abyCCKPwrTbl[14]; 35361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 abyOFDMPwrTbl[14]; 35461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 abyOFDMAPwrTbl[42]; 35561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 35661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u16 wCurrentRate; 357f84cdf65a79b808217d9e8b82ea12d170cf66b3dMalcolm Priestley u16 tx_rate_fb0; 358f84cdf65a79b808217d9e8b82ea12d170cf66b3dMalcolm Priestley u16 tx_rate_fb1; 359f84cdf65a79b808217d9e8b82ea12d170cf66b3dMalcolm Priestley 36061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byShortRetryLimit; 36161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byLongRetryLimit; 362a0ad27765a5f4c9dc90fabe6a4b04a8656d7fae3Malcolm Priestley 363a0ad27765a5f4c9dc90fabe6a4b04a8656d7fae3Malcolm Priestley enum nl80211_iftype op_mode; 364a0ad27765a5f4c9dc90fabe6a4b04a8656d7fae3Malcolm Priestley 36561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley int bShortSlotTime; 36661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley int bBarkerPreambleMd; 36761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 36861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Power save */ 369db8f37fa3355f249e34446eac0d08c1b89c2ed77Malcolm Priestley u16 current_aid; 37061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 37161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* Beacon releated */ 37261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u16 wSeqCounter; 37361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 374ad74e91d06225e9f649baad786faf0992e996050Malcolm Priestley enum vnt_cmd_state command_state; 37561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 37680f0d0923f7a8f580db2415e30580585e5d7f272Malcolm Priestley enum vnt_cmd command; 37761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 37861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* 802.11 counter */ 37961462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 380b595f9b89c609476de8165ee081f8fb5d25d02f7Malcolm Priestley enum vnt_cmd cmd_queue[CMD_Q_SIZE]; 38133a60b87b65eb69bc31adb12ee92cf0664a2ad3bMalcolm Priestley u32 cmd_dequeue_idx; 38233a60b87b65eb69bc31adb12ee92cf0664a2ad3bMalcolm Priestley u32 cmd_enqueue_idx; 38333a60b87b65eb69bc31adb12ee92cf0664a2ad3bMalcolm Priestley u32 free_cmd_queue; 38433a60b87b65eb69bc31adb12ee92cf0664a2ad3bMalcolm Priestley int cmd_running; 38561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 386d1eb5003d78cd791ff1f214163030e993d53f49bMalcolm Priestley unsigned long key_entry_inuse; 38761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 38861462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byAutoFBCtrl; 38961462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 39061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* For Update BaseBand VGA Gain Offset */ 39161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 abyBBVGA[BB_VGA_LEVEL]; 39261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley signed long ldBmThreshold[BB_VGA_LEVEL]; 39361462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 39461462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byBBPreEDRSSI; 39561462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byBBPreEDIndex; 39661462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley 39761462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley /* command timer */ 39894488a7ebfbc95c4b8fbfe39644e97b926a550a7Malcolm Priestley struct delayed_work run_command_work; 39992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 40061462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley int bChannelSwitch; 40161462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byNewChannel; 40261462ab32f8b5a3d133b734455c3a8d6b6d1de7cMalcolm Priestley u8 byChannelSwitchCount; 40392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 4041786384e13e9e380ee3a0507d041663ff0ca124cMalcolm Priestley struct ieee80211_low_level_stats low_stats; 40514c5ef57714d21ff8234aa9a756765e9cb38f837Malcolm Priestley}; 40692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 407dbf0a03b66e0d26795a7582ffa4be0fff5e00254Peter Senna Tschudin#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \ 408dbf0a03b66e0d26795a7582ffa4be0fff5e00254Peter Senna Tschudin if ((uVar) >= ((uModulo) - 1)) \ 409dbf0a03b66e0d26795a7582ffa4be0fff5e00254Peter Senna Tschudin (uVar) = 0; \ 410dbf0a03b66e0d26795a7582ffa4be0fff5e00254Peter Senna Tschudin else \ 411dbf0a03b66e0d26795a7582ffa4be0fff5e00254Peter Senna Tschudin (uVar)++; \ 41292b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond} 41392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 41492b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_DISCONNECTED 0x00000002 41592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_POST_READS 0x00000100 41692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define fMP_POST_WRITES 0x00000200 41792b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 41892b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F)) 41992b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F)) 42092b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#define MP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F)) 42192b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 422d4f376ddbecf8d2927bd5326f39659ba570cac7eMalcolm Priestley#define MP_IS_READY(_M) (((_M)->Flags & fMP_DISCONNECTED) == 0) 42392b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 42430816f838a6589a76bca6d2afd73cafd02343429Malcolm Priestleyint vnt_init(struct vnt_private *priv); 42592b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond 42692b96797118e5836294a6d42a5a8e10b86f50e3fForest Bond#endif 427