2009-04-25 08:30:44 -06:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
* File: device.h
|
|
|
|
*
|
|
|
|
* Purpose: MAC Data structure
|
|
|
|
*
|
|
|
|
* Author: Tevin Chen
|
|
|
|
*
|
|
|
|
* Date: Mar 17, 1997
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DEVICE_H__
|
|
|
|
#define __DEVICE_H__
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/ioport.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#include <linux/etherdevice.h>
|
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/timer.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/wait.h>
|
|
|
|
#include <linux/if_arp.h>
|
|
|
|
#include <linux/sched.h>
|
2010-06-03 10:15:54 -06:00
|
|
|
#include <linux/io.h>
|
2009-04-25 08:30:44 -06:00
|
|
|
#include <linux/if.h>
|
2014-08-17 13:42:25 -06:00
|
|
|
#include <linux/crc32.h>
|
2010-06-03 10:15:54 -06:00
|
|
|
#include <linux/uaccess.h>
|
2009-04-25 08:30:44 -06:00
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
#include <linux/inetdevice.h>
|
|
|
|
#include <linux/reboot.h>
|
|
|
|
#include <linux/ethtool.h>
|
|
|
|
/* Include Wireless Extension definition and check version - Jean II */
|
2014-10-29 11:43:36 -06:00
|
|
|
#include <net/mac80211.h>
|
2009-04-25 08:30:44 -06:00
|
|
|
#include <linux/wireless.h>
|
2014-10-25 14:26:56 -06:00
|
|
|
#include <net/iw_handler.h> /* New driver API */
|
2009-04-25 08:30:44 -06:00
|
|
|
|
|
|
|
#ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
|
|
|
|
#define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
|
|
|
|
#endif
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* device specific */
|
2009-08-12 15:54:03 -06:00
|
|
|
|
2009-04-25 08:30:44 -06:00
|
|
|
#include "device_cfg.h"
|
|
|
|
#include "ttype.h"
|
|
|
|
#include "wmgr.h"
|
|
|
|
#include "mib.h"
|
|
|
|
#include "srom.h"
|
|
|
|
#include "desc.h"
|
|
|
|
#include "key.h"
|
|
|
|
#include "mac.h"
|
|
|
|
|
|
|
|
/*--------------------- Export Definitions -------------------------*/
|
|
|
|
|
2014-10-29 11:55:48 -06:00
|
|
|
#define RATE_1M 0
|
|
|
|
#define RATE_2M 1
|
|
|
|
#define RATE_5M 2
|
|
|
|
#define RATE_11M 3
|
|
|
|
#define RATE_6M 4
|
|
|
|
#define RATE_9M 5
|
|
|
|
#define RATE_12M 6
|
|
|
|
#define RATE_18M 7
|
|
|
|
#define RATE_24M 8
|
|
|
|
#define RATE_36M 9
|
|
|
|
#define RATE_48M 10
|
|
|
|
#define RATE_54M 11
|
|
|
|
#define RATE_AUTO 12
|
|
|
|
#define MAX_RATE 12
|
|
|
|
|
2009-04-25 08:30:44 -06:00
|
|
|
#define MAC_MAX_CONTEXT_REG (256+128)
|
|
|
|
|
|
|
|
#define MAX_MULTICAST_ADDRESS_NUM 32
|
2010-05-14 20:37:32 -06:00
|
|
|
#define MULTICAST_ADDRESS_LIST_SIZE (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
|
2009-04-25 08:30:44 -06:00
|
|
|
|
|
|
|
#define DUPLICATE_RX_CACHE_LENGTH 5
|
|
|
|
|
|
|
|
#define NUM_KEY_ENTRY 11
|
|
|
|
|
|
|
|
#define TX_WEP_NONE 0
|
|
|
|
#define TX_WEP_OTF 1
|
|
|
|
#define TX_WEP_SW 2
|
|
|
|
#define TX_WEP_SWOTP 3
|
|
|
|
#define TX_WEP_OTPSW 4
|
|
|
|
#define TX_WEP_SW232 5
|
|
|
|
|
|
|
|
#define KEYSEL_WEP40 0
|
|
|
|
#define KEYSEL_WEP104 1
|
|
|
|
#define KEYSEL_TKIP 2
|
|
|
|
#define KEYSEL_CCMP 3
|
|
|
|
|
|
|
|
#define AUTO_FB_NONE 0
|
|
|
|
#define AUTO_FB_0 1
|
|
|
|
#define AUTO_FB_1 2
|
|
|
|
|
|
|
|
#define FB_RATE0 0
|
|
|
|
#define FB_RATE1 1
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* Antenna Mode */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define ANT_A 0
|
|
|
|
#define ANT_B 1
|
|
|
|
#define ANT_DIVERSITY 2
|
|
|
|
#define ANT_RXD_TXA 3
|
|
|
|
#define ANT_RXD_TXB 4
|
|
|
|
#define ANT_UNKNOWN 0xFF
|
|
|
|
|
|
|
|
#define MAXCHECKHANGCNT 4
|
|
|
|
|
|
|
|
#define BB_VGA_LEVEL 4
|
|
|
|
#define BB_VGA_CHANGE_THRESHOLD 16
|
|
|
|
|
|
|
|
#ifndef RUN_AT
|
|
|
|
#define RUN_AT(x) (jiffies+(x))
|
|
|
|
#endif
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* DMA related */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define RESERV_AC0DMA 4
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* BUILD OBJ mode */
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
#define AVAIL_TD(p, q) ((p)->sOpts.nTxDescs[(q)] - ((p)->iTDUsed[(q)]))
|
2009-04-25 08:30:44 -06:00
|
|
|
|
|
|
|
#define NUM 64
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* 0:11A 1:11B 2:11G */
|
2009-04-25 08:30:44 -06:00
|
|
|
typedef enum _VIA_BB_TYPE
|
|
|
|
{
|
2013-03-18 11:44:45 -06:00
|
|
|
BB_TYPE_11A = 0,
|
|
|
|
BB_TYPE_11B,
|
|
|
|
BB_TYPE_11G
|
2009-04-25 08:30:44 -06:00
|
|
|
} VIA_BB_TYPE, *PVIA_BB_TYPE;
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* 0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate) */
|
2009-04-25 08:30:44 -06:00
|
|
|
typedef enum _VIA_PKT_TYPE
|
|
|
|
{
|
2013-03-18 11:44:45 -06:00
|
|
|
PK_TYPE_11A = 0,
|
|
|
|
PK_TYPE_11B,
|
|
|
|
PK_TYPE_11GB,
|
|
|
|
PK_TYPE_11GA
|
2009-04-25 08:30:44 -06:00
|
|
|
} VIA_PKT_TYPE, *PVIA_PKT_TYPE;
|
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
typedef struct __chip_info_tbl {
|
|
|
|
CHIP_TYPE chip_id;
|
|
|
|
char *name;
|
|
|
|
int io_size;
|
|
|
|
int nTxQueue;
|
|
|
|
u32 flags;
|
2009-04-25 08:30:44 -06:00
|
|
|
} CHIP_INFO, *PCHIP_INFO;
|
|
|
|
|
|
|
|
typedef enum {
|
2013-03-18 11:44:45 -06:00
|
|
|
OWNED_BY_HOST = 0,
|
|
|
|
OWNED_BY_NIC = 1
|
2009-04-25 08:30:44 -06:00
|
|
|
} DEVICE_OWNER_TYPE, *PDEVICE_OWNER_TYPE;
|
|
|
|
|
|
|
|
#define CB_MAX_RX_FRAG 64
|
2014-10-25 14:26:56 -06:00
|
|
|
/* DeFragment Control Block, used for collecting fragments prior to reassembly */
|
2014-07-24 17:06:19 -06:00
|
|
|
typedef struct tagSDeFragControlBlock {
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned short wSequence;
|
|
|
|
unsigned short wFragNum;
|
|
|
|
unsigned char abyAddr2[ETH_ALEN];
|
|
|
|
unsigned int uLifetime;
|
|
|
|
struct sk_buff *skb;
|
|
|
|
unsigned char *pbyRxBuffer;
|
|
|
|
unsigned int cbFrameLength;
|
|
|
|
bool bInUse;
|
2009-08-12 15:54:07 -06:00
|
|
|
} SDeFragControlBlock, *PSDeFragControlBlock;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* flags for options */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define DEVICE_FLAGS_IP_ALIGN 0x00000001UL
|
|
|
|
#define DEVICE_FLAGS_PREAMBLE_TYPE 0x00000002UL
|
|
|
|
#define DEVICE_FLAGS_OP_MODE 0x00000004UL
|
|
|
|
#define DEVICE_FLAGS_PS_MODE 0x00000008UL
|
|
|
|
#define DEVICE_FLAGS_80211h_MODE 0x00000010UL
|
|
|
|
#define DEVICE_FLAGS_DiversityANT 0x00000020UL
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* flags for driver status */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define DEVICE_FLAGS_OPENED 0x00010000UL
|
|
|
|
#define DEVICE_FLAGS_WOL_ENABLED 0x00080000UL
|
2014-10-25 14:26:56 -06:00
|
|
|
/* flags for capabilities */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define DEVICE_FLAGS_TX_ALIGN 0x01000000UL
|
|
|
|
#define DEVICE_FLAGS_HAVE_CAM 0x02000000UL
|
|
|
|
#define DEVICE_FLAGS_FLOW_CTRL 0x04000000UL
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* flags for MII status */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define DEVICE_LINK_FAIL 0x00000001UL
|
|
|
|
#define DEVICE_SPEED_10 0x00000002UL
|
|
|
|
#define DEVICE_SPEED_100 0x00000004UL
|
|
|
|
#define DEVICE_SPEED_1000 0x00000008UL
|
|
|
|
#define DEVICE_DUPLEX_FULL 0x00000010UL
|
|
|
|
#define DEVICE_AUTONEG_ENABLE 0x00000020UL
|
|
|
|
#define DEVICE_FORCED_BY_EEPROM 0x00000040UL
|
2014-10-25 14:26:56 -06:00
|
|
|
/* for device_set_media_duplex */
|
2009-04-25 08:30:44 -06:00
|
|
|
#define DEVICE_LINK_CHANGE 0x00000001UL
|
|
|
|
|
|
|
|
typedef struct __device_opt {
|
2014-10-25 14:26:56 -06:00
|
|
|
int nRxDescs0; /* Number of RX descriptors0 */
|
|
|
|
int nRxDescs1; /* Number of RX descriptors1 */
|
|
|
|
int nTxDescs[2]; /* Number of TX descriptors 0, 1 */
|
|
|
|
int int_works; /* interrupt limits */
|
|
|
|
int rts_thresh; /* rts threshold */
|
2013-03-18 11:44:45 -06:00
|
|
|
int frag_thresh;
|
|
|
|
int data_rate;
|
|
|
|
int channel_num;
|
|
|
|
int short_retry;
|
|
|
|
int long_retry;
|
|
|
|
int bbp_type;
|
|
|
|
u32 flags;
|
2009-04-25 08:30:44 -06:00
|
|
|
} OPTIONS, *POPTIONS;
|
|
|
|
|
2014-08-10 08:47:03 -06:00
|
|
|
struct vnt_private {
|
2013-03-18 11:44:45 -06:00
|
|
|
struct pci_dev *pcid;
|
2014-10-29 11:43:36 -06:00
|
|
|
/* mac80211 */
|
|
|
|
struct ieee80211_hw *hw;
|
|
|
|
struct ieee80211_vif *vif;
|
2014-10-29 11:43:37 -06:00
|
|
|
unsigned long key_entry_inuse;
|
2014-10-29 11:43:43 -06:00
|
|
|
u32 basic_rates;
|
2014-10-29 11:43:42 -06:00
|
|
|
u16 current_aid;
|
2014-10-29 11:43:43 -06:00
|
|
|
int mc_list_count;
|
|
|
|
u8 mac_hw;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* dma addr, rx/tx pool */
|
2013-03-18 11:44:45 -06:00
|
|
|
dma_addr_t pool_dma;
|
|
|
|
dma_addr_t rd0_pool_dma;
|
|
|
|
dma_addr_t rd1_pool_dma;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
dma_addr_t td0_pool_dma;
|
|
|
|
dma_addr_t td1_pool_dma;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
dma_addr_t tx_bufs_dma0;
|
|
|
|
dma_addr_t tx_bufs_dma1;
|
|
|
|
dma_addr_t tx_beacon_dma;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char *tx0_bufs;
|
|
|
|
unsigned char *tx1_bufs;
|
|
|
|
unsigned char *tx_beacon_bufs;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
CHIP_TYPE chip_id;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-07-22 14:08:26 -06:00
|
|
|
void __iomem *PortOffset;
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned long dwIsr;
|
|
|
|
u32 memaddr;
|
|
|
|
u32 ioaddr;
|
|
|
|
u32 io_size;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byRevId;
|
staging: vt6655: replace memcpy() by ether_addr_copy() using coccinelle and pack variables
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c :
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
The changes were applied using the following coccinelle rule:
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
After applying the rule, some referencing operations were
adjusted manually to avoid a gcc compilation warning.
According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.
A check was made on the following datastructures:
- vnt_mic_hdr
- tagS802_11Header
- tagSEthernetHeader
- vnt_rts_g
- ieee80211_rts
- vnt_private
To maintain that the array abyCurrentNetAddr in vnt_private is aligned,
it was placed before the boolean bLinkPass in the struct definition.
The definition can be found in device.h. A couple of variables were
packed in holes detected by pahole.
Output of pahole when running it on rxtx.o after the changes:
truct tagSEthernetHeader {
unsigned char abyDstAddr[6]; /* 0 6 */
unsigned char abySrcAddr[6]; /* 6 6 */
short unsigned int wType; /* 12 2 */
/* size: 14, cachelines: 1, members: 3 */
/* last cacheline: 14 bytes */
};
struct tagS802_11Header {
short unsigned int wFrameCtl; /* 0 2 */
short unsigned int wDurationID; /* 2 2 */
unsigned char abyAddr1[6]; /* 4 6 */
unsigned char abyAddr2[6]; /* 10 6 */
unsigned char abyAddr3[6]; /* 16 6 */
short unsigned int wSeqCtl; /* 22 2 */
unsigned char abyAddr4[6]; /* 24 6 */
/* size: 30, cachelines: 1, members: 7 */
/* last cacheline: 30 bytes */
};
struct ieee80211_rts {
__le16 frame_control; /* 0 2 */
__le16 duration; /* 2 2 */
u8 ra[6]; /* 4 6 */
u8 ta[6]; /* 10 6 */
/* size: 16, cachelines: 1, members: 4 */
/* last cacheline: 16 bytes */
};
struct vnt_private {
struct pci_dev * pcid; /* 0 4 */
struct net_device * dev; /* 4 4 */
dma_addr_t pool_dma; /* 8 4 */
dma_addr_t rd0_pool_dma; /* 12 4 */
dma_addr_t rd1_pool_dma; /* 16 4 */
dma_addr_t td0_pool_dma; /* 20 4 */
dma_addr_t td1_pool_dma; /* 24 4 */
dma_addr_t tx_bufs_dma0; /* 28 4 */
dma_addr_t tx_bufs_dma1; /* 32 4 */
dma_addr_t tx_beacon_dma; /* 36 4 */
unsigned char * tx0_bufs; /* 40 4 */
unsigned char * tx1_bufs; /* 44 4 */
unsigned char * tx_beacon_bufs; /* 48 4 */
CHIP_TYPE chip_id; /* 52 4 */
void * PortOffset; /* 56 4 */
long unsigned int dwIsr; /* 60 4 */
/*--- cacheline 1 boundary (64 bytes) ---*/
u32 memaddr; /* 64 4 */
u32 ioaddr; /* 68 4 */
u32 io_size; /* 72 4 */
unsigned char byRevId; /* 76 1 */
unsigned char byRxMode; /* 77 1 */
short unsigned int SubSystemID; /* 78 2 */
short unsigned int SubVendorID; /* 80 2 */
spinlock_t lock; /* 82 2 */
int nTxQueues; /* 84 4 */
volatile int iTDUsed; /* 88 8 */
volatile PSTxDesc apCurrTD; /* 96 8 */
volatile PSTxDesc apTailTD; /* 104 8 */
volatile PSTxDesc apTD0Rings; /* 112 4 */
volatile PSTxDesc apTD1Rings; /* 116 4 */
volatile PSRxDesc aRD0Ring; /* 120 4 */
volatile PSRxDesc aRD1Ring; /* 124 4 */
/*--- cacheline 2 boundary (128 bytes) ---*/
volatile PSRxDesc pCurrRD; /* 128 8 */
SCache sDupRxCache; /* 136 44 */
SDeFragControlBlock sRxDFCB[64]; /* 180 2048 */
/*--- cacheline 34 boundary (2176 bytes) was 52 bytes ago ---*/
unsigned int cbDFCB; /* 2228 4 */
unsigned int cbFreeDFCB; /* 2232 4 */
unsigned int uCurrentDFCBIdx; /* 2236 4 */
/*--- cacheline 35 boundary (2240 bytes) ---*/
OPTIONS sOpts; /* 2240 52 */
u32 flags; /* 2292 4 */
u32 rx_buf_sz; /* 2296 4 */
int multicast_limit; /* 2300 4 */
/*--- cacheline 36 boundary (2304 bytes) ---*/
pid_t MLMEThr_pid; /* 2304 4 */
struct completion notify; /* 2308 16 */
struct semaphore mlme_semaphore; /* 2324 16 */
u32 rx_bytes; /* 2340 4 */
unsigned char byLocalID; /* 2344 1 */
unsigned char byRFType; /* 2345 1 */
unsigned char byMaxPwrLevel; /* 2346 1 */
unsigned char byZoneType; /* 2347 1 */
bool bZoneRegExist; /* 2348 1 */
unsigned char byOriginalZonetype; /* 2349 1 */
unsigned char abyMacContext[384]; /* 2350 384 */
/*--- cacheline 42 boundary (2688 bytes) was 46 bytes ago ---*/
unsigned char abyCurrentNetAddr[6]; /* 2734 6 */
bool bLinkPass; /* 2740 1 */
/* XXX 3 bytes hole, try to pack */
SStatCounter scStatistic; /* 2744 776 */
/*--- cacheline 55 boundary (3520 bytes) ---*/
SDot11Counters s802_11Counter; /* 3520 172 */
/*--- cacheline 57 boundary (3648 bytes) was 44 bytes ago ---*/
PSMgmtObject pMgmt; /* 3692 4 */
SMgmtObject sMgmtObj; /* 3696 95840 */
/*--- cacheline 1555 boundary (99520 bytes) was 16 bytes ago ---*/
/* Bitfield combined with previous fields */
unsigned int uCurrRSSI; /* 0 4 */
unsigned char byCurrSQ; /* 0 1 */
long unsigned int dwTxAntennaSel; /* 0 4 */
long unsigned int dwRxAntennaSel; /* 0 4 */
unsigned char byAntennaCount; /* 0 1 */
unsigned char byRxAntennaMode; /* 0 1 */
unsigned char byTxAntennaMode; /* 0 1 */
bool bTxRxAntInv; /* 0 1 */
unsigned char * pbyTmpBuff; /* 0 4 */
unsigned int uSIFS; /* 0 4 */
unsigned int uDIFS; /* 0 4 */
unsigned int uEIFS; /* 0 4 */
unsigned int uSlot; /* 0 4 */
unsigned int uCwMin; /* 0 4 */
unsigned int uCwMax; /* 0 4 */
unsigned char bySIFS; /* 0 1 */
unsigned char byDIFS; /* 0 1 */
unsigned char byEIFS; /* 0 1 */
unsigned char bySlot; /* 0 1 */
unsigned char byCWMaxMin; /* 0 1 */
CARD_PHY_TYPE eCurrentPHYType; /* 0 4 */
VIA_BB_TYPE byBBType; /* 0 4 */
VIA_PKT_TYPE byPacketType; /* 0 4 */
short unsigned int wBasicRate; /* 0 2 */
unsigned char byACKRate; /* 0 1 */
unsigned char byTopOFDMBasicRate; /* 0 1 */
unsigned char byTopCCKBasicRate; /* 0 1 */
unsigned char byMinChannel; /* 0 1 */
unsigned char byMaxChannel; /* 0 1 */
unsigned int uConnectionRate; /* 0 4 */
unsigned char byPreambleType; /* 0 1 */
unsigned char byShortPreamble; /* 0 1 */
short unsigned int wCurrentRate; /* 0 2 */
short unsigned int wRTSThreshold; /* 0 2 */
short unsigned int wFragmentationThreshold; /* 0 2 */
unsigned char byShortRetryLimit; /* 0 1 */
unsigned char byLongRetryLimit; /* 0 1 */
enum nl80211_iftype op_mode; /* 0 4 */
unsigned char byOpMode; /* 0 1 */
bool bBSSIDFilter; /* 0 1 */
short unsigned int wMaxTransmitMSDULifetime; /* 0 2 */
unsigned char abyBSSID[6]; /* 0 6 */
unsigned char abyDesireBSSID[6]; /* 0 6 */
short unsigned int wACKDuration; /* 0 2 */
short unsigned int wRTSTransmitLen; /* 0 2 */
unsigned char byRTSServiceField; /* 0 1 */
unsigned char byRTSSignalField; /* 0 1 */
long unsigned int dwMaxReceiveLifetime; /* 0 4 */
bool bEncryptionEnable; /* 0 1 */
bool bLongHeader; /* 0 1 */
bool bShortSlotTime; /* 0 1 */
bool bProtectMode; /* 0 1 */
bool bNonERPPresent; /* 0 1 */
bool bBarkerPreambleMd; /* 0 1 */
unsigned char byERPFlag; /* 0 1 */
short unsigned int wUseProtectCntDown; /* 0 2 */
bool bRadioControlOff; /* 0 1 */
bool bRadioOff; /* 0 1 */
bool bEnablePSMode; /* 0 1 */
short unsigned int wListenInterval; /* 0 2 */
bool bPWBitOn; /* 0 1 */
WMAC_POWER_MODE ePSMode; /* 0 4 */
unsigned char byRadioCtl; /* 0 1 */
unsigned char byGPIO; /* 0 1 */
bool bHWRadioOff; /* 0 1 */
bool bPrvActive4RadioOFF; /* 0 1 */
bool bGPIOBlockRead; /* 0 1 */
short unsigned int wSeqCounter; /* 0 2 */
short unsigned int wBCNBufLen; /* 0 2 */
bool bBeaconBufReady; /* 0 1 */
bool bBeaconSent; /* 0 1 */
bool bIsBeaconBufReadySet; /* 0 1 */
unsigned int cbBeaconBufReadySetCnt; /* 0 4 */
bool bFixRate; /* 0 1 */
unsigned char byCurrentCh; /* 0 1 */
unsigned int uScanTime; /* 0 4 */
CMD_STATE eCommandState; /* 0 4 */
CMD_CODE eCommand; /* 0 4 */
bool bBeaconTx; /* 0 1 */
bool bStopBeacon; /* 0 1 */
bool bStopDataPkt; /* 0 1 */
bool bStopTx0Pkt; /* 0 1 */
unsigned int uAutoReConnectTime; /* 0 4 */
CMD_ITEM eCmdQueue[32]; /* 0 1408 */
unsigned int uCmdDequeueIdx; /* 0 4 */
unsigned int uCmdEnqueueIdx; /* 0 4 */
unsigned int cbFreeCmdQueue; /* 0 4 */
bool bCmdRunning; /* 0 1 */
bool bCmdClear; /* 0 1 */
bool bRoaming; /* 0 1 */
unsigned char abyIPAddr[4]; /* 0 4 */
long unsigned int ulTxPower; /* 0 4 */
NDIS_802_11_WEP_STATUS eEncryptionStatus; /* 0 4 */
bool bTransmitKey; /* 0 1 */
NDIS_802_11_WEP_STATUS eOldEncryptionStatus; /* 0 4 */
SKeyManagement sKey; /* 0 3784 */
long unsigned int dwIVCounter; /* 0 4 */
u64 qwPacketNumber; /* 0 8 */
unsigned int uCurrentWEPMode; /* 0 4 */
RC4Ext SBox; /* 0 264 */
unsigned char abyPRNG[35]; /* 0 35 */
unsigned char byKeyIndex; /* 0 1 */
unsigned int uKeyLength; /* 0 4 */
unsigned char abyKey[29]; /* 0 29 */
bool bAES; /* 0 1 */
unsigned char byCntMeasure; /* 0 1 */
unsigned int uAssocCount; /* 0 4 */
bool bMoreData; /* 0 1 */
bool bGrpAckPolicy; /* 0 1 */
bool bAssocInfoSet; /* 0 1 */
unsigned char byAutoFBCtrl; /* 0 1 */
bool bTxMICFail; /* 0 1 */
bool bRxMICFail; /* 0 1 */
unsigned int uRATEIdx; /* 0 4 */
bool bUpdateBBVGA; /* 0 1 */
unsigned int uBBVGADiffCount; /* 0 4 */
unsigned char byBBVGANew; /* 0 1 */
unsigned char byBBVGACurrent; /* 0 1 */
unsigned char abyBBVGA[4]; /* 0 4 */
long int ldBmThreshold[4]; /* 0 16 */
unsigned char byBBPreEDRSSI; /* 0 1 */
unsigned char byBBPreEDIndex; /* 0 1 */
bool bRadioCmd; /* 0 1 */
long unsigned int dwDiagRefCount; /* 0 4 */
unsigned char byFOETuning; /* 0 1 */
unsigned char byAutoPwrTunning; /* 0 1 */
short int sPSetPointCCK; /* 0 2 */
short int sPSetPointOFDMG; /* 0 2 */
short int sPSetPointOFDMA; /* 0 2 */
long int lPFormulaOffset; /* 0 4 */
short int sPThreshold; /* 0 2 */
char cAdjustStep; /* 0 1 */
char cMinTxAGC; /* 0 1 */
unsigned char byCCKPwr; /* 0 1 */
unsigned char byOFDMPwrG; /* 0 1 */
unsigned char byCurPwr; /* 0 1 */
char byCurPwrdBm; /* 0 1 */
unsigned char abyCCKPwrTbl[15]; /* 0 15 */
unsigned char abyOFDMPwrTbl[57]; /* 0 57 */
char abyCCKDefaultPwr[15]; /* 0 15 */
char abyOFDMDefaultPwr[57]; /* 0 57 */
char abyRegPwr[57]; /* 0 57 */
char abyLocalPwr[57]; /* 0 57 */
unsigned char byBBCR4d; /* 0 1 */
unsigned char byBBCRc9; /* 0 1 */
unsigned char byBBCR88; /* 0 1 */
unsigned char byBBCR09; /* 0 1 */
struct timer_list sTimerCommand; /* 0 52 */
struct timer_list sTimerTxData; /* 0 52 */
long unsigned int nTxDataTimeCout; /* 0 4 */
bool fTxDataInSleep; /* 0 1 */
bool IsTxDataTrigger; /* 0 1 */
bool fWPA_Authened; /* 0 1 */
unsigned char byReAssocCount; /* 0 1 */
unsigned char byLinkWaitCount; /* 0 1 */
unsigned char abyNodeName[17]; /* 0 17 */
bool bDiversityRegCtlON; /* 0 1 */
bool bDiversityEnable; /* 0 1 */
long unsigned int ulDiversityNValue; /* 0 4 */
long unsigned int ulDiversityMValue; /* 0 4 */
unsigned char byTMax; /* 0 1 */
unsigned char byTMax2; /* 0 1 */
unsigned char byTMax3; /* 0 1 */
long unsigned int ulSQ3TH; /* 0 4 */
long unsigned int uDiversityCnt; /* 0 4 */
unsigned char byAntennaState; /* 0 1 */
long unsigned int ulRatio_State0; /* 0 4 */
long unsigned int ulRatio_State1; /* 0 4 */
struct timer_list TimerSQ3Tmax1; /* 0 52 */
struct timer_list TimerSQ3Tmax2; /* 0 52 */
struct timer_list TimerSQ3Tmax3; /* 0 52 */
long unsigned int uNumSQ3[12]; /* 0 48 */
short unsigned int wAntDiversityMaxRate; /* 0 2 */
SEthernetHeader sTxEthHeader; /* 0 14 */
SEthernetHeader sRxEthHeader; /* 0 14 */
unsigned char abyBroadcastAddr[6]; /* 0 6 */
unsigned char abySNAP_RFC1042[6]; /* 0 6 */
unsigned char abySNAP_Bridgetunnel[6]; /* 0 6 */
unsigned char abyEEPROM[256]; /* 0 256 */
SPMKID gsPMKID; /* 0 360 */
SPMKIDCandidateEvent gsPMKIDCandidate; /* 0 72 */
bool b11hEnable; /* 0 1 */
unsigned char abyCountryCode[3]; /* 0 3 */
unsigned int uNumOfMeasureEIDs; /* 0 4 */
PWLAN_IE_MEASURE_REQ pCurrMeasureEID; /* 0 4 */
bool bMeasureInProgress; /* 0 1 */
unsigned char byOrgChannel; /* 0 1 */
unsigned char byOrgRCR; /* 0 1 */
long unsigned int dwOrgMAR0; /* 0 4 */
long unsigned int dwOrgMAR4; /* 0 4 */
unsigned char byBasicMap; /* 0 1 */
unsigned char byCCAFraction; /* 0 1 */
unsigned char abyRPIs[8]; /* 0 8 */
long unsigned int dwRPIs[8]; /* 0 32 */
bool bChannelSwitch; /* 0 1 */
unsigned char byNewChannel; /* 0 1 */
unsigned char byChannelSwitchCount; /* 0 1 */
bool bQuietEnable; /* 0 1 */
bool bEnableFirstQuiet; /* 0 1 */
unsigned char byQuietStartCount; /* 0 1 */
unsigned int uQuietEnqueue; /* 0 4 */
long unsigned int dwCurrentQuietEndTime; /* 0 4 */
SQuietControl sQuiet[8]; /* 0 96 */
bool bCountryInfo5G; /* 0 1 */
bool bCountryInfo24G; /* 0 1 */
short unsigned int wBeaconInterval; /* 0 2 */
struct net_device * wpadev; /* 0 4 */
bool bWPADEVUp; /* 0 1 */
struct sk_buff * skb; /* 0 4 */
unsigned int bwextcount; /* 0 4 */
bool bWPASuppWextEnabled; /* 0 1 */
bool bEnableHostapd; /* 0 1 */
bool bEnable8021x; /* 0 1 */
bool bEnableHostWEP; /* 0 1 */
struct net_device * apdev; /* 0 4 */
int (*tx_80211)(struct sk_buff *,
struct net_device *); /* 0 4 */
unsigned int uChannel; /* 0 4 */
bool bMACSuspend; /* 0 1 */
struct iw_statistics wstats; /* 0 32 */
bool bCommit; /* 0 1 */
/*--- cacheline 1672 boundary (107008 bytes) ---*/
/* size: 107008, cachelines: 1672, members: 279 */
/* sum members: 107005, holes: 1, sum holes: 3 */
/* padding: 41471 */
/* BRAIN FART ALERT! 107008 != 107005 + 3(holes), diff = 0 */
};
struct vnt_mic_hdr {
u8 id; /* 0 1 */
u8 tx_priority; /* 1 1 */
u8 mic_addr2[6]; /* 2 6 */
u8 ccmp_pn[6]; /* 8 6 */
__be16 payload_len; /* 14 2 */
__be16 hlen; /* 16 2 */
__le16 frame_control; /* 18 2 */
u8 addr1[6]; /* 20 6 */
u8 addr2[6]; /* 26 6 */
u8 addr3[6]; /* 32 6 */
__le16 seq_ctrl; /* 38 2 */
u8 addr4[6]; /* 40 6 */
u16 packing; /* 46 2 */
/* size: 48, cachelines: 1, members: 13 */
/* last cacheline: 48 bytes */
};
struct vnt_rts_g {
struct vnt_phy_field b; /* 0 4 */
struct vnt_phy_field a; /* 4 4 */
__le16 duration_ba; /* 8 2 */
__le16 duration_aa; /* 10 2 */
__le16 duration_bb; /* 12 2 */
u16 reserved; /* 14 2 */
struct ieee80211_rts data; /* 16 16 */
/* size: 32, cachelines: 1, members: 7 */
/* last cacheline: 32 bytes */
};
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-10 18:42:45 -06:00
|
|
|
unsigned char byRxMode;
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned short SubSystemID;
|
|
|
|
unsigned short SubVendorID;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
staging: vt6655: replace memcpy() by ether_addr_copy() using coccinelle and pack variables
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c :
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
The changes were applied using the following coccinelle rule:
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
After applying the rule, some referencing operations were
adjusted manually to avoid a gcc compilation warning.
According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.
A check was made on the following datastructures:
- vnt_mic_hdr
- tagS802_11Header
- tagSEthernetHeader
- vnt_rts_g
- ieee80211_rts
- vnt_private
To maintain that the array abyCurrentNetAddr in vnt_private is aligned,
it was placed before the boolean bLinkPass in the struct definition.
The definition can be found in device.h. A couple of variables were
packed in holes detected by pahole.
Output of pahole when running it on rxtx.o after the changes:
truct tagSEthernetHeader {
unsigned char abyDstAddr[6]; /* 0 6 */
unsigned char abySrcAddr[6]; /* 6 6 */
short unsigned int wType; /* 12 2 */
/* size: 14, cachelines: 1, members: 3 */
/* last cacheline: 14 bytes */
};
struct tagS802_11Header {
short unsigned int wFrameCtl; /* 0 2 */
short unsigned int wDurationID; /* 2 2 */
unsigned char abyAddr1[6]; /* 4 6 */
unsigned char abyAddr2[6]; /* 10 6 */
unsigned char abyAddr3[6]; /* 16 6 */
short unsigned int wSeqCtl; /* 22 2 */
unsigned char abyAddr4[6]; /* 24 6 */
/* size: 30, cachelines: 1, members: 7 */
/* last cacheline: 30 bytes */
};
struct ieee80211_rts {
__le16 frame_control; /* 0 2 */
__le16 duration; /* 2 2 */
u8 ra[6]; /* 4 6 */
u8 ta[6]; /* 10 6 */
/* size: 16, cachelines: 1, members: 4 */
/* last cacheline: 16 bytes */
};
struct vnt_private {
struct pci_dev * pcid; /* 0 4 */
struct net_device * dev; /* 4 4 */
dma_addr_t pool_dma; /* 8 4 */
dma_addr_t rd0_pool_dma; /* 12 4 */
dma_addr_t rd1_pool_dma; /* 16 4 */
dma_addr_t td0_pool_dma; /* 20 4 */
dma_addr_t td1_pool_dma; /* 24 4 */
dma_addr_t tx_bufs_dma0; /* 28 4 */
dma_addr_t tx_bufs_dma1; /* 32 4 */
dma_addr_t tx_beacon_dma; /* 36 4 */
unsigned char * tx0_bufs; /* 40 4 */
unsigned char * tx1_bufs; /* 44 4 */
unsigned char * tx_beacon_bufs; /* 48 4 */
CHIP_TYPE chip_id; /* 52 4 */
void * PortOffset; /* 56 4 */
long unsigned int dwIsr; /* 60 4 */
/*--- cacheline 1 boundary (64 bytes) ---*/
u32 memaddr; /* 64 4 */
u32 ioaddr; /* 68 4 */
u32 io_size; /* 72 4 */
unsigned char byRevId; /* 76 1 */
unsigned char byRxMode; /* 77 1 */
short unsigned int SubSystemID; /* 78 2 */
short unsigned int SubVendorID; /* 80 2 */
spinlock_t lock; /* 82 2 */
int nTxQueues; /* 84 4 */
volatile int iTDUsed; /* 88 8 */
volatile PSTxDesc apCurrTD; /* 96 8 */
volatile PSTxDesc apTailTD; /* 104 8 */
volatile PSTxDesc apTD0Rings; /* 112 4 */
volatile PSTxDesc apTD1Rings; /* 116 4 */
volatile PSRxDesc aRD0Ring; /* 120 4 */
volatile PSRxDesc aRD1Ring; /* 124 4 */
/*--- cacheline 2 boundary (128 bytes) ---*/
volatile PSRxDesc pCurrRD; /* 128 8 */
SCache sDupRxCache; /* 136 44 */
SDeFragControlBlock sRxDFCB[64]; /* 180 2048 */
/*--- cacheline 34 boundary (2176 bytes) was 52 bytes ago ---*/
unsigned int cbDFCB; /* 2228 4 */
unsigned int cbFreeDFCB; /* 2232 4 */
unsigned int uCurrentDFCBIdx; /* 2236 4 */
/*--- cacheline 35 boundary (2240 bytes) ---*/
OPTIONS sOpts; /* 2240 52 */
u32 flags; /* 2292 4 */
u32 rx_buf_sz; /* 2296 4 */
int multicast_limit; /* 2300 4 */
/*--- cacheline 36 boundary (2304 bytes) ---*/
pid_t MLMEThr_pid; /* 2304 4 */
struct completion notify; /* 2308 16 */
struct semaphore mlme_semaphore; /* 2324 16 */
u32 rx_bytes; /* 2340 4 */
unsigned char byLocalID; /* 2344 1 */
unsigned char byRFType; /* 2345 1 */
unsigned char byMaxPwrLevel; /* 2346 1 */
unsigned char byZoneType; /* 2347 1 */
bool bZoneRegExist; /* 2348 1 */
unsigned char byOriginalZonetype; /* 2349 1 */
unsigned char abyMacContext[384]; /* 2350 384 */
/*--- cacheline 42 boundary (2688 bytes) was 46 bytes ago ---*/
unsigned char abyCurrentNetAddr[6]; /* 2734 6 */
bool bLinkPass; /* 2740 1 */
/* XXX 3 bytes hole, try to pack */
SStatCounter scStatistic; /* 2744 776 */
/*--- cacheline 55 boundary (3520 bytes) ---*/
SDot11Counters s802_11Counter; /* 3520 172 */
/*--- cacheline 57 boundary (3648 bytes) was 44 bytes ago ---*/
PSMgmtObject pMgmt; /* 3692 4 */
SMgmtObject sMgmtObj; /* 3696 95840 */
/*--- cacheline 1555 boundary (99520 bytes) was 16 bytes ago ---*/
/* Bitfield combined with previous fields */
unsigned int uCurrRSSI; /* 0 4 */
unsigned char byCurrSQ; /* 0 1 */
long unsigned int dwTxAntennaSel; /* 0 4 */
long unsigned int dwRxAntennaSel; /* 0 4 */
unsigned char byAntennaCount; /* 0 1 */
unsigned char byRxAntennaMode; /* 0 1 */
unsigned char byTxAntennaMode; /* 0 1 */
bool bTxRxAntInv; /* 0 1 */
unsigned char * pbyTmpBuff; /* 0 4 */
unsigned int uSIFS; /* 0 4 */
unsigned int uDIFS; /* 0 4 */
unsigned int uEIFS; /* 0 4 */
unsigned int uSlot; /* 0 4 */
unsigned int uCwMin; /* 0 4 */
unsigned int uCwMax; /* 0 4 */
unsigned char bySIFS; /* 0 1 */
unsigned char byDIFS; /* 0 1 */
unsigned char byEIFS; /* 0 1 */
unsigned char bySlot; /* 0 1 */
unsigned char byCWMaxMin; /* 0 1 */
CARD_PHY_TYPE eCurrentPHYType; /* 0 4 */
VIA_BB_TYPE byBBType; /* 0 4 */
VIA_PKT_TYPE byPacketType; /* 0 4 */
short unsigned int wBasicRate; /* 0 2 */
unsigned char byACKRate; /* 0 1 */
unsigned char byTopOFDMBasicRate; /* 0 1 */
unsigned char byTopCCKBasicRate; /* 0 1 */
unsigned char byMinChannel; /* 0 1 */
unsigned char byMaxChannel; /* 0 1 */
unsigned int uConnectionRate; /* 0 4 */
unsigned char byPreambleType; /* 0 1 */
unsigned char byShortPreamble; /* 0 1 */
short unsigned int wCurrentRate; /* 0 2 */
short unsigned int wRTSThreshold; /* 0 2 */
short unsigned int wFragmentationThreshold; /* 0 2 */
unsigned char byShortRetryLimit; /* 0 1 */
unsigned char byLongRetryLimit; /* 0 1 */
enum nl80211_iftype op_mode; /* 0 4 */
unsigned char byOpMode; /* 0 1 */
bool bBSSIDFilter; /* 0 1 */
short unsigned int wMaxTransmitMSDULifetime; /* 0 2 */
unsigned char abyBSSID[6]; /* 0 6 */
unsigned char abyDesireBSSID[6]; /* 0 6 */
short unsigned int wACKDuration; /* 0 2 */
short unsigned int wRTSTransmitLen; /* 0 2 */
unsigned char byRTSServiceField; /* 0 1 */
unsigned char byRTSSignalField; /* 0 1 */
long unsigned int dwMaxReceiveLifetime; /* 0 4 */
bool bEncryptionEnable; /* 0 1 */
bool bLongHeader; /* 0 1 */
bool bShortSlotTime; /* 0 1 */
bool bProtectMode; /* 0 1 */
bool bNonERPPresent; /* 0 1 */
bool bBarkerPreambleMd; /* 0 1 */
unsigned char byERPFlag; /* 0 1 */
short unsigned int wUseProtectCntDown; /* 0 2 */
bool bRadioControlOff; /* 0 1 */
bool bRadioOff; /* 0 1 */
bool bEnablePSMode; /* 0 1 */
short unsigned int wListenInterval; /* 0 2 */
bool bPWBitOn; /* 0 1 */
WMAC_POWER_MODE ePSMode; /* 0 4 */
unsigned char byRadioCtl; /* 0 1 */
unsigned char byGPIO; /* 0 1 */
bool bHWRadioOff; /* 0 1 */
bool bPrvActive4RadioOFF; /* 0 1 */
bool bGPIOBlockRead; /* 0 1 */
short unsigned int wSeqCounter; /* 0 2 */
short unsigned int wBCNBufLen; /* 0 2 */
bool bBeaconBufReady; /* 0 1 */
bool bBeaconSent; /* 0 1 */
bool bIsBeaconBufReadySet; /* 0 1 */
unsigned int cbBeaconBufReadySetCnt; /* 0 4 */
bool bFixRate; /* 0 1 */
unsigned char byCurrentCh; /* 0 1 */
unsigned int uScanTime; /* 0 4 */
CMD_STATE eCommandState; /* 0 4 */
CMD_CODE eCommand; /* 0 4 */
bool bBeaconTx; /* 0 1 */
bool bStopBeacon; /* 0 1 */
bool bStopDataPkt; /* 0 1 */
bool bStopTx0Pkt; /* 0 1 */
unsigned int uAutoReConnectTime; /* 0 4 */
CMD_ITEM eCmdQueue[32]; /* 0 1408 */
unsigned int uCmdDequeueIdx; /* 0 4 */
unsigned int uCmdEnqueueIdx; /* 0 4 */
unsigned int cbFreeCmdQueue; /* 0 4 */
bool bCmdRunning; /* 0 1 */
bool bCmdClear; /* 0 1 */
bool bRoaming; /* 0 1 */
unsigned char abyIPAddr[4]; /* 0 4 */
long unsigned int ulTxPower; /* 0 4 */
NDIS_802_11_WEP_STATUS eEncryptionStatus; /* 0 4 */
bool bTransmitKey; /* 0 1 */
NDIS_802_11_WEP_STATUS eOldEncryptionStatus; /* 0 4 */
SKeyManagement sKey; /* 0 3784 */
long unsigned int dwIVCounter; /* 0 4 */
u64 qwPacketNumber; /* 0 8 */
unsigned int uCurrentWEPMode; /* 0 4 */
RC4Ext SBox; /* 0 264 */
unsigned char abyPRNG[35]; /* 0 35 */
unsigned char byKeyIndex; /* 0 1 */
unsigned int uKeyLength; /* 0 4 */
unsigned char abyKey[29]; /* 0 29 */
bool bAES; /* 0 1 */
unsigned char byCntMeasure; /* 0 1 */
unsigned int uAssocCount; /* 0 4 */
bool bMoreData; /* 0 1 */
bool bGrpAckPolicy; /* 0 1 */
bool bAssocInfoSet; /* 0 1 */
unsigned char byAutoFBCtrl; /* 0 1 */
bool bTxMICFail; /* 0 1 */
bool bRxMICFail; /* 0 1 */
unsigned int uRATEIdx; /* 0 4 */
bool bUpdateBBVGA; /* 0 1 */
unsigned int uBBVGADiffCount; /* 0 4 */
unsigned char byBBVGANew; /* 0 1 */
unsigned char byBBVGACurrent; /* 0 1 */
unsigned char abyBBVGA[4]; /* 0 4 */
long int ldBmThreshold[4]; /* 0 16 */
unsigned char byBBPreEDRSSI; /* 0 1 */
unsigned char byBBPreEDIndex; /* 0 1 */
bool bRadioCmd; /* 0 1 */
long unsigned int dwDiagRefCount; /* 0 4 */
unsigned char byFOETuning; /* 0 1 */
unsigned char byAutoPwrTunning; /* 0 1 */
short int sPSetPointCCK; /* 0 2 */
short int sPSetPointOFDMG; /* 0 2 */
short int sPSetPointOFDMA; /* 0 2 */
long int lPFormulaOffset; /* 0 4 */
short int sPThreshold; /* 0 2 */
char cAdjustStep; /* 0 1 */
char cMinTxAGC; /* 0 1 */
unsigned char byCCKPwr; /* 0 1 */
unsigned char byOFDMPwrG; /* 0 1 */
unsigned char byCurPwr; /* 0 1 */
char byCurPwrdBm; /* 0 1 */
unsigned char abyCCKPwrTbl[15]; /* 0 15 */
unsigned char abyOFDMPwrTbl[57]; /* 0 57 */
char abyCCKDefaultPwr[15]; /* 0 15 */
char abyOFDMDefaultPwr[57]; /* 0 57 */
char abyRegPwr[57]; /* 0 57 */
char abyLocalPwr[57]; /* 0 57 */
unsigned char byBBCR4d; /* 0 1 */
unsigned char byBBCRc9; /* 0 1 */
unsigned char byBBCR88; /* 0 1 */
unsigned char byBBCR09; /* 0 1 */
struct timer_list sTimerCommand; /* 0 52 */
struct timer_list sTimerTxData; /* 0 52 */
long unsigned int nTxDataTimeCout; /* 0 4 */
bool fTxDataInSleep; /* 0 1 */
bool IsTxDataTrigger; /* 0 1 */
bool fWPA_Authened; /* 0 1 */
unsigned char byReAssocCount; /* 0 1 */
unsigned char byLinkWaitCount; /* 0 1 */
unsigned char abyNodeName[17]; /* 0 17 */
bool bDiversityRegCtlON; /* 0 1 */
bool bDiversityEnable; /* 0 1 */
long unsigned int ulDiversityNValue; /* 0 4 */
long unsigned int ulDiversityMValue; /* 0 4 */
unsigned char byTMax; /* 0 1 */
unsigned char byTMax2; /* 0 1 */
unsigned char byTMax3; /* 0 1 */
long unsigned int ulSQ3TH; /* 0 4 */
long unsigned int uDiversityCnt; /* 0 4 */
unsigned char byAntennaState; /* 0 1 */
long unsigned int ulRatio_State0; /* 0 4 */
long unsigned int ulRatio_State1; /* 0 4 */
struct timer_list TimerSQ3Tmax1; /* 0 52 */
struct timer_list TimerSQ3Tmax2; /* 0 52 */
struct timer_list TimerSQ3Tmax3; /* 0 52 */
long unsigned int uNumSQ3[12]; /* 0 48 */
short unsigned int wAntDiversityMaxRate; /* 0 2 */
SEthernetHeader sTxEthHeader; /* 0 14 */
SEthernetHeader sRxEthHeader; /* 0 14 */
unsigned char abyBroadcastAddr[6]; /* 0 6 */
unsigned char abySNAP_RFC1042[6]; /* 0 6 */
unsigned char abySNAP_Bridgetunnel[6]; /* 0 6 */
unsigned char abyEEPROM[256]; /* 0 256 */
SPMKID gsPMKID; /* 0 360 */
SPMKIDCandidateEvent gsPMKIDCandidate; /* 0 72 */
bool b11hEnable; /* 0 1 */
unsigned char abyCountryCode[3]; /* 0 3 */
unsigned int uNumOfMeasureEIDs; /* 0 4 */
PWLAN_IE_MEASURE_REQ pCurrMeasureEID; /* 0 4 */
bool bMeasureInProgress; /* 0 1 */
unsigned char byOrgChannel; /* 0 1 */
unsigned char byOrgRCR; /* 0 1 */
long unsigned int dwOrgMAR0; /* 0 4 */
long unsigned int dwOrgMAR4; /* 0 4 */
unsigned char byBasicMap; /* 0 1 */
unsigned char byCCAFraction; /* 0 1 */
unsigned char abyRPIs[8]; /* 0 8 */
long unsigned int dwRPIs[8]; /* 0 32 */
bool bChannelSwitch; /* 0 1 */
unsigned char byNewChannel; /* 0 1 */
unsigned char byChannelSwitchCount; /* 0 1 */
bool bQuietEnable; /* 0 1 */
bool bEnableFirstQuiet; /* 0 1 */
unsigned char byQuietStartCount; /* 0 1 */
unsigned int uQuietEnqueue; /* 0 4 */
long unsigned int dwCurrentQuietEndTime; /* 0 4 */
SQuietControl sQuiet[8]; /* 0 96 */
bool bCountryInfo5G; /* 0 1 */
bool bCountryInfo24G; /* 0 1 */
short unsigned int wBeaconInterval; /* 0 2 */
struct net_device * wpadev; /* 0 4 */
bool bWPADEVUp; /* 0 1 */
struct sk_buff * skb; /* 0 4 */
unsigned int bwextcount; /* 0 4 */
bool bWPASuppWextEnabled; /* 0 1 */
bool bEnableHostapd; /* 0 1 */
bool bEnable8021x; /* 0 1 */
bool bEnableHostWEP; /* 0 1 */
struct net_device * apdev; /* 0 4 */
int (*tx_80211)(struct sk_buff *,
struct net_device *); /* 0 4 */
unsigned int uChannel; /* 0 4 */
bool bMACSuspend; /* 0 1 */
struct iw_statistics wstats; /* 0 32 */
bool bCommit; /* 0 1 */
/*--- cacheline 1672 boundary (107008 bytes) ---*/
/* size: 107008, cachelines: 1672, members: 279 */
/* sum members: 107005, holes: 1, sum holes: 3 */
/* padding: 41471 */
/* BRAIN FART ALERT! 107008 != 107005 + 3(holes), diff = 0 */
};
struct vnt_mic_hdr {
u8 id; /* 0 1 */
u8 tx_priority; /* 1 1 */
u8 mic_addr2[6]; /* 2 6 */
u8 ccmp_pn[6]; /* 8 6 */
__be16 payload_len; /* 14 2 */
__be16 hlen; /* 16 2 */
__le16 frame_control; /* 18 2 */
u8 addr1[6]; /* 20 6 */
u8 addr2[6]; /* 26 6 */
u8 addr3[6]; /* 32 6 */
__le16 seq_ctrl; /* 38 2 */
u8 addr4[6]; /* 40 6 */
u16 packing; /* 46 2 */
/* size: 48, cachelines: 1, members: 13 */
/* last cacheline: 48 bytes */
};
struct vnt_rts_g {
struct vnt_phy_field b; /* 0 4 */
struct vnt_phy_field a; /* 4 4 */
__le16 duration_ba; /* 8 2 */
__le16 duration_aa; /* 10 2 */
__le16 duration_bb; /* 12 2 */
u16 reserved; /* 14 2 */
struct ieee80211_rts data; /* 16 16 */
/* size: 32, cachelines: 1, members: 7 */
/* last cacheline: 32 bytes */
};
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-10 18:42:45 -06:00
|
|
|
spinlock_t lock;
|
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
int nTxQueues;
|
|
|
|
volatile int iTDUsed[TYPE_MAXTD];
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
volatile PSTxDesc apCurrTD[TYPE_MAXTD];
|
|
|
|
volatile PSTxDesc apTailTD[TYPE_MAXTD];
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
volatile PSTxDesc apTD0Rings;
|
|
|
|
volatile PSTxDesc apTD1Rings;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
volatile PSRxDesc aRD0Ring;
|
|
|
|
volatile PSRxDesc aRD1Ring;
|
|
|
|
volatile PSRxDesc pCurrRD[TYPE_MAXRD];
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
SDeFragControlBlock sRxDFCB[CB_MAX_RX_FRAG];
|
|
|
|
unsigned int cbDFCB;
|
|
|
|
unsigned int cbFreeDFCB;
|
|
|
|
unsigned int uCurrentDFCBIdx;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
OPTIONS sOpts;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
u32 flags;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
u32 rx_buf_sz;
|
2014-10-29 11:43:36 -06:00
|
|
|
u8 rx_rate;
|
2013-03-18 11:44:45 -06:00
|
|
|
int multicast_limit;
|
2014-07-28 14:43:28 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
u32 rx_bytes;
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* Version control */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byLocalID;
|
|
|
|
unsigned char byRFType;
|
|
|
|
|
|
|
|
unsigned char byMaxPwrLevel;
|
|
|
|
unsigned char byZoneType;
|
|
|
|
bool bZoneRegExist;
|
|
|
|
unsigned char byOriginalZonetype;
|
2014-10-29 11:55:59 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char abyCurrentNetAddr[ETH_ALEN];
|
2014-10-25 14:26:56 -06:00
|
|
|
bool bLinkPass; /* link status: OK or fail */
|
2013-03-18 11:44:45 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* Adapter statistics */
|
2013-03-18 11:44:45 -06:00
|
|
|
SStatCounter scStatistic;
|
2014-10-25 14:26:56 -06:00
|
|
|
/* 802.11 counter */
|
2013-03-18 11:44:45 -06:00
|
|
|
SDot11Counters s802_11Counter;
|
|
|
|
|
|
|
|
unsigned int uCurrRSSI;
|
|
|
|
unsigned char byCurrSQ;
|
|
|
|
|
|
|
|
unsigned long dwTxAntennaSel;
|
|
|
|
unsigned long dwRxAntennaSel;
|
|
|
|
unsigned char byAntennaCount;
|
|
|
|
unsigned char byRxAntennaMode;
|
|
|
|
unsigned char byTxAntennaMode;
|
|
|
|
bool bTxRxAntInv;
|
|
|
|
|
|
|
|
unsigned char *pbyTmpBuff;
|
2014-10-25 14:26:56 -06:00
|
|
|
unsigned int uSIFS; /* Current SIFS */
|
|
|
|
unsigned int uDIFS; /* Current DIFS */
|
|
|
|
unsigned int uEIFS; /* Current EIFS */
|
|
|
|
unsigned int uSlot; /* Current SlotTime */
|
|
|
|
unsigned int uCwMin; /* Current CwMin */
|
|
|
|
unsigned int uCwMax; /* CwMax is fixed on 1023. */
|
|
|
|
/* PHY parameter */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char bySIFS;
|
|
|
|
unsigned char byDIFS;
|
|
|
|
unsigned char byEIFS;
|
|
|
|
unsigned char bySlot;
|
|
|
|
unsigned char byCWMaxMin;
|
2014-10-25 14:26:56 -06:00
|
|
|
CARD_PHY_TYPE eCurrentPHYType;
|
|
|
|
|
|
|
|
VIA_BB_TYPE byBBType; /* 0:11A, 1:11B, 2:11G */
|
|
|
|
VIA_PKT_TYPE byPacketType; /*
|
|
|
|
* 0:11a,1:11b,2:11gb (only CCK
|
|
|
|
* in BasicRate), 3:11ga (OFDM in
|
|
|
|
* Basic Rate)
|
|
|
|
*/
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned short wBasicRate;
|
|
|
|
unsigned char byACKRate;
|
|
|
|
unsigned char byTopOFDMBasicRate;
|
|
|
|
unsigned char byTopCCKBasicRate;
|
|
|
|
|
|
|
|
unsigned char byMinChannel;
|
|
|
|
unsigned char byMaxChannel;
|
|
|
|
unsigned int uConnectionRate;
|
|
|
|
|
|
|
|
unsigned char byPreambleType;
|
|
|
|
unsigned char byShortPreamble;
|
|
|
|
|
|
|
|
unsigned short wCurrentRate;
|
|
|
|
unsigned short wRTSThreshold;
|
|
|
|
unsigned short wFragmentationThreshold;
|
|
|
|
unsigned char byShortRetryLimit;
|
|
|
|
unsigned char byLongRetryLimit;
|
2014-08-30 15:25:49 -06:00
|
|
|
enum nl80211_iftype op_mode;
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byOpMode;
|
|
|
|
bool bBSSIDFilter;
|
|
|
|
unsigned short wMaxTransmitMSDULifetime;
|
|
|
|
|
|
|
|
bool bEncryptionEnable;
|
|
|
|
bool bLongHeader;
|
|
|
|
bool bShortSlotTime;
|
|
|
|
bool bProtectMode;
|
|
|
|
bool bNonERPPresent;
|
|
|
|
bool bBarkerPreambleMd;
|
|
|
|
|
|
|
|
bool bRadioControlOff;
|
|
|
|
bool bRadioOff;
|
|
|
|
bool bEnablePSMode;
|
|
|
|
unsigned short wListenInterval;
|
|
|
|
bool bPWBitOn;
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* GPIO Radio Control */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byRadioCtl;
|
|
|
|
unsigned char byGPIO;
|
|
|
|
bool bHWRadioOff;
|
|
|
|
bool bPrvActive4RadioOFF;
|
|
|
|
bool bGPIOBlockRead;
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* Beacon related */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned short wSeqCounter;
|
|
|
|
unsigned short wBCNBufLen;
|
|
|
|
bool bBeaconBufReady;
|
|
|
|
bool bBeaconSent;
|
|
|
|
bool bIsBeaconBufReadySet;
|
|
|
|
unsigned int cbBeaconBufReadySetCnt;
|
|
|
|
bool bFixRate;
|
|
|
|
unsigned char byCurrentCh;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
bool bAES;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byAutoFBCtrl;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* For Update BaseBand VGA Gain Offset */
|
2013-03-18 11:44:45 -06:00
|
|
|
bool bUpdateBBVGA;
|
|
|
|
unsigned int uBBVGADiffCount;
|
|
|
|
unsigned char byBBVGANew;
|
|
|
|
unsigned char byBBVGACurrent;
|
|
|
|
unsigned char abyBBVGA[BB_VGA_LEVEL];
|
|
|
|
long ldBmThreshold[BB_VGA_LEVEL];
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byBBPreEDRSSI;
|
|
|
|
unsigned char byBBPreEDIndex;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned long dwDiagRefCount;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* For FOE Tuning */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byFOETuning;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* For RF Power table */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byCCKPwr;
|
|
|
|
unsigned char byOFDMPwrG;
|
|
|
|
unsigned char byCurPwr;
|
|
|
|
char byCurPwrdBm;
|
|
|
|
unsigned char abyCCKPwrTbl[CB_MAX_CHANNEL_24G+1];
|
|
|
|
unsigned char abyOFDMPwrTbl[CB_MAX_CHANNEL+1];
|
|
|
|
char abyCCKDefaultPwr[CB_MAX_CHANNEL_24G+1];
|
|
|
|
char abyOFDMDefaultPwr[CB_MAX_CHANNEL+1];
|
|
|
|
char abyRegPwr[CB_MAX_CHANNEL+1];
|
|
|
|
char abyLocalPwr[CB_MAX_CHANNEL+1];
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* BaseBand Loopback Use */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned char byBBCR4d;
|
|
|
|
unsigned char byBBCRc9;
|
|
|
|
unsigned char byBBCR88;
|
|
|
|
unsigned char byBBCR09;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-03-18 11:44:45 -06:00
|
|
|
bool bDiversityRegCtlON;
|
|
|
|
bool bDiversityEnable;
|
|
|
|
unsigned long ulDiversityNValue;
|
|
|
|
unsigned long ulDiversityMValue;
|
|
|
|
unsigned char byTMax;
|
|
|
|
unsigned char byTMax2;
|
|
|
|
unsigned char byTMax3;
|
|
|
|
unsigned long ulSQ3TH;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* ANT diversity */
|
2013-03-18 11:44:45 -06:00
|
|
|
unsigned long uDiversityCnt;
|
|
|
|
unsigned char byAntennaState;
|
|
|
|
unsigned long ulRatio_State0;
|
|
|
|
unsigned long ulRatio_State1;
|
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* SQ3 functions for antenna diversity */
|
2013-03-18 11:44:45 -06:00
|
|
|
struct timer_list TimerSQ3Tmax1;
|
|
|
|
struct timer_list TimerSQ3Tmax2;
|
|
|
|
struct timer_list TimerSQ3Tmax3;
|
|
|
|
|
|
|
|
unsigned long uNumSQ3[MAX_RATE];
|
|
|
|
unsigned short wAntDiversityMaxRate;
|
|
|
|
|
|
|
|
unsigned char abyBroadcastAddr[ETH_ALEN];
|
|
|
|
unsigned char abySNAP_RFC1042[ETH_ALEN];
|
|
|
|
unsigned char abySNAP_Bridgetunnel[ETH_ALEN];
|
2014-10-25 14:26:56 -06:00
|
|
|
unsigned char abyEEPROM[EEP_MAX_CONTEXT_SIZE]; /* unsigned long alignment */
|
2013-03-18 11:44:45 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
/* for 802.11h */
|
2013-03-18 11:44:45 -06:00
|
|
|
bool b11hEnable;
|
|
|
|
|
|
|
|
unsigned short wBeaconInterval;
|
|
|
|
|
|
|
|
unsigned int uChannel;
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2014-10-25 14:26:56 -06:00
|
|
|
struct iw_statistics wstats; /* wireless stats */
|
2014-08-10 08:47:03 -06:00
|
|
|
};
|
2009-04-25 08:30:44 -06:00
|
|
|
|
2013-01-08 10:52:33 -07:00
|
|
|
static inline PDEVICE_RD_INFO alloc_rd_info(void)
|
|
|
|
{
|
|
|
|
return kzalloc(sizeof(DEVICE_RD_INFO), GFP_ATOMIC);
|
2009-04-25 08:30:44 -06:00
|
|
|
}
|
|
|
|
|
2013-01-08 10:52:34 -07:00
|
|
|
static inline PDEVICE_TD_INFO alloc_td_info(void)
|
|
|
|
{
|
|
|
|
return kzalloc(sizeof(DEVICE_TD_INFO), GFP_ATOMIC);
|
2009-04-25 08:30:44 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/*--------------------- Export Functions --------------------------*/
|
|
|
|
|
2014-08-10 08:46:55 -06:00
|
|
|
bool device_alloc_frag_buf(struct vnt_private *pDevice,
|
|
|
|
PSDeFragControlBlock pDeF);
|
2009-04-25 08:30:44 -06:00
|
|
|
#endif
|