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
35 #include <linux/types.h>
38 #if !defined(__TTYPE_H__)
41 #if !defined(__TETHER_H__)
49 /*--------------------- Export Definitions -------------------------*/
51 // max transmit or receive buffer size
52 #define CB_MAX_BUF_SIZE 2900U // max buffer size
53 // NOTE: must be multiple of 4
55 #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE // max Tx buffer size
56 #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE // max Rx buffer size when not use Multi-RD
58 #define CB_BEACON_BUF_SIZE 512U // default beacon buffer size
60 #define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE
62 #define MAX_INTERRUPT_SIZE 32
65 #define RX_BLOCKS 64 // form 0x60 to 0xA0
66 #define TX_BLOCKS 32 // from 0xA0 to 0xC0
68 #define CB_MAX_RX_DESC 128 // max # of descriptor
69 #define CB_MIN_RX_DESC 16 // min # of rx descriptor
70 #define CB_MAX_TX_DESC 128 // max # of descriptor
71 #define CB_MIN_TX_DESC 16 // min # of tx descriptor
73 #define CB_RD_NUM 64 // default # of RD
74 #define CB_TD_NUM 64 // default # of TD
79 // Bits in the RSR register
81 #define RSR_ADDRBROAD 0x80 // 1000 0000
82 #define RSR_ADDRMULTI 0x40 // 0100 0000
83 #define RSR_ADDRUNI 0x00 // 0000 0000
84 #define RSR_IVLDTYP 0x20 // 0010 0000 , invalid packet type
85 #define RSR_IVLDLEN 0x10 // 0001 0000 , invalid len (> 2312 byte)
86 #define RSR_BSSIDOK 0x08 // 0000 1000
87 #define RSR_CRCOK 0x04 // 0000 0100
88 #define RSR_BCNSSIDOK 0x02 // 0000 0010
89 #define RSR_ADDROK 0x01 // 0000 0001
92 // Bits in the new RSR register
94 #define NEWRSR_DECRYPTOK 0x10 // 0001 0000
95 #define NEWRSR_CFPIND 0x08 // 0000 1000
96 #define NEWRSR_HWUTSF 0x04 // 0000 0100
97 #define NEWRSR_BCNHITAID 0x02 // 0000 0010
98 #define NEWRSR_BCNHITAID0 0x01 // 0000 0001
102 // Bits in the TSR register
104 #define TSR_RETRYTMO 0x08 // 0000 1000
105 #define TSR_TMO 0x04 // 0000 0100
106 #define TSR_ACKDATA 0x02 // 0000 0010
107 #define TSR_VALID 0x01 // 0000 0001
110 #define CB_PROTOCOL_RESERVED_SECTION 16
114 // if retrys excess 15 times , tx will abort, and
115 // if tx fifo underflow, tx will fail
116 // we should try to resend it
117 #define CB_MAX_TX_ABORT_RETRY 3
120 #define FIFOCTL_AUTO_FB_1 0x1000 // 0001 0000 0000 0000
121 #define FIFOCTL_AUTO_FB_0 0x0800 // 0000 1000 0000 0000
122 #define FIFOCTL_GRPACK 0x0400 // 0000 0100 0000 0000
123 #define FIFOCTL_11GA 0x0300 // 0000 0011 0000 0000
124 #define FIFOCTL_11GB 0x0200 // 0000 0010 0000 0000
125 #define FIFOCTL_11B 0x0100 // 0000 0001 0000 0000
126 #define FIFOCTL_11A 0x0000 // 0000 0000 0000 0000
127 #define FIFOCTL_RTS 0x0080 // 0000 0000 1000 0000
128 #define FIFOCTL_ISDMA0 0x0040 // 0000 0000 0100 0000
129 #define FIFOCTL_GENINT 0x0020 // 0000 0000 0010 0000
130 #define FIFOCTL_TMOEN 0x0010 // 0000 0000 0001 0000
131 #define FIFOCTL_LRETRY 0x0008 // 0000 0000 0000 1000
132 #define FIFOCTL_CRCDIS 0x0004 // 0000 0000 0000 0100
133 #define FIFOCTL_NEEDACK 0x0002 // 0000 0000 0000 0010
134 #define FIFOCTL_LHEAD 0x0001 // 0000 0000 0000 0001
136 //WMAC definition Frag Control
137 #define FRAGCTL_AES 0x0300 // 0000 0011 0000 0000
138 #define FRAGCTL_TKIP 0x0200 // 0000 0010 0000 0000
139 #define FRAGCTL_LEGACY 0x0100 // 0000 0001 0000 0000
140 #define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000
141 //#define FRAGCTL_AC3 0x000C // 0000 0000 0000 1100
142 //#define FRAGCTL_AC2 0x0008 // 0000 0000 0000 1000
143 //#define FRAGCTL_AC1 0x0004 // 0000 0000 0000 0100
144 //#define FRAGCTL_AC0 0x0000 // 0000 0000 0000 0000
145 #define FRAGCTL_ENDFRAG 0x0003 // 0000 0000 0000 0011
146 #define FRAGCTL_MIDFRAG 0x0002 // 0000 0000 0000 0010
147 #define FRAGCTL_STAFRAG 0x0001 // 0000 0000 0000 0001
148 #define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000
151 //#define TYPE_AC0DMA 0
152 //#define TYPE_TXDMA0 1
153 #define TYPE_TXDMA0 0
154 #define TYPE_AC0DMA 1
155 #define TYPE_ATIMDMA 2
156 #define TYPE_SYNCDMA 3
159 #define TYPE_BEACONDMA 4
161 #define TYPE_RXDMA0 0
162 #define TYPE_RXDMA1 1
167 // TD_INFO flags control bit
168 #define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb
169 #define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap)
170 #define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit
171 //#define TD_FLAGS_NETIF_SKB 0x04
173 /*--------------------- Export Types ------------------------------*/
177 // RsvTime buffer header
179 typedef struct tagSRrvTime_gRTS {
180 WORD wRTSTxRrvTime_ba;
181 WORD wRTSTxRrvTime_aa;
182 WORD wRTSTxRrvTime_bb;
186 }__attribute__ ((__packed__))
187 SRrvTime_gRTS, DEF* PSRrvTime_gRTS;
188 typedef const SRrvTime_gRTS DEF* PCSRrvTime_gRTS;
190 typedef struct tagSRrvTime_gCTS {
191 WORD wCTSTxRrvTime_ba;
195 }__attribute__ ((__packed__))
196 SRrvTime_gCTS, DEF* PSRrvTime_gCTS;
197 typedef const SRrvTime_gCTS DEF* PCSRrvTime_gCTS;
199 typedef struct tagSRrvTime_ab {
202 }__attribute__ ((__packed__))
203 SRrvTime_ab, DEF* PSRrvTime_ab;
204 typedef const SRrvTime_ab DEF* PCSRrvTime_ab;
206 typedef struct tagSRrvTime_atim {
207 WORD wCTSTxRrvTime_ba;
209 }__attribute__ ((__packed__))
210 SRrvTime_atim, DEF* PSRrvTime_atim;
211 typedef const SRrvTime_atim DEF* PCSRrvTime_atim;
216 typedef struct tagSRTSData {
219 BYTE abyRA[U_ETHER_ADDR_LEN];
220 BYTE abyTA[U_ETHER_ADDR_LEN];
221 }__attribute__ ((__packed__))
222 SRTSData, DEF* PSRTSData;
223 typedef const SRTSData DEF* PCSRTSData;
225 typedef struct tagSRTS_g {
226 BYTE bySignalField_b;
227 BYTE byServiceField_b;
228 WORD wTransmitLength_b;
229 BYTE bySignalField_a;
230 BYTE byServiceField_a;
231 WORD wTransmitLength_a;
237 }__attribute__ ((__packed__))
238 SRTS_g, DEF* PSRTS_g;
239 typedef const SRTS_g DEF* PCSRTS_g;
242 typedef struct tagSRTS_g_FB {
243 BYTE bySignalField_b;
244 BYTE byServiceField_b;
245 WORD wTransmitLength_b;
246 BYTE bySignalField_a;
247 BYTE byServiceField_a;
248 WORD wTransmitLength_a;
253 WORD wRTSDuration_ba_f0;
254 WORD wRTSDuration_aa_f0;
255 WORD wRTSDuration_ba_f1;
256 WORD wRTSDuration_aa_f1;
258 }__attribute__ ((__packed__))
259 SRTS_g_FB, DEF* PSRTS_g_FB;
260 typedef const SRTS_g_FB DEF* PCSRTS_g_FB;
263 typedef struct tagSRTS_ab {
266 WORD wTransmitLength;
270 }__attribute__ ((__packed__))
271 SRTS_ab, DEF* PSRTS_ab;
272 typedef const SRTS_ab DEF* PCSRTS_ab;
275 typedef struct tagSRTS_a_FB {
278 WORD wTransmitLength;
281 WORD wRTSDuration_f0;
282 WORD wRTSDuration_f1;
284 }__attribute__ ((__packed__))
285 SRTS_a_FB, DEF* PSRTS_a_FB;
286 typedef const SRTS_a_FB DEF* PCSRTS_a_FB;
292 typedef struct tagSCTSData {
295 BYTE abyRA[U_ETHER_ADDR_LEN];
297 }__attribute__ ((__packed__))
298 SCTSData, DEF* PSCTSData;
300 typedef struct tagSCTS {
301 BYTE bySignalField_b;
302 BYTE byServiceField_b;
303 WORD wTransmitLength_b;
307 }__attribute__ ((__packed__))
309 typedef const SCTS DEF* PCSCTS;
311 typedef struct tagSCTS_FB {
312 BYTE bySignalField_b;
313 BYTE byServiceField_b;
314 WORD wTransmitLength_b;
317 WORD wCTSDuration_ba_f0;
318 WORD wCTSDuration_ba_f1;
320 }__attribute__ ((__packed__))
321 SCTS_FB, DEF* PSCTS_FB;
322 typedef const SCTS_FB DEF* PCSCTS_FB;
328 typedef struct tagSTxBufHead {
334 }__attribute__ ((__packed__))
335 STxBufHead, DEF* PSTxBufHead;
336 typedef const STxBufHead DEF* PCSTxBufHead;
338 typedef struct tagSTxShortBufHead {
341 }__attribute__ ((__packed__))
342 STxShortBufHead, DEF* PSTxShortBufHead;
343 typedef const STxShortBufHead DEF* PCSTxShortBufHead;
348 typedef struct tagSTxDataHead_g {
349 BYTE bySignalField_b;
350 BYTE byServiceField_b;
351 WORD wTransmitLength_b;
352 BYTE bySignalField_a;
353 BYTE byServiceField_a;
354 WORD wTransmitLength_a;
357 WORD wTimeStampOff_b;
358 WORD wTimeStampOff_a;
359 }__attribute__ ((__packed__))
360 STxDataHead_g, DEF* PSTxDataHead_g;
361 typedef const STxDataHead_g DEF* PCSTxDataHead_g;
363 typedef struct tagSTxDataHead_g_FB {
364 BYTE bySignalField_b;
365 BYTE byServiceField_b;
366 WORD wTransmitLength_b;
367 BYTE bySignalField_a;
368 BYTE byServiceField_a;
369 WORD wTransmitLength_a;
374 WORD wTimeStampOff_b;
375 WORD wTimeStampOff_a;
376 }__attribute__ ((__packed__))
377 STxDataHead_g_FB, DEF* PSTxDataHead_g_FB;
378 typedef const STxDataHead_g_FB DEF* PCSTxDataHead_g_FB;
381 typedef struct tagSTxDataHead_ab {
384 WORD wTransmitLength;
387 }__attribute__ ((__packed__))
388 STxDataHead_ab, DEF* PSTxDataHead_ab;
389 typedef const STxDataHead_ab DEF* PCSTxDataHead_ab;
392 typedef struct tagSTxDataHead_a_FB {
395 WORD wTransmitLength;
400 }__attribute__ ((__packed__))
401 STxDataHead_a_FB, DEF* PSTxDataHead_a_FB;
402 typedef const STxDataHead_a_FB DEF* PCSTxDataHead_a_FB;
405 // MICHDR data header
407 typedef struct tagSMICHDRHead {
411 }__attribute__ ((__packed__))
412 SMICHDRHead, DEF* PSMICHDRHead;
413 typedef const SMICHDRHead DEF* PCSMICHDRHead;
415 typedef struct tagSBEACONCtl {
420 }__attribute__ ((__packed__))
424 typedef struct tagSSecretKey {
427 }__attribute__ ((__packed__))
430 typedef struct tagSKeyEntry {
439 }__attribute__ ((__packed__))
441 /*--------------------- Export Macros ------------------------------*/
443 /*--------------------- Export Classes ----------------------------*/
445 /*--------------------- Export Variables --------------------------*/
447 /*--------------------- Export Functions --------------------------*/