]>
Commit | Line | Data |
---|---|---|
5449c685 FB |
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 | ||
5449c685 FB |
31 | #ifndef __DESC_H__ |
32 | #define __DESC_H__ | |
33 | ||
34 | #include <linux/types.h> | |
35 | #include <linux/mm.h> | |
5449c685 | 36 | #include "ttype.h" |
5449c685 | 37 | #include "tether.h" |
612822f5 | 38 | |
5449c685 FB |
39 | /*--------------------- Export Definitions -------------------------*/ |
40 | ||
41 | #define B_OWNED_BY_CHIP 1 // | |
42 | #define B_OWNED_BY_HOST 0 // | |
43 | ||
44 | // | |
45 | // Bits in the RSR register | |
46 | // | |
47 | #define RSR_ADDRBROAD 0x80 // 1000 0000 | |
48 | #define RSR_ADDRMULTI 0x40 // 0100 0000 | |
49 | #define RSR_ADDRUNI 0x00 // 0000 0000 | |
50 | #define RSR_IVLDTYP 0x20 // 0010 0000 , invalid packet type | |
51 | #define RSR_IVLDLEN 0x10 // 0001 0000 , invalid len (> 2312 byte) | |
52 | #define RSR_BSSIDOK 0x08 // 0000 1000 | |
53 | #define RSR_CRCOK 0x04 // 0000 0100 | |
54 | #define RSR_BCNSSIDOK 0x02 // 0000 0010 | |
55 | #define RSR_ADDROK 0x01 // 0000 0001 | |
56 | ||
57 | // | |
58 | // Bits in the new RSR register | |
59 | // | |
60 | #define NEWRSR_DECRYPTOK 0x10 // 0001 0000 | |
61 | #define NEWRSR_CFPIND 0x08 // 0000 1000 | |
62 | #define NEWRSR_HWUTSF 0x04 // 0000 0100 | |
63 | #define NEWRSR_BCNHITAID 0x02 // 0000 0010 | |
64 | #define NEWRSR_BCNHITAID0 0x01 // 0000 0001 | |
65 | ||
66 | // | |
67 | // Bits in the TSR0 register | |
68 | // | |
69 | #define TSR0_PWRSTS1_2 0xC0 // 1100 0000 | |
70 | #define TSR0_PWRSTS7 0x20 // 0010 0000 | |
71 | #define TSR0_NCR 0x1F // 0001 1111 | |
72 | ||
73 | // | |
74 | // Bits in the TSR1 register | |
75 | // | |
76 | #define TSR1_TERR 0x80 // 1000 0000 | |
77 | #define TSR1_PWRSTS4_6 0x70 // 0111 0000 | |
78 | #define TSR1_RETRYTMO 0x08 // 0000 1000 | |
79 | #define TSR1_TMO 0x04 // 0000 0100 | |
80 | #define TSR1_PWRSTS3 0x02 // 0000 0010 | |
81 | #define ACK_DATA 0x01 // 0000 0000 | |
82 | ||
83 | // | |
84 | // Bits in the TCR register | |
85 | // | |
86 | #define EDMSDU 0x04 // 0000 0100 end of sdu | |
87 | #define TCR_EDP 0x02 // 0000 0010 end of packet | |
88 | #define TCR_STP 0x01 // 0000 0001 start of packet | |
89 | ||
90 | // max transmit or receive buffer size | |
91 | #define CB_MAX_BUF_SIZE 2900U // max buffer size | |
78a717d8 | 92 | // NOTE: must be multiple of 4 |
5449c685 FB |
93 | #define CB_MAX_TX_BUF_SIZE CB_MAX_BUF_SIZE // max Tx buffer size |
94 | #define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE // max Rx buffer size when not use Multi-RD | |
95 | ||
96 | #define CB_BEACON_BUF_SIZE 512U // default beacon buffer size | |
97 | ||
98 | #define CB_MAX_RX_DESC 128 // max # of descriptor | |
99 | #define CB_MIN_RX_DESC 16 // min # of rx descriptor | |
100 | #define CB_MAX_TX_DESC 64 // max # of descriptor | |
101 | #define CB_MIN_TX_DESC 16 // min # of tx descriptor | |
102 | ||
103 | #define CB_MAX_RECEIVED_PACKETS 16 // max # of received packets at one time | |
78a717d8 JP |
104 | // limit our receive routine to indicating |
105 | // this many at a time for 2 reasons: | |
106 | // 1. driver flow control to protocol layer | |
107 | // 2. limit the time used in ISR routine | |
5449c685 FB |
108 | |
109 | #define CB_EXTRA_RD_NUM 32 // default # of Extra RD | |
110 | #define CB_RD_NUM 32 // default # of RD | |
111 | #define CB_TD_NUM 32 // default # of TD | |
112 | ||
5449c685 FB |
113 | // max number of physical segments |
114 | // in a single NDIS packet. Above this threshold, the packet | |
115 | // is copied into a single physically contiguous buffer | |
116 | #define CB_MAX_SEGMENT 4 | |
117 | ||
118 | #define CB_MIN_MAP_REG_NUM 4 | |
119 | #define CB_MAX_MAP_REG_NUM CB_MAX_TX_DESC | |
120 | ||
121 | #define CB_PROTOCOL_RESERVED_SECTION 16 | |
122 | ||
5449c685 FB |
123 | // if retrys excess 15 times , tx will abort, and |
124 | // if tx fifo underflow, tx will fail | |
125 | // we should try to resend it | |
126 | #define CB_MAX_TX_ABORT_RETRY 3 | |
127 | ||
128 | #ifdef __BIG_ENDIAN | |
129 | ||
130 | // WMAC definition FIFO Control | |
131 | #define FIFOCTL_AUTO_FB_1 0x0010 // 0001 0000 0000 0000 | |
132 | #define FIFOCTL_AUTO_FB_0 0x0008 // 0000 1000 0000 0000 | |
133 | #define FIFOCTL_GRPACK 0x0004 // 0000 0100 0000 0000 | |
134 | #define FIFOCTL_11GA 0x0003 // 0000 0011 0000 0000 | |
135 | #define FIFOCTL_11GB 0x0002 // 0000 0010 0000 0000 | |
136 | #define FIFOCTL_11B 0x0001 // 0000 0001 0000 0000 | |
137 | #define FIFOCTL_11A 0x0000 // 0000 0000 0000 0000 | |
138 | #define FIFOCTL_RTS 0x8000 // 0000 0000 1000 0000 | |
139 | #define FIFOCTL_ISDMA0 0x4000 // 0000 0000 0100 0000 | |
140 | #define FIFOCTL_GENINT 0x2000 // 0000 0000 0010 0000 | |
141 | #define FIFOCTL_TMOEN 0x1000 // 0000 0000 0001 0000 | |
142 | #define FIFOCTL_LRETRY 0x0800 // 0000 0000 0000 1000 | |
143 | #define FIFOCTL_CRCDIS 0x0400 // 0000 0000 0000 0100 | |
144 | #define FIFOCTL_NEEDACK 0x0200 // 0000 0000 0000 0010 | |
145 | #define FIFOCTL_LHEAD 0x0100 // 0000 0000 0000 0001 | |
146 | ||
147 | //WMAC definition Frag Control | |
148 | #define FRAGCTL_AES 0x0003 // 0000 0011 0000 0000 | |
149 | #define FRAGCTL_TKIP 0x0002 // 0000 0010 0000 0000 | |
150 | #define FRAGCTL_LEGACY 0x0001 // 0000 0001 0000 0000 | |
151 | #define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000 | |
5449c685 FB |
152 | #define FRAGCTL_ENDFRAG 0x0300 // 0000 0000 0000 0011 |
153 | #define FRAGCTL_MIDFRAG 0x0200 // 0000 0000 0000 0010 | |
154 | #define FRAGCTL_STAFRAG 0x0100 // 0000 0000 0000 0001 | |
155 | #define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000 | |
156 | ||
157 | #else | |
158 | ||
159 | #define FIFOCTL_AUTO_FB_1 0x1000 // 0001 0000 0000 0000 | |
160 | #define FIFOCTL_AUTO_FB_0 0x0800 // 0000 1000 0000 0000 | |
161 | #define FIFOCTL_GRPACK 0x0400 // 0000 0100 0000 0000 | |
162 | #define FIFOCTL_11GA 0x0300 // 0000 0011 0000 0000 | |
163 | #define FIFOCTL_11GB 0x0200 // 0000 0010 0000 0000 | |
164 | #define FIFOCTL_11B 0x0100 // 0000 0001 0000 0000 | |
165 | #define FIFOCTL_11A 0x0000 // 0000 0000 0000 0000 | |
166 | #define FIFOCTL_RTS 0x0080 // 0000 0000 1000 0000 | |
167 | #define FIFOCTL_ISDMA0 0x0040 // 0000 0000 0100 0000 | |
168 | #define FIFOCTL_GENINT 0x0020 // 0000 0000 0010 0000 | |
169 | #define FIFOCTL_TMOEN 0x0010 // 0000 0000 0001 0000 | |
170 | #define FIFOCTL_LRETRY 0x0008 // 0000 0000 0000 1000 | |
171 | #define FIFOCTL_CRCDIS 0x0004 // 0000 0000 0000 0100 | |
172 | #define FIFOCTL_NEEDACK 0x0002 // 0000 0000 0000 0010 | |
173 | #define FIFOCTL_LHEAD 0x0001 // 0000 0000 0000 0001 | |
174 | ||
175 | //WMAC definition Frag Control | |
176 | #define FRAGCTL_AES 0x0300 // 0000 0011 0000 0000 | |
177 | #define FRAGCTL_TKIP 0x0200 // 0000 0010 0000 0000 | |
178 | #define FRAGCTL_LEGACY 0x0100 // 0000 0001 0000 0000 | |
179 | #define FRAGCTL_NONENCRYPT 0x0000 // 0000 0000 0000 0000 | |
5449c685 FB |
180 | #define FRAGCTL_ENDFRAG 0x0003 // 0000 0000 0000 0011 |
181 | #define FRAGCTL_MIDFRAG 0x0002 // 0000 0000 0000 0010 | |
182 | #define FRAGCTL_STAFRAG 0x0001 // 0000 0000 0000 0001 | |
183 | #define FRAGCTL_NONFRAG 0x0000 // 0000 0000 0000 0000 | |
184 | ||
185 | #endif // #ifdef __BIG_ENDIAN | |
186 | ||
5449c685 FB |
187 | #define TYPE_TXDMA0 0 |
188 | #define TYPE_AC0DMA 1 | |
189 | #define TYPE_ATIMDMA 2 | |
190 | #define TYPE_SYNCDMA 3 | |
191 | #define TYPE_MAXTD 2 | |
192 | ||
193 | #define TYPE_BEACONDMA 4 | |
194 | ||
195 | #define TYPE_RXDMA0 0 | |
196 | #define TYPE_RXDMA1 1 | |
197 | #define TYPE_MAXRD 2 | |
198 | ||
5449c685 FB |
199 | // TD_INFO flags control bit |
200 | #define TD_FLAGS_NETIF_SKB 0x01 // check if need release skb | |
201 | #define TD_FLAGS_PRIV_SKB 0x02 // check if called from private skb(hostap) | |
202 | #define TD_FLAGS_PS_RETRY 0x04 // check if PS STA frame re-transmit | |
5449c685 FB |
203 | |
204 | /*--------------------- Export Types ------------------------------*/ | |
205 | ||
206 | // ref_sk_buff is used for mapping the skb structure between pre-built driver-obj & running kernel. | |
207 | // Since different kernel version (2.4x) may change skb structure, i.e. pre-built driver-obj | |
208 | // may link to older skb that leads error. | |
209 | ||
210 | typedef struct tagDEVICE_RD_INFO { | |
78a717d8 JP |
211 | struct sk_buff *skb; |
212 | dma_addr_t skb_dma; | |
213 | dma_addr_t curr_desc; | |
5449c685 FB |
214 | } DEVICE_RD_INFO, *PDEVICE_RD_INFO; |
215 | ||
5449c685 FB |
216 | #ifdef __BIG_ENDIAN |
217 | ||
218 | typedef struct tagRDES0 { | |
78a717d8 | 219 | volatile unsigned short wResCount; |
5449c685 | 220 | union { |
c17ce8c2 | 221 | volatile u16 f15Reserved; |
5449c685 | 222 | struct { |
78a717d8 | 223 | volatile u8 f8Reserved1; |
737c3d70 CC |
224 | volatile u8 f1Owner:1; |
225 | volatile u8 f7Reserved:7; | |
5449c685 FB |
226 | } __attribute__ ((__packed__)); |
227 | } __attribute__ ((__packed__)); | |
228 | } __attribute__ ((__packed__)) | |
229 | SRDES0, *PSRDES0; | |
230 | ||
231 | #else | |
232 | ||
233 | typedef struct tagRDES0 { | |
78a717d8 JP |
234 | unsigned short wResCount; |
235 | unsigned short f15Reserved:15; | |
236 | unsigned short f1Owner:1; | |
5449c685 FB |
237 | } __attribute__ ((__packed__)) |
238 | SRDES0; | |
239 | ||
5449c685 FB |
240 | #endif |
241 | ||
242 | typedef struct tagRDES1 { | |
78a717d8 JP |
243 | unsigned short wReqCount; |
244 | unsigned short wReserved; | |
5449c685 FB |
245 | } __attribute__ ((__packed__)) |
246 | SRDES1; | |
247 | ||
248 | // | |
249 | // Rx descriptor | |
250 | // | |
251 | typedef struct tagSRxDesc { | |
78a717d8 JP |
252 | volatile SRDES0 m_rd0RD0; |
253 | volatile SRDES1 m_rd1RD1; | |
254 | volatile u32 buff_addr; | |
255 | volatile u32 next_desc; | |
829127b4 MP |
256 | struct tagSRxDesc *next __aligned(8); |
257 | volatile PDEVICE_RD_INFO pRDInfo __aligned(8); | |
5449c685 | 258 | } __attribute__ ((__packed__)) |
a884847a JL |
259 | SRxDesc, *PSRxDesc; |
260 | typedef const SRxDesc *PCSRxDesc; | |
5449c685 FB |
261 | |
262 | #ifdef __BIG_ENDIAN | |
263 | ||
5449c685 | 264 | typedef struct tagTDES0 { |
78a717d8 JP |
265 | volatile unsigned char byTSR0; |
266 | volatile unsigned char byTSR1; | |
5449c685 | 267 | union { |
c17ce8c2 | 268 | volatile u16 f15Txtime; |
5449c685 | 269 | struct { |
78a717d8 | 270 | volatile u8 f8Reserved1; |
737c3d70 CC |
271 | volatile u8 f1Owner:1; |
272 | volatile u8 f7Reserved:7; | |
5449c685 FB |
273 | } __attribute__ ((__packed__)); |
274 | } __attribute__ ((__packed__)); | |
275 | } __attribute__ ((__packed__)) | |
276 | STDES0, PSTDES0; | |
277 | ||
278 | #else | |
279 | ||
280 | typedef struct tagTDES0 { | |
78a717d8 JP |
281 | volatile unsigned char byTSR0; |
282 | volatile unsigned char byTSR1; | |
283 | volatile unsigned short f15Txtime:15; | |
284 | volatile unsigned short f1Owner:1; | |
5449c685 FB |
285 | } __attribute__ ((__packed__)) |
286 | STDES0; | |
287 | ||
288 | #endif | |
289 | ||
5449c685 | 290 | typedef struct tagTDES1 { |
78a717d8 JP |
291 | volatile unsigned short wReqCount; |
292 | volatile unsigned char byTCR; | |
293 | volatile unsigned char byReserved; | |
5449c685 FB |
294 | } __attribute__ ((__packed__)) |
295 | STDES1; | |
296 | ||
78a717d8 JP |
297 | typedef struct tagDEVICE_TD_INFO { |
298 | struct sk_buff *skb; | |
299 | unsigned char *buf; | |
300 | dma_addr_t skb_dma; | |
301 | dma_addr_t buf_dma; | |
302 | dma_addr_t curr_desc; | |
303 | unsigned long dwReqCount; | |
304 | unsigned long dwHeaderLength; | |
305 | unsigned char byFlags; | |
5449c685 FB |
306 | } DEVICE_TD_INFO, *PDEVICE_TD_INFO; |
307 | ||
5449c685 FB |
308 | // |
309 | // transmit descriptor | |
310 | // | |
311 | typedef struct tagSTxDesc { | |
78a717d8 JP |
312 | volatile STDES0 m_td0TD0; |
313 | volatile STDES1 m_td1TD1; | |
314 | volatile u32 buff_addr; | |
315 | volatile u32 next_desc; | |
829127b4 MP |
316 | struct tagSTxDesc *next __aligned(8); |
317 | volatile PDEVICE_TD_INFO pTDInfo __aligned(8); | |
5449c685 | 318 | } __attribute__ ((__packed__)) |
a884847a JL |
319 | STxDesc, *PSTxDesc; |
320 | typedef const STxDesc *PCSTxDesc; | |
5449c685 | 321 | |
5449c685 | 322 | typedef struct tagSTxSyncDesc { |
78a717d8 JP |
323 | volatile STDES0 m_td0TD0; |
324 | volatile STDES1 m_td1TD1; | |
325 | volatile u32 buff_addr; // pointer to logical buffer | |
326 | volatile u32 next_desc; // pointer to next logical descriptor | |
327 | volatile unsigned short m_wFIFOCtl; | |
328 | volatile unsigned short m_wTimeStamp; | |
829127b4 MP |
329 | struct tagSTxSyncDesc *next __aligned(8); |
330 | volatile PDEVICE_TD_INFO pTDInfo __aligned(8); | |
5449c685 | 331 | } __attribute__ ((__packed__)) |
a884847a JL |
332 | STxSyncDesc, *PSTxSyncDesc; |
333 | typedef const STxSyncDesc *PCSTxSyncDesc; | |
5449c685 | 334 | |
5449c685 FB |
335 | // |
336 | // RsvTime buffer header | |
337 | // | |
338 | typedef struct tagSRrvTime_gRTS { | |
78a717d8 JP |
339 | unsigned short wRTSTxRrvTime_ba; |
340 | unsigned short wRTSTxRrvTime_aa; | |
341 | unsigned short wRTSTxRrvTime_bb; | |
342 | unsigned short wReserved; | |
343 | unsigned short wTxRrvTime_b; | |
344 | unsigned short wTxRrvTime_a; | |
345 | } __attribute__ ((__packed__)) | |
a884847a JL |
346 | SRrvTime_gRTS, *PSRrvTime_gRTS; |
347 | typedef const SRrvTime_gRTS *PCSRrvTime_gRTS; | |
5449c685 FB |
348 | |
349 | typedef struct tagSRrvTime_gCTS { | |
78a717d8 JP |
350 | unsigned short wCTSTxRrvTime_ba; |
351 | unsigned short wReserved; | |
352 | unsigned short wTxRrvTime_b; | |
353 | unsigned short wTxRrvTime_a; | |
354 | } __attribute__ ((__packed__)) | |
a884847a JL |
355 | SRrvTime_gCTS, *PSRrvTime_gCTS; |
356 | typedef const SRrvTime_gCTS *PCSRrvTime_gCTS; | |
5449c685 FB |
357 | |
358 | typedef struct tagSRrvTime_ab { | |
78a717d8 JP |
359 | unsigned short wRTSTxRrvTime; |
360 | unsigned short wTxRrvTime; | |
361 | } __attribute__ ((__packed__)) | |
a884847a JL |
362 | SRrvTime_ab, *PSRrvTime_ab; |
363 | typedef const SRrvTime_ab *PCSRrvTime_ab; | |
5449c685 FB |
364 | |
365 | typedef struct tagSRrvTime_atim { | |
78a717d8 JP |
366 | unsigned short wCTSTxRrvTime_ba; |
367 | unsigned short wTxRrvTime_a; | |
368 | } __attribute__ ((__packed__)) | |
a884847a JL |
369 | SRrvTime_atim, *PSRrvTime_atim; |
370 | typedef const SRrvTime_atim *PCSRrvTime_atim; | |
5449c685 FB |
371 | |
372 | // | |
373 | // RTS buffer header | |
374 | // | |
375 | typedef struct tagSRTSData { | |
78a717d8 JP |
376 | unsigned short wFrameControl; |
377 | unsigned short wDurationID; | |
378 | unsigned char abyRA[ETH_ALEN]; | |
379 | unsigned char abyTA[ETH_ALEN]; | |
380 | } __attribute__ ((__packed__)) | |
a884847a JL |
381 | SRTSData, *PSRTSData; |
382 | typedef const SRTSData *PCSRTSData; | |
5449c685 FB |
383 | |
384 | typedef struct tagSRTS_g { | |
78a717d8 JP |
385 | unsigned char bySignalField_b; |
386 | unsigned char byServiceField_b; | |
387 | unsigned short wTransmitLength_b; | |
388 | unsigned char bySignalField_a; | |
389 | unsigned char byServiceField_a; | |
390 | unsigned short wTransmitLength_a; | |
391 | unsigned short wDuration_ba; | |
392 | unsigned short wDuration_aa; | |
393 | unsigned short wDuration_bb; | |
394 | unsigned short wReserved; | |
395 | SRTSData Data; | |
396 | } __attribute__ ((__packed__)) | |
a884847a JL |
397 | SRTS_g, *PSRTS_g; |
398 | typedef const SRTS_g *PCSRTS_g; | |
5449c685 | 399 | |
5449c685 | 400 | typedef struct tagSRTS_g_FB { |
78a717d8 JP |
401 | unsigned char bySignalField_b; |
402 | unsigned char byServiceField_b; | |
403 | unsigned short wTransmitLength_b; | |
404 | unsigned char bySignalField_a; | |
405 | unsigned char byServiceField_a; | |
406 | unsigned short wTransmitLength_a; | |
407 | unsigned short wDuration_ba; | |
408 | unsigned short wDuration_aa; | |
409 | unsigned short wDuration_bb; | |
410 | unsigned short wReserved; | |
411 | unsigned short wRTSDuration_ba_f0; | |
412 | unsigned short wRTSDuration_aa_f0; | |
413 | unsigned short wRTSDuration_ba_f1; | |
414 | unsigned short wRTSDuration_aa_f1; | |
415 | SRTSData Data; | |
416 | } __attribute__ ((__packed__)) | |
a884847a JL |
417 | SRTS_g_FB, *PSRTS_g_FB; |
418 | typedef const SRTS_g_FB *PCSRTS_g_FB; | |
5449c685 | 419 | |
5449c685 | 420 | typedef struct tagSRTS_ab { |
78a717d8 JP |
421 | unsigned char bySignalField; |
422 | unsigned char byServiceField; | |
423 | unsigned short wTransmitLength; | |
424 | unsigned short wDuration; | |
425 | unsigned short wReserved; | |
426 | SRTSData Data; | |
427 | } __attribute__ ((__packed__)) | |
a884847a JL |
428 | SRTS_ab, *PSRTS_ab; |
429 | typedef const SRTS_ab *PCSRTS_ab; | |
5449c685 | 430 | |
5449c685 | 431 | typedef struct tagSRTS_a_FB { |
78a717d8 JP |
432 | unsigned char bySignalField; |
433 | unsigned char byServiceField; | |
434 | unsigned short wTransmitLength; | |
435 | unsigned short wDuration; | |
436 | unsigned short wReserved; | |
437 | unsigned short wRTSDuration_f0; | |
438 | unsigned short wRTSDuration_f1; | |
439 | SRTSData Data; | |
440 | } __attribute__ ((__packed__)) | |
a884847a JL |
441 | SRTS_a_FB, *PSRTS_a_FB; |
442 | typedef const SRTS_a_FB *PCSRTS_a_FB; | |
5449c685 | 443 | |
5449c685 FB |
444 | // |
445 | // CTS buffer header | |
446 | // | |
447 | typedef struct tagSCTSData { | |
78a717d8 JP |
448 | unsigned short wFrameControl; |
449 | unsigned short wDurationID; | |
450 | unsigned char abyRA[ETH_ALEN]; | |
451 | unsigned short wReserved; | |
452 | } __attribute__ ((__packed__)) | |
a884847a | 453 | SCTSData, *PSCTSData; |
5449c685 FB |
454 | |
455 | typedef struct tagSCTS { | |
78a717d8 JP |
456 | unsigned char bySignalField_b; |
457 | unsigned char byServiceField_b; | |
458 | unsigned short wTransmitLength_b; | |
459 | unsigned short wDuration_ba; | |
460 | unsigned short wReserved; | |
461 | SCTSData Data; | |
462 | } __attribute__ ((__packed__)) | |
a884847a JL |
463 | SCTS, *PSCTS; |
464 | typedef const SCTS *PCSCTS; | |
5449c685 FB |
465 | |
466 | typedef struct tagSCTS_FB { | |
78a717d8 JP |
467 | unsigned char bySignalField_b; |
468 | unsigned char byServiceField_b; | |
469 | unsigned short wTransmitLength_b; | |
470 | unsigned short wDuration_ba; | |
471 | unsigned short wReserved; | |
472 | unsigned short wCTSDuration_ba_f0; | |
473 | unsigned short wCTSDuration_ba_f1; | |
474 | SCTSData Data; | |
475 | } __attribute__ ((__packed__)) | |
a884847a JL |
476 | SCTS_FB, *PSCTS_FB; |
477 | typedef const SCTS_FB *PCSCTS_FB; | |
5449c685 | 478 | |
5449c685 FB |
479 | // |
480 | // Tx FIFO header | |
481 | // | |
482 | typedef struct tagSTxBufHead { | |
78a717d8 JP |
483 | u32 adwTxKey[4]; |
484 | unsigned short wFIFOCtl; | |
485 | unsigned short wTimeStamp; | |
486 | unsigned short wFragCtl; | |
487 | unsigned char byTxPower; | |
488 | unsigned char wReserved; | |
489 | } __attribute__ ((__packed__)) | |
a884847a JL |
490 | STxBufHead, *PSTxBufHead; |
491 | typedef const STxBufHead *PCSTxBufHead; | |
5449c685 FB |
492 | |
493 | typedef struct tagSTxShortBufHead { | |
78a717d8 JP |
494 | unsigned short wFIFOCtl; |
495 | unsigned short wTimeStamp; | |
496 | } __attribute__ ((__packed__)) | |
a884847a JL |
497 | STxShortBufHead, *PSTxShortBufHead; |
498 | typedef const STxShortBufHead *PCSTxShortBufHead; | |
5449c685 FB |
499 | |
500 | // | |
501 | // Tx data header | |
502 | // | |
503 | typedef struct tagSTxDataHead_g { | |
78a717d8 JP |
504 | unsigned char bySignalField_b; |
505 | unsigned char byServiceField_b; | |
506 | unsigned short wTransmitLength_b; | |
507 | unsigned char bySignalField_a; | |
508 | unsigned char byServiceField_a; | |
509 | unsigned short wTransmitLength_a; | |
510 | unsigned short wDuration_b; | |
511 | unsigned short wDuration_a; | |
512 | unsigned short wTimeStampOff_b; | |
513 | unsigned short wTimeStampOff_a; | |
514 | } __attribute__ ((__packed__)) | |
a884847a JL |
515 | STxDataHead_g, *PSTxDataHead_g; |
516 | typedef const STxDataHead_g *PCSTxDataHead_g; | |
5449c685 FB |
517 | |
518 | typedef struct tagSTxDataHead_g_FB { | |
78a717d8 JP |
519 | unsigned char bySignalField_b; |
520 | unsigned char byServiceField_b; | |
521 | unsigned short wTransmitLength_b; | |
522 | unsigned char bySignalField_a; | |
523 | unsigned char byServiceField_a; | |
524 | unsigned short wTransmitLength_a; | |
525 | unsigned short wDuration_b; | |
526 | unsigned short wDuration_a; | |
527 | unsigned short wDuration_a_f0; | |
528 | unsigned short wDuration_a_f1; | |
529 | unsigned short wTimeStampOff_b; | |
530 | unsigned short wTimeStampOff_a; | |
531 | } __attribute__ ((__packed__)) | |
a884847a JL |
532 | STxDataHead_g_FB, *PSTxDataHead_g_FB; |
533 | typedef const STxDataHead_g_FB *PCSTxDataHead_g_FB; | |
5449c685 | 534 | |
5449c685 | 535 | typedef struct tagSTxDataHead_ab { |
78a717d8 JP |
536 | unsigned char bySignalField; |
537 | unsigned char byServiceField; | |
538 | unsigned short wTransmitLength; | |
539 | unsigned short wDuration; | |
540 | unsigned short wTimeStampOff; | |
541 | } __attribute__ ((__packed__)) | |
a884847a JL |
542 | STxDataHead_ab, *PSTxDataHead_ab; |
543 | typedef const STxDataHead_ab *PCSTxDataHead_ab; | |
5449c685 | 544 | |
5449c685 | 545 | typedef struct tagSTxDataHead_a_FB { |
78a717d8 JP |
546 | unsigned char bySignalField; |
547 | unsigned char byServiceField; | |
548 | unsigned short wTransmitLength; | |
549 | unsigned short wDuration; | |
550 | unsigned short wTimeStampOff; | |
551 | unsigned short wDuration_f0; | |
552 | unsigned short wDuration_f1; | |
553 | } __attribute__ ((__packed__)) | |
a884847a JL |
554 | STxDataHead_a_FB, *PSTxDataHead_a_FB; |
555 | typedef const STxDataHead_a_FB *PCSTxDataHead_a_FB; | |
5449c685 FB |
556 | |
557 | // | |
558 | // MICHDR data header | |
559 | // | |
560 | typedef struct tagSMICHDRHead { | |
78a717d8 JP |
561 | u32 adwHDR0[4]; |
562 | u32 adwHDR1[4]; | |
563 | u32 adwHDR2[4]; | |
564 | } __attribute__ ((__packed__)) | |
a884847a JL |
565 | SMICHDRHead, *PSMICHDRHead; |
566 | typedef const SMICHDRHead *PCSMICHDRHead; | |
5449c685 FB |
567 | |
568 | typedef struct tagSBEACONCtl { | |
78a717d8 JP |
569 | u32 BufReady:1; |
570 | u32 TSF:15; | |
571 | u32 BufLen:11; | |
572 | u32 Reserved:5; | |
573 | } __attribute__ ((__packed__)) | |
5449c685 FB |
574 | SBEACONCtl; |
575 | ||
5449c685 | 576 | typedef struct tagSSecretKey { |
78a717d8 JP |
577 | u32 dwLowDword; |
578 | unsigned char byHighByte; | |
579 | } __attribute__ ((__packed__)) | |
5449c685 FB |
580 | SSecretKey; |
581 | ||
582 | typedef struct tagSKeyEntry { | |
78a717d8 JP |
583 | unsigned char abyAddrHi[2]; |
584 | unsigned short wKCTL; | |
585 | unsigned char abyAddrLo[4]; | |
586 | u32 dwKey0[4]; | |
587 | u32 dwKey1[4]; | |
588 | u32 dwKey2[4]; | |
589 | u32 dwKey3[4]; | |
590 | u32 dwKey4[4]; | |
591 | } __attribute__ ((__packed__)) | |
5449c685 FB |
592 | SKeyEntry; |
593 | /*--------------------- Export Macros ------------------------------*/ | |
594 | ||
595 | /*--------------------- Export Classes ----------------------------*/ | |
596 | ||
597 | /*--------------------- Export Variables --------------------------*/ | |
598 | ||
599 | /*--------------------- Export Functions --------------------------*/ | |
600 | ||
5449c685 | 601 | #endif // __DESC_H__ |