blob: 18427238efcf3b5c947d921a8fff02c16859987a [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: desc.h
20 *
21 * Purpose:The header file of descriptor
22 *
23 * Revision History:
24 *
25 * Author: Tevin Chen
26 *
27 * Date: May 21, 1996
28 *
29 */
30
Forest Bond5449c682009-04-25 10:30:44 -040031#ifndef __DESC_H__
32#define __DESC_H__
33
34#include <linux/types.h>
35#include <linux/mm.h>
Forest Bond5449c682009-04-25 10:30:44 -040036#include "ttype.h"
Forest Bond5449c682009-04-25 10:30:44 -040037#include "tether.h"
Jim Lieb612822f2009-08-12 14:54:03 -070038
Igor Bezukh795a8f92014-07-25 19:05:31 +030039#define B_OWNED_BY_CHIP 1
40#define B_OWNED_BY_HOST 0
Forest Bond5449c682009-04-25 10:30:44 -040041
42//
43// Bits in the RSR register
44//
Igor Bezukh795a8f92014-07-25 19:05:31 +030045#define RSR_ADDRBROAD 0x80
46#define RSR_ADDRMULTI 0x40
47#define RSR_ADDRUNI 0x00
48#define RSR_IVLDTYP 0x20
49#define RSR_IVLDLEN 0x10 // invalid len (> 2312 byte)
50#define RSR_BSSIDOK 0x08
51#define RSR_CRCOK 0x04
52#define RSR_BCNSSIDOK 0x02
53#define RSR_ADDROK 0x01
Forest Bond5449c682009-04-25 10:30:44 -040054
55//
56// Bits in the new RSR register
57//
Igor Bezukh795a8f92014-07-25 19:05:31 +030058#define NEWRSR_DECRYPTOK 0x10
59#define NEWRSR_CFPIND 0x08
60#define NEWRSR_HWUTSF 0x04
61#define NEWRSR_BCNHITAID 0x02
62#define NEWRSR_BCNHITAID0 0x01
Forest Bond5449c682009-04-25 10:30:44 -040063
64//
65// Bits in the TSR0 register
66//
Igor Bezukh795a8f92014-07-25 19:05:31 +030067#define TSR0_PWRSTS1_2 0xC0
68#define TSR0_PWRSTS7 0x20
69#define TSR0_NCR 0x1F
Forest Bond5449c682009-04-25 10:30:44 -040070
71//
72// Bits in the TSR1 register
73//
Igor Bezukh795a8f92014-07-25 19:05:31 +030074#define TSR1_TERR 0x80
75#define TSR1_PWRSTS4_6 0x70
76#define TSR1_RETRYTMO 0x08
77#define TSR1_TMO 0x04
78#define TSR1_PWRSTS3 0x02
79#define ACK_DATA 0x01
Forest Bond5449c682009-04-25 10:30:44 -040080
81//
82// Bits in the TCR register
83//
Igor Bezukh795a8f92014-07-25 19:05:31 +030084#define EDMSDU 0x04 // end of sdu
85#define TCR_EDP 0x02 // end of packet
86#define TCR_STP 0x01 // start of packet
Forest Bond5449c682009-04-25 10:30:44 -040087
88// max transmit or receive buffer size
Igor Bezukh795a8f92014-07-25 19:05:31 +030089#define CB_MAX_BUF_SIZE 2900U
Joe Perches78a717d2013-03-18 10:44:44 -070090 // NOTE: must be multiple of 4
Igor Bezukh795a8f92014-07-25 19:05:31 +030091#define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE
92#define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE
Forest Bond5449c682009-04-25 10:30:44 -040093
Igor Bezukh795a8f92014-07-25 19:05:31 +030094#define CB_BEACON_BUF_SIZE 512U
Forest Bond5449c682009-04-25 10:30:44 -040095
Igor Bezukh795a8f92014-07-25 19:05:31 +030096#define CB_MAX_RX_DESC 128
97#define CB_MIN_RX_DESC 16
98#define CB_MAX_TX_DESC 64
99#define CB_MIN_TX_DESC 16
Forest Bond5449c682009-04-25 10:30:44 -0400100
Igor Bezukh795a8f92014-07-25 19:05:31 +0300101#define CB_MAX_RECEIVED_PACKETS 16
Joe Perches78a717d2013-03-18 10:44:44 -0700102 // limit our receive routine to indicating
103 // this many at a time for 2 reasons:
104 // 1. driver flow control to protocol layer
105 // 2. limit the time used in ISR routine
Forest Bond5449c682009-04-25 10:30:44 -0400106
Igor Bezukh795a8f92014-07-25 19:05:31 +0300107#define CB_EXTRA_RD_NUM 32
108#define CB_RD_NUM 32
109#define CB_TD_NUM 32
Forest Bond5449c682009-04-25 10:30:44 -0400110
Forest Bond5449c682009-04-25 10:30:44 -0400111// max number of physical segments
112// in a single NDIS packet. Above this threshold, the packet
113// is copied into a single physically contiguous buffer
114#define CB_MAX_SEGMENT 4
115
116#define CB_MIN_MAP_REG_NUM 4
117#define CB_MAX_MAP_REG_NUM CB_MAX_TX_DESC
118
119#define CB_PROTOCOL_RESERVED_SECTION 16
120
Forest Bond5449c682009-04-25 10:30:44 -0400121// if retrys excess 15 times , tx will abort, and
122// if tx fifo underflow, tx will fail
123// we should try to resend it
124#define CB_MAX_TX_ABORT_RETRY 3
125
126#ifdef __BIG_ENDIAN
127
128// WMAC definition FIFO Control
Igor Bezukh795a8f92014-07-25 19:05:31 +0300129#define FIFOCTL_AUTO_FB_1 0x0010
130#define FIFOCTL_AUTO_FB_0 0x0008
131#define FIFOCTL_GRPACK 0x0004
132#define FIFOCTL_11GA 0x0003
133#define FIFOCTL_11GB 0x0002
134#define FIFOCTL_11B 0x0001
135#define FIFOCTL_11A 0x0000
136#define FIFOCTL_RTS 0x8000
137#define FIFOCTL_ISDMA0 0x4000
138#define FIFOCTL_GENINT 0x2000
139#define FIFOCTL_TMOEN 0x1000
140#define FIFOCTL_LRETRY 0x0800
141#define FIFOCTL_CRCDIS 0x0400
142#define FIFOCTL_NEEDACK 0x0200
143#define FIFOCTL_LHEAD 0x0100
Forest Bond5449c682009-04-25 10:30:44 -0400144
145//WMAC definition Frag Control
Igor Bezukh795a8f92014-07-25 19:05:31 +0300146#define FRAGCTL_AES 0x0003
147#define FRAGCTL_TKIP 0x0002
148#define FRAGCTL_LEGACY 0x0001
149#define FRAGCTL_NONENCRYPT 0x0000
150#define FRAGCTL_ENDFRAG 0x0300
151#define FRAGCTL_MIDFRAG 0x0200
152#define FRAGCTL_STAFRAG 0x0100
153#define FRAGCTL_NONFRAG 0x0000
Forest Bond5449c682009-04-25 10:30:44 -0400154
155#else
156
Igor Bezukh795a8f92014-07-25 19:05:31 +0300157#define FIFOCTL_AUTO_FB_1 0x1000
158#define FIFOCTL_AUTO_FB_0 0x0800
159#define FIFOCTL_GRPACK 0x0400
160#define FIFOCTL_11GA 0x0300
161#define FIFOCTL_11GB 0x0200
162#define FIFOCTL_11B 0x0100
163#define FIFOCTL_11A 0x0000
164#define FIFOCTL_RTS 0x0080
165#define FIFOCTL_ISDMA0 0x0040
166#define FIFOCTL_GENINT 0x0020
167#define FIFOCTL_TMOEN 0x0010
168#define FIFOCTL_LRETRY 0x0008
169#define FIFOCTL_CRCDIS 0x0004
170#define FIFOCTL_NEEDACK 0x0002
171#define FIFOCTL_LHEAD 0x0001
Forest Bond5449c682009-04-25 10:30:44 -0400172
173//WMAC definition Frag Control
Igor Bezukh795a8f92014-07-25 19:05:31 +0300174#define FRAGCTL_AES 0x0300
175#define FRAGCTL_TKIP 0x0200
176#define FRAGCTL_LEGACY 0x0100
177#define FRAGCTL_NONENCRYPT 0x0000
178#define FRAGCTL_ENDFRAG 0x0003
179#define FRAGCTL_MIDFRAG 0x0002
180#define FRAGCTL_STAFRAG 0x0001
181#define FRAGCTL_NONFRAG 0x0000
Forest Bond5449c682009-04-25 10:30:44 -0400182
Igor Bezukh795a8f92014-07-25 19:05:31 +0300183#endif
Forest Bond5449c682009-04-25 10:30:44 -0400184
Forest Bond5449c682009-04-25 10:30:44 -0400185#define TYPE_TXDMA0 0
186#define TYPE_AC0DMA 1
187#define TYPE_ATIMDMA 2
188#define TYPE_SYNCDMA 3
189#define TYPE_MAXTD 2
190
191#define TYPE_BEACONDMA 4
192
193#define TYPE_RXDMA0 0
194#define TYPE_RXDMA1 1
195#define TYPE_MAXRD 2
196
Forest Bond5449c682009-04-25 10:30:44 -0400197// TD_INFO flags control bit
198#define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb
199#define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)
200#define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit
Forest Bond5449c682009-04-25 10:30:44 -0400201
Forest Bond5449c682009-04-25 10:30:44 -0400202// ref_sk_buff is used for mapping the skb structure between pre-built driver-obj & running kernel.
203// Since different kernel version (2.4x) may change skb structure, i.e. pre-built driver-obj
204// may link to older skb that leads error.
205
206typedef struct tagDEVICE_RD_INFO {
Joe Perches78a717d2013-03-18 10:44:44 -0700207 struct sk_buff *skb;
208 dma_addr_t skb_dma;
209 dma_addr_t curr_desc;
Forest Bond5449c682009-04-25 10:30:44 -0400210} DEVICE_RD_INFO, *PDEVICE_RD_INFO;
211
Forest Bond5449c682009-04-25 10:30:44 -0400212#ifdef __BIG_ENDIAN
213
214typedef struct tagRDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700215 volatile unsigned short wResCount;
Forest Bond5449c682009-04-25 10:30:44 -0400216 union {
Charles Clémentc17ce8c2010-05-28 12:34:20 -0700217 volatile u16 f15Reserved;
Forest Bond5449c682009-04-25 10:30:44 -0400218 struct {
Joe Perches78a717d2013-03-18 10:44:44 -0700219 volatile u8 f8Reserved1;
Charles Clément737c3d72010-05-28 12:34:19 -0700220 volatile u8 f1Owner:1;
221 volatile u8 f7Reserved:7;
Forest Bond5449c682009-04-25 10:30:44 -0400222 } __attribute__ ((__packed__));
223 } __attribute__ ((__packed__));
224} __attribute__ ((__packed__))
225SRDES0, *PSRDES0;
226
227#else
228
229typedef struct tagRDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700230 unsigned short wResCount;
231 unsigned short f15Reserved:15;
232 unsigned short f1Owner:1;
Forest Bond5449c682009-04-25 10:30:44 -0400233} __attribute__ ((__packed__))
234SRDES0;
235
Forest Bond5449c682009-04-25 10:30:44 -0400236#endif
237
238typedef struct tagRDES1 {
Joe Perches78a717d2013-03-18 10:44:44 -0700239 unsigned short wReqCount;
240 unsigned short wReserved;
Forest Bond5449c682009-04-25 10:30:44 -0400241} __attribute__ ((__packed__))
242SRDES1;
243
244//
245// Rx descriptor
246//
247typedef struct tagSRxDesc {
Joe Perches78a717d2013-03-18 10:44:44 -0700248 volatile SRDES0 m_rd0RD0;
249 volatile SRDES1 m_rd1RD1;
250 volatile u32 buff_addr;
251 volatile u32 next_desc;
Malcolm Priestley829127b2014-03-06 22:44:21 +0000252 struct tagSRxDesc *next __aligned(8);
253 volatile PDEVICE_RD_INFO pRDInfo __aligned(8);
Forest Bond5449c682009-04-25 10:30:44 -0400254} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700255SRxDesc, *PSRxDesc;
256typedef const SRxDesc *PCSRxDesc;
Forest Bond5449c682009-04-25 10:30:44 -0400257
258#ifdef __BIG_ENDIAN
259
Forest Bond5449c682009-04-25 10:30:44 -0400260typedef struct tagTDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700261 volatile unsigned char byTSR0;
262 volatile unsigned char byTSR1;
Forest Bond5449c682009-04-25 10:30:44 -0400263 union {
Charles Clémentc17ce8c2010-05-28 12:34:20 -0700264 volatile u16 f15Txtime;
Forest Bond5449c682009-04-25 10:30:44 -0400265 struct {
Joe Perches78a717d2013-03-18 10:44:44 -0700266 volatile u8 f8Reserved1;
Charles Clément737c3d72010-05-28 12:34:19 -0700267 volatile u8 f1Owner:1;
268 volatile u8 f7Reserved:7;
Forest Bond5449c682009-04-25 10:30:44 -0400269 } __attribute__ ((__packed__));
270 } __attribute__ ((__packed__));
271} __attribute__ ((__packed__))
272STDES0, PSTDES0;
273
274#else
275
276typedef struct tagTDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700277 volatile unsigned char byTSR0;
278 volatile unsigned char byTSR1;
279 volatile unsigned short f15Txtime:15;
280 volatile unsigned short f1Owner:1;
Forest Bond5449c682009-04-25 10:30:44 -0400281} __attribute__ ((__packed__))
282STDES0;
283
284#endif
285
Forest Bond5449c682009-04-25 10:30:44 -0400286typedef struct tagTDES1 {
Joe Perches78a717d2013-03-18 10:44:44 -0700287 volatile unsigned short wReqCount;
288 volatile unsigned char byTCR;
289 volatile unsigned char byReserved;
Forest Bond5449c682009-04-25 10:30:44 -0400290} __attribute__ ((__packed__))
291STDES1;
292
Joe Perches78a717d2013-03-18 10:44:44 -0700293typedef struct tagDEVICE_TD_INFO {
294 struct sk_buff *skb;
295 unsigned char *buf;
296 dma_addr_t skb_dma;
297 dma_addr_t buf_dma;
298 dma_addr_t curr_desc;
299 unsigned long dwReqCount;
300 unsigned long dwHeaderLength;
301 unsigned char byFlags;
Forest Bond5449c682009-04-25 10:30:44 -0400302} DEVICE_TD_INFO, *PDEVICE_TD_INFO;
303
Forest Bond5449c682009-04-25 10:30:44 -0400304//
305// transmit descriptor
306//
307typedef struct tagSTxDesc {
Joe Perches78a717d2013-03-18 10:44:44 -0700308 volatile STDES0 m_td0TD0;
309 volatile STDES1 m_td1TD1;
310 volatile u32 buff_addr;
311 volatile u32 next_desc;
Malcolm Priestley829127b2014-03-06 22:44:21 +0000312 struct tagSTxDesc *next __aligned(8);
313 volatile PDEVICE_TD_INFO pTDInfo __aligned(8);
Forest Bond5449c682009-04-25 10:30:44 -0400314} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700315STxDesc, *PSTxDesc;
316typedef const STxDesc *PCSTxDesc;
Forest Bond5449c682009-04-25 10:30:44 -0400317
Forest Bond5449c682009-04-25 10:30:44 -0400318typedef struct tagSTxSyncDesc {
Joe Perches78a717d2013-03-18 10:44:44 -0700319 volatile STDES0 m_td0TD0;
320 volatile STDES1 m_td1TD1;
321 volatile u32 buff_addr; // pointer to logical buffer
322 volatile u32 next_desc; // pointer to next logical descriptor
323 volatile unsigned short m_wFIFOCtl;
324 volatile unsigned short m_wTimeStamp;
Malcolm Priestley829127b2014-03-06 22:44:21 +0000325 struct tagSTxSyncDesc *next __aligned(8);
326 volatile PDEVICE_TD_INFO pTDInfo __aligned(8);
Forest Bond5449c682009-04-25 10:30:44 -0400327} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700328STxSyncDesc, *PSTxSyncDesc;
329typedef const STxSyncDesc *PCSTxSyncDesc;
Forest Bond5449c682009-04-25 10:30:44 -0400330
Forest Bond5449c682009-04-25 10:30:44 -0400331//
332// RsvTime buffer header
333//
334typedef struct tagSRrvTime_gRTS {
Joe Perches78a717d2013-03-18 10:44:44 -0700335 unsigned short wRTSTxRrvTime_ba;
336 unsigned short wRTSTxRrvTime_aa;
337 unsigned short wRTSTxRrvTime_bb;
338 unsigned short wReserved;
339 unsigned short wTxRrvTime_b;
340 unsigned short wTxRrvTime_a;
341} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700342SRrvTime_gRTS, *PSRrvTime_gRTS;
343typedef const SRrvTime_gRTS *PCSRrvTime_gRTS;
Forest Bond5449c682009-04-25 10:30:44 -0400344
345typedef struct tagSRrvTime_gCTS {
Joe Perches78a717d2013-03-18 10:44:44 -0700346 unsigned short wCTSTxRrvTime_ba;
347 unsigned short wReserved;
348 unsigned short wTxRrvTime_b;
349 unsigned short wTxRrvTime_a;
350} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700351SRrvTime_gCTS, *PSRrvTime_gCTS;
352typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
Forest Bond5449c682009-04-25 10:30:44 -0400353
354typedef struct tagSRrvTime_ab {
Joe Perches78a717d2013-03-18 10:44:44 -0700355 unsigned short wRTSTxRrvTime;
356 unsigned short wTxRrvTime;
357} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700358SRrvTime_ab, *PSRrvTime_ab;
359typedef const SRrvTime_ab *PCSRrvTime_ab;
Forest Bond5449c682009-04-25 10:30:44 -0400360
361typedef struct tagSRrvTime_atim {
Joe Perches78a717d2013-03-18 10:44:44 -0700362 unsigned short wCTSTxRrvTime_ba;
363 unsigned short wTxRrvTime_a;
364} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700365SRrvTime_atim, *PSRrvTime_atim;
366typedef const SRrvTime_atim *PCSRrvTime_atim;
Forest Bond5449c682009-04-25 10:30:44 -0400367
368//
369// RTS buffer header
370//
371typedef struct tagSRTSData {
Joe Perches78a717d2013-03-18 10:44:44 -0700372 unsigned short wFrameControl;
373 unsigned short wDurationID;
374 unsigned char abyRA[ETH_ALEN];
375 unsigned char abyTA[ETH_ALEN];
376} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700377SRTSData, *PSRTSData;
378typedef const SRTSData *PCSRTSData;
Forest Bond5449c682009-04-25 10:30:44 -0400379
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100380/* Length, Service, and Signal fields of Phy for Tx */
381struct vnt_phy_field {
382 u8 signal;
383 u8 service;
384 __le16 len;
385} __packed;
386
Malcolm Priestley864a5a32014-08-20 22:30:30 +0100387union vnt_phy_field_swap {
388 struct vnt_phy_field field_read;
389 u16 swap[2];
390 u32 field_write;
391};
392
Forest Bond5449c682009-04-25 10:30:44 -0400393typedef struct tagSRTS_g {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100394 struct vnt_phy_field b;
395 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700396 unsigned char bySignalField_b;
397 unsigned char byServiceField_b;
398 unsigned short wTransmitLength_b;
399 unsigned char bySignalField_a;
400 unsigned char byServiceField_a;
401 unsigned short wTransmitLength_a;
402 unsigned short wDuration_ba;
403 unsigned short wDuration_aa;
404 unsigned short wDuration_bb;
405 unsigned short wReserved;
406 SRTSData Data;
407} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700408SRTS_g, *PSRTS_g;
409typedef const SRTS_g *PCSRTS_g;
Forest Bond5449c682009-04-25 10:30:44 -0400410
Forest Bond5449c682009-04-25 10:30:44 -0400411typedef struct tagSRTS_g_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100412 struct vnt_phy_field b;
413 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700414 unsigned char bySignalField_b;
415 unsigned char byServiceField_b;
416 unsigned short wTransmitLength_b;
417 unsigned char bySignalField_a;
418 unsigned char byServiceField_a;
419 unsigned short wTransmitLength_a;
420 unsigned short wDuration_ba;
421 unsigned short wDuration_aa;
422 unsigned short wDuration_bb;
423 unsigned short wReserved;
424 unsigned short wRTSDuration_ba_f0;
425 unsigned short wRTSDuration_aa_f0;
426 unsigned short wRTSDuration_ba_f1;
427 unsigned short wRTSDuration_aa_f1;
428 SRTSData Data;
429} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700430SRTS_g_FB, *PSRTS_g_FB;
431typedef const SRTS_g_FB *PCSRTS_g_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400432
Forest Bond5449c682009-04-25 10:30:44 -0400433typedef struct tagSRTS_ab {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100434 struct vnt_phy_field ab;
Joe Perches78a717d2013-03-18 10:44:44 -0700435 unsigned char bySignalField;
436 unsigned char byServiceField;
437 unsigned short wTransmitLength;
438 unsigned short wDuration;
439 unsigned short wReserved;
440 SRTSData Data;
441} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700442SRTS_ab, *PSRTS_ab;
443typedef const SRTS_ab *PCSRTS_ab;
Forest Bond5449c682009-04-25 10:30:44 -0400444
Forest Bond5449c682009-04-25 10:30:44 -0400445typedef struct tagSRTS_a_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100446 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700447 unsigned char bySignalField;
448 unsigned char byServiceField;
449 unsigned short wTransmitLength;
450 unsigned short wDuration;
451 unsigned short wReserved;
452 unsigned short wRTSDuration_f0;
453 unsigned short wRTSDuration_f1;
454 SRTSData Data;
455} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700456SRTS_a_FB, *PSRTS_a_FB;
457typedef const SRTS_a_FB *PCSRTS_a_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400458
Forest Bond5449c682009-04-25 10:30:44 -0400459//
460// CTS buffer header
461//
462typedef struct tagSCTSData {
Joe Perches78a717d2013-03-18 10:44:44 -0700463 unsigned short wFrameControl;
464 unsigned short wDurationID;
465 unsigned char abyRA[ETH_ALEN];
466 unsigned short wReserved;
467} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700468SCTSData, *PSCTSData;
Forest Bond5449c682009-04-25 10:30:44 -0400469
470typedef struct tagSCTS {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100471 struct vnt_phy_field b;
Joe Perches78a717d2013-03-18 10:44:44 -0700472 unsigned char bySignalField_b;
473 unsigned char byServiceField_b;
474 unsigned short wTransmitLength_b;
475 unsigned short wDuration_ba;
476 unsigned short wReserved;
477 SCTSData Data;
478} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700479SCTS, *PSCTS;
480typedef const SCTS *PCSCTS;
Forest Bond5449c682009-04-25 10:30:44 -0400481
482typedef struct tagSCTS_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100483 struct vnt_phy_field b;
Joe Perches78a717d2013-03-18 10:44:44 -0700484 unsigned char bySignalField_b;
485 unsigned char byServiceField_b;
486 unsigned short wTransmitLength_b;
487 unsigned short wDuration_ba;
488 unsigned short wReserved;
489 unsigned short wCTSDuration_ba_f0;
490 unsigned short wCTSDuration_ba_f1;
491 SCTSData Data;
492} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700493SCTS_FB, *PSCTS_FB;
494typedef const SCTS_FB *PCSCTS_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400495
Forest Bond5449c682009-04-25 10:30:44 -0400496//
497// Tx FIFO header
498//
499typedef struct tagSTxBufHead {
Joe Perches78a717d2013-03-18 10:44:44 -0700500 u32 adwTxKey[4];
501 unsigned short wFIFOCtl;
502 unsigned short wTimeStamp;
503 unsigned short wFragCtl;
504 unsigned char byTxPower;
505 unsigned char wReserved;
506} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700507STxBufHead, *PSTxBufHead;
508typedef const STxBufHead *PCSTxBufHead;
Forest Bond5449c682009-04-25 10:30:44 -0400509
510typedef struct tagSTxShortBufHead {
Joe Perches78a717d2013-03-18 10:44:44 -0700511 unsigned short wFIFOCtl;
512 unsigned short wTimeStamp;
513} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700514STxShortBufHead, *PSTxShortBufHead;
515typedef const STxShortBufHead *PCSTxShortBufHead;
Forest Bond5449c682009-04-25 10:30:44 -0400516
517//
518// Tx data header
519//
520typedef struct tagSTxDataHead_g {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100521 struct vnt_phy_field b;
522 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700523 unsigned char bySignalField_b;
524 unsigned char byServiceField_b;
525 unsigned short wTransmitLength_b;
526 unsigned char bySignalField_a;
527 unsigned char byServiceField_a;
528 unsigned short wTransmitLength_a;
529 unsigned short wDuration_b;
530 unsigned short wDuration_a;
531 unsigned short wTimeStampOff_b;
532 unsigned short wTimeStampOff_a;
533} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700534STxDataHead_g, *PSTxDataHead_g;
535typedef const STxDataHead_g *PCSTxDataHead_g;
Forest Bond5449c682009-04-25 10:30:44 -0400536
537typedef struct tagSTxDataHead_g_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100538 struct vnt_phy_field b;
539 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700540 unsigned char bySignalField_b;
541 unsigned char byServiceField_b;
542 unsigned short wTransmitLength_b;
543 unsigned char bySignalField_a;
544 unsigned char byServiceField_a;
545 unsigned short wTransmitLength_a;
546 unsigned short wDuration_b;
547 unsigned short wDuration_a;
548 unsigned short wDuration_a_f0;
549 unsigned short wDuration_a_f1;
550 unsigned short wTimeStampOff_b;
551 unsigned short wTimeStampOff_a;
552} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700553STxDataHead_g_FB, *PSTxDataHead_g_FB;
554typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400555
Forest Bond5449c682009-04-25 10:30:44 -0400556typedef struct tagSTxDataHead_ab {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100557 struct vnt_phy_field ab;
Joe Perches78a717d2013-03-18 10:44:44 -0700558 unsigned char bySignalField;
559 unsigned char byServiceField;
560 unsigned short wTransmitLength;
561 unsigned short wDuration;
562 unsigned short wTimeStampOff;
563} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700564STxDataHead_ab, *PSTxDataHead_ab;
565typedef const STxDataHead_ab *PCSTxDataHead_ab;
Forest Bond5449c682009-04-25 10:30:44 -0400566
Forest Bond5449c682009-04-25 10:30:44 -0400567typedef struct tagSTxDataHead_a_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100568 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700569 unsigned char bySignalField;
570 unsigned char byServiceField;
571 unsigned short wTransmitLength;
572 unsigned short wDuration;
573 unsigned short wTimeStampOff;
574 unsigned short wDuration_f0;
575 unsigned short wDuration_f1;
576} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700577STxDataHead_a_FB, *PSTxDataHead_a_FB;
578typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400579
Forest Bond5449c682009-04-25 10:30:44 -0400580typedef struct tagSBEACONCtl {
Joe Perches78a717d2013-03-18 10:44:44 -0700581 u32 BufReady:1;
582 u32 TSF:15;
583 u32 BufLen:11;
584 u32 Reserved:5;
585} __attribute__ ((__packed__))
Forest Bond5449c682009-04-25 10:30:44 -0400586SBEACONCtl;
587
Forest Bond5449c682009-04-25 10:30:44 -0400588typedef struct tagSSecretKey {
Joe Perches78a717d2013-03-18 10:44:44 -0700589 u32 dwLowDword;
590 unsigned char byHighByte;
591} __attribute__ ((__packed__))
Forest Bond5449c682009-04-25 10:30:44 -0400592SSecretKey;
593
594typedef struct tagSKeyEntry {
Joe Perches78a717d2013-03-18 10:44:44 -0700595 unsigned char abyAddrHi[2];
596 unsigned short wKCTL;
597 unsigned char abyAddrLo[4];
598 u32 dwKey0[4];
599 u32 dwKey1[4];
600 u32 dwKey2[4];
601 u32 dwKey3[4];
602 u32 dwKey4[4];
603} __attribute__ ((__packed__))
Forest Bond5449c682009-04-25 10:30:44 -0400604SKeyEntry;
Forest Bond5449c682009-04-25 10:30:44 -0400605
Forest Bond5449c682009-04-25 10:30:44 -0400606#endif // __DESC_H__