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>
36 #include <linux/ieee80211.h>
40 /* max transmit or receive buffer size */
41 #define CB_MAX_BUF_SIZE 2900U /* NOTE: must be multiple of 4 */
43 /* max TX buffer size */
44 #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE
45 /* max RX buffer size when not use Multi-RD */
46 #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE
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 /* from 0x60 to 0xA0 */
55 #define TX_BLOCKS 32 /* from 0xA0 to 0xC0 */
57 #define CB_MAX_RX_DESC 128 /* max # of descriptors */
58 #define CB_MIN_RX_DESC 16 /* min # of RX descriptors */
59 #define CB_MAX_TX_DESC 128 /* max # of descriptors */
60 #define CB_MIN_TX_DESC 16 /* min # of TX descriptors */
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
69 #define RSR_ADDRMULTI 0x40
70 #define RSR_ADDRUNI 0x00
71 #define RSR_IVLDTYP 0x20 /* invalid packet type */
72 #define RSR_IVLDLEN 0x10 /* invalid len (> 2312 byte) */
73 #define RSR_BSSIDOK 0x08
74 #define RSR_CRCOK 0x04
75 #define RSR_BCNSSIDOK 0x02
76 #define RSR_ADDROK 0x01
79 * bits in the new RSR register
81 #define NEWRSR_DECRYPTOK 0x10
82 #define NEWRSR_CFPIND 0x08
83 #define NEWRSR_HWUTSF 0x04
84 #define NEWRSR_BCNHITAID 0x02
85 #define NEWRSR_BCNHITAID0 0x01
88 * bits in the TSR register
90 #define TSR_RETRYTMO 0x08
92 #define TSR_ACKDATA 0x02
93 #define TSR_VALID 0x01
95 #define CB_PROTOCOL_RESERVED_SECTION 16
98 * if retries exceed 15 times, TX will abort, and
99 * if TX fifo underflow, TX will fail
100 * we should try to resend it
102 #define CB_MAX_TX_ABORT_RETRY 3
104 #define FIFOCTL_AUTO_FB_1 0x1000
105 #define FIFOCTL_AUTO_FB_0 0x0800
106 #define FIFOCTL_GRPACK 0x0400
107 #define FIFOCTL_11GA 0x0300
108 #define FIFOCTL_11GB 0x0200
109 #define FIFOCTL_11B 0x0100
110 #define FIFOCTL_11A 0x0000
111 #define FIFOCTL_RTS 0x0080
112 #define FIFOCTL_ISDMA0 0x0040
113 #define FIFOCTL_GENINT 0x0020
114 #define FIFOCTL_TMOEN 0x0010
115 #define FIFOCTL_LRETRY 0x0008
116 #define FIFOCTL_CRCDIS 0x0004
117 #define FIFOCTL_NEEDACK 0x0002
118 #define FIFOCTL_LHEAD 0x0001
120 /* WMAC definition Frag Control */
121 #define FRAGCTL_AES 0x0300
122 #define FRAGCTL_TKIP 0x0200
123 #define FRAGCTL_LEGACY 0x0100
124 #define FRAGCTL_NONENCRYPT 0x0000
125 #define FRAGCTL_ENDFRAG 0x0003
126 #define FRAGCTL_MIDFRAG 0x0002
127 #define FRAGCTL_STAFRAG 0x0001
128 #define FRAGCTL_NONFRAG 0x0000
130 #define TYPE_TXDMA0 0
131 #define TYPE_AC0DMA 1
132 #define TYPE_ATIMDMA 2
133 #define TYPE_SYNCDMA 3
136 #define TYPE_BEACONDMA 4
138 #define TYPE_RXDMA0 0
139 #define TYPE_RXDMA1 1
142 /* TD_INFO flags control bit */
143 #define TD_FLAGS_NETIF_SKB 0x01 /* check if need release skb */
144 #define TD_FLAGS_PRIV_SKB 0x02 /* check if called from private skb(hostap) */
145 #define TD_FLAGS_PS_RETRY 0x04 /* check if PS STA frame re-transmit */
148 * RsvTime buffer header
150 typedef struct tagSRrvTime_gRTS {
151 u16 wRTSTxRrvTime_ba;
152 u16 wRTSTxRrvTime_aa;
153 u16 wRTSTxRrvTime_bb;
157 } __attribute__ ((__packed__))
158 SRrvTime_gRTS, *PSRrvTime_gRTS;
160 typedef const SRrvTime_gRTS *PCSRrvTime_gRTS;
162 typedef struct tagSRrvTime_gCTS {
163 u16 wCTSTxRrvTime_ba;
167 } __attribute__ ((__packed__))
168 SRrvTime_gCTS, *PSRrvTime_gCTS;
170 typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
172 typedef struct tagSRrvTime_ab {
175 } __attribute__ ((__packed__))
176 SRrvTime_ab, *PSRrvTime_ab;
178 typedef const SRrvTime_ab *PCSRrvTime_ab;
180 typedef struct tagSRrvTime_atim {
181 u16 wCTSTxRrvTime_ba;
183 } __attribute__ ((__packed__))
184 SRrvTime_atim, *PSRrvTime_atim;
186 typedef const SRrvTime_atim *PCSRrvTime_atim;
191 typedef struct tagSRTS_g {
194 u16 wTransmitLength_b;
197 u16 wTransmitLength_a;
202 struct ieee80211_rts data;
203 } __attribute__ ((__packed__))
205 typedef const SRTS_g *PCSRTS_g;
207 typedef struct tagSRTS_g_FB {
210 u16 wTransmitLength_b;
213 u16 wTransmitLength_a;
218 u16 wRTSDuration_ba_f0;
219 u16 wRTSDuration_aa_f0;
220 u16 wRTSDuration_ba_f1;
221 u16 wRTSDuration_aa_f1;
222 struct ieee80211_rts data;
223 } __attribute__ ((__packed__))
224 SRTS_g_FB, *PSRTS_g_FB;
226 typedef const SRTS_g_FB *PCSRTS_g_FB;
228 typedef struct tagSRTS_ab {
234 struct ieee80211_rts data;
235 } __attribute__ ((__packed__))
238 typedef const SRTS_ab *PCSRTS_ab;
240 typedef struct tagSRTS_a_FB {
248 struct ieee80211_rts data;
249 } __attribute__ ((__packed__))
250 SRTS_a_FB, *PSRTS_a_FB;
252 typedef const SRTS_a_FB *PCSRTS_a_FB;
257 typedef struct tagSCTS {
260 u16 wTransmitLength_b;
263 struct ieee80211_cts data;
265 } __attribute__ ((__packed__))
268 typedef const SCTS *PCSCTS;
270 typedef struct tagSCTS_FB {
273 u16 wTransmitLength_b;
276 u16 wCTSDuration_ba_f0;
277 u16 wCTSDuration_ba_f1;
278 struct ieee80211_cts data;
280 } __attribute__ ((__packed__))
283 typedef const SCTS_FB *PCSCTS_FB;
288 typedef struct tagSTxBufHead {
294 } __attribute__ ((__packed__))
295 STxBufHead, *PSTxBufHead;
296 typedef const STxBufHead *PCSTxBufHead;
298 typedef struct tagSTxShortBufHead {
301 } __attribute__ ((__packed__))
302 STxShortBufHead, *PSTxShortBufHead;
303 typedef const STxShortBufHead *PCSTxShortBufHead;
308 typedef struct tagSTxDataHead_g {
311 u16 wTransmitLength_b;
314 u16 wTransmitLength_a;
319 } __attribute__ ((__packed__))
320 STxDataHead_g, *PSTxDataHead_g;
322 typedef const STxDataHead_g *PCSTxDataHead_g;
324 typedef struct tagSTxDataHead_g_FB {
327 u16 wTransmitLength_b;
330 u16 wTransmitLength_a;
337 } __attribute__ ((__packed__))
338 STxDataHead_g_FB, *PSTxDataHead_g_FB;
339 typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB;
341 typedef struct tagSTxDataHead_ab {
347 } __attribute__ ((__packed__))
348 STxDataHead_ab, *PSTxDataHead_ab;
349 typedef const STxDataHead_ab *PCSTxDataHead_ab;
351 typedef struct tagSTxDataHead_a_FB {
359 } __attribute__ ((__packed__))
360 STxDataHead_a_FB, *PSTxDataHead_a_FB;
361 typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB;
366 typedef struct tagSMICHDRHead {
370 } __attribute__ ((__packed__))
371 SMICHDRHead, *PSMICHDRHead;
373 typedef const SMICHDRHead *PCSMICHDRHead;
375 typedef struct tagSBEACONCtl {
380 } __attribute__ ((__packed__))
383 typedef struct tagSSecretKey {
386 } __attribute__ ((__packed__))
389 typedef struct tagSKeyEntry {
398 } __attribute__ ((__packed__))
401 #endif /* __DESC_H__ */