2 * carl9170 firmware - used by the ar9170 wireless device
6 * Copyright (c) 2000-2005 ZyDAS Technology Corporation
7 * Copyright (c) 2007-2009 Atheros Communications, Inc.
8 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
9 * Copyright 2009-2011 Christian Lamparter <chunkeey@googlemail.com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; If not, see <http://www.gnu.org/licenses/>.
25 #ifndef __CARL9170FW_USB_FIFO_H
26 #define __CARL9170FW_USB_FIFO_H
32 /* Block Size define */
39 /* Block toggle number define */
44 /* Endpoint transfer type */
45 #define TF_TYPE_ISOCHRONOUS 1
46 #define TF_TYPE_BULK 2
47 #define TF_TYPE_INTERRUPT 3
49 /* Endpoint or FIFO direction define */
50 #define DIRECTION_IN 0
51 #define DIRECTION_OUT 1
53 #define HS_C1_I0_A0_EP1_MAX_PACKET 512
54 #define HS_C1_I0_A0_EP1_bInterval 0
56 #define HS_C1_I0_A0_EP_NUMBER 0x04
57 #define HS_C1_I0_A0_EP_LENGTH (EP_LENGTH * HS_C1_I0_A0_EP_NUMBER)
58 #define HS_C1_I0_ALT_LENGTH (HS_C1_I0_A0_EP_LENGTH)
59 #define HS_C1_INTERFACE_LENGTH (HS_C1_I0_ALT_LENGTH)
61 #define HS_C1_CONFIG_TOTAL_LENGTH (CONFIG_LENGTH + INTERFACE_LENGTH + HS_C1_INTERFACE_LENGTH)
62 #define FS_C1_CONFIG_TOTAL_LENGTH (CONFIG_LENGTH + INTERFACE_LENGTH + FS_C1_INTERFACE_LENGTH)
64 #define FS_C1_I0_A0_EP1_MAX_PACKET 64
65 /* #define FS_C1_I0_A0_EP1_bInterval HS_C1_I0_A0_EP1_bInterval */
67 #define HS_CONFIGURATION_NUMBER 1
68 #define FS_CONFIGURATION_NUMBER 1
71 #define fDOUBLE_BUF_IN 0
76 #define HS_C1_INTERFACE_NUMBER 0x01
78 #define HS_C1_iConfiguration 0x00
79 #define HS_C1_bmAttribute 0x80
81 #define HS_C1_iMaxPower 0xFA
84 #define HS_C1_I0_ALT_NUMBER 0X01
85 /* AlternateSetting 0 */
86 #define HS_C1_I0_A0_bInterfaceNumber 0x00
87 #define HS_C1_I0_A0_bAlternateSetting 0x00
89 #define HS_C1_I0_A0_EP_NUMBER 0x04
90 #define HS_C1_I0_A0_bInterfaceClass 0xff
91 #define HS_C1_I0_A0_bInterfaceSubClass 0x00
92 #define HS_C1_I0_A0_bInterfaceProtocol 0x00
93 #define HS_C1_I0_A0_iInterface 0x00
96 #define HS_C1_I0_A0_EP1_BLKSIZE 512
97 #define HS_C1_I0_A0_EP1_BLKNO DOUBLE_BLK
98 #define HS_C1_I0_A0_EP1_DIRECTION DIRECTION_OUT
99 #define HS_C1_I0_A0_EP1_TYPE TF_TYPE_BULK
101 #define HS_C1_I0_A0_EP1_MAX_PACKET 512
102 #define HS_C1_I0_A0_EP1_bInterval 0
105 #define HS_C1_I0_A0_EP2_BLKSIZE 512
106 /* JWEI 2003/08/20 */
107 #define HS_C1_I0_A0_EP2_BLKNO SINGLE_BLK
108 #define HS_C1_I0_A0_EP2_DIRECTION DIRECTION_IN
109 #define HS_C1_I0_A0_EP2_TYPE TF_TYPE_BULK
110 #define HS_C1_I0_A0_EP2_MAX_PACKET 512
111 #define HS_C1_I0_A0_EP2_bInterval 0
114 #define HS_C1_I0_A0_EP3_BLKSIZE 64
115 #define HS_C1_I0_A0_EP3_BLKNO SINGLE_BLK
116 #define HS_C1_I0_A0_EP3_DIRECTION DIRECTION_IN
117 #define HS_C1_I0_A0_EP3_TYPE TF_TYPE_INTERRUPT
118 #define HS_C1_I0_A0_EP3_MAX_PACKET 0x0040
119 #define HS_C1_I0_A0_EP3_bInterval 01
122 * Note: HS Bulk type require max pkt size = 512
123 * ==> must use Interrupt type for max pkt size = 64
127 #define HS_C1_I0_A0_EP4_BLKSIZE 64
128 #define HS_C1_I0_A0_EP4_BLKNO SINGLE_BLK
129 #define HS_C1_I0_A0_EP4_DIRECTION DIRECTION_OUT
130 #define HS_C1_I0_A0_EP4_TYPE TF_TYPE_INTERRUPT
131 #define HS_C1_I0_A0_EP4_MAX_PACKET 0x0040
132 #define HS_C1_I0_A0_EP4_bInterval 01
134 #define HS_C1_I0_A0_EP_LENGTH (EP_LENGTH * HS_C1_I0_A0_EP_NUMBER)
136 #define HS_C1_I0_A0_EP1_FIFO_START 0
137 #define HS_C1_I0_A0_EP1_FIFO_NO (HS_C1_I0_A0_EP1_BLKNO * HS_C1_I0_A0_EP1_BLKSIZE)
138 #define HS_C1_I0_A0_EP1_FIFO_CONFIG (uint8_t)(0x80 | ((HS_C1_I0_A0_EP1_BLKSIZE - 1) << 4) | ((HS_C1_I0_A0_EP1_BLKNO - 1) << 2) | HS_C1_I0_A0_EP1_TYPE)
139 #define HS_C1_I0_A0_EP1_FIFO_MAP (((1 - HS_C1_I0_A0_EP1_DIRECTION) << 4) | 1)
140 #define HS_C1_I0_A0_EP1_MAP (HS_C1_I0_A0_EP1_FIFO_START | (HS_C1_I0_A0_EP1_FIFO_START << 4) | (MASK_F0 >> (4*HS_C1_I0_A0_EP1_DIRECTION)))
143 #define HS_C1_I0_A0_EP2_FIFO_START (uint8_t)(HS_C1_I0_A0_EP1_FIFO_START + HS_C1_I0_A0_EP1_FIFO_NO)
144 #define HS_C1_I0_A0_EP2_FIFO_NO (uint8_t)(HS_C1_I0_A0_EP2_BLKNO * HS_C1_I0_A0_EP2_BLKSIZE)
145 #define HS_C1_I0_A0_EP2_FIFO_CONFIG (uint8_t)(0x80 | ((HS_C1_I0_A0_EP2_BLKSIZE - 1) << 4) | ((HS_C1_I0_A0_EP2_BLKNO - 1) << 2) | HS_C1_I0_A0_EP2_TYPE)
146 #define HS_C1_I0_A0_EP2_FIFO_MAP (uint8_t)(((1 - HS_C1_I0_A0_EP2_DIRECTION) << 4) | 2)
147 #define HS_C1_I0_A0_EP2_MAP (uint8_t)(HS_C1_I0_A0_EP2_FIFO_START | (HS_C1_I0_A0_EP2_FIFO_START << 4) | (MASK_F0 >> (4*HS_C1_I0_A0_EP2_DIRECTION)))
150 #define HS_C1_I0_A0_EP3_FIFO_START 14
151 #define HS_C1_I0_A0_EP3_FIFO_NO (HS_C1_I0_A0_EP3_BLKNO * HS_C1_I0_A0_EP3_BLKSIZE)
152 #define HS_C1_I0_A0_EP3_FIFO_CONFIG (uint8_t)(0x80 | ((HS_C1_I0_A0_EP3_BLKSIZE - 1) << 4) | ((HS_C1_I0_A0_EP3_BLKNO - 1) << 2) | HS_C1_I0_A0_EP3_TYPE)
153 #define HS_C1_I0_A0_EP3_FIFO_MAP (uint8_t)(((1 - HS_C1_I0_A0_EP3_DIRECTION) << 4) | 3)
154 #define HS_C1_I0_A0_EP3_MAP (uint8_t)(HS_C1_I0_A0_EP3_FIFO_START | (HS_C1_I0_A0_EP3_FIFO_START << 4) | (MASK_F0 >> (4*HS_C1_I0_A0_EP3_DIRECTION)))
157 #define HS_C1_I0_A0_EP4_FIFO_START (HS_C1_I0_A0_EP3_FIFO_START + HS_C1_I0_A0_EP3_FIFO_NO)
158 #define HS_C1_I0_A0_EP4_FIFO_NO (HS_C1_I0_A0_EP4_BLKNO * HS_C1_I0_A0_EP4_BLKSIZE)
159 #define HS_C1_I0_A0_EP4_FIFO_CONFIG (uint8_t)(0x80 | ((HS_C1_I0_A0_EP4_BLKSIZE - 1) << 4) | ((HS_C1_I0_A0_EP4_BLKNO - 1) << 2) | HS_C1_I0_A0_EP4_TYPE)
160 #define HS_C1_I0_A0_EP4_FIFO_MAP (((1 - HS_C1_I0_A0_EP4_DIRECTION) << 4) | 4)
161 #define HS_C1_I0_A0_EP4_MAP (uint8_t)(HS_C1_I0_A0_EP4_FIFO_START | (HS_C1_I0_A0_EP4_FIFO_START << 4) | (MASK_F0 >> (4*HS_C1_I0_A0_EP4_DIRECTION)))
163 /* Configuration 1 */
164 #define FS_C1_INTERFACE_NUMBER 0x01
166 #define FS_C1_iConfiguration 0x00
167 #define FS_C1_bmAttribute 0x80
168 #define FS_C1_iMaxPower 0xfa
171 #define FS_C1_I0_ALT_NUMBER 0x01
172 /* AlternateSetting 0x00 */
173 #define FS_C1_I0_A0_bInterfaceNumber 0x00
174 #define FS_C1_I0_A0_bAlternateSetting 0x00
175 #define FS_C1_I0_A0_EP_NUMBER 0x04
176 #define FS_C1_I0_A0_bInterfaceClass 0xff
177 #define FS_C1_I0_A0_bInterfaceSubClass 0x00
178 #define FS_C1_I0_A0_bInterfaceProtocol 0x00
181 #define FS_C1_I0_A0_EP1_BLKSIZE 512
182 /* JWEI 2003/05/19 */
183 #define FS_C1_I0_A0_EP1_BLKNO DOUBLE_BLK
184 #define FS_C1_I0_A0_EP1_DIRECTION DIRECTION_OUT
185 #define FS_C1_I0_A0_EP1_TYPE TF_TYPE_BULK
186 #define FS_C1_I0_A0_EP1_MAX_PACKET 64
187 #define FS_C1_I0_A0_EP1_bInterval 0
190 #define FS_C1_I0_A0_EP2_BLKSIZE 512
191 /* JWEI 2003/08/20 */
192 #define FS_C1_I0_A0_EP2_BLKNO SINGLE_BLK
193 #define FS_C1_I0_A0_EP2_DIRECTION DIRECTION_IN
194 #define FS_C1_I0_A0_EP2_TYPE TF_TYPE_BULK
195 #define FS_C1_I0_A0_EP2_MAX_PACKET 64
196 #define FS_C1_I0_A0_EP2_bInterval 0
199 #define FS_C1_I0_A0_EP3_BLKSIZE 64
200 #define FS_C1_I0_A0_EP3_BLKNO SINGLE_BLK
201 #define FS_C1_I0_A0_EP3_DIRECTION DIRECTION_IN
202 #define FS_C1_I0_A0_EP3_TYPE TF_TYPE_INTERRUPT
203 #define FS_C1_I0_A0_EP3_MAX_PACKET 0x0040
204 #define FS_C1_I0_A0_EP3_bInterval 1
207 #define FS_C1_I0_A0_EP4_BLKSIZE 64
208 #define FS_C1_I0_A0_EP4_BLKNO SINGLE_BLK
209 #define FS_C1_I0_A0_EP4_DIRECTION DIRECTION_OUT
210 #define FS_C1_I0_A0_EP4_TYPE TF_TYPE_BULK
211 #define FS_C1_I0_A0_EP4_MAX_PACKET 0x0040
212 #define FS_C1_I0_A0_EP4_bInterval 0
214 #define FS_C1_I0_A0_EP_LENGTH (EP_LENGTH * FS_C1_I0_A0_EP_NUMBER)
216 #define FS_C1_I0_A0_EP1_FIFO_START 0
217 #define FS_C1_I0_A0_EP1_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP1_BLKNO * FS_C1_I0_A0_EP1_BLKSIZE)
218 #define FS_C1_I0_A0_EP1_FIFO_CONFIG (uint8_t)(0x80 | ((FS_C1_I0_A0_EP1_BLKSIZE - 1) << 4) | ((FS_C1_I0_A0_EP1_BLKNO - 1) << 2) | FS_C1_I0_A0_EP1_TYPE)
219 #define FS_C1_I0_A0_EP1_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP1_DIRECTION) << 4) | 1)
220 #define FS_C1_I0_A0_EP1_MAP (uint8_t)(FS_C1_I0_A0_EP1_FIFO_START | (FS_C1_I0_A0_EP1_FIFO_START << 4) | (MASK_F0 >> (4*FS_C1_I0_A0_EP1_DIRECTION)))
223 #define FS_C1_I0_A0_EP2_FIFO_START (uint8_t)(FS_C1_I0_A0_EP1_FIFO_START + FS_C1_I0_A0_EP1_FIFO_NO)
224 #define FS_C1_I0_A0_EP2_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP2_BLKNO * FS_C1_I0_A0_EP2_BLKSIZE)
225 #define FS_C1_I0_A0_EP2_FIFO_CONFIG (uint8_t)(0x80 | ((FS_C1_I0_A0_EP2_BLKSIZE - 1) << 4) | ((FS_C1_I0_A0_EP2_BLKNO - 1) << 2) | FS_C1_I0_A0_EP2_TYPE)
226 #define FS_C1_I0_A0_EP2_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP2_DIRECTION) << 4) | 2)
227 #define FS_C1_I0_A0_EP2_MAP (uint8_t)(FS_C1_I0_A0_EP2_FIFO_START | (FS_C1_I0_A0_EP2_FIFO_START << 4) | (MASK_F0 >> (4*FS_C1_I0_A0_EP2_DIRECTION)))
230 #define FS_C1_I0_A0_EP3_FIFO_START 14
231 #define FS_C1_I0_A0_EP3_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP3_BLKNO * FS_C1_I0_A0_EP3_BLKSIZE)
232 #define FS_C1_I0_A0_EP3_FIFO_CONFIG (uint8_t)(0x80 | ((FS_C1_I0_A0_EP3_BLKSIZE - 1) << 4) | ((FS_C1_I0_A0_EP3_BLKNO - 1) << 2) | FS_C1_I0_A0_EP3_TYPE)
233 #define FS_C1_I0_A0_EP3_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP3_DIRECTION) << 4) | 3)
234 #define FS_C1_I0_A0_EP3_MAP (uint8_t)(FS_C1_I0_A0_EP3_FIFO_START | (FS_C1_I0_A0_EP3_FIFO_START << 4) | (MASK_F0 >> (4*FS_C1_I0_A0_EP3_DIRECTION)))
237 #define FS_C1_I0_A0_EP4_FIFO_START (uint8_t)(FS_C1_I0_A0_EP3_FIFO_START + FS_C1_I0_A0_EP3_FIFO_NO)
238 #define FS_C1_I0_A0_EP4_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP4_BLKNO * FS_C1_I0_A0_EP4_BLKSIZE)
239 #define FS_C1_I0_A0_EP4_FIFO_CONFIG (uint8_t)(0x80 | ((FS_C1_I0_A0_EP4_BLKSIZE - 1) << 4) | ((FS_C1_I0_A0_EP4_BLKNO - 1) << 2) | FS_C1_I0_A0_EP4_TYPE)
240 #define FS_C1_I0_A0_EP4_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP4_DIRECTION) << 4) | 4)
241 #define FS_C1_I0_A0_EP4_MAP (uint8_t)(FS_C1_I0_A0_EP4_FIFO_START | (FS_C1_I0_A0_EP4_FIFO_START << 4) | (MASK_F0 >> (4*FS_C1_I0_A0_EP4_DIRECTION)))
243 #endif /* __CARL9170FW_USB_FIFO_H */