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