blob: 83efbfb57c798ef2189aa73e67ff2afbb48ba160 [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 */
Malcolm Priestleyff8d9f02014-11-07 19:06:07 +0000151#define BB_TYPE_11A 0
152#define BB_TYPE_11B 1
153#define BB_TYPE_11G 2
Forest Bond5449c682009-04-25 10:30:44 -0400154
Malcolm Priestleybf8918d2014-11-07 19:06:08 +0000155/* 0:11a, 1:11b, 2:11gb (only CCK in BasicRate), 3:11ga (OFDM in BasicRate) */
156#define PK_TYPE_11A 0
157#define PK_TYPE_11B 1
158#define PK_TYPE_11GB 2
159#define PK_TYPE_11GA 3
Forest Bond5449c682009-04-25 10:30:44 -0400160
Joe Perches4ec4aa42013-03-18 10:44:45 -0700161typedef struct __chip_info_tbl {
162 CHIP_TYPE chip_id;
163 char *name;
164 int io_size;
165 int nTxQueue;
166 u32 flags;
Forest Bond5449c682009-04-25 10:30:44 -0400167} CHIP_INFO, *PCHIP_INFO;
168
Forest Bond5449c682009-04-25 10:30:44 -0400169typedef enum {
Joe Perches4ec4aa42013-03-18 10:44:45 -0700170 OWNED_BY_HOST = 0,
171 OWNED_BY_NIC = 1
Forest Bond5449c682009-04-25 10:30:44 -0400172} DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
173
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200174/* flags for options */
Forest Bond5449c682009-04-25 10:30:44 -0400175#define DEVICE_FLAGS_IP_ALIGN 0x00000001UL
176#define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
177#define DEVICE_FLAGS_OP_MODE 0x00000004UL
178#define DEVICE_FLAGS_PS_MODE 0x00000008UL
179#define DEVICE_FLAGS_80211h_MODE 0x00000010UL
180#define DEVICE_FLAGS_DiversityANT 0x00000020UL
181
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200182/* flags for driver status */
Forest Bond5449c682009-04-25 10:30:44 -0400183#define DEVICE_FLAGS_OPENED 0x00010000UL
184#define DEVICE_FLAGS_WOL_ENABLED 0x00080000UL
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200185/* flags for capabilities */
Forest Bond5449c682009-04-25 10:30:44 -0400186#define DEVICE_FLAGS_TX_ALIGN 0x01000000UL
187#define DEVICE_FLAGS_HAVE_CAM 0x02000000UL
188#define DEVICE_FLAGS_FLOW_CTRL 0x04000000UL
189
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200190/* flags for MII status */
Forest Bond5449c682009-04-25 10:30:44 -0400191#define DEVICE_LINK_FAIL 0x00000001UL
192#define DEVICE_SPEED_10 0x00000002UL
193#define DEVICE_SPEED_100 0x00000004UL
194#define DEVICE_SPEED_1000 0x00000008UL
195#define DEVICE_DUPLEX_FULL 0x00000010UL
196#define DEVICE_AUTONEG_ENABLE 0x00000020UL
197#define DEVICE_FORCED_BY_EEPROM 0x00000040UL
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200198/* for device_set_media_duplex */
Forest Bond5449c682009-04-25 10:30:44 -0400199#define DEVICE_LINK_CHANGE 0x00000001UL
200
Forest Bond5449c682009-04-25 10:30:44 -0400201typedef struct __device_opt {
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200202 int nRxDescs0; /* Number of RX descriptors0 */
203 int nRxDescs1; /* Number of RX descriptors1 */
204 int nTxDescs[2]; /* Number of TX descriptors 0, 1 */
205 int int_works; /* interrupt limits */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700206 int short_retry;
207 int long_retry;
208 int bbp_type;
209 u32 flags;
Forest Bond5449c682009-04-25 10:30:44 -0400210} OPTIONS, *POPTIONS;
211
Malcolm Priestley80f598a2014-08-10 15:47:03 +0100212struct vnt_private {
Joe Perches4ec4aa42013-03-18 10:44:45 -0700213 struct pci_dev *pcid;
Malcolm Priestley33b1c8c2014-10-29 17:43:36 +0000214 /* mac80211 */
215 struct ieee80211_hw *hw;
216 struct ieee80211_vif *vif;
Malcolm Priestleyfee7506a12014-10-29 17:43:37 +0000217 unsigned long key_entry_inuse;
Malcolm Priestley67013f22014-10-29 17:43:43 +0000218 u32 basic_rates;
Malcolm Priestley89cf9be2014-10-29 17:43:42 +0000219 u16 current_aid;
Malcolm Priestley67013f22014-10-29 17:43:43 +0000220 int mc_list_count;
221 u8 mac_hw;
Forest Bond5449c682009-04-25 10:30:44 -0400222
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200223/* dma addr, rx/tx pool */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700224 dma_addr_t pool_dma;
225 dma_addr_t rd0_pool_dma;
226 dma_addr_t rd1_pool_dma;
Forest Bond5449c682009-04-25 10:30:44 -0400227
Joe Perches4ec4aa42013-03-18 10:44:45 -0700228 dma_addr_t td0_pool_dma;
229 dma_addr_t td1_pool_dma;
Forest Bond5449c682009-04-25 10:30:44 -0400230
Joe Perches4ec4aa42013-03-18 10:44:45 -0700231 dma_addr_t tx_bufs_dma0;
232 dma_addr_t tx_bufs_dma1;
233 dma_addr_t tx_beacon_dma;
Forest Bond5449c682009-04-25 10:30:44 -0400234
Joe Perches4ec4aa42013-03-18 10:44:45 -0700235 unsigned char *tx0_bufs;
236 unsigned char *tx1_bufs;
237 unsigned char *tx_beacon_bufs;
Forest Bond5449c682009-04-25 10:30:44 -0400238
Joe Perches4ec4aa42013-03-18 10:44:45 -0700239 CHIP_TYPE chip_id;
Forest Bond5449c682009-04-25 10:30:44 -0400240
Guillaume Clement16834402014-07-22 22:08:26 +0200241 void __iomem *PortOffset;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700242 unsigned long dwIsr;
243 u32 memaddr;
244 u32 ioaddr;
245 u32 io_size;
Forest Bond5449c682009-04-25 10:30:44 -0400246
Joe Perches4ec4aa42013-03-18 10:44:45 -0700247 unsigned char byRevId;
Aya Mahfouz2359b5c2014-10-11 02:42:45 +0200248 unsigned char byRxMode;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700249 unsigned short SubSystemID;
250 unsigned short SubVendorID;
Forest Bond5449c682009-04-25 10:30:44 -0400251
Aya Mahfouz2359b5c2014-10-11 02:42:45 +0200252 spinlock_t lock;
253
Joe Perches4ec4aa42013-03-18 10:44:45 -0700254 int nTxQueues;
255 volatile int iTDUsed[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400256
Joe Perches4ec4aa42013-03-18 10:44:45 -0700257 volatile PSTxDesc apCurrTD[TYPE_MAXTD];
258 volatile PSTxDesc apTailTD[TYPE_MAXTD];
Forest Bond5449c682009-04-25 10:30:44 -0400259
Joe Perches4ec4aa42013-03-18 10:44:45 -0700260 volatile PSTxDesc apTD0Rings;
261 volatile PSTxDesc apTD1Rings;
Forest Bond5449c682009-04-25 10:30:44 -0400262
Joe Perches4ec4aa42013-03-18 10:44:45 -0700263 volatile PSRxDesc aRD0Ring;
264 volatile PSRxDesc aRD1Ring;
265 volatile PSRxDesc pCurrRD[TYPE_MAXRD];
Forest Bond5449c682009-04-25 10:30:44 -0400266
Joe Perches4ec4aa42013-03-18 10:44:45 -0700267 OPTIONS sOpts;
Forest Bond5449c682009-04-25 10:30:44 -0400268
Joe Perches4ec4aa42013-03-18 10:44:45 -0700269 u32 flags;
Forest Bond5449c682009-04-25 10:30:44 -0400270
Joe Perches4ec4aa42013-03-18 10:44:45 -0700271 u32 rx_buf_sz;
Malcolm Priestley33b1c8c2014-10-29 17:43:36 +0000272 u8 rx_rate;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700273 int multicast_limit;
Malcolm Priestley9a802f22014-07-28 21:43:28 +0100274
Joe Perches4ec4aa42013-03-18 10:44:45 -0700275 u32 rx_bytes;
Forest Bond5449c682009-04-25 10:30:44 -0400276
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200277 /* Version control */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700278 unsigned char byLocalID;
279 unsigned char byRFType;
Forest Bond5449c682009-04-25 10:30:44 -0400280
Joe Perches4ec4aa42013-03-18 10:44:45 -0700281 unsigned char byMaxPwrLevel;
282 unsigned char byZoneType;
283 bool bZoneRegExist;
284 unsigned char byOriginalZonetype;
Malcolm Priestley14676102014-10-29 17:55:59 +0000285
Malcolm Priestleyc397d462014-11-07 19:06:09 +0000286 unsigned char abyCurrentNetAddr[ETH_ALEN]; __aligned(2)
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200287 bool bLinkPass; /* link status: OK or fail */
Forest Bond5449c682009-04-25 10:30:44 -0400288
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200289 /* Adapter statistics */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700290 SStatCounter scStatistic;
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200291 /* 802.11 counter */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700292 SDot11Counters s802_11Counter;
Forest Bond5449c682009-04-25 10:30:44 -0400293
Joe Perches4ec4aa42013-03-18 10:44:45 -0700294 unsigned int uCurrRSSI;
295 unsigned char byCurrSQ;
Forest Bond5449c682009-04-25 10:30:44 -0400296
Joe Perches4ec4aa42013-03-18 10:44:45 -0700297 unsigned long dwTxAntennaSel;
298 unsigned long dwRxAntennaSel;
299 unsigned char byAntennaCount;
300 unsigned char byRxAntennaMode;
301 unsigned char byTxAntennaMode;
302 bool bTxRxAntInv;
Forest Bond5449c682009-04-25 10:30:44 -0400303
Joe Perches4ec4aa42013-03-18 10:44:45 -0700304 unsigned char *pbyTmpBuff;
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200305 unsigned int uSIFS; /* Current SIFS */
306 unsigned int uDIFS; /* Current DIFS */
307 unsigned int uEIFS; /* Current EIFS */
308 unsigned int uSlot; /* Current SlotTime */
309 unsigned int uCwMin; /* Current CwMin */
310 unsigned int uCwMax; /* CwMax is fixed on 1023. */
311 /* PHY parameter */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700312 unsigned char bySIFS;
313 unsigned char byDIFS;
314 unsigned char byEIFS;
315 unsigned char bySlot;
316 unsigned char byCWMaxMin;
Forest Bond5449c682009-04-25 10:30:44 -0400317
Malcolm Priestleyff8d9f02014-11-07 19:06:07 +0000318 u8 byBBType; /* 0:11A, 1:11B, 2:11G */
Malcolm Priestleybf8918d2014-11-07 19:06:08 +0000319 u8 byPacketType; /*
320 * 0:11a,1:11b,2:11gb (only CCK
321 * in BasicRate), 3:11ga (OFDM in
322 * Basic Rate)
323 */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700324 unsigned short wBasicRate;
325 unsigned char byACKRate;
326 unsigned char byTopOFDMBasicRate;
327 unsigned char byTopCCKBasicRate;
Forest Bond5449c682009-04-25 10:30:44 -0400328
Joe Perches4ec4aa42013-03-18 10:44:45 -0700329 unsigned char byMinChannel;
330 unsigned char byMaxChannel;
Forest Bond5449c682009-04-25 10:30:44 -0400331
Joe Perches4ec4aa42013-03-18 10:44:45 -0700332 unsigned char byPreambleType;
333 unsigned char byShortPreamble;
Forest Bond5449c682009-04-25 10:30:44 -0400334
Joe Perches4ec4aa42013-03-18 10:44:45 -0700335 unsigned short wCurrentRate;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700336 unsigned char byShortRetryLimit;
337 unsigned char byLongRetryLimit;
Malcolm Priestleya9873672014-08-30 22:25:49 +0100338 enum nl80211_iftype op_mode;
Joe Perches4ec4aa42013-03-18 10:44:45 -0700339 bool bBSSIDFilter;
340 unsigned short wMaxTransmitMSDULifetime;
Forest Bond5449c682009-04-25 10:30:44 -0400341
Joe Perches4ec4aa42013-03-18 10:44:45 -0700342 bool bEncryptionEnable;
343 bool bLongHeader;
344 bool bShortSlotTime;
345 bool bProtectMode;
346 bool bNonERPPresent;
347 bool bBarkerPreambleMd;
Forest Bond5449c682009-04-25 10:30:44 -0400348
Joe Perches4ec4aa42013-03-18 10:44:45 -0700349 bool bRadioControlOff;
350 bool bRadioOff;
351 bool bEnablePSMode;
352 unsigned short wListenInterval;
353 bool bPWBitOn;
Forest Bond5449c682009-04-25 10:30:44 -0400354
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200355 /* GPIO Radio Control */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700356 unsigned char byRadioCtl;
357 unsigned char byGPIO;
358 bool bHWRadioOff;
359 bool bPrvActive4RadioOFF;
360 bool bGPIOBlockRead;
Forest Bond5449c682009-04-25 10:30:44 -0400361
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200362 /* Beacon related */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700363 unsigned short wSeqCounter;
364 unsigned short wBCNBufLen;
365 bool bBeaconBufReady;
366 bool bBeaconSent;
367 bool bIsBeaconBufReadySet;
368 unsigned int cbBeaconBufReadySetCnt;
369 bool bFixRate;
370 unsigned char byCurrentCh;
Forest Bond5449c682009-04-25 10:30:44 -0400371
Joe Perches4ec4aa42013-03-18 10:44:45 -0700372 bool bAES;
Forest Bond5449c682009-04-25 10:30:44 -0400373
Joe Perches4ec4aa42013-03-18 10:44:45 -0700374 unsigned char byAutoFBCtrl;
Forest Bond5449c682009-04-25 10:30:44 -0400375
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200376 /* For Update BaseBand VGA Gain Offset */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700377 bool bUpdateBBVGA;
378 unsigned int uBBVGADiffCount;
379 unsigned char byBBVGANew;
380 unsigned char byBBVGACurrent;
381 unsigned char abyBBVGA[BB_VGA_LEVEL];
382 long ldBmThreshold[BB_VGA_LEVEL];
Forest Bond5449c682009-04-25 10:30:44 -0400383
Joe Perches4ec4aa42013-03-18 10:44:45 -0700384 unsigned char byBBPreEDRSSI;
385 unsigned char byBBPreEDIndex;
Forest Bond5449c682009-04-25 10:30:44 -0400386
Joe Perches4ec4aa42013-03-18 10:44:45 -0700387 unsigned long dwDiagRefCount;
Forest Bond5449c682009-04-25 10:30:44 -0400388
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200389 /* For FOE Tuning */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700390 unsigned char byFOETuning;
Forest Bond5449c682009-04-25 10:30:44 -0400391
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200392 /* For RF Power table */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700393 unsigned char byCCKPwr;
394 unsigned char byOFDMPwrG;
395 unsigned char byCurPwr;
396 char byCurPwrdBm;
397 unsigned char abyCCKPwrTbl[CB_MAX_CHANNEL_24G+1];
398 unsigned char abyOFDMPwrTbl[CB_MAX_CHANNEL+1];
399 char abyCCKDefaultPwr[CB_MAX_CHANNEL_24G+1];
400 char abyOFDMDefaultPwr[CB_MAX_CHANNEL+1];
401 char abyRegPwr[CB_MAX_CHANNEL+1];
402 char abyLocalPwr[CB_MAX_CHANNEL+1];
Forest Bond5449c682009-04-25 10:30:44 -0400403
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200404 /* BaseBand Loopback Use */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700405 unsigned char byBBCR4d;
406 unsigned char byBBCRc9;
407 unsigned char byBBCR88;
408 unsigned char byBBCR09;
Forest Bond5449c682009-04-25 10:30:44 -0400409
Joe Perches4ec4aa42013-03-18 10:44:45 -0700410 bool bDiversityRegCtlON;
411 bool bDiversityEnable;
412 unsigned long ulDiversityNValue;
413 unsigned long ulDiversityMValue;
414 unsigned char byTMax;
415 unsigned char byTMax2;
416 unsigned char byTMax3;
417 unsigned long ulSQ3TH;
Forest Bond5449c682009-04-25 10:30:44 -0400418
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200419 /* ANT diversity */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700420 unsigned long uDiversityCnt;
421 unsigned char byAntennaState;
422 unsigned long ulRatio_State0;
423 unsigned long ulRatio_State1;
Forest Bond5449c682009-04-25 10:30:44 -0400424
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200425 /* SQ3 functions for antenna diversity */
Joe Perches4ec4aa42013-03-18 10:44:45 -0700426 struct timer_list TimerSQ3Tmax1;
427 struct timer_list TimerSQ3Tmax2;
428 struct timer_list TimerSQ3Tmax3;
Forest Bond5449c682009-04-25 10:30:44 -0400429
Joe Perches4ec4aa42013-03-18 10:44:45 -0700430 unsigned long uNumSQ3[MAX_RATE];
431 unsigned short wAntDiversityMaxRate;
Forest Bond5449c682009-04-25 10:30:44 -0400432
Veronika Kabatova81a4e952014-10-25 22:26:56 +0200433 unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /* unsigned long alignment */
Forest Bond5449c682009-04-25 10:30:44 -0400434
Joe Perches4ec4aa42013-03-18 10:44:45 -0700435 unsigned short wBeaconInterval;
Malcolm Priestley80f598a2014-08-10 15:47:03 +0100436};
Forest Bond5449c682009-04-25 10:30:44 -0400437
Devendra Naga8473f652013-01-08 12:52:33 -0500438static inline PDEVICE_RD_INFO alloc_rd_info(void)
439{
440 return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
Forest Bond5449c682009-04-25 10:30:44 -0400441}
442
Devendra Nagad1b46e72013-01-08 12:52:34 -0500443static inline PDEVICE_TD_INFO alloc_td_info(void)
444{
445 return kzalloc(sizeof(DEVICE_TD_INFO), GFP_ATOMIC);
Forest Bond5449c682009-04-25 10:30:44 -0400446}
Forest Bond5449c682009-04-25 10:30:44 -0400447#endif