ar5211desc.h revision 1.1 1 1.1 alc /*
2 1.1 alc * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 1.1 alc * Copyright (c) 2002-2006 Atheros Communications, Inc.
4 1.1 alc *
5 1.1 alc * Permission to use, copy, modify, and/or distribute this software for any
6 1.1 alc * purpose with or without fee is hereby granted, provided that the above
7 1.1 alc * copyright notice and this permission notice appear in all copies.
8 1.1 alc *
9 1.1 alc * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 1.1 alc * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 1.1 alc * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 1.1 alc * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 1.1 alc * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 1.1 alc * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 1.1 alc * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 1.1 alc *
17 1.1 alc * $Id: ar5211desc.h,v 1.1 2008/12/11 04:46:34 alc Exp $
18 1.1 alc */
19 1.1 alc #ifndef _DEV_ATH_AR5211DESC_H
20 1.1 alc #define _DEV_ATH_AR5211DESC_H
21 1.1 alc
22 1.1 alc #include "ah_desc.h"
23 1.1 alc
24 1.1 alc /*
25 1.1 alc * Defintions for the DMA descriptors used by the Atheros
26 1.1 alc * AR5211 and AR5110 Wireless Lan controller parts.
27 1.1 alc */
28 1.1 alc
29 1.1 alc /* DMA descriptors */
30 1.1 alc struct ar5211_desc {
31 1.1 alc uint32_t ds_link; /* link pointer */
32 1.1 alc uint32_t ds_data; /* data buffer pointer */
33 1.1 alc uint32_t ds_ctl0; /* DMA control 0 */
34 1.1 alc uint32_t ds_ctl1; /* DMA control 1 */
35 1.1 alc uint32_t ds_status0; /* DMA status 0 */
36 1.1 alc uint32_t ds_status1; /* DMA status 1 */
37 1.1 alc } __packed;
38 1.1 alc #define AR5211DESC(_ds) ((struct ar5211_desc *)(_ds))
39 1.1 alc #define AR5211DESC_CONST(_ds) ((const struct ar5211_desc *)(_ds))
40 1.1 alc
41 1.1 alc /* TX ds_ctl0 */
42 1.1 alc #define AR_FrameLen 0x00000fff /* frame length */
43 1.1 alc /* bits 12-17 are reserved */
44 1.1 alc #define AR_XmitRate 0x003c0000 /* txrate */
45 1.1 alc #define AR_XmitRate_S 18
46 1.1 alc #define AR_RTSCTSEnable 0x00400000 /* RTS/CTS enable */
47 1.1 alc #define AR_VEOL 0x00800000 /* virtual end-of-list */
48 1.1 alc #define AR_ClearDestMask 0x01000000 /* Clear destination mask bit */
49 1.1 alc #define AR_AntModeXmit 0x1e000000 /* TX antenna seslection */
50 1.1 alc #define AR_AntModeXmit_S 25
51 1.1 alc #define AR_TxInterReq 0x20000000 /* TX interrupt request */
52 1.1 alc #define AR_EncryptKeyValid 0x40000000 /* EncryptKeyIdx is valid */
53 1.1 alc /* bit 31 is reserved */
54 1.1 alc
55 1.1 alc /* TX ds_ctl1 */
56 1.1 alc #define AR_BufLen 0x00000fff /* data buffer length */
57 1.1 alc #define AR_More 0x00001000 /* more desc in this frame */
58 1.1 alc #define AR_EncryptKeyIdx 0x000fe000 /* ecnrypt key table index */
59 1.1 alc #define AR_EncryptKeyIdx_S 13
60 1.1 alc #define AR_FrmType 0x00700000 /* frame type indication */
61 1.1 alc #define AR_FrmType_S 20
62 1.1 alc #define AR_Frm_Normal 0x00000000 /* normal frame */
63 1.1 alc #define AR_Frm_ATIM 0x00100000 /* ATIM frame */
64 1.1 alc #define AR_Frm_PSPOLL 0x00200000 /* PS poll frame */
65 1.1 alc #define AR_Frm_Beacon 0x00300000 /* Beacon frame */
66 1.1 alc #define AR_Frm_ProbeResp 0x00400000 /* no delay data */
67 1.1 alc #define AR_NoAck 0x00800000 /* No ACK flag */
68 1.1 alc /* bits 24-31 are reserved */
69 1.1 alc
70 1.1 alc /* RX ds_ctl1 */
71 1.1 alc /* AR_BufLen 0x00000fff data buffer length */
72 1.1 alc /* bit 12 is reserved */
73 1.1 alc #define AR_RxInterReq 0x00002000 /* RX interrupt request */
74 1.1 alc /* bits 14-31 are reserved */
75 1.1 alc
76 1.1 alc /* TX ds_status0 */
77 1.1 alc #define AR_FrmXmitOK 0x00000001 /* TX success */
78 1.1 alc #define AR_ExcessiveRetries 0x00000002 /* excessive retries */
79 1.1 alc #define AR_FIFOUnderrun 0x00000004 /* TX FIFO underrun */
80 1.1 alc #define AR_Filtered 0x00000008 /* TX filter indication */
81 1.1 alc /* NB: the spec has the Short+Long retry counts reversed */
82 1.1 alc #define AR_LongRetryCnt 0x000000f0 /* long retry count */
83 1.1 alc #define AR_LongRetryCnt_S 4
84 1.1 alc #define AR_ShortRetryCnt 0x00000f00 /* short retry count */
85 1.1 alc #define AR_ShortRetryCnt_S 8
86 1.1 alc #define AR_VirtCollCnt 0x0000f000 /* virtual collision count */
87 1.1 alc #define AR_VirtCollCnt_S 12
88 1.1 alc #define AR_SendTimestamp 0xffff0000 /* TX timestamp */
89 1.1 alc #define AR_SendTimestamp_S 16
90 1.1 alc
91 1.1 alc /* RX ds_status0 */
92 1.1 alc #define AR_DataLen 0x00000fff /* RX data length */
93 1.1 alc /* AR_More 0x00001000 more desc in this frame */
94 1.1 alc /* bits 13-14 are reserved */
95 1.1 alc #define AR_RcvRate 0x00078000 /* reception rate */
96 1.1 alc #define AR_RcvRate_S 15
97 1.1 alc #define AR_RcvSigStrength 0x07f80000 /* receive signal strength */
98 1.1 alc #define AR_RcvSigStrength_S 19
99 1.1 alc #define AR_RcvAntenna 0x38000000 /* receive antenaa */
100 1.1 alc #define AR_RcvAntenna_S 27
101 1.1 alc /* bits 30-31 are reserved */
102 1.1 alc
103 1.1 alc /* TX ds_status1 */
104 1.1 alc #define AR_Done 0x00000001 /* descripter complete */
105 1.1 alc #define AR_SeqNum 0x00001ffe /* TX sequence number */
106 1.1 alc #define AR_SeqNum_S 1
107 1.1 alc #define AR_AckSigStrength 0x001fe000 /* strength of ACK */
108 1.1 alc #define AR_AckSigStrength_S 13
109 1.1 alc /* bits 21-31 are reserved */
110 1.1 alc
111 1.1 alc /* RX ds_status1 */
112 1.1 alc /* AR_Done 0x00000001 descripter complete */
113 1.1 alc #define AR_FrmRcvOK 0x00000002 /* frame reception success */
114 1.1 alc #define AR_CRCErr 0x00000004 /* CRC error */
115 1.1 alc /* bit 3 reserved */
116 1.1 alc #define AR_DecryptCRCErr 0x00000010 /* Decryption CRC fiailure */
117 1.1 alc #define AR_PHYErr 0x000000e0 /* PHY error */
118 1.1 alc #define AR_PHYErr_S 5
119 1.1 alc #define AR_PHYErr_Underrun 0x00000000 /* Transmit underrun */
120 1.1 alc #define AR_PHYErr_Tim 0x00000020 /* Timing error */
121 1.1 alc #define AR_PHYErr_Par 0x00000040 /* Parity error */
122 1.1 alc #define AR_PHYErr_Rate 0x00000060 /* Illegal rate */
123 1.1 alc #define AR_PHYErr_Len 0x00000080 /* Illegal length */
124 1.1 alc #define AR_PHYErr_Radar 0x000000a0 /* Radar detect */
125 1.1 alc #define AR_PHYErr_Srv 0x000000c0 /* Illegal service */
126 1.1 alc #define AR_PHYErr_TOR 0x000000e0 /* Transmit override receive */
127 1.1 alc #define AR_KeyIdxValid 0x00000100 /* decryption key index valid */
128 1.1 alc #define AR_KeyIdx 0x00007e00 /* Decryption key index */
129 1.1 alc #define AR_KeyIdx_S 9
130 1.1 alc #define AR_RcvTimestamp 0x0fff8000 /* timestamp */
131 1.1 alc #define AR_RcvTimestamp_S 15
132 1.1 alc #define AR_KeyCacheMiss 0x10000000 /* key cache miss indication */
133 1.1 alc
134 1.1 alc #endif /* _DEV_ATH_AR5211DESC_H_ */
135