blob: 1393210771dea4c2a4af7add959a95cf630ba582 [file] [log] [blame]
Forest Bond5449c682009-04-25 10:30:44 -04001/*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * File: device.h
20 *
21 * Purpose: MAC Data structure
22 *
23 * Author: Tevin Chen
24 *
25 * Date: Mar 17, 1997
26 *
27 */
28
29#ifndef __DEVICE_H__
30#define __DEVICE_H__
31
Forest Bond5449c682009-04-25 10:30:44 -040032#include <linux/module.h>
Forest Bond5449c682009-04-25 10:30:44 -040033#include <linux/types.h>
Forest Bond5449c682009-04-25 10:30:44 -040034#include <linux/mm.h>
35#include <linux/errno.h>
36#include <linux/ioport.h>
37#include <linux/pci.h>
38#include <linux/kernel.h>
39#include <linux/netdevice.h>
40#include <linux/etherdevice.h>
41#include <linux/skbuff.h>
42#include <linux/delay.h>
43#include <linux/timer.h>
44#include <linux/slab.h>
45#include <linux/interrupt.h>
Forest Bond5449c682009-04-25 10:30:44 -040046#include <linux/string.h>
47#include <linux/wait.h>
48#include <linux/if_arp.h>
49#include <linux/sched.h>
Charles Clémentcf160bc2010-06-03 09:15:54 -070050#include <linux/io.h>
Forest Bond5449c682009-04-25 10:30:44 -040051#include <linux/if.h>
Malcolm Priestleyb39d60c2014-08-17 20:42:25 +010052#include <linux/crc32.h>
Charles Clémentcf160bc2010-06-03 09:15:54 -070053#include <linux/uaccess.h>
Forest Bond5449c682009-04-25 10:30:44 -040054#include <linux/proc_fs.h>
55#include <linux/inetdevice.h>
56#include <linux/reboot.h>
Forest Bond5449c682009-04-25 10:30:44 -040057#include <linux/ethtool.h>
Forest Bond5449c682009-04-25 10:30:44 -040058/* Include Wireless Extension definition and check version - Jean II */
Malcolm Priestley33b1c8c2014-10-29 17:43:36 +000059#include <net/mac80211.h>
Forest Bond5449c682009-04-25 10:30:44 -040060#include <linux/wireless.h>
Veronika Kabatova81a4e952014-10-25 22:26:56 +020061#include <net/iw_handler.h> /* New driver API */
Forest Bond5449c682009-04-25 10:30:44 -040062
Forest Bond5449c682009-04-25 10:30:44 -040063#ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
64#define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
65#endif
Forest Bond5449c682009-04-25 10:30:44 -040066
Veronika Kabatova81a4e952014-10-25 22:26:56 +020067/* device specific */
Jim Lieb612822f2009-08-12 14:54:03 -070068
Forest Bond5449c682009-04-25 10:30:44 -040069#include "device_cfg.h"
Malcolm Priestley33785982014-10-29 17:56:05 +000070#include "card.h"
Forest Bond5449c682009-04-25 10:30:44 -040071#include "mib.h"
Forest Bond5449c682009-04-25 10:30:44 -040072#include "srom.h"
Forest Bond5449c682009-04-25 10:30:44 -040073#include "desc.h"
Forest Bond5449c682009-04-25 10:30:44 -040074#include "key.h"
Forest Bond5449c682009-04-25 10:30:44 -040075#include "mac.h"
Forest Bond5449c682009-04-25 10:30:44 -040076
Forest Bond5449c682009-04-25 10:30:44 -040077/*--------------------- Export Definitions -------------------------*/
78
Malcolm Priestleyb0437f22014-10-29 17:55:48 +000079#define RATE_1M 0
80#define RATE_2M 1
81#define RATE_5M 2
82#define RATE_11M 3
83#define RATE_6M 4
84#define RATE_9M 5
85#define RATE_12M 6
86#define RATE_18M 7
87#define RATE_24M 8
88#define RATE_36M 9
89#define RATE_48M 10
90#define RATE_54M 11
91#define RATE_AUTO 12
92#define MAX_RATE 12
93
Forest Bond5449c682009-04-25 10:30:44 -040094#define MAC_MAX_CONTEXT_REG (256+128)
95
96#define MAX_MULTICAST_ADDRESS_NUM 32
Charles Clément078b0782010-05-14 19:37:32 -070097#define MULTICAST_ADDRESS_LIST_SIZE (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
Forest Bond5449c682009-04-25 10:30:44 -040098
Forest Bond5449c682009-04-25 10:30:44 -040099#define DUPLICATE_RX_CACHE_LENGTH 5
100
101#define NUM_KEY_ENTRY 11
102
103#define TX_WEP_NONE 0
104#define TX_WEP_OTF 1
105#define TX_WEP_SW 2
106#define TX_WEP_SWOTP 3
107#define TX_WEP_OTPSW 4
108#define TX_WEP_SW232 5
109
110#define KEYSEL_WEP40 0
111#define KEYSEL_WEP104 1
112#define KEYSEL_TKIP 2
113#define KEYSEL_CCMP 3
114
Forest Bond5449c682009-04-25 10:30:44 -0400115#define AUTO_FB_NONE 0
116#define AUTO_FB_0 1
117#define AUTO_FB_1 2
118
119#define FB_RATE0 0
120#define FB_RATE1 1
121
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200122/* Antenna Mode */
Forest Bond5449c682009-04-25 10:30:44 -0400123#define ANT_A 0
124#define ANT_B 1
125#define ANT_DIVERSITY 2
126#define ANT_RXD_TXA 3
127#define ANT_RXD_TXB 4
128#define ANT_UNKNOWN 0xFF
129
130#define MAXCHECKHANGCNT 4
131
132#define BB_VGA_LEVEL 4
133#define BB_VGA_CHANGE_THRESHOLD 16
134
Forest Bond5449c682009-04-25 10:30:44 -0400135#ifndef RUN_AT
136#define RUN_AT(x) (jiffies+(x))
137#endif
138
Malcolm Priestleyc3fb4642014-10-29 17:56:04 +0000139#define MAKE_BEACON_RESERVED 10 /* (us) */
140
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200141/* DMA related */
Forest Bond5449c682009-04-25 10:30:44 -0400142#define RESERV_AC0DMA 4
143
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200144/* BUILD OBJ mode */
Forest Bond5449c682009-04-25 10:30:44 -0400145
Joe Perches4ec4aa42013-03-18 10:44:45 -0700146#define AVAIL_TD(p, q) ((p)->sOpts.nTxDescs[(q)] - ((p)->iTDUsed[(q)]))
Forest Bond5449c682009-04-25 10:30:44 -0400147
Forest Bond5449c682009-04-25 10:30:44 -0400148#define NUM 64
Forest Bond5449c682009-04-25 10:30:44 -0400149
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200150/* 0:11A 1:11B 2:11G */
Forest Bond5449c682009-04-25 10:30:44 -0400151typedef enum _VIA_BB_TYPE
152{
Joe Perches4ec4aa42013-03-18 10:44:45 -0700153 BB_TYPE_11A = 0,
154 BB_TYPE_11B,
155 BB_TYPE_11G
Forest Bond5449c682009-04-25 10:30:44 -0400156} VIA_BB_TYPE, *PVIA_BB_TYPE;
157
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200158/* 0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) */
Forest Bond5449c682009-04-25 10:30:44 -0400159typedef enum _VIA_PKT_TYPE
160{
Joe Perches4ec4aa42013-03-18 10:44:45 -0700161 PK_TYPE_11A = 0,
162 PK_TYPE_11B,
163 PK_TYPE_11GB,
164 PK_TYPE_11GA
Forest Bond5449c682009-04-25 10:30:44 -0400165} VIA_PKT_TYPE, *PVIA_PKT_TYPE;
166
Joe Perches4ec4aa42013-03-18 10:44:45 -0700167typedef struct __chip_info_tbl {
168 CHIP_TYPE chip_id;
169 char *name;
170 int io_size;
171 int nTxQueue;
172 u32 flags;
Forest Bond5449c682009-04-25 10:30:44 -0400173} CHIP_INFO, *PCHIP_INFO;
174
Forest Bond5449c682009-04-25 10:30:44 -0400175typedef enum {
Joe Perches4ec4aa42013-03-18 10:44:45 -0700176 OWNED_BY_HOST = 0,
177 OWNED_BY_NIC = 1
Forest Bond5449c682009-04-25 10:30:44 -0400178} DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
179
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200180/* flags for options */
Forest Bond5449c682009-04-25 10:30:44 -0400181#define DEVICE_FLAGS_IP_ALIGN 0x00000001UL
182#define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
183#define DEVICE_FLAGS_OP_MODE 0x00000004UL
184#define DEVICE_FLAGS_PS_MODE 0x00000008UL
185#define DEVICE_FLAGS_80211h_MODE 0x00000010UL
186#define DEVICE_FLAGS_DiversityANT 0x00000020UL
187
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200188/* flags for driver status */
Forest Bond5449c682009-04-25 10:30:44 -0400189#define DEVICE_FLAGS_OPENED 0x00010000UL
190#define DEVICE_FLAGS_WOL_ENABLED 0x00080000UL
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200191/* flags for capabilities */
Forest Bond5449c682009-04-25 10:30:44 -0400192#define DEVICE_FLAGS_TX_ALIGN 0x01000000UL
193#define DEVICE_FLAGS_HAVE_CAM 0x02000000UL
194#define DEVICE_FLAGS_FLOW_CTRL 0x04000000UL
195
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200196/* flags for MII status */
Forest Bond5449c682009-04-25 10:30:44 -0400197#define DEVICE_LINK_FAIL 0x00000001UL
198#define DEVICE_SPEED_10 0x00000002UL
199#define DEVICE_SPEED_100 0x00000004UL
200#define DEVICE_SPEED_1000 0x00000008UL
201#define DEVICE_DUPLEX_FULL 0x00000010UL
202#define DEVICE_AUTONEG_ENABLE 0x00000020UL
203#define DEVICE_FORCED_BY_EEPROM 0x00000040UL
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200204/* for device_set_media_duplex */
Forest Bond5449c682009-04-25 10:30:44 -0400205#define DEVICE_LINK_CHANGE 0x00000001UL
206
Forest Bond5449c682009-04-25 10:30:44 -0400207typedef struct __device_opt {
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200208 int nRxDescs0; /* Number of RX descriptors0 */
209 int nRxDescs1; /* Number of RX descriptors1 */
210 int nTxDescs[2]; /* Number of TX descriptors 0, 1 */
211 int int_works; /* interrupt limits */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700212 int short_retry;
213 int long_retry;
214 int bbp_type;
215 u32 flags;
Forest Bond5449c682009-04-25 10:30:44 -0400216} OPTIONS, *POPTIONS;
217
Malcolm Priestley80f598a2014-08-10 15:47:03 +0100218struct vnt_private {
Joe Perches4ec4aa42013-03-18 10:44:45 -0700219 struct pci_dev *pcid;
Malcolm Priestley33b1c8c2014-10-29 17:43:36 +0000220 /* mac80211 */
221 struct ieee80211_hw *hw;
222 struct ieee80211_vif *vif;
Malcolm Priestleyfee7506a12014-10-29 17:43:37 +0000223 unsigned long key_entry_inuse;
Malcolm Priestley67013f22014-10-29 17:43:43 +0000224 u32 basic_rates;
Malcolm Priestley89cf9be2014-10-29 17:43:42 +0000225 u16 current_aid;
Malcolm Priestley67013f22014-10-29 17:43:43 +0000226 int mc_list_count;
227 u8 mac_hw;
Forest Bond5449c682009-04-25 10:30:44 -0400228
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200229/* dma addr, rx/tx pool */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700230 dma_addr_t pool_dma;
231 dma_addr_t rd0_pool_dma;
232 dma_addr_t rd1_pool_dma;
Forest Bond5449c682009-04-25 10:30:44 -0400233
Joe Perches4ec4aa42013-03-18 10:44:45 -0700234 dma_addr_t td0_pool_dma;
235 dma_addr_t td1_pool_dma;
Forest Bond5449c682009-04-25 10:30:44 -0400236
Joe Perches4ec4aa42013-03-18 10:44:45 -0700237 dma_addr_t tx_bufs_dma0;
238 dma_addr_t tx_bufs_dma1;
239 dma_addr_t tx_beacon_dma;
Forest Bond5449c682009-04-25 10:30:44 -0400240
Joe Perches4ec4aa42013-03-18 10:44:45 -0700241 unsigned char *tx0_bufs;
242 unsigned char *tx1_bufs;
243 unsigned char *tx_beacon_bufs;
Forest Bond5449c682009-04-25 10:30:44 -0400244
Joe Perches4ec4aa42013-03-18 10:44:45 -0700245 CHIP_TYPE chip_id;
Forest Bond5449c682009-04-25 10:30:44 -0400246
Guillaume Clement16834402014-07-22 22:08:26 +0200247 void __iomem *PortOffset;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700248 unsigned long dwIsr;
249 u32 memaddr;
250 u32 ioaddr;
251 u32 io_size;
Forest Bond5449c682009-04-25 10:30:44 -0400252
Joe Perches4ec4aa42013-03-18 10:44:45 -0700253 unsigned char byRevId;
Aya Mahfouz2359b5c2014-10-11 02:42:45 +0200254 unsigned char byRxMode;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700255 unsigned short SubSystemID;
256 unsigned short SubVendorID;
Forest Bond5449c682009-04-25 10:30:44 -0400257
Aya Mahfouz2359b5c2014-10-11 02:42:45 +0200258 spinlock_t lock;
259
Joe Perches4ec4aa42013-03-18 10:44:45 -0700260 int nTxQueues;
261 volatile int iTDUsed[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400262
Joe Perches4ec4aa42013-03-18 10:44:45 -0700263 volatile PSTxDesc apCurrTD[TYPE_MAXTD];
264 volatile PSTxDesc apTailTD[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400265
Joe Perches4ec4aa42013-03-18 10:44:45 -0700266 volatile PSTxDesc apTD0Rings;
267 volatile PSTxDesc apTD1Rings;
Forest Bond5449c682009-04-25 10:30:44 -0400268
Joe Perches4ec4aa42013-03-18 10:44:45 -0700269 volatile PSRxDesc aRD0Ring;
270 volatile PSRxDesc aRD1Ring;
271 volatile PSRxDesc pCurrRD[TYPE_MAXRD];
Forest Bond5449c682009-04-25 10:30:44 -0400272
Joe Perches4ec4aa42013-03-18 10:44:45 -0700273 OPTIONS sOpts;
Forest Bond5449c682009-04-25 10:30:44 -0400274
Joe Perches4ec4aa42013-03-18 10:44:45 -0700275 u32 flags;
Forest Bond5449c682009-04-25 10:30:44 -0400276
Joe Perches4ec4aa42013-03-18 10:44:45 -0700277 u32 rx_buf_sz;
Malcolm Priestley33b1c8c2014-10-29 17:43:36 +0000278 u8 rx_rate;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700279 int multicast_limit;
Malcolm Priestley9a802f22014-07-28 21:43:28 +0100280
Joe Perches4ec4aa42013-03-18 10:44:45 -0700281 u32 rx_bytes;
Forest Bond5449c682009-04-25 10:30:44 -0400282
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200283 /* Version control */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700284 unsigned char byLocalID;
285 unsigned char byRFType;
Forest Bond5449c682009-04-25 10:30:44 -0400286
Joe Perches4ec4aa42013-03-18 10:44:45 -0700287 unsigned char byMaxPwrLevel;
288 unsigned char byZoneType;
289 bool bZoneRegExist;
290 unsigned char byOriginalZonetype;
Malcolm Priestley14676102014-10-29 17:55:59 +0000291
Joe Perches4ec4aa42013-03-18 10:44:45 -0700292 unsigned char abyCurrentNetAddr[ETH_ALEN];
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200293 bool bLinkPass; /* link status: OK or fail */
Forest Bond5449c682009-04-25 10:30:44 -0400294
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200295 /* Adapter statistics */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700296 SStatCounter scStatistic;
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200297 /* 802.11 counter */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700298 SDot11Counters s802_11Counter;
Forest Bond5449c682009-04-25 10:30:44 -0400299
Joe Perches4ec4aa42013-03-18 10:44:45 -0700300 unsigned int uCurrRSSI;
301 unsigned char byCurrSQ;
Forest Bond5449c682009-04-25 10:30:44 -0400302
Joe Perches4ec4aa42013-03-18 10:44:45 -0700303 unsigned long dwTxAntennaSel;
304 unsigned long dwRxAntennaSel;
305 unsigned char byAntennaCount;
306 unsigned char byRxAntennaMode;
307 unsigned char byTxAntennaMode;
308 bool bTxRxAntInv;
Forest Bond5449c682009-04-25 10:30:44 -0400309
Joe Perches4ec4aa42013-03-18 10:44:45 -0700310 unsigned char *pbyTmpBuff;
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200311 unsigned int uSIFS; /* Current SIFS */
312 unsigned int uDIFS; /* Current DIFS */
313 unsigned int uEIFS; /* Current EIFS */
314 unsigned int uSlot; /* Current SlotTime */
315 unsigned int uCwMin; /* Current CwMin */
316 unsigned int uCwMax; /* CwMax is fixed on 1023. */
317 /* PHY parameter */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700318 unsigned char bySIFS;
319 unsigned char byDIFS;
320 unsigned char byEIFS;
321 unsigned char bySlot;
322 unsigned char byCWMaxMin;
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200323 CARD_PHY_TYPE eCurrentPHYType;
Forest Bond5449c682009-04-25 10:30:44 -0400324
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200325 VIA_BB_TYPE byBBType; /* 0:11A, 1:11B, 2:11G */
326 VIA_PKT_TYPE byPacketType; /*
327 * 0:11a,1:11b,2:11gb (only CCK
328 * in BasicRate), 3:11ga (OFDM in
329 * Basic Rate)
330 */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700331 unsigned short wBasicRate;
332 unsigned char byACKRate;
333 unsigned char byTopOFDMBasicRate;
334 unsigned char byTopCCKBasicRate;
Forest Bond5449c682009-04-25 10:30:44 -0400335
Joe Perches4ec4aa42013-03-18 10:44:45 -0700336 unsigned char byMinChannel;
337 unsigned char byMaxChannel;
Forest Bond5449c682009-04-25 10:30:44 -0400338
Joe Perches4ec4aa42013-03-18 10:44:45 -0700339 unsigned char byPreambleType;
340 unsigned char byShortPreamble;
Forest Bond5449c682009-04-25 10:30:44 -0400341
Joe Perches4ec4aa42013-03-18 10:44:45 -0700342 unsigned short wCurrentRate;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700343 unsigned char byShortRetryLimit;
344 unsigned char byLongRetryLimit;
Malcolm Priestleya9873672014-08-30 22:25:49 +0100345 enum nl80211_iftype op_mode;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700346 bool bBSSIDFilter;
347 unsigned short wMaxTransmitMSDULifetime;
Forest Bond5449c682009-04-25 10:30:44 -0400348
Joe Perches4ec4aa42013-03-18 10:44:45 -0700349 bool bEncryptionEnable;
350 bool bLongHeader;
351 bool bShortSlotTime;
352 bool bProtectMode;
353 bool bNonERPPresent;
354 bool bBarkerPreambleMd;
Forest Bond5449c682009-04-25 10:30:44 -0400355
Joe Perches4ec4aa42013-03-18 10:44:45 -0700356 bool bRadioControlOff;
357 bool bRadioOff;
358 bool bEnablePSMode;
359 unsigned short wListenInterval;
360 bool bPWBitOn;
Forest Bond5449c682009-04-25 10:30:44 -0400361
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200362 /* GPIO Radio Control */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700363 unsigned char byRadioCtl;
364 unsigned char byGPIO;
365 bool bHWRadioOff;
366 bool bPrvActive4RadioOFF;
367 bool bGPIOBlockRead;
Forest Bond5449c682009-04-25 10:30:44 -0400368
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200369 /* Beacon related */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700370 unsigned short wSeqCounter;
371 unsigned short wBCNBufLen;
372 bool bBeaconBufReady;
373 bool bBeaconSent;
374 bool bIsBeaconBufReadySet;
375 unsigned int cbBeaconBufReadySetCnt;
376 bool bFixRate;
377 unsigned char byCurrentCh;
Forest Bond5449c682009-04-25 10:30:44 -0400378
Joe Perches4ec4aa42013-03-18 10:44:45 -0700379 bool bAES;
Forest Bond5449c682009-04-25 10:30:44 -0400380
Joe Perches4ec4aa42013-03-18 10:44:45 -0700381 unsigned char byAutoFBCtrl;
Forest Bond5449c682009-04-25 10:30:44 -0400382
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200383 /* For Update BaseBand VGA Gain Offset */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700384 bool bUpdateBBVGA;
385 unsigned int uBBVGADiffCount;
386 unsigned char byBBVGANew;
387 unsigned char byBBVGACurrent;
388 unsigned char abyBBVGA[BB_VGA_LEVEL];
389 long ldBmThreshold[BB_VGA_LEVEL];
Forest Bond5449c682009-04-25 10:30:44 -0400390
Joe Perches4ec4aa42013-03-18 10:44:45 -0700391 unsigned char byBBPreEDRSSI;
392 unsigned char byBBPreEDIndex;
Forest Bond5449c682009-04-25 10:30:44 -0400393
Joe Perches4ec4aa42013-03-18 10:44:45 -0700394 unsigned long dwDiagRefCount;
Forest Bond5449c682009-04-25 10:30:44 -0400395
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200396 /* For FOE Tuning */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700397 unsigned char byFOETuning;
Forest Bond5449c682009-04-25 10:30:44 -0400398
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200399 /* For RF Power table */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700400 unsigned char byCCKPwr;
401 unsigned char byOFDMPwrG;
402 unsigned char byCurPwr;
403 char byCurPwrdBm;
404 unsigned char abyCCKPwrTbl[CB_MAX_CHANNEL_24G+1];
405 unsigned char abyOFDMPwrTbl[CB_MAX_CHANNEL+1];
406 char abyCCKDefaultPwr[CB_MAX_CHANNEL_24G+1];
407 char abyOFDMDefaultPwr[CB_MAX_CHANNEL+1];
408 char abyRegPwr[CB_MAX_CHANNEL+1];
409 char abyLocalPwr[CB_MAX_CHANNEL+1];
Forest Bond5449c682009-04-25 10:30:44 -0400410
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200411 /* BaseBand Loopback Use */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700412 unsigned char byBBCR4d;
413 unsigned char byBBCRc9;
414 unsigned char byBBCR88;
415 unsigned char byBBCR09;
Forest Bond5449c682009-04-25 10:30:44 -0400416
Joe Perches4ec4aa42013-03-18 10:44:45 -0700417 bool bDiversityRegCtlON;
418 bool bDiversityEnable;
419 unsigned long ulDiversityNValue;
420 unsigned long ulDiversityMValue;
421 unsigned char byTMax;
422 unsigned char byTMax2;
423 unsigned char byTMax3;
424 unsigned long ulSQ3TH;
Forest Bond5449c682009-04-25 10:30:44 -0400425
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200426 /* ANT diversity */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700427 unsigned long uDiversityCnt;
428 unsigned char byAntennaState;
429 unsigned long ulRatio_State0;
430 unsigned long ulRatio_State1;
Forest Bond5449c682009-04-25 10:30:44 -0400431
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200432 /* SQ3 functions for antenna diversity */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700433 struct timer_list TimerSQ3Tmax1;
434 struct timer_list TimerSQ3Tmax2;
435 struct timer_list TimerSQ3Tmax3;
Forest Bond5449c682009-04-25 10:30:44 -0400436
Joe Perches4ec4aa42013-03-18 10:44:45 -0700437 unsigned long uNumSQ3[MAX_RATE];
438 unsigned short wAntDiversityMaxRate;
Forest Bond5449c682009-04-25 10:30:44 -0400439
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200440 unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /* unsigned long alignment */
Forest Bond5449c682009-04-25 10:30:44 -0400441
Joe Perches4ec4aa42013-03-18 10:44:45 -0700442 unsigned short wBeaconInterval;
Malcolm Priestley80f598a2014-08-10 15:47:03 +0100443};
Forest Bond5449c682009-04-25 10:30:44 -0400444
Devendra Naga8473f652013-01-08 12:52:33 -0500445static inline PDEVICE_RD_INFO alloc_rd_info(void)
446{
447 return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
Forest Bond5449c682009-04-25 10:30:44 -0400448}
449
Devendra Nagad1b46e72013-01-08 12:52:34 -0500450static inline PDEVICE_TD_INFO alloc_td_info(void)
451{
452 return kzalloc(sizeof(DEVICE_TD_INFO), GFP_ATOMIC);
Forest Bond5449c682009-04-25 10:30:44 -0400453}
Forest Bond5449c682009-04-25 10:30:44 -0400454#endif