1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #ifndef __LINUX_USB_WUSB_WA_H
33 #define __LINUX_USB_WUSB_WA_H
34
35
36
37
38
39
40
41 enum {
42 WA_EXEC_RC_CMD = 40,
43 };
44
45
46 enum {
47 WUSB_REQ_ADD_MMC_IE = 20,
48 WUSB_REQ_REMOVE_MMC_IE = 21,
49 WUSB_REQ_SET_NUM_DNTS = 22,
50 WUSB_REQ_SET_CLUSTER_ID = 23,
51 WUSB_REQ_SET_DEV_INFO = 24,
52 WUSB_REQ_GET_TIME = 25,
53 WUSB_REQ_SET_STREAM_IDX = 26,
54 WUSB_REQ_SET_WUSB_MAS = 27,
55 WUSB_REQ_CHAN_STOP = 28,
56 };
57
58
59
60 enum {
61 WUSB_TIME_ADJ = 0,
62 WUSB_TIME_BPST = 1,
63 WUSB_TIME_WUSB = 2,
64 };
65
66 enum {
67 WA_ENABLE = 0x01,
68 WA_RESET = 0x02,
69 RPIPE_PAUSE = 0x1,
70 RPIPE_STALL = 0x2,
71 };
72
73
74 enum {
75 WA_STATUS_ENABLED = 0x01,
76 WA_STATUS_RESETTING = 0x02
77 };
78
79 enum rpipe_crs {
80 RPIPE_CRS_CTL = 0x01,
81 RPIPE_CRS_ISO = 0x02,
82 RPIPE_CRS_BULK = 0x04,
83 RPIPE_CRS_INTR = 0x08
84 };
85
86
87
88
89
90
91 struct usb_rpipe_descriptor {
92 u8 bLength;
93 u8 bDescriptorType;
94 __le16 wRPipeIndex;
95 __le16 wRequests;
96 __le16 wBlocks;
97 __le16 wMaxPacketSize;
98 union {
99 u8 dwa_bHSHubAddress;
100 u8 hwa_bMaxBurst;
101 };
102 union {
103 u8 dwa_bHSHubPort;
104 u8 hwa_bDeviceInfoIndex;
105 };
106 u8 bSpeed;
107 union {
108 u8 dwa_bDeviceAddress;
109 u8 hwa_reserved;
110 };
111 u8 bEndpointAddress;
112 u8 bDataSequence;
113 __le32 dwCurrentWindow;
114 u8 bMaxDataSequence;
115 u8 bInterval;
116 u8 bOverTheAirInterval;
117 u8 bmAttribute;
118 u8 bmCharacteristics;
119 u8 bmRetryOptions;
120 __le16 wNumTransactionErrors;
121 } __attribute__ ((packed));
122
123
124
125
126
127
128
129 enum wa_notif_type {
130 DWA_NOTIF_RWAKE = 0x91,
131 DWA_NOTIF_PORTSTATUS = 0x92,
132 WA_NOTIF_TRANSFER = 0x93,
133 HWA_NOTIF_BPST_ADJ = 0x94,
134 HWA_NOTIF_DN = 0x95,
135 };
136
137
138
139
140
141
142
143 struct wa_notif_hdr {
144 u8 bLength;
145 u8 bNotifyType;
146 } __packed;
147
148
149
150
151
152
153
154
155
156
157 struct hwa_notif_dn {
158 struct wa_notif_hdr hdr;
159 u8 bSourceDeviceAddr;
160 u8 bmAttributes;
161 struct wusb_dn_hdr dndata[];
162 } __packed;
163
164
165 enum wa_xfer_type {
166 WA_XFER_TYPE_CTL = 0x80,
167 WA_XFER_TYPE_BI = 0x81,
168 WA_XFER_TYPE_ISO = 0x82,
169 WA_XFER_RESULT = 0x83,
170 WA_XFER_ABORT = 0x84,
171 WA_XFER_ISO_PACKET_INFO = 0xA0,
172 WA_XFER_ISO_PACKET_STATUS = 0xA1,
173 };
174
175
176 struct wa_xfer_hdr {
177 u8 bLength;
178 u8 bRequestType;
179 __le16 wRPipe;
180 __le32 dwTransferID;
181 __le32 dwTransferLength;
182 u8 bTransferSegment;
183 } __packed;
184
185 struct wa_xfer_ctl {
186 struct wa_xfer_hdr hdr;
187 u8 bmAttribute;
188 __le16 wReserved;
189 struct usb_ctrlrequest baSetupData;
190 } __packed;
191
192 struct wa_xfer_bi {
193 struct wa_xfer_hdr hdr;
194 u8 bReserved;
195 __le16 wReserved;
196 } __packed;
197
198
199 struct wa_xfer_hwaiso {
200 struct wa_xfer_hdr hdr;
201 u8 bReserved;
202 __le16 wPresentationTime;
203 __le32 dwNumOfPackets;
204 } __packed;
205
206 struct wa_xfer_packet_info_hwaiso {
207 __le16 wLength;
208 u8 bPacketType;
209 u8 bReserved;
210 __le16 PacketLength[0];
211 } __packed;
212
213 struct wa_xfer_packet_status_len_hwaiso {
214 __le16 PacketLength;
215 __le16 PacketStatus;
216 } __packed;
217
218 struct wa_xfer_packet_status_hwaiso {
219 __le16 wLength;
220 u8 bPacketType;
221 u8 bReserved;
222 struct wa_xfer_packet_status_len_hwaiso PacketStatus[0];
223 } __packed;
224
225
226 struct wa_xfer_abort {
227 u8 bLength;
228 u8 bRequestType;
229 __le16 wRPipe;
230 __le32 dwTransferID;
231 } __packed;
232
233
234
235
236
237 struct wa_notif_xfer {
238 struct wa_notif_hdr hdr;
239 u8 bEndpoint;
240 u8 Reserved;
241 } __packed;
242
243
244 enum {
245 WA_XFER_STATUS_SUCCESS,
246 WA_XFER_STATUS_HALTED,
247 WA_XFER_STATUS_DATA_BUFFER_ERROR,
248 WA_XFER_STATUS_BABBLE,
249 WA_XFER_RESERVED,
250 WA_XFER_STATUS_NOT_FOUND,
251 WA_XFER_STATUS_INSUFFICIENT_RESOURCE,
252 WA_XFER_STATUS_TRANSACTION_ERROR,
253 WA_XFER_STATUS_ABORTED,
254 WA_XFER_STATUS_RPIPE_NOT_READY,
255 WA_XFER_INVALID_FORMAT,
256 WA_XFER_UNEXPECTED_SEGMENT_NUMBER,
257 WA_XFER_STATUS_RPIPE_TYPE_MISMATCH,
258 };
259
260
261 struct wa_xfer_result {
262 struct wa_notif_hdr hdr;
263 __le32 dwTransferID;
264 __le32 dwTransferLength;
265 u8 bTransferSegment;
266 u8 bTransferStatus;
267 __le32 dwNumOfPackets;
268 } __packed;
269
270
271
272
273
274
275
276
277
278
279
280 struct usb_wa_descriptor {
281 u8 bLength;
282 u8 bDescriptorType;
283 __le16 bcdWAVersion;
284 u8 bNumPorts;
285 u8 bmAttributes;
286 __le16 wNumRPipes;
287 __le16 wRPipeMaxBlock;
288 u8 bRPipeBlockSize;
289 u8 bPwrOn2PwrGood;
290 u8 bNumMMCIEs;
291 u8 DeviceRemovable;
292 } __packed;
293
294
295
296
297 struct hwa_dev_info {
298 u8 bmDeviceAvailability[32];
299 u8 bDeviceAddress;
300 __le16 wPHYRates;
301 u8 bmDeviceAttribute;
302 } __packed;
303
304 #endif