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 // max transmit or receive buffer size
40 #define CB_MAX_BUF_SIZE 2900U // max buffer size
41 // NOTE: must be multiple of 4
43 #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE // max Tx buffer size
44 #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE // max Rx buffer size when not use Multi-RD
46 #define CB_BEACON_BUF_SIZE 512U // default beacon buffer size
48 #define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE
50 #define MAX_INTERRUPT_SIZE 32
52 #define RX_BLOCKS 64 // form 0x60 to 0xA0
53 #define TX_BLOCKS 32 // from 0xA0 to 0xC0
55 #define CB_MAX_RX_DESC 128 // max # of descriptor
56 #define CB_MIN_RX_DESC 16 // min # of rx descriptor
57 #define CB_MAX_TX_DESC 128 // max # of descriptor
58 #define CB_MIN_TX_DESC 16 // min # of tx descriptor
60 #define CB_RD_NUM 64 // default # of RD
61 #define CB_TD_NUM 64 // default # of TD
64 // Bits in the RSR register
66 #define RSR_ADDRBROAD 0x80 // 1000 0000
67 #define RSR_ADDRMULTI 0x40 // 0100 0000
68 #define RSR_ADDRUNI 0x00 // 0000 0000
69 #define RSR_IVLDTYP 0x20 // 0010 0000 , invalid packet type
70 #define RSR_IVLDLEN 0x10 // 0001 0000 , invalid len (> 2312 byte)
71 #define RSR_BSSIDOK 0x08 // 0000 1000
72 #define RSR_CRCOK 0x04 // 0000 0100
73 #define RSR_BCNSSIDOK 0x02 // 0000 0010
74 #define RSR_ADDROK 0x01 // 0000 0001
77 // Bits in the new RSR register
79 #define NEWRSR_DECRYPTOK 0x10 // 0001 0000
80 #define NEWRSR_CFPIND 0x08 // 0000 1000
81 #define NEWRSR_HWUTSF 0x04 // 0000 0100
82 #define NEWRSR_BCNHITAID 0x02 // 0000 0010
83 #define NEWRSR_BCNHITAID0 0x01 // 0000 0001
86 // Bits in the TSR register
88 #define TSR_RETRYTMO 0x08 // 0000 1000
89 #define TSR_TMO 0x04 // 0000 0100
90 #define TSR_ACKDATA 0x02 // 0000 0010
91 #define TSR_VALID 0x01 // 0000 0001
93 #define CB_PROTOCOL_RESERVED_SECTION 16
95 // if retrys excess 15 times , tx will abort, and
96 // if tx fifo underflow, tx will fail
97 // we should try to resend it
98 #define CB_MAX_TX_ABORT_RETRY 3
100 #define FIFOCTL_AUTO_FB_1 0x1000 // 0001 0000 0000 0000
101 #define FIFOCTL_AUTO_FB_0 0x0800 // 0000 1000 0000 0000
102 #define FIFOCTL_GRPACK 0x0400 // 0000 0100 0000 0000
103 #define FIFOCTL_11GA 0x0300 // 0000 0011 0000 0000
104 #define FIFOCTL_11GB 0x0200 // 0000 0010 0000 0000
105 #define FIFOCTL_11B 0x0100 // 0000 0001 0000 0000
106 #define FIFOCTL_11A 0x0000 // 0000 0000 0000 0000
107 #define FIFOCTL_RTS 0x0080 // 0000 0000 1000 0000
108 #define FIFOCTL_ISDMA0 0x0040 // 0000 0000 0100 0000
109 #define FIFOCTL_GENINT 0x0020 // 0000 0000 0010 0000
110 #define FIFOCTL_TMOEN 0x0010 // 0000 0000 0001 0000
111 #define FIFOCTL_LRETRY 0x0008 // 0000 0000 0000 1000
112 #define FIFOCTL_CRCDIS 0x0004 // 0000 0000 0000 0100
113 #define FIFOCTL_NEEDACK 0x0002 // 0000 0000 0000 0010
114 #define FIFOCTL_LHEAD 0x0001 // 0000 0000 0000 0001
116 //WMAC definition Frag Control
117 #define FRAGCTL_AES 0x0300 // 0000 0011 0000 0000
118 #define FRAGCTL_TKIP 0x0200 // 0000 0010 0000 0000
119 #define FRAGCTL_LEGACY 0x0100 // 0000 0001 0000 0000
120 #define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000
121 #define FRAGCTL_ENDFRAG 0x0003 // 0000 0000 0000 0011
122 #define FRAGCTL_MIDFRAG 0x0002 // 0000 0000 0000 0010
123 #define FRAGCTL_STAFRAG 0x0001 // 0000 0000 0000 0001
124 #define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000
126 #define TYPE_TXDMA0 0
127 #define TYPE_AC0DMA 1
128 #define TYPE_ATIMDMA 2
129 #define TYPE_SYNCDMA 3
132 #define TYPE_BEACONDMA 4
134 #define TYPE_RXDMA0 0
135 #define TYPE_RXDMA1 1
138 // TD_INFO flags control bit
139 #define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb
140 #define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)
141 #define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit
144 // RsvTime buffer header
146 typedef struct tagSRrvTime_gRTS {
147 WORD wRTSTxRrvTime_ba;
148 WORD wRTSTxRrvTime_aa;
149 WORD wRTSTxRrvTime_bb;
153 } __attribute__ ((__packed__))
154 SRrvTime_gRTS, *PSRrvTime_gRTS;
156 typedef const SRrvTime_gRTS *PCSRrvTime_gRTS;
158 typedef struct tagSRrvTime_gCTS {
159 WORD wCTSTxRrvTime_ba;
163 } __attribute__ ((__packed__))
164 SRrvTime_gCTS, *PSRrvTime_gCTS;
166 typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
168 typedef struct tagSRrvTime_ab {
171 } __attribute__ ((__packed__))
172 SRrvTime_ab, *PSRrvTime_ab;
174 typedef const SRrvTime_ab *PCSRrvTime_ab;
176 typedef struct tagSRrvTime_atim {
177 WORD wCTSTxRrvTime_ba;
179 } __attribute__ ((__packed__))
180 SRrvTime_atim, *PSRrvTime_atim;
182 typedef const SRrvTime_atim *PCSRrvTime_atim;
187 typedef struct tagSRTSData {
190 BYTE abyRA[ETH_ALEN];
191 BYTE abyTA[ETH_ALEN];
192 } __attribute__ ((__packed__))
193 SRTSData, *PSRTSData;
195 typedef const SRTSData *PCSRTSData;
197 typedef struct tagSRTS_g {
198 BYTE bySignalField_b;
199 BYTE byServiceField_b;
200 WORD wTransmitLength_b;
201 BYTE bySignalField_a;
202 BYTE byServiceField_a;
203 WORD wTransmitLength_a;
209 } __attribute__ ((__packed__))
211 typedef const SRTS_g *PCSRTS_g;
213 typedef struct tagSRTS_g_FB {
214 BYTE bySignalField_b;
215 BYTE byServiceField_b;
216 WORD wTransmitLength_b;
217 BYTE bySignalField_a;
218 BYTE byServiceField_a;
219 WORD wTransmitLength_a;
224 WORD wRTSDuration_ba_f0;
225 WORD wRTSDuration_aa_f0;
226 WORD wRTSDuration_ba_f1;
227 WORD wRTSDuration_aa_f1;
229 } __attribute__ ((__packed__))
230 SRTS_g_FB, *PSRTS_g_FB;
232 typedef const SRTS_g_FB *PCSRTS_g_FB;
234 typedef struct tagSRTS_ab {
237 WORD wTransmitLength;
241 } __attribute__ ((__packed__))
244 typedef const SRTS_ab *PCSRTS_ab;
246 typedef struct tagSRTS_a_FB {
249 WORD wTransmitLength;
252 WORD wRTSDuration_f0;
253 WORD wRTSDuration_f1;
255 } __attribute__ ((__packed__))
256 SRTS_a_FB, *PSRTS_a_FB;
258 typedef const SRTS_a_FB *PCSRTS_a_FB;
263 typedef struct tagSCTSData {
266 BYTE abyRA[ETH_ALEN];
268 } __attribute__ ((__packed__))
269 SCTSData, *PSCTSData;
271 typedef struct tagSCTS {
272 BYTE bySignalField_b;
273 BYTE byServiceField_b;
274 WORD wTransmitLength_b;
278 } __attribute__ ((__packed__))
281 typedef const SCTS *PCSCTS;
283 typedef struct tagSCTS_FB {
284 BYTE bySignalField_b;
285 BYTE byServiceField_b;
286 WORD wTransmitLength_b;
289 WORD wCTSDuration_ba_f0;
290 WORD wCTSDuration_ba_f1;
292 } __attribute__ ((__packed__))
295 typedef const SCTS_FB *PCSCTS_FB;
300 typedef struct tagSTxBufHead {
306 } __attribute__ ((__packed__))
307 STxBufHead, *PSTxBufHead;
308 typedef const STxBufHead *PCSTxBufHead;
310 typedef struct tagSTxShortBufHead {
313 } __attribute__ ((__packed__))
314 STxShortBufHead, *PSTxShortBufHead;
315 typedef const STxShortBufHead *PCSTxShortBufHead;
320 typedef struct tagSTxDataHead_g {
321 BYTE bySignalField_b;
322 BYTE byServiceField_b;
323 WORD wTransmitLength_b;
324 BYTE bySignalField_a;
325 BYTE byServiceField_a;
326 WORD wTransmitLength_a;
329 WORD wTimeStampOff_b;
330 WORD wTimeStampOff_a;
331 } __attribute__ ((__packed__))
332 STxDataHead_g, *PSTxDataHead_g;
334 typedef const STxDataHead_g *PCSTxDataHead_g;
336 typedef struct tagSTxDataHead_g_FB {
337 BYTE bySignalField_b;
338 BYTE byServiceField_b;
339 WORD wTransmitLength_b;
340 BYTE bySignalField_a;
341 BYTE byServiceField_a;
342 WORD wTransmitLength_a;
347 WORD wTimeStampOff_b;
348 WORD wTimeStampOff_a;
349 } __attribute__ ((__packed__))
350 STxDataHead_g_FB, *PSTxDataHead_g_FB;
351 typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB;
353 typedef struct tagSTxDataHead_ab {
356 WORD wTransmitLength;
359 } __attribute__ ((__packed__))
360 STxDataHead_ab, *PSTxDataHead_ab;
361 typedef const STxDataHead_ab *PCSTxDataHead_ab;
363 typedef struct tagSTxDataHead_a_FB {
366 WORD wTransmitLength;
371 } __attribute__ ((__packed__))
372 STxDataHead_a_FB, *PSTxDataHead_a_FB;
373 typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB;
376 // MICHDR data header
378 typedef struct tagSMICHDRHead {
382 } __attribute__ ((__packed__))
383 SMICHDRHead, *PSMICHDRHead;
385 typedef const SMICHDRHead *PCSMICHDRHead;
387 typedef struct tagSBEACONCtl {
392 } __attribute__ ((__packed__))
395 typedef struct tagSSecretKey {
398 } __attribute__ ((__packed__))
401 typedef struct tagSKeyEntry {
410 } __attribute__ ((__packed__))
413 #endif /* __DESC_H__ */