Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
desc.h
Go to the documentation of this file.
1 /*
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 
31 #ifndef __DESC_H__
32 #define __DESC_H__
33 
34 #include <linux/types.h>
35 #include <linux/mm.h>
36 #include "ttype.h"
37 #include "tether.h"
38 
39 // max transmit or receive buffer size
40 #define CB_MAX_BUF_SIZE 2900U // max buffer size
41  // NOTE: must be multiple of 4
42 
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
45 
46 #define CB_BEACON_BUF_SIZE 512U // default beacon buffer size
47 
48 #define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE
49 
50 #define MAX_INTERRUPT_SIZE 32
51 
52 #define RX_BLOCKS 64 // form 0x60 to 0xA0
53 #define TX_BLOCKS 32 // from 0xA0 to 0xC0
54 
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
59 
60 #define CB_RD_NUM 64 // default # of RD
61 #define CB_TD_NUM 64 // default # of TD
62 
63 //
64 // Bits in the RSR register
65 //
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
75 
76 //
77 // Bits in the new RSR register
78 //
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
84 
85 //
86 // Bits in the TSR register
87 //
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
92 
93 #define CB_PROTOCOL_RESERVED_SECTION 16
94 
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
99 
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
115 
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
125 
126 #define TYPE_TXDMA0 0
127 #define TYPE_AC0DMA 1
128 #define TYPE_ATIMDMA 2
129 #define TYPE_SYNCDMA 3
130 #define TYPE_MAXTD 2
131 
132 #define TYPE_BEACONDMA 4
133 
134 #define TYPE_RXDMA0 0
135 #define TYPE_RXDMA1 1
136 #define TYPE_MAXRD 2
137 
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
142 
143 //
144 // RsvTime buffer header
145 //
146 typedef struct tagSRrvTime_gRTS {
153 } __attribute__ ((__packed__))
154 SRrvTime_gRTS, *PSRrvTime_gRTS;
156 typedef const SRrvTime_gRTS *PCSRrvTime_gRTS;
163 } __attribute__ ((__packed__))
164 SRrvTime_gCTS, *PSRrvTime_gCTS;
166 typedef const SRrvTime_gCTS *PCSRrvTime_gCTS;
167 
168 typedef struct tagSRrvTime_ab {
171 } __attribute__ ((__packed__))
172 SRrvTime_ab, *PSRrvTime_ab;
174 typedef const SRrvTime_ab *PCSRrvTime_ab;
175 
176 typedef struct tagSRrvTime_atim {
179 } __attribute__ ((__packed__))
180 SRrvTime_atim, *PSRrvTime_atim;
181 
182 typedef const SRrvTime_atim *PCSRrvTime_atim;
183 
184 //
185 // RTS buffer header
186 //
187 typedef struct tagSRTSData {
192 } __attribute__ ((__packed__))
193 SRTSData, *PSRTSData;
195 typedef const SRTSData *PCSRTSData;
197 typedef struct tagSRTS_g {
208  SRTSData Data;
209 } __attribute__ ((__packed__))
210 SRTS_g, *PSRTS_g;
211 typedef const SRTS_g *PCSRTS_g;
228  SRTSData Data;
229 } __attribute__ ((__packed__))
230 SRTS_g_FB, *PSRTS_g_FB;
231 
232 typedef const SRTS_g_FB *PCSRTS_g_FB;
233 
234 typedef struct tagSRTS_ab {
240  SRTSData Data;
241 } __attribute__ ((__packed__))
242 SRTS_ab, *PSRTS_ab;
244 typedef const SRTS_ab *PCSRTS_ab;
254  SRTSData Data;
255 } __attribute__ ((__packed__))
256 SRTS_a_FB, *PSRTS_a_FB;
257 
258 typedef const SRTS_a_FB *PCSRTS_a_FB;
259 
260 //
261 // CTS buffer header
262 //
268 } __attribute__ ((__packed__))
269 SCTSData, *PSCTSData;
270 
271 typedef struct tagSCTS {
277  SCTSData Data;
278 } __attribute__ ((__packed__))
280 
281 typedef const SCTS *PCSCTS;
282 
283 typedef struct tagSCTS_FB {
291  SCTSData Data;
292 } __attribute__ ((__packed__))
293 SCTS_FB, *PSCTS_FB;
294 
295 typedef const SCTS_FB *PCSCTS_FB;
296 
297 //
298 // Tx FIFO header
299 //
306 } __attribute__ ((__packed__))
307 STxBufHead, *PSTxBufHead;
308 typedef const STxBufHead *PCSTxBufHead;
313 } __attribute__ ((__packed__))
314 STxShortBufHead, *PSTxShortBufHead;
315 typedef const STxShortBufHead *PCSTxShortBufHead;
316 
317 //
318 // Tx data header
319 //
320 typedef struct tagSTxDataHead_g {
331 } __attribute__ ((__packed__))
332 STxDataHead_g, *PSTxDataHead_g;
333 
334 typedef const STxDataHead_g *PCSTxDataHead_g;
335 
336 typedef struct tagSTxDataHead_g_FB {
349 } __attribute__ ((__packed__))
350 STxDataHead_g_FB, *PSTxDataHead_g_FB;
351 typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB;
352 
353 typedef struct tagSTxDataHead_ab {
359 } __attribute__ ((__packed__))
360 STxDataHead_ab, *PSTxDataHead_ab;
361 typedef const STxDataHead_ab *PCSTxDataHead_ab;
362 
363 typedef struct tagSTxDataHead_a_FB {
371 } __attribute__ ((__packed__))
372 STxDataHead_a_FB, *PSTxDataHead_a_FB;
373 typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB;
374 
375 //
376 // MICHDR data header
377 //
382 } __attribute__ ((__packed__))
383 SMICHDRHead, *PSMICHDRHead;
385 typedef const SMICHDRHead *PCSMICHDRHead;
387 typedef struct tagSBEACONCtl {
389  DWORD TSF : 15;
390  DWORD BufLen : 11;
392 } __attribute__ ((__packed__))
393 SBEACONCtl;
398 } __attribute__ ((__packed__))
399 SSecretKey;
410 } __attribute__ ((__packed__))
411 SKeyEntry;
413 #endif /* __DESC_H__ */