2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
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.
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.
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.
21 * Purpose:The header file of descriptor
34 #include <linux/types.h>
39 /*--------------------- Export Definitions -------------------------*/
41 // max transmit or receive buffer size
42 #define CB_MAX_BUF_SIZE 2900U // max buffer size
43 // NOTE: must be multiple of 4
45 #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE // max Tx buffer size
46 #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE // max Rx buffer size when not use Multi-RD
48 #define CB_BEACON_BUF_SIZE 512U // default beacon buffer size
50 #define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE
52 #define MAX_INTERRUPT_SIZE 32
54 #define RX_BLOCKS 64 // form 0x60 to 0xA0
55 #define TX_BLOCKS 32 // from 0xA0 to 0xC0
57 #define CB_MAX_RX_DESC 128 // max # of descriptor
58 #define CB_MIN_RX_DESC 16 // min # of rx descriptor
59 #define CB_MAX_TX_DESC 128 // max # of descriptor
60 #define CB_MIN_TX_DESC 16 // min # of tx descriptor
62 #define CB_RD_NUM 64 // default # of RD
63 #define CB_TD_NUM 64 // default # of TD
66 // Bits in the RSR register
68 #define RSR_ADDRBROAD 0x80 // 1000 0000
69 #define RSR_ADDRMULTI 0x40 // 0100 0000
70 #define RSR_ADDRUNI 0x00 // 0000 0000
71 #define RSR_IVLDTYP 0x20 // 0010 0000 , invalid packet type
72 #define RSR_IVLDLEN 0x10 // 0001 0000 , invalid len (> 2312 byte)
73 #define RSR_BSSIDOK 0x08 // 0000 1000
74 #define RSR_CRCOK 0x04 // 0000 0100
75 #define RSR_BCNSSIDOK 0x02 // 0000 0010
76 #define RSR_ADDROK 0x01 // 0000 0001
79 // Bits in the new RSR register
81 #define NEWRSR_DECRYPTOK 0x10 // 0001 0000
82 #define NEWRSR_CFPIND 0x08 // 0000 1000
83 #define NEWRSR_HWUTSF 0x04 // 0000 0100
84 #define NEWRSR_BCNHITAID 0x02 // 0000 0010
85 #define NEWRSR_BCNHITAID0 0x01 // 0000 0001
88 // Bits in the TSR register
90 #define TSR_RETRYTMO 0x08 // 0000 1000
91 #define TSR_TMO 0x04 // 0000 0100
92 #define TSR_ACKDATA 0x02 // 0000 0010
93 #define TSR_VALID 0x01 // 0000 0001
95 #define CB_PROTOCOL_RESERVED_SECTION 16
97 // if retrys excess 15 times , tx will abort, and
98 // if tx fifo underflow, tx will fail
99 // we should try to resend it
100 #define CB_MAX_TX_ABORT_RETRY 3
102 #define FIFOCTL_AUTO_FB_1 0x1000 // 0001 0000 0000 0000
103 #define FIFOCTL_AUTO_FB_0 0x0800 // 0000 1000 0000 0000
104 #define FIFOCTL_GRPACK 0x0400 // 0000 0100 0000 0000
105 #define FIFOCTL_11GA 0x0300 // 0000 0011 0000 0000
106 #define FIFOCTL_11GB 0x0200 // 0000 0010 0000 0000
107 #define FIFOCTL_11B 0x0100 // 0000 0001 0000 0000
108 #define FIFOCTL_11A 0x0000 // 0000 0000 0000 0000
109 #define FIFOCTL_RTS 0x0080 // 0000 0000 1000 0000
110 #define FIFOCTL_ISDMA0 0x0040 // 0000 0000 0100 0000
111 #define FIFOCTL_GENINT 0x0020 // 0000 0000 0010 0000
112 #define FIFOCTL_TMOEN 0x0010 // 0000 0000 0001 0000
113 #define FIFOCTL_LRETRY 0x0008 // 0000 0000 0000 1000
114 #define FIFOCTL_CRCDIS 0x0004 // 0000 0000 0000 0100
115 #define FIFOCTL_NEEDACK 0x0002 // 0000 0000 0000 0010
116 #define FIFOCTL_LHEAD 0x0001 // 0000 0000 0000 0001
118 //WMAC definition Frag Control
119 #define FRAGCTL_AES 0x0300 // 0000 0011 0000 0000
120 #define FRAGCTL_TKIP 0x0200 // 0000 0010 0000 0000
121 #define FRAGCTL_LEGACY 0x0100 // 0000 0001 0000 0000
122 #define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000
123 //#define FRAGCTL_AC3 0x000C // 0000 0000 0000 1100
124 //#define FRAGCTL_AC2 0x0008 // 0000 0000 0000 1000
125 //#define FRAGCTL_AC1 0x0004 // 0000 0000 0000 0100
126 //#define FRAGCTL_AC0 0x0000 // 0000 0000 0000 0000
127 #define FRAGCTL_ENDFRAG 0x0003 // 0000 0000 0000 0011
128 #define FRAGCTL_MIDFRAG 0x0002 // 0000 0000 0000 0010
129 #define FRAGCTL_STAFRAG 0x0001 // 0000 0000 0000 0001
130 #define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000
132 //#define TYPE_AC0DMA 0
133 //#define TYPE_TXDMA0 1
134 #define TYPE_TXDMA0 0
135 #define TYPE_AC0DMA 1
136 #define TYPE_ATIMDMA 2
137 #define TYPE_SYNCDMA 3
140 #define TYPE_BEACONDMA 4
142 #define TYPE_RXDMA0 0
143 #define TYPE_RXDMA1 1
146 // TD_INFO flags control bit
147 #define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb
148 #define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)
149 #define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit
150 //#define TD_FLAGS_NETIF_SKB 0x04
152 /*--------------------- Export Types ------------------------------*/
155 // RsvTime buffer header
157 typedef struct tagSRrvTime_gRTS
{
158 WORD wRTSTxRrvTime_ba
;
159 WORD wRTSTxRrvTime_aa
;
160 WORD wRTSTxRrvTime_bb
;
164 } __attribute__ ((__packed__
))
165 SRrvTime_gRTS
, *PSRrvTime_gRTS
;
167 typedef const SRrvTime_gRTS
*PCSRrvTime_gRTS
;
169 typedef struct tagSRrvTime_gCTS
{
170 WORD wCTSTxRrvTime_ba
;
174 } __attribute__ ((__packed__
))
175 SRrvTime_gCTS
, *PSRrvTime_gCTS
;
177 typedef const SRrvTime_gCTS
*PCSRrvTime_gCTS
;
179 typedef struct tagSRrvTime_ab
{
182 } __attribute__ ((__packed__
))
183 SRrvTime_ab
, *PSRrvTime_ab
;
185 typedef const SRrvTime_ab
*PCSRrvTime_ab
;
187 typedef struct tagSRrvTime_atim
{
188 WORD wCTSTxRrvTime_ba
;
190 } __attribute__ ((__packed__
))
191 SRrvTime_atim
, *PSRrvTime_atim
;
193 typedef const SRrvTime_atim
*PCSRrvTime_atim
;
198 typedef struct tagSRTSData
{
201 BYTE abyRA
[ETH_ALEN
];
202 BYTE abyTA
[ETH_ALEN
];
203 } __attribute__ ((__packed__
))
204 SRTSData
, *PSRTSData
;
206 typedef const SRTSData
*PCSRTSData
;
208 typedef struct tagSRTS_g
{
209 BYTE bySignalField_b
;
210 BYTE byServiceField_b
;
211 WORD wTransmitLength_b
;
212 BYTE bySignalField_a
;
213 BYTE byServiceField_a
;
214 WORD wTransmitLength_a
;
220 } __attribute__ ((__packed__
))
222 typedef const SRTS_g
*PCSRTS_g
;
224 typedef struct tagSRTS_g_FB
{
225 BYTE bySignalField_b
;
226 BYTE byServiceField_b
;
227 WORD wTransmitLength_b
;
228 BYTE bySignalField_a
;
229 BYTE byServiceField_a
;
230 WORD wTransmitLength_a
;
235 WORD wRTSDuration_ba_f0
;
236 WORD wRTSDuration_aa_f0
;
237 WORD wRTSDuration_ba_f1
;
238 WORD wRTSDuration_aa_f1
;
240 } __attribute__ ((__packed__
))
241 SRTS_g_FB
, *PSRTS_g_FB
;
243 typedef const SRTS_g_FB
*PCSRTS_g_FB
;
245 typedef struct tagSRTS_ab
{
248 WORD wTransmitLength
;
252 } __attribute__ ((__packed__
))
255 typedef const SRTS_ab
*PCSRTS_ab
;
257 typedef struct tagSRTS_a_FB
{
260 WORD wTransmitLength
;
263 WORD wRTSDuration_f0
;
264 WORD wRTSDuration_f1
;
266 } __attribute__ ((__packed__
))
267 SRTS_a_FB
, *PSRTS_a_FB
;
269 typedef const SRTS_a_FB
*PCSRTS_a_FB
;
275 typedef struct tagSCTSData
{
278 BYTE abyRA
[ETH_ALEN
];
280 } __attribute__ ((__packed__
))
281 SCTSData
, *PSCTSData
;
283 typedef struct tagSCTS
{
284 BYTE bySignalField_b
;
285 BYTE byServiceField_b
;
286 WORD wTransmitLength_b
;
290 } __attribute__ ((__packed__
))
293 typedef const SCTS
*PCSCTS
;
295 typedef struct tagSCTS_FB
{
296 BYTE bySignalField_b
;
297 BYTE byServiceField_b
;
298 WORD wTransmitLength_b
;
301 WORD wCTSDuration_ba_f0
;
302 WORD wCTSDuration_ba_f1
;
304 } __attribute__ ((__packed__
))
307 typedef const SCTS_FB
*PCSCTS_FB
;
312 typedef struct tagSTxBufHead
{
318 } __attribute__ ((__packed__
))
319 STxBufHead
, *PSTxBufHead
;
320 typedef const STxBufHead
*PCSTxBufHead
;
322 typedef struct tagSTxShortBufHead
{
325 } __attribute__ ((__packed__
))
326 STxShortBufHead
, *PSTxShortBufHead
;
327 typedef const STxShortBufHead
*PCSTxShortBufHead
;
332 typedef struct tagSTxDataHead_g
{
333 BYTE bySignalField_b
;
334 BYTE byServiceField_b
;
335 WORD wTransmitLength_b
;
336 BYTE bySignalField_a
;
337 BYTE byServiceField_a
;
338 WORD wTransmitLength_a
;
341 WORD wTimeStampOff_b
;
342 WORD wTimeStampOff_a
;
343 } __attribute__ ((__packed__
))
344 STxDataHead_g
, *PSTxDataHead_g
;
346 typedef const STxDataHead_g
*PCSTxDataHead_g
;
348 typedef struct tagSTxDataHead_g_FB
{
349 BYTE bySignalField_b
;
350 BYTE byServiceField_b
;
351 WORD wTransmitLength_b
;
352 BYTE bySignalField_a
;
353 BYTE byServiceField_a
;
354 WORD wTransmitLength_a
;
359 WORD wTimeStampOff_b
;
360 WORD wTimeStampOff_a
;
361 } __attribute__ ((__packed__
))
362 STxDataHead_g_FB
, *PSTxDataHead_g_FB
;
363 typedef const STxDataHead_g_FB
*PCSTxDataHead_g_FB
;
365 typedef struct tagSTxDataHead_ab
{
368 WORD wTransmitLength
;
371 } __attribute__ ((__packed__
))
372 STxDataHead_ab
, *PSTxDataHead_ab
;
373 typedef const STxDataHead_ab
*PCSTxDataHead_ab
;
375 typedef struct tagSTxDataHead_a_FB
{
378 WORD wTransmitLength
;
383 } __attribute__ ((__packed__
))
384 STxDataHead_a_FB
, *PSTxDataHead_a_FB
;
385 typedef const STxDataHead_a_FB
*PCSTxDataHead_a_FB
;
388 // MICHDR data header
390 typedef struct tagSMICHDRHead
{
394 } __attribute__ ((__packed__
))
395 SMICHDRHead
, *PSMICHDRHead
;
397 typedef const SMICHDRHead
*PCSMICHDRHead
;
399 typedef struct tagSBEACONCtl
{
404 } __attribute__ ((__packed__
))
407 typedef struct tagSSecretKey
{
410 } __attribute__ ((__packed__
))
413 typedef struct tagSKeyEntry
{
422 } __attribute__ ((__packed__
))
424 /*--------------------- Export Macros ------------------------------*/
426 /*--------------------- Export Classes ----------------------------*/
428 /*--------------------- Export Variables --------------------------*/
430 /*--------------------- Export Functions --------------------------*/
432 #endif /* __DESC_H__ */