blob: 3ce5fe873bd9f4084ee873c31d111e3ad0d61586 [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>
Malcolm Priestley52c41302014-08-30 22:25:39 +010036#include "linux/ieee80211.h"
Forest Bond5449c682009-04-25 10:30:44 -040037#include "ttype.h"
Forest Bond5449c682009-04-25 10:30:44 -040038#include "tether.h"
Jim Lieb612822f2009-08-12 14:54:03 -070039
Igor Bezukh795a8f92014-07-25 19:05:31 +030040#define B_OWNED_BY_CHIP 1
41#define B_OWNED_BY_HOST 0
Forest Bond5449c682009-04-25 10:30:44 -040042
43//
44// Bits in the RSR register
45//
Igor Bezukh795a8f92014-07-25 19:05:31 +030046#define RSR_ADDRBROAD 0x80
47#define RSR_ADDRMULTI 0x40
48#define RSR_ADDRUNI 0x00
49#define RSR_IVLDTYP 0x20
50#define RSR_IVLDLEN 0x10 // invalid len (> 2312 byte)
51#define RSR_BSSIDOK 0x08
52#define RSR_CRCOK 0x04
53#define RSR_BCNSSIDOK 0x02
54#define RSR_ADDROK 0x01
Forest Bond5449c682009-04-25 10:30:44 -040055
56//
57// Bits in the new RSR register
58//
Igor Bezukh795a8f92014-07-25 19:05:31 +030059#define NEWRSR_DECRYPTOK 0x10
60#define NEWRSR_CFPIND 0x08
61#define NEWRSR_HWUTSF 0x04
62#define NEWRSR_BCNHITAID 0x02
63#define NEWRSR_BCNHITAID0 0x01
Forest Bond5449c682009-04-25 10:30:44 -040064
65//
66// Bits in the TSR0 register
67//
Igor Bezukh795a8f92014-07-25 19:05:31 +030068#define TSR0_PWRSTS1_2 0xC0
69#define TSR0_PWRSTS7 0x20
70#define TSR0_NCR 0x1F
Forest Bond5449c682009-04-25 10:30:44 -040071
72//
73// Bits in the TSR1 register
74//
Igor Bezukh795a8f92014-07-25 19:05:31 +030075#define TSR1_TERR 0x80
76#define TSR1_PWRSTS4_6 0x70
77#define TSR1_RETRYTMO 0x08
78#define TSR1_TMO 0x04
79#define TSR1_PWRSTS3 0x02
80#define ACK_DATA 0x01
Forest Bond5449c682009-04-25 10:30:44 -040081
82//
83// Bits in the TCR register
84//
Igor Bezukh795a8f92014-07-25 19:05:31 +030085#define EDMSDU 0x04 // end of sdu
86#define TCR_EDP 0x02 // end of packet
87#define TCR_STP 0x01 // start of packet
Forest Bond5449c682009-04-25 10:30:44 -040088
89// max transmit or receive buffer size
Igor Bezukh795a8f92014-07-25 19:05:31 +030090#define CB_MAX_BUF_SIZE 2900U
Joe Perches78a717d2013-03-18 10:44:44 -070091 // NOTE: must be multiple of 4
Igor Bezukh795a8f92014-07-25 19:05:31 +030092#define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE
93#define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE
Forest Bond5449c682009-04-25 10:30:44 -040094
Igor Bezukh795a8f92014-07-25 19:05:31 +030095#define CB_BEACON_BUF_SIZE 512U
Forest Bond5449c682009-04-25 10:30:44 -040096
Igor Bezukh795a8f92014-07-25 19:05:31 +030097#define CB_MAX_RX_DESC 128
98#define CB_MIN_RX_DESC 16
99#define CB_MAX_TX_DESC 64
100#define CB_MIN_TX_DESC 16
Forest Bond5449c682009-04-25 10:30:44 -0400101
Igor Bezukh795a8f92014-07-25 19:05:31 +0300102#define CB_MAX_RECEIVED_PACKETS 16
Joe Perches78a717d2013-03-18 10:44:44 -0700103 // limit our receive routine to indicating
104 // this many at a time for 2 reasons:
105 // 1. driver flow control to protocol layer
106 // 2. limit the time used in ISR routine
Forest Bond5449c682009-04-25 10:30:44 -0400107
Igor Bezukh795a8f92014-07-25 19:05:31 +0300108#define CB_EXTRA_RD_NUM 32
109#define CB_RD_NUM 32
110#define CB_TD_NUM 32
Forest Bond5449c682009-04-25 10:30:44 -0400111
Forest Bond5449c682009-04-25 10:30:44 -0400112// max number of physical segments
113// in a single NDIS packet. Above this threshold, the packet
114// is copied into a single physically contiguous buffer
115#define CB_MAX_SEGMENT 4
116
117#define CB_MIN_MAP_REG_NUM 4
118#define CB_MAX_MAP_REG_NUM CB_MAX_TX_DESC
119
120#define CB_PROTOCOL_RESERVED_SECTION 16
121
Forest Bond5449c682009-04-25 10:30:44 -0400122// if retrys excess 15 times , tx will abort, and
123// if tx fifo underflow, tx will fail
124// we should try to resend it
125#define CB_MAX_TX_ABORT_RETRY 3
126
127#ifdef __BIG_ENDIAN
128
129// WMAC definition FIFO Control
Igor Bezukh795a8f92014-07-25 19:05:31 +0300130#define FIFOCTL_AUTO_FB_1 0x0010
131#define FIFOCTL_AUTO_FB_0 0x0008
132#define FIFOCTL_GRPACK 0x0004
133#define FIFOCTL_11GA 0x0003
134#define FIFOCTL_11GB 0x0002
135#define FIFOCTL_11B 0x0001
136#define FIFOCTL_11A 0x0000
137#define FIFOCTL_RTS 0x8000
138#define FIFOCTL_ISDMA0 0x4000
139#define FIFOCTL_GENINT 0x2000
140#define FIFOCTL_TMOEN 0x1000
141#define FIFOCTL_LRETRY 0x0800
142#define FIFOCTL_CRCDIS 0x0400
143#define FIFOCTL_NEEDACK 0x0200
144#define FIFOCTL_LHEAD 0x0100
Forest Bond5449c682009-04-25 10:30:44 -0400145
146//WMAC definition Frag Control
Igor Bezukh795a8f92014-07-25 19:05:31 +0300147#define FRAGCTL_AES 0x0003
148#define FRAGCTL_TKIP 0x0002
149#define FRAGCTL_LEGACY 0x0001
150#define FRAGCTL_NONENCRYPT 0x0000
151#define FRAGCTL_ENDFRAG 0x0300
152#define FRAGCTL_MIDFRAG 0x0200
153#define FRAGCTL_STAFRAG 0x0100
154#define FRAGCTL_NONFRAG 0x0000
Forest Bond5449c682009-04-25 10:30:44 -0400155
156#else
157
Igor Bezukh795a8f92014-07-25 19:05:31 +0300158#define FIFOCTL_AUTO_FB_1 0x1000
159#define FIFOCTL_AUTO_FB_0 0x0800
160#define FIFOCTL_GRPACK 0x0400
161#define FIFOCTL_11GA 0x0300
162#define FIFOCTL_11GB 0x0200
163#define FIFOCTL_11B 0x0100
164#define FIFOCTL_11A 0x0000
165#define FIFOCTL_RTS 0x0080
166#define FIFOCTL_ISDMA0 0x0040
167#define FIFOCTL_GENINT 0x0020
168#define FIFOCTL_TMOEN 0x0010
169#define FIFOCTL_LRETRY 0x0008
170#define FIFOCTL_CRCDIS 0x0004
171#define FIFOCTL_NEEDACK 0x0002
172#define FIFOCTL_LHEAD 0x0001
Forest Bond5449c682009-04-25 10:30:44 -0400173
174//WMAC definition Frag Control
Igor Bezukh795a8f92014-07-25 19:05:31 +0300175#define FRAGCTL_AES 0x0300
176#define FRAGCTL_TKIP 0x0200
177#define FRAGCTL_LEGACY 0x0100
178#define FRAGCTL_NONENCRYPT 0x0000
179#define FRAGCTL_ENDFRAG 0x0003
180#define FRAGCTL_MIDFRAG 0x0002
181#define FRAGCTL_STAFRAG 0x0001
182#define FRAGCTL_NONFRAG 0x0000
Forest Bond5449c682009-04-25 10:30:44 -0400183
Igor Bezukh795a8f92014-07-25 19:05:31 +0300184#endif
Forest Bond5449c682009-04-25 10:30:44 -0400185
Forest Bond5449c682009-04-25 10:30:44 -0400186#define TYPE_TXDMA0 0
187#define TYPE_AC0DMA 1
188#define TYPE_ATIMDMA 2
189#define TYPE_SYNCDMA 3
190#define TYPE_MAXTD 2
191
192#define TYPE_BEACONDMA 4
193
194#define TYPE_RXDMA0 0
195#define TYPE_RXDMA1 1
196#define TYPE_MAXRD 2
197
Forest Bond5449c682009-04-25 10:30:44 -0400198// TD_INFO flags control bit
199#define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb
200#define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)
201#define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit
Forest Bond5449c682009-04-25 10:30:44 -0400202
Forest Bond5449c682009-04-25 10:30:44 -0400203// ref_sk_buff is used for mapping the skb structure between pre-built driver-obj & running kernel.
204// Since different kernel version (2.4x) may change skb structure, i.e. pre-built driver-obj
205// may link to older skb that leads error.
206
207typedef struct tagDEVICE_RD_INFO {
Joe Perches78a717d2013-03-18 10:44:44 -0700208 struct sk_buff *skb;
209 dma_addr_t skb_dma;
210 dma_addr_t curr_desc;
Forest Bond5449c682009-04-25 10:30:44 -0400211} DEVICE_RD_INFO, *PDEVICE_RD_INFO;
212
Forest Bond5449c682009-04-25 10:30:44 -0400213#ifdef __BIG_ENDIAN
214
215typedef struct tagRDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700216 volatile unsigned short wResCount;
Forest Bond5449c682009-04-25 10:30:44 -0400217 union {
Charles Clémentc17ce8c2010-05-28 12:34:20 -0700218 volatile u16 f15Reserved;
Forest Bond5449c682009-04-25 10:30:44 -0400219 struct {
Joe Perches78a717d2013-03-18 10:44:44 -0700220 volatile u8 f8Reserved1;
Charles Clément737c3d72010-05-28 12:34:19 -0700221 volatile u8 f1Owner:1;
222 volatile u8 f7Reserved:7;
Forest Bond5449c682009-04-25 10:30:44 -0400223 } __attribute__ ((__packed__));
224 } __attribute__ ((__packed__));
225} __attribute__ ((__packed__))
226SRDES0, *PSRDES0;
227
228#else
229
230typedef struct tagRDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700231 unsigned short wResCount;
232 unsigned short f15Reserved:15;
233 unsigned short f1Owner:1;
Forest Bond5449c682009-04-25 10:30:44 -0400234} __attribute__ ((__packed__))
235SRDES0;
236
Forest Bond5449c682009-04-25 10:30:44 -0400237#endif
238
239typedef struct tagRDES1 {
Joe Perches78a717d2013-03-18 10:44:44 -0700240 unsigned short wReqCount;
241 unsigned short wReserved;
Forest Bond5449c682009-04-25 10:30:44 -0400242} __attribute__ ((__packed__))
243SRDES1;
244
245//
246// Rx descriptor
247//
248typedef struct tagSRxDesc {
Joe Perches78a717d2013-03-18 10:44:44 -0700249 volatile SRDES0 m_rd0RD0;
250 volatile SRDES1 m_rd1RD1;
251 volatile u32 buff_addr;
252 volatile u32 next_desc;
Malcolm Priestley829127b2014-03-06 22:44:21 +0000253 struct tagSRxDesc *next __aligned(8);
254 volatile PDEVICE_RD_INFO pRDInfo __aligned(8);
Forest Bond5449c682009-04-25 10:30:44 -0400255} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700256SRxDesc, *PSRxDesc;
257typedef const SRxDesc *PCSRxDesc;
Forest Bond5449c682009-04-25 10:30:44 -0400258
259#ifdef __BIG_ENDIAN
260
Forest Bond5449c682009-04-25 10:30:44 -0400261typedef struct tagTDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700262 volatile unsigned char byTSR0;
263 volatile unsigned char byTSR1;
Forest Bond5449c682009-04-25 10:30:44 -0400264 union {
Charles Clémentc17ce8c2010-05-28 12:34:20 -0700265 volatile u16 f15Txtime;
Forest Bond5449c682009-04-25 10:30:44 -0400266 struct {
Joe Perches78a717d2013-03-18 10:44:44 -0700267 volatile u8 f8Reserved1;
Charles Clément737c3d72010-05-28 12:34:19 -0700268 volatile u8 f1Owner:1;
269 volatile u8 f7Reserved:7;
Forest Bond5449c682009-04-25 10:30:44 -0400270 } __attribute__ ((__packed__));
271 } __attribute__ ((__packed__));
272} __attribute__ ((__packed__))
273STDES0, PSTDES0;
274
275#else
276
277typedef struct tagTDES0 {
Joe Perches78a717d2013-03-18 10:44:44 -0700278 volatile unsigned char byTSR0;
279 volatile unsigned char byTSR1;
280 volatile unsigned short f15Txtime:15;
281 volatile unsigned short f1Owner:1;
Forest Bond5449c682009-04-25 10:30:44 -0400282} __attribute__ ((__packed__))
283STDES0;
284
285#endif
286
Forest Bond5449c682009-04-25 10:30:44 -0400287typedef struct tagTDES1 {
Joe Perches78a717d2013-03-18 10:44:44 -0700288 volatile unsigned short wReqCount;
289 volatile unsigned char byTCR;
290 volatile unsigned char byReserved;
Forest Bond5449c682009-04-25 10:30:44 -0400291} __attribute__ ((__packed__))
292STDES1;
293
Joe Perches78a717d2013-03-18 10:44:44 -0700294typedef struct tagDEVICE_TD_INFO {
295 struct sk_buff *skb;
296 unsigned char *buf;
297 dma_addr_t skb_dma;
298 dma_addr_t buf_dma;
299 dma_addr_t curr_desc;
300 unsigned long dwReqCount;
301 unsigned long dwHeaderLength;
302 unsigned char byFlags;
Forest Bond5449c682009-04-25 10:30:44 -0400303} DEVICE_TD_INFO, *PDEVICE_TD_INFO;
304
Forest Bond5449c682009-04-25 10:30:44 -0400305//
306// transmit descriptor
307//
308typedef struct tagSTxDesc {
Joe Perches78a717d2013-03-18 10:44:44 -0700309 volatile STDES0 m_td0TD0;
310 volatile STDES1 m_td1TD1;
311 volatile u32 buff_addr;
312 volatile u32 next_desc;
Malcolm Priestley829127b2014-03-06 22:44:21 +0000313 struct tagSTxDesc *next __aligned(8);
314 volatile PDEVICE_TD_INFO pTDInfo __aligned(8);
Forest Bond5449c682009-04-25 10:30:44 -0400315} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700316STxDesc, *PSTxDesc;
317typedef const STxDesc *PCSTxDesc;
Forest Bond5449c682009-04-25 10:30:44 -0400318
Forest Bond5449c682009-04-25 10:30:44 -0400319typedef struct tagSTxSyncDesc {
Joe Perches78a717d2013-03-18 10:44:44 -0700320 volatile STDES0 m_td0TD0;
321 volatile STDES1 m_td1TD1;
322 volatile u32 buff_addr; // pointer to logical buffer
323 volatile u32 next_desc; // pointer to next logical descriptor
324 volatile unsigned short m_wFIFOCtl;
325 volatile unsigned short m_wTimeStamp;
Malcolm Priestley829127b2014-03-06 22:44:21 +0000326 struct tagSTxSyncDesc *next __aligned(8);
327 volatile PDEVICE_TD_INFO pTDInfo __aligned(8);
Forest Bond5449c682009-04-25 10:30:44 -0400328} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700329STxSyncDesc, *PSTxSyncDesc;
330typedef const STxSyncDesc *PCSTxSyncDesc;
Forest Bond5449c682009-04-25 10:30:44 -0400331
Forest Bond5449c682009-04-25 10:30:44 -0400332//
333// RsvTime buffer header
334//
Forest Bond5449c682009-04-25 10:30:44 -0400335typedef struct tagSRrvTime_atim {
Joe Perches78a717d2013-03-18 10:44:44 -0700336 unsigned short wCTSTxRrvTime_ba;
337 unsigned short wTxRrvTime_a;
338} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700339SRrvTime_atim, *PSRrvTime_atim;
340typedef const SRrvTime_atim *PCSRrvTime_atim;
Forest Bond5449c682009-04-25 10:30:44 -0400341
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100342/* Length, Service, and Signal fields of Phy for Tx */
343struct vnt_phy_field {
344 u8 signal;
345 u8 service;
346 __le16 len;
347} __packed;
348
Malcolm Priestley864a5a32014-08-20 22:30:30 +0100349union vnt_phy_field_swap {
350 struct vnt_phy_field field_read;
351 u16 swap[2];
352 u32 field_write;
353};
354
Forest Bond5449c682009-04-25 10:30:44 -0400355typedef struct tagSRTS_g {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100356 struct vnt_phy_field b;
357 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700358 unsigned short wDuration_ba;
359 unsigned short wDuration_aa;
360 unsigned short wDuration_bb;
361 unsigned short wReserved;
Malcolm Priestley52c41302014-08-30 22:25:39 +0100362 struct ieee80211_rts data;
Joe Perches78a717d2013-03-18 10:44:44 -0700363} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700364SRTS_g, *PSRTS_g;
365typedef const SRTS_g *PCSRTS_g;
Forest Bond5449c682009-04-25 10:30:44 -0400366
Forest Bond5449c682009-04-25 10:30:44 -0400367typedef struct tagSRTS_g_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100368 struct vnt_phy_field b;
369 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700370 unsigned short wDuration_ba;
371 unsigned short wDuration_aa;
372 unsigned short wDuration_bb;
373 unsigned short wReserved;
374 unsigned short wRTSDuration_ba_f0;
375 unsigned short wRTSDuration_aa_f0;
376 unsigned short wRTSDuration_ba_f1;
377 unsigned short wRTSDuration_aa_f1;
Malcolm Priestley52c41302014-08-30 22:25:39 +0100378 struct ieee80211_rts data;
Joe Perches78a717d2013-03-18 10:44:44 -0700379} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700380SRTS_g_FB, *PSRTS_g_FB;
381typedef const SRTS_g_FB *PCSRTS_g_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400382
Forest Bond5449c682009-04-25 10:30:44 -0400383typedef struct tagSRTS_ab {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100384 struct vnt_phy_field ab;
Joe Perches78a717d2013-03-18 10:44:44 -0700385 unsigned short wDuration;
386 unsigned short wReserved;
Malcolm Priestley52c41302014-08-30 22:25:39 +0100387 struct ieee80211_rts data;
Joe Perches78a717d2013-03-18 10:44:44 -0700388} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700389SRTS_ab, *PSRTS_ab;
390typedef const SRTS_ab *PCSRTS_ab;
Forest Bond5449c682009-04-25 10:30:44 -0400391
Forest Bond5449c682009-04-25 10:30:44 -0400392typedef struct tagSRTS_a_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100393 struct vnt_phy_field a;
Joe Perches78a717d2013-03-18 10:44:44 -0700394 unsigned short wDuration;
395 unsigned short wReserved;
396 unsigned short wRTSDuration_f0;
397 unsigned short wRTSDuration_f1;
Malcolm Priestley52c41302014-08-30 22:25:39 +0100398 struct ieee80211_rts data;
Joe Perches78a717d2013-03-18 10:44:44 -0700399} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700400SRTS_a_FB, *PSRTS_a_FB;
401typedef const SRTS_a_FB *PCSRTS_a_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400402
Forest Bond5449c682009-04-25 10:30:44 -0400403//
404// CTS buffer header
405//
406typedef struct tagSCTSData {
Joe Perches78a717d2013-03-18 10:44:44 -0700407 unsigned short wFrameControl;
408 unsigned short wDurationID;
409 unsigned char abyRA[ETH_ALEN];
410 unsigned short wReserved;
411} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700412SCTSData, *PSCTSData;
Forest Bond5449c682009-04-25 10:30:44 -0400413
414typedef struct tagSCTS {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100415 struct vnt_phy_field b;
Joe Perches78a717d2013-03-18 10:44:44 -0700416 unsigned short wDuration_ba;
417 unsigned short wReserved;
418 SCTSData Data;
419} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700420SCTS, *PSCTS;
421typedef const SCTS *PCSCTS;
Forest Bond5449c682009-04-25 10:30:44 -0400422
423typedef struct tagSCTS_FB {
Malcolm Priestleyedbae992014-08-20 22:30:27 +0100424 struct vnt_phy_field b;
Joe Perches78a717d2013-03-18 10:44:44 -0700425 unsigned short wDuration_ba;
426 unsigned short wReserved;
427 unsigned short wCTSDuration_ba_f0;
428 unsigned short wCTSDuration_ba_f1;
429 SCTSData Data;
430} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700431SCTS_FB, *PSCTS_FB;
432typedef const SCTS_FB *PCSCTS_FB;
Forest Bond5449c682009-04-25 10:30:44 -0400433
Forest Bond5449c682009-04-25 10:30:44 -0400434//
435// Tx FIFO header
436//
437typedef struct tagSTxBufHead {
Joe Perches78a717d2013-03-18 10:44:44 -0700438 u32 adwTxKey[4];
439 unsigned short wFIFOCtl;
440 unsigned short wTimeStamp;
441 unsigned short wFragCtl;
442 unsigned char byTxPower;
443 unsigned char wReserved;
444} __attribute__ ((__packed__))
Jim Lieba8848472009-08-12 14:54:07 -0700445STxBufHead, *PSTxBufHead;
446typedef const STxBufHead *PCSTxBufHead;
Forest Bond5449c682009-04-25 10:30:44 -0400447
Forest Bond5449c682009-04-25 10:30:44 -0400448typedef struct tagSBEACONCtl {
Joe Perches78a717d2013-03-18 10:44:44 -0700449 u32 BufReady:1;
450 u32 TSF:15;
451 u32 BufLen:11;
452 u32 Reserved:5;
453} __attribute__ ((__packed__))
Forest Bond5449c682009-04-25 10:30:44 -0400454SBEACONCtl;
455
Forest Bond5449c682009-04-25 10:30:44 -0400456typedef struct tagSSecretKey {
Joe Perches78a717d2013-03-18 10:44:44 -0700457 u32 dwLowDword;
458 unsigned char byHighByte;
459} __attribute__ ((__packed__))
Forest Bond5449c682009-04-25 10:30:44 -0400460SSecretKey;
461
462typedef struct tagSKeyEntry {
Joe Perches78a717d2013-03-18 10:44:44 -0700463 unsigned char abyAddrHi[2];
464 unsigned short wKCTL;
465 unsigned char abyAddrLo[4];
466 u32 dwKey0[4];
467 u32 dwKey1[4];
468 u32 dwKey2[4];
469 u32 dwKey3[4];
470 u32 dwKey4[4];
471} __attribute__ ((__packed__))
Forest Bond5449c682009-04-25 10:30:44 -0400472SKeyEntry;
Forest Bond5449c682009-04-25 10:30:44 -0400473
Forest Bond5449c682009-04-25 10:30:44 -0400474#endif // __DESC_H__