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, 2010 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, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef __CARL9170FW_USB_FIFO_H
27 #define __CARL9170FW_USB_FIFO_H
33 /* Block Size define */
40 /* Block toggle number define */
45 /* Endpoint transfer type */
46 #define TF_TYPE_ISOCHRONOUS 1
47 #define TF_TYPE_BULK 2
48 #define TF_TYPE_INTERRUPT 3
50 /* Endpoint or FIFO direction define */
51 #define DIRECTION_IN 0
52 #define DIRECTION_OUT 1
54 #define HS_C1_I0_A0_EP1_MAX_PACKET 512
55 #define HS_C1_I0_A0_EP1_bInterval 0
57 #define HS_C1_I0_A0_EP_NUMBER 0x04
58 #define HS_C1_I0_A0_EP_LENGTH (EP_LENGTH * HS_C1_I0_A0_EP_NUMBER)
59 #define HS_C1_I0_ALT_LENGTH (HS_C1_I0_A0_EP_LENGTH)
60 #define HS_C1_INTERFACE_LENGTH (HS_C1_I0_ALT_LENGTH)
62 #define HS_C1_CONFIG_TOTAL_LENGTH (CONFIG_LENGTH + INTERFACE_LENGTH + HS_C1_INTERFACE_LENGTH)
63 #define FS_C1_CONFIG_TOTAL_LENGTH (CONFIG_LENGTH + INTERFACE_LENGTH + FS_C1_INTERFACE_LENGTH)
65 #define FS_C1_I0_A0_EP1_MAX_PACKET 64
66 /* #define FS_C1_I0_A0_EP1_bInterval HS_C1_I0_A0_EP1_bInterval */
68 #define HS_CONFIGURATION_NUMBER 1
69 #define FS_CONFIGURATION_NUMBER 1
72 #define fDOUBLE_BUF_IN 0
77 #define HS_C1_INTERFACE_NUMBER 0x01
79 #define HS_C1_iConfiguration 0x00
80 #define HS_C1_bmAttribute 0x80
82 #define HS_C1_iMaxPower 0xFA
85 #define HS_C1_I0_ALT_NUMBER 0X01
86 /* AlternateSetting 0 */
87 #define HS_C1_I0_A0_bInterfaceNumber 0x00
88 #define HS_C1_I0_A0_bAlternateSetting 0x00
90 #define HS_C1_I0_A0_EP_NUMBER 0x04
91 #define HS_C1_I0_A0_bInterfaceClass 0xff
92 #define HS_C1_I0_A0_bInterfaceSubClass 0x00
93 #define HS_C1_I0_A0_bInterfaceProtocol 0x00
94 #define HS_C1_I0_A0_iInterface 0x00
97 #define HS_C1_I0_A0_EP1_BLKSIZE 512
98 #define HS_C1_I0_A0_EP1_BLKNO DOUBLE_BLK
99 #define HS_C1_I0_A0_EP1_DIRECTION DIRECTION_OUT
100 #define HS_C1_I0_A0_EP1_TYPE TF_TYPE_BULK
102 #define HS_C1_I0_A0_EP1_MAX_PACKET 512
103 #define HS_C1_I0_A0_EP1_bInterval 0
106 #define HS_C1_I0_A0_EP2_BLKSIZE 512
107 /* JWEI 2003/08/20 */
108 #define HS_C1_I0_A0_EP2_BLKNO SINGLE_BLK
109 #define HS_C1_I0_A0_EP2_DIRECTION DIRECTION_IN
110 #define HS_C1_I0_A0_EP2_TYPE TF_TYPE_BULK
111 #define HS_C1_I0_A0_EP2_MAX_PACKET 512
112 #define HS_C1_I0_A0_EP2_bInterval 0
115 #define HS_C1_I0_A0_EP3_BLKSIZE 64
116 #define HS_C1_I0_A0_EP3_BLKNO SINGLE_BLK
117 #define HS_C1_I0_A0_EP3_DIRECTION DIRECTION_IN
118 #define HS_C1_I0_A0_EP3_TYPE TF_TYPE_INTERRUPT
119 #define HS_C1_I0_A0_EP3_MAX_PACKET 0x0040
120 #define HS_C1_I0_A0_EP3_bInterval 01
123 * Note: HS Bulk type require max pkt size = 512
124 * ==> must use Interrupt type for max pkt size = 64
128 #define HS_C1_I0_A0_EP4_BLKSIZE 64
129 #define HS_C1_I0_A0_EP4_BLKNO SINGLE_BLK
130 #define HS_C1_I0_A0_EP4_DIRECTION DIRECTION_OUT
131 #define HS_C1_I0_A0_EP4_TYPE TF_TYPE_INTERRUPT
132 #define HS_C1_I0_A0_EP4_MAX_PACKET 0x0040
133 #define HS_C1_I0_A0_EP4_bInterval 01
135 #define HS_C1_I0_A0_EP_LENGTH (EP_LENGTH * HS_C1_I0_A0_EP_NUMBER)
137 #define HS_C1_I0_A0_EP1_FIFO_START 0
138 #define HS_C1_I0_A0_EP1_FIFO_NO (HS_C1_I0_A0_EP1_BLKNO * HS_C1_I0_A0_EP1_BLKSIZE)
139 #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)
140 #define HS_C1_I0_A0_EP1_FIFO_MAP (((1 - HS_C1_I0_A0_EP1_DIRECTION) << 4) | 1)
141 #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)))
144 #define HS_C1_I0_A0_EP2_FIFO_START (uint8_t)(HS_C1_I0_A0_EP1_FIFO_START + HS_C1_I0_A0_EP1_FIFO_NO)
145 #define HS_C1_I0_A0_EP2_FIFO_NO (uint8_t)(HS_C1_I0_A0_EP2_BLKNO * HS_C1_I0_A0_EP2_BLKSIZE)
146 #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)
147 #define HS_C1_I0_A0_EP2_FIFO_MAP (uint8_t)(((1 - HS_C1_I0_A0_EP2_DIRECTION) << 4) | 2)
148 #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)))
151 #define HS_C1_I0_A0_EP3_FIFO_START 14
152 #define HS_C1_I0_A0_EP3_FIFO_NO (HS_C1_I0_A0_EP3_BLKNO * HS_C1_I0_A0_EP3_BLKSIZE)
153 #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)
154 #define HS_C1_I0_A0_EP3_FIFO_MAP (uint8_t)(((1 - HS_C1_I0_A0_EP3_DIRECTION) << 4) | 3)
155 #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)))
158 #define HS_C1_I0_A0_EP4_FIFO_START (HS_C1_I0_A0_EP3_FIFO_START + HS_C1_I0_A0_EP3_FIFO_NO)
159 #define HS_C1_I0_A0_EP4_FIFO_NO (HS_C1_I0_A0_EP4_BLKNO * HS_C1_I0_A0_EP4_BLKSIZE)
160 #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)
161 #define HS_C1_I0_A0_EP4_FIFO_MAP (((1 - HS_C1_I0_A0_EP4_DIRECTION) << 4) | 4)
162 #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)))
164 /* Configuration 1 */
165 #define FS_C1_INTERFACE_NUMBER 0x01
167 #define FS_C1_iConfiguration 0x00
168 #define FS_C1_bmAttribute 0x80
169 #define FS_C1_iMaxPower 0xfa
172 #define FS_C1_I0_ALT_NUMBER 0x01
173 /* AlternateSetting 0x00 */
174 #define FS_C1_I0_A0_bInterfaceNumber 0x00
175 #define FS_C1_I0_A0_bAlternateSetting 0x00
176 #define FS_C1_I0_A0_EP_NUMBER 0x04
177 #define FS_C1_I0_A0_bInterfaceClass 0xff
178 #define FS_C1_I0_A0_bInterfaceSubClass 0x00
179 #define FS_C1_I0_A0_bInterfaceProtocol 0x00
182 #define FS_C1_I0_A0_EP1_BLKSIZE 512
183 /* JWEI 2003/05/19 */
184 #define FS_C1_I0_A0_EP1_BLKNO DOUBLE_BLK
185 #define FS_C1_I0_A0_EP1_DIRECTION DIRECTION_OUT
186 #define FS_C1_I0_A0_EP1_TYPE TF_TYPE_BULK
187 #define FS_C1_I0_A0_EP1_MAX_PACKET 64
188 #define FS_C1_I0_A0_EP1_bInterval 0
191 #define FS_C1_I0_A0_EP2_BLKSIZE 512
192 /* JWEI 2003/08/20 */
193 #define FS_C1_I0_A0_EP2_BLKNO SINGLE_BLK
194 #define FS_C1_I0_A0_EP2_DIRECTION DIRECTION_IN
195 #define FS_C1_I0_A0_EP2_TYPE TF_TYPE_BULK
196 #define FS_C1_I0_A0_EP2_MAX_PACKET 64
197 #define FS_C1_I0_A0_EP2_bInterval 0
200 #define FS_C1_I0_A0_EP3_BLKSIZE 64
201 #define FS_C1_I0_A0_EP3_BLKNO SINGLE_BLK
202 #define FS_C1_I0_A0_EP3_DIRECTION DIRECTION_IN
203 #define FS_C1_I0_A0_EP3_TYPE TF_TYPE_INTERRUPT
204 #define FS_C1_I0_A0_EP3_MAX_PACKET 0x0040
205 #define FS_C1_I0_A0_EP3_bInterval 1
208 #define FS_C1_I0_A0_EP4_BLKSIZE 64
209 #define FS_C1_I0_A0_EP4_BLKNO SINGLE_BLK
210 #define FS_C1_I0_A0_EP4_DIRECTION DIRECTION_OUT
211 #define FS_C1_I0_A0_EP4_TYPE TF_TYPE_BULK
212 #define FS_C1_I0_A0_EP4_MAX_PACKET 0x0040
213 #define FS_C1_I0_A0_EP4_bInterval 0
215 #define FS_C1_I0_A0_EP_LENGTH (EP_LENGTH * FS_C1_I0_A0_EP_NUMBER)
217 #define FS_C1_I0_A0_EP1_FIFO_START 0
218 #define FS_C1_I0_A0_EP1_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP1_BLKNO * FS_C1_I0_A0_EP1_BLKSIZE)
219 #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)
220 #define FS_C1_I0_A0_EP1_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP1_DIRECTION) << 4) | 1)
221 #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)))
224 #define FS_C1_I0_A0_EP2_FIFO_START (uint8_t)(FS_C1_I0_A0_EP1_FIFO_START + FS_C1_I0_A0_EP1_FIFO_NO)
225 #define FS_C1_I0_A0_EP2_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP2_BLKNO * FS_C1_I0_A0_EP2_BLKSIZE)
226 #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)
227 #define FS_C1_I0_A0_EP2_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP2_DIRECTION) << 4) | 2)
228 #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)))
231 #define FS_C1_I0_A0_EP3_FIFO_START 14
232 #define FS_C1_I0_A0_EP3_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP3_BLKNO * FS_C1_I0_A0_EP3_BLKSIZE)
233 #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)
234 #define FS_C1_I0_A0_EP3_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP3_DIRECTION) << 4) | 3)
235 #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)))
238 #define FS_C1_I0_A0_EP4_FIFO_START (uint8_t)(FS_C1_I0_A0_EP3_FIFO_START + FS_C1_I0_A0_EP3_FIFO_NO)
239 #define FS_C1_I0_A0_EP4_FIFO_NO (uint8_t)(FS_C1_I0_A0_EP4_BLKNO * FS_C1_I0_A0_EP4_BLKSIZE)
240 #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)
241 #define FS_C1_I0_A0_EP4_FIFO_MAP (uint8_t)(((1 - FS_C1_I0_A0_EP4_DIRECTION) << 4) | 4)
242 #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)))
244 #endif /* __CARL9170FW_USB_FIFO_H */