blob: 4832666cc580eca1b417f4132a115f244b1b0363 [file] [log] [blame]
Forest Bond92b96792009-06-13 07:38:31 -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 *
Forest Bond92b96792009-06-13 07:38:31 -040015 *
16 * File: device.h
17 *
18 * Purpose: MAC Data structure
19 *
20 * Author: Tevin Chen
21 *
22 * Date: Mar 17, 1997
23 *
24 */
25
26#ifndef __DEVICE_H__
27#define __DEVICE_H__
28
Forest Bond92b96792009-06-13 07:38:31 -040029#include <linux/module.h>
Forest Bond92b96792009-06-13 07:38:31 -040030#include <linux/kernel.h>
Forest Bond92b96792009-06-13 07:38:31 -040031#include <linux/slab.h>
Malcolm Priestley11d404c2012-11-24 14:19:34 +000032#include <linux/delay.h>
33#include <linux/device.h>
Ben Hutchings31d5bbf2011-01-09 04:16:48 +000034#include <linux/firmware.h>
Malcolm Priestley11d404c2012-11-24 14:19:34 +000035#include <linux/suspend.h>
36#include <linux/if_arp.h>
37#include <linux/wireless.h>
Malcolm Priestley11d404c2012-11-24 14:19:34 +000038#include <linux/timer.h>
39#include <linux/usb.h>
Malcolm Priestleyf0fde112013-11-03 19:02:41 +000040#include <linux/crc32.h>
Malcolm Priestley63b99072014-06-25 21:14:22 +010041#include <net/mac80211.h>
Malcolm Priestley11d404c2012-11-24 14:19:34 +000042
Forest Bond92b96792009-06-13 07:38:31 -040043#ifdef SIOCETHTOOL
44#define DEVICE_ETHTOOL_IOCTL_SUPPORT
45#include <linux/ethtool.h>
46#else
47#undef DEVICE_ETHTOOL_IOCTL_SUPPORT
48#endif
Forest Bond92b96792009-06-13 07:38:31 -040049
Malcolm Priestleyf07e9fb2014-06-25 21:14:34 +010050#define RATE_1M 0
51#define RATE_2M 1
52#define RATE_5M 2
53#define RATE_11M 3
54#define RATE_6M 4
55#define RATE_9M 5
56#define RATE_12M 6
57#define RATE_18M 7
58#define RATE_24M 8
59#define RATE_36M 9
60#define RATE_48M 10
61#define RATE_54M 11
62#define RATE_AUTO 12
63
Malcolm Priestley4aeaf152014-05-17 09:50:24 +010064#define MAX_RATE 12
65
Andres Mored3e23952013-01-31 15:57:19 -050066/*
67 * device specific
68 */
Forest Bond92b96792009-06-13 07:38:31 -040069
Forest Bond92b96792009-06-13 07:38:31 -040070#include "wcmd.h"
Forest Bond92b96792009-06-13 07:38:31 -040071#include "desc.h"
Forest Bond92b96792009-06-13 07:38:31 -040072#include "key.h"
Forest Bond92b96792009-06-13 07:38:31 -040073#include "card.h"
Forest Bond92b96792009-06-13 07:38:31 -040074
Otavio Salvador5008c452009-10-12 23:47:36 -030075#define VNT_USB_VENDOR_ID 0x160a
Forest Bond92b96792009-06-13 07:38:31 -040076#define VNT_USB_PRODUCT_ID 0x3184
77
Malcolm Priestley4aeaf152014-05-17 09:50:24 +010078#define DEVICE_NAME "vt6656"
79#define DEVICE_FULL_DRV_NAM "VIA Networking Wireless LAN USB Driver"
80
Malcolm Priestleyfeab4812014-07-25 20:51:52 +010081#define DEVICE_VERSION "mac80211"
Malcolm Priestley4aeaf152014-05-17 09:50:24 +010082
83#define CONFIG_PATH "/etc/vntconfiguration.dat"
84
85#define MAX_UINTS 8
86#define OPTION_DEFAULT { [0 ... MAX_UINTS-1] = -1}
87
Forest Bond92b96792009-06-13 07:38:31 -040088#define DUPLICATE_RX_CACHE_LENGTH 5
89
Forest Bond92b96792009-06-13 07:38:31 -040090#define AUTO_FB_NONE 0
91#define AUTO_FB_0 1
92#define AUTO_FB_1 2
93
94#define FB_RATE0 0
95#define FB_RATE1 1
96
Andres Mored3e23952013-01-31 15:57:19 -050097/* Antenna Mode */
Forest Bond92b96792009-06-13 07:38:31 -040098#define ANT_A 0
99#define ANT_B 1
100#define ANT_DIVERSITY 2
101#define ANT_RXD_TXA 3
102#define ANT_RXD_TXB 4
103#define ANT_UNKNOWN 0xFF
104#define ANT_TXA 0
105#define ANT_TXB 1
106#define ANT_RXA 2
107#define ANT_RXB 3
108
Forest Bond92b96792009-06-13 07:38:31 -0400109#define BB_VGA_LEVEL 4
110#define BB_VGA_CHANGE_THRESHOLD 3
111
Malcolm Priestley15baf4f2014-05-17 09:50:28 +0100112#define EEP_MAX_CONTEXT_SIZE 256
113
114/* Contents in the EEPROM */
115#define EEP_OFS_PAR 0x0
116#define EEP_OFS_ANTENNA 0x17
117#define EEP_OFS_RADIOCTL 0x18
118#define EEP_OFS_RFTYPE 0x1b
119#define EEP_OFS_MINCHANNEL 0x1c
120#define EEP_OFS_MAXCHANNEL 0x1d
121#define EEP_OFS_SIGNATURE 0x1e
122#define EEP_OFS_ZONETYPE 0x1f
123#define EEP_OFS_RFTABLE 0x20
124#define EEP_OFS_PWR_CCK 0x20
125#define EEP_OFS_SETPT_CCK 0x21
126#define EEP_OFS_PWR_OFDMG 0x23
127
128#define EEP_OFS_CALIB_TX_IQ 0x24
129#define EEP_OFS_CALIB_TX_DC 0x25
130#define EEP_OFS_CALIB_RX_IQ 0x26
131
132#define EEP_OFS_MAJOR_VER 0x2e
133#define EEP_OFS_MINOR_VER 0x2f
134
135#define EEP_OFS_CCK_PWR_TBL 0x30
136#define EEP_OFS_OFDM_PWR_TBL 0x40
137#define EEP_OFS_OFDMA_PWR_TBL 0x50
138
139/* Bits in EEP_OFS_ANTENNA */
140#define EEP_ANTENNA_MAIN 0x1
141#define EEP_ANTENNA_AUX 0x2
142#define EEP_ANTINV 0x4
143
144/* Bits in EEP_OFS_RADIOCTL */
145#define EEP_RADIOCTL_ENABLE 0x80
146
Malcolm Priestley60f8ce82014-05-17 09:50:30 +0100147/* control commands */
148#define MESSAGE_TYPE_READ 0x1
149#define MESSAGE_TYPE_WRITE 0x0
150#define MESSAGE_TYPE_LOCK_OR 0x2
151#define MESSAGE_TYPE_LOCK_AND 0x3
152#define MESSAGE_TYPE_WRITE_MASK 0x4
153#define MESSAGE_TYPE_CARDINIT 0x5
154#define MESSAGE_TYPE_INIT_RSP 0x6
155#define MESSAGE_TYPE_MACSHUTDOWN 0x7
156#define MESSAGE_TYPE_SETKEY 0x8
157#define MESSAGE_TYPE_CLRKEYENTRY 0x9
158#define MESSAGE_TYPE_WRITE_MISCFF 0xa
159#define MESSAGE_TYPE_SET_ANTMD 0xb
Gustavo A. R. Silva733b3b02015-01-11 16:35:54 -0600160#define MESSAGE_TYPE_SELECT_CHANNEL 0xc
Malcolm Priestley60f8ce82014-05-17 09:50:30 +0100161#define MESSAGE_TYPE_SET_TSFTBTT 0xd
162#define MESSAGE_TYPE_SET_SSTIFS 0xe
163#define MESSAGE_TYPE_CHANGE_BBTYPE 0xf
164#define MESSAGE_TYPE_DISABLE_PS 0x10
165#define MESSAGE_TYPE_WRITE_IFRF 0x11
166
167/* command read/write(index) */
168#define MESSAGE_REQUEST_MEM 0x1
169#define MESSAGE_REQUEST_BBREG 0x2
170#define MESSAGE_REQUEST_MACREG 0x3
171#define MESSAGE_REQUEST_EEPROM 0x4
172#define MESSAGE_REQUEST_TSF 0x5
173#define MESSAGE_REQUEST_TBTT 0x6
174#define MESSAGE_REQUEST_BBAGC 0x7
175#define MESSAGE_REQUEST_VERSION 0x8
176#define MESSAGE_REQUEST_RF_INIT 0x9
177#define MESSAGE_REQUEST_RF_INIT2 0xa
178#define MESSAGE_REQUEST_RF_CH0 0xb
179#define MESSAGE_REQUEST_RF_CH1 0xc
180#define MESSAGE_REQUEST_RF_CH2 0xd
181
182/* USB registers */
183#define USB_REG4 0x604
184
Malcolm Priestley302433d2013-11-03 17:40:51 +0000185#define DEVICE_INIT_COLD 0x0 /* cold init */
186#define DEVICE_INIT_RESET 0x1 /* reset init or Dx to D0 power remain */
187#define DEVICE_INIT_DXPL 0x2 /* Dx to D0 power lost init */
Forest Bond92b96792009-06-13 07:38:31 -0400188
Malcolm Priestley60f8ce82014-05-17 09:50:30 +0100189/* Device init */
190struct vnt_cmd_card_init {
191 u8 init_class;
192 u8 exist_sw_net_addr;
193 u8 sw_net_addr[6];
194 u8 short_retry_limit;
195 u8 long_retry_limit;
196};
197
198struct vnt_rsp_card_init {
199 u8 status;
200 u8 net_addr[6];
201 u8 rf_type;
202 u8 min_channel;
203 u8 max_channel;
204};
205
Andres Mored3e23952013-01-31 15:57:19 -0500206/* USB */
Forest Bond92b96792009-06-13 07:38:31 -0400207
Andres Mored3e23952013-01-31 15:57:19 -0500208/*
209 * Enum of context types for SendPacket
210 */
Malcolm Priestley1450ba62014-02-19 21:56:33 +0000211enum {
212 CONTEXT_DATA_PACKET = 1,
Malcolm Priestleyd38b13a2014-06-25 21:14:23 +0100213 CONTEXT_MGMT_PACKET,
214 CONTEXT_BEACON_PACKET
Malcolm Priestley1450ba62014-02-19 21:56:33 +0000215};
Forest Bond92b96792009-06-13 07:38:31 -0400216
Andres Mored3e23952013-01-31 15:57:19 -0500217/* RCB (Receive Control Block) */
Malcolm Priestley115cac22013-08-28 21:12:35 +0100218struct vnt_rcb {
Malcolm Priestley325de982014-07-18 06:36:11 +0100219 void *priv;
220 struct urb *urb;
Malcolm Priestleydd0a7742012-12-10 21:59:10 +0000221 struct sk_buff *skb;
Malcolm Priestley325de982014-07-18 06:36:11 +0100222 int in_use;
Malcolm Priestley115cac22013-08-28 21:12:35 +0100223};
Forest Bond92b96792009-06-13 07:38:31 -0400224
Andres Mored3e23952013-01-31 15:57:19 -0500225/* used to track bulk out irps */
Malcolm Priestleydcdf1d02013-08-27 12:41:50 +0100226struct vnt_usb_send_context {
Malcolm Priestley30a05b32014-05-15 22:49:11 +0100227 void *priv;
228 struct sk_buff *skb;
229 struct urb *urb;
Malcolm Priestley1622c8f2014-05-31 13:34:58 +0100230 struct ieee80211_hdr *hdr;
Malcolm Priestley30a05b32014-05-15 22:49:11 +0100231 unsigned int buf_len;
Malcolm Priestley0f5567c2014-07-20 15:33:33 +0100232 u32 frame_len;
Malcolm Priestley1622c8f2014-05-31 13:34:58 +0100233 u16 tx_hdr_size;
Malcolm Priestley798f0602014-07-20 15:33:34 +0100234 u16 tx_rate;
Malcolm Priestley1450ba62014-02-19 21:56:33 +0000235 u8 type;
Malcolm Priestley71d764a2014-07-05 19:24:27 +0100236 u8 pkt_no;
Malcolm Priestleye8c98752014-07-20 15:33:31 +0100237 u8 pkt_type;
Malcolm Priestley2eca8db2014-07-20 15:33:32 +0100238 u8 need_ack;
Malcolm Priestley71d764a2014-07-05 19:24:27 +0100239 u8 fb_option;
Malcolm Priestley30a05b32014-05-15 22:49:11 +0100240 bool in_use;
241 unsigned char data[MAX_TOTAL_SIZE_WITH_ALL_HEADERS];
Malcolm Priestleydcdf1d02013-08-27 12:41:50 +0100242};
Forest Bond92b96792009-06-13 07:38:31 -0400243
Andres Mored3e23952013-01-31 15:57:19 -0500244/*
245 * Structure to keep track of USB interrupt packets
246 */
Malcolm Priestleyf764e002014-02-19 18:39:09 +0000247struct vnt_interrupt_buffer {
248 u8 *data_buf;
249 bool in_use;
250};
Forest Bond92b96792009-06-13 07:38:31 -0400251
Andres Mored3e23952013-01-31 15:57:19 -0500252/*++ NDIS related */
Forest Bond92b96792009-06-13 07:38:31 -0400253
Peter Senna Tschudin879be452014-07-16 18:13:43 +0200254enum {
255 STATUS_SUCCESS = 0,
256 STATUS_FAILURE,
257 STATUS_RESOURCES,
258 STATUS_PENDING,
259};
Forest Bond92b96792009-06-13 07:38:31 -0400260
Andres Mored3e23952013-01-31 15:57:19 -0500261/* flags for options */
Alexey Tuliae7bda762015-11-21 15:36:47 +0300262#define DEVICE_FLAGS_UNPLUG 0
263#define DEVICE_FLAGS_DISCONNECTED 1
Forest Bond92b96792009-06-13 07:38:31 -0400264
Malcolm Priestley14c5ef52013-01-17 23:19:37 +0000265struct vnt_private {
Malcolm Priestley63b99072014-06-25 21:14:22 +0100266 /* mac80211 */
267 struct ieee80211_hw *hw;
Malcolm Priestleydb8f37f2014-06-25 21:14:25 +0100268 struct ieee80211_vif *vif;
Malcolm Priestley30816f82014-06-25 21:14:27 +0100269 u8 mac_hw;
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000270 /* netdev */
271 struct usb_device *usb;
Forest Bond92b96792009-06-13 07:38:31 -0400272
Malcolm Priestley63b99072014-06-25 21:14:22 +0100273 u64 tsf_time;
274 u8 rx_rate;
275
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000276 u32 rx_buf_sz;
Malcolm Priestleydb8f37f2014-06-25 21:14:25 +0100277 int mc_list_count;
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000278
279 spinlock_t lock;
Malcolm Priestleyc91b1862014-05-15 22:49:19 +0100280 struct mutex usb_lock;
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000281
Malcolm Priestley27463212014-07-24 21:13:16 +0100282 unsigned long flags;
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000283
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000284 /* USB */
Malcolm Priestley3d582482014-07-18 06:36:14 +0100285 struct urb *interrupt_urb;
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000286 u32 int_interval;
Forest Bond92b96792009-06-13 07:38:31 -0400287
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000288 /* Variables to track resources for the BULK In Pipe */
Malcolm Priestley85770112014-07-18 06:36:15 +0100289 struct vnt_rcb *rcb[CB_MAX_RX_DESC];
Malcolm Priestley6da47382014-07-19 12:30:03 +0100290 u32 num_rcb;
Forest Bond92b96792009-06-13 07:38:31 -0400291
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000292 /* Variables to track resources for the BULK Out Pipe */
Malcolm Priestleyf7e4a8f2014-07-18 06:36:16 +0100293 struct vnt_usb_send_context *tx_context[CB_MAX_TX_DESC];
Malcolm Priestley03b7e352014-07-19 12:30:04 +0100294 u32 num_tx_context;
Forest Bond92b96792009-06-13 07:38:31 -0400295
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000296 /* Variables to track resources for the Interrupt In Pipe */
Malcolm Priestleyf764e002014-02-19 18:39:09 +0000297 struct vnt_interrupt_buffer int_buf;
Forest Bond92b96792009-06-13 07:38:31 -0400298
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000299 /* Version control */
Malcolm Priestley8a73f9d2014-07-19 12:30:05 +0100300 u16 firmware_version;
Malcolm Priestleyf1945a12014-07-19 12:30:06 +0100301 u8 local_id;
Malcolm Priestley6242eca2014-07-19 12:30:07 +0100302 u8 rf_type;
Malcolm Priestleycd5856a2014-07-19 12:30:08 +0100303 u8 bb_rx_conf;
Forest Bond92b96792009-06-13 07:38:31 -0400304
Malcolm Priestley748bf692013-11-03 17:49:32 +0000305 struct vnt_cmd_card_init init_command;
306 struct vnt_rsp_card_init init_response;
Krzysztof Adamskie2382232014-12-09 12:01:38 +0100307 u8 current_net_addr[ETH_ALEN] __aligned(2);
308 u8 permanent_net_addr[ETH_ALEN] __aligned(2);
Forest Bond92b96792009-06-13 07:38:31 -0400309
Malcolm Priestley35cc8f92014-07-19 12:30:12 +0100310 u8 exist_sw_net_addr;
Forest Bond92b96792009-06-13 07:38:31 -0400311
Malcolm Priestley113f0b92014-07-19 12:30:13 +0100312 u64 current_tsf;
Forest Bond92b96792009-06-13 07:38:31 -0400313
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000314 /* 802.11 MAC specific */
Malcolm Priestley125cfc62014-07-19 12:30:14 +0100315 u32 current_rssi;
Forest Bond92b96792009-06-13 07:38:31 -0400316
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000317 /* Antenna Diversity */
Malcolm Priestley2044dbd2014-07-19 12:30:16 +0100318 int tx_rx_ant_inv;
319 u32 rx_antenna_sel;
320 u8 rx_antenna_mode;
321 u8 tx_antenna_mode;
322 u8 radio_ctl;
Forest Bond92b96792009-06-13 07:38:31 -0400323
Andres Morecc856e62010-05-17 21:34:01 -0300324 /* IFS & Cw */
Malcolm Priestleyff5fee22014-07-19 12:30:18 +0100325 u32 sifs; /* Current SIFS */
326 u32 difs; /* Current DIFS */
327 u32 eifs; /* Current EIFS */
328 u32 slot; /* Current SlotTime */
Andres Morecc856e62010-05-17 21:34:01 -0300329
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000330 /* Rate */
Malcolm Priestley65df77e2014-07-20 15:33:11 +0100331 u8 bb_type; /* 0: 11A, 1:11B, 2:11G */
Malcolm Priestleye12471d2014-07-20 15:33:12 +0100332 u8 packet_type; /* 0:11a 1:11b 2:11gb 3:11ga */
Malcolm Priestley93a73552014-07-20 15:33:13 +0100333 u32 basic_rates;
Malcolm Priestley3c8a5b22014-07-20 15:33:14 +0100334 u8 top_ofdm_basic_rate;
Malcolm Priestleyd80bf432014-07-20 15:33:15 +0100335 u8 top_cck_basic_rate;
Forest Bond92b96792009-06-13 07:38:31 -0400336
Malcolm Priestleybbb11262014-07-20 15:33:16 +0100337 u8 eeprom[EEP_MAX_CONTEXT_SIZE]; /*u32 alignment */
Forest Bond92b96792009-06-13 07:38:31 -0400338
Malcolm Priestley98e93fe2014-07-20 15:33:17 +0100339 u8 preamble_type;
Forest Bond92b96792009-06-13 07:38:31 -0400340
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000341 /* For RF Power table */
Malcolm Priestley5a974912014-07-20 15:33:18 +0100342 u8 cck_pwr;
343 u8 ofdm_pwr_g;
344 u8 ofdm_pwr_a;
345 u8 power;
346 u8 cck_pwr_tbl[14];
347 u8 ofdm_pwr_tbl[14];
348 u8 ofdm_a_pwr_tbl[42];
Forest Bond92b96792009-06-13 07:38:31 -0400349
Malcolm Priestley8b84c1d2014-07-20 15:33:19 +0100350 u16 current_rate;
Malcolm Priestleyf84cdf62013-10-15 21:00:09 +0100351 u16 tx_rate_fb0;
352 u16 tx_rate_fb1;
353
Malcolm Priestley388e5cb2014-07-20 15:33:20 +0100354 u8 short_retry_limit;
355 u8 long_retry_limit;
Malcolm Priestleya0ad2772014-02-15 21:56:20 +0000356
357 enum nl80211_iftype op_mode;
358
Malcolm Priestleya641c9e2014-07-20 15:33:21 +0100359 int short_slot_time;
Forest Bond92b96792009-06-13 07:38:31 -0400360
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000361 /* Power save */
Malcolm Priestleydb8f37f2014-06-25 21:14:25 +0100362 u16 current_aid;
Forest Bond92b96792009-06-13 07:38:31 -0400363
Colin Cronin59082602015-05-14 23:33:34 -0700364 /* Beacon related */
Malcolm Priestley1b2bc0a2014-07-20 15:33:23 +0100365 u16 seq_counter;
Forest Bond92b96792009-06-13 07:38:31 -0400366
Malcolm Priestleyad74e912014-07-13 10:42:42 +0100367 enum vnt_cmd_state command_state;
Forest Bond92b96792009-06-13 07:38:31 -0400368
Malcolm Priestley80f0d092014-07-13 10:42:41 +0100369 enum vnt_cmd command;
Forest Bond92b96792009-06-13 07:38:31 -0400370
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000371 /* 802.11 counter */
Forest Bond92b96792009-06-13 07:38:31 -0400372
Malcolm Priestleyb595f9b2014-07-13 10:42:43 +0100373 enum vnt_cmd cmd_queue[CMD_Q_SIZE];
Malcolm Priestley33a60b82014-07-13 10:42:45 +0100374 u32 cmd_dequeue_idx;
375 u32 cmd_enqueue_idx;
376 u32 free_cmd_queue;
377 int cmd_running;
Forest Bond92b96792009-06-13 07:38:31 -0400378
Malcolm Priestleyd1eb5002014-06-25 21:14:24 +0100379 unsigned long key_entry_inuse;
Forest Bond92b96792009-06-13 07:38:31 -0400380
Malcolm Priestleya6177ae2014-07-20 15:33:24 +0100381 u8 auto_fb_ctrl;
Forest Bond92b96792009-06-13 07:38:31 -0400382
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000383 /* For Update BaseBand VGA Gain Offset */
Malcolm Priestleyc37cbd372014-07-20 15:33:25 +0100384 u8 bb_vga[BB_VGA_LEVEL];
Forest Bond92b96792009-06-13 07:38:31 -0400385
Malcolm Priestley12687222014-07-20 15:33:27 +0100386 u8 bb_pre_ed_rssi;
Malcolm Priestley43fd1922014-07-20 15:33:28 +0100387 u8 bb_pre_ed_index;
Forest Bond92b96792009-06-13 07:38:31 -0400388
Malcolm Priestley43c93d92015-09-27 09:17:41 +0100389 u16 wake_up_count;
390
Malcolm Priestley61462ab2013-01-17 23:21:50 +0000391 /* command timer */
Malcolm Priestley94488a72013-09-27 16:48:14 +0100392 struct delayed_work run_command_work;
Forest Bond92b96792009-06-13 07:38:31 -0400393
Malcolm Priestley1786384e2014-06-29 20:39:54 +0100394 struct ieee80211_low_level_stats low_stats;
Malcolm Priestley14c5ef52013-01-17 23:19:37 +0000395};
Forest Bond92b96792009-06-13 07:38:31 -0400396
Peter Senna Tschudindbf0a032014-07-15 23:23:24 +0200397#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \
398 if ((uVar) >= ((uModulo) - 1)) \
399 (uVar) = 0; \
400 else \
401 (uVar)++; \
Forest Bond92b96792009-06-13 07:38:31 -0400402}
403
Malcolm Priestley30816f82014-06-25 21:14:27 +0100404int vnt_init(struct vnt_private *priv);
Forest Bond92b96792009-06-13 07:38:31 -0400405
406#endif