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};
70
71
72enum {
73 WA_STATUS_ENABLED = 0x01,
74 WA_STATUS_RESETTING = 0x02
75};
76
77enum rpipe_crs {
78 RPIPE_CRS_CTL = 0x01,
79 RPIPE_CRS_ISO = 0x02,
80 RPIPE_CRS_BULK = 0x04,
81 RPIPE_CRS_INTR = 0x08
82};
83
84
85
86
87
88
89struct usb_rpipe_descriptor {
90 u8 bLength;
91 u8 bDescriptorType;
92 __le16 wRPipeIndex;
93 __le16 wRequests;
94 __le16 wBlocks;
95 __le16 wMaxPacketSize;
96 u8 bHSHubAddress;
97 u8 bHSHubPort;
98 u8 bSpeed;
99 u8 bDeviceAddress;
100 u8 bEndpointAddress;
101 u8 bDataSequence;
102 __le32 dwCurrentWindow;
103 u8 bMaxDataSequence;
104 u8 bInterval;
105 u8 bOverTheAirInterval;
106 u8 bmAttribute;
107 u8 bmCharacteristics;
108 u8 bmRetryOptions;
109 __le16 wNumTransactionErrors;
110} __attribute__ ((packed));
111
112
113
114
115
116
117
118enum wa_notif_type {
119 DWA_NOTIF_RWAKE = 0x91,
120 DWA_NOTIF_PORTSTATUS = 0x92,
121 WA_NOTIF_TRANSFER = 0x93,
122 HWA_NOTIF_BPST_ADJ = 0x94,
123 HWA_NOTIF_DN = 0x95,
124};
125
126
127
128
129
130
131
132struct wa_notif_hdr {
133 u8 bLength;
134 u8 bNotifyType;
135} __attribute__((packed));
136
137
138
139
140
141
142
143
144
145
146struct hwa_notif_dn {
147 struct wa_notif_hdr hdr;
148 u8 bSourceDeviceAddr;
149 u8 bmAttributes;
150 struct wusb_dn_hdr dndata[];
151} __attribute__((packed));
152
153
154enum wa_xfer_type {
155 WA_XFER_TYPE_CTL = 0x80,
156 WA_XFER_TYPE_BI = 0x81,
157 WA_XFER_TYPE_ISO = 0x82,
158 WA_XFER_RESULT = 0x83,
159 WA_XFER_ABORT = 0x84,
160};
161
162
163struct wa_xfer_hdr {
164 u8 bLength;
165 u8 bRequestType;
166 __le16 wRPipe;
167 __le32 dwTransferID;
168 __le32 dwTransferLength;
169 u8 bTransferSegment;
170} __attribute__((packed));
171
172struct wa_xfer_ctl {
173 struct wa_xfer_hdr hdr;
174 u8 bmAttribute;
175 __le16 wReserved;
176 struct usb_ctrlrequest baSetupData;
177} __attribute__((packed));
178
179struct wa_xfer_bi {
180 struct wa_xfer_hdr hdr;
181 u8 bReserved;
182 __le16 wReserved;
183} __attribute__((packed));
184
185struct wa_xfer_hwaiso {
186 struct wa_xfer_hdr hdr;
187 u8 bReserved;
188 __le16 wPresentationTime;
189 __le32 dwNumOfPackets;
190
191} __attribute__((packed));
192
193
194struct wa_xfer_abort {
195 u8 bLength;
196 u8 bRequestType;
197 __le16 wRPipe;
198 __le32 dwTransferID;
199} __attribute__((packed));
200
201
202
203
204
205struct wa_notif_xfer {
206 struct wa_notif_hdr hdr;
207 u8 bEndpoint;
208 u8 Reserved;
209} __attribute__((packed));
210
211
212enum {
213 WA_XFER_STATUS_SUCCESS,
214 WA_XFER_STATUS_HALTED,
215 WA_XFER_STATUS_DATA_BUFFER_ERROR,
216 WA_XFER_STATUS_BABBLE,
217 WA_XFER_RESERVED,
218 WA_XFER_STATUS_NOT_FOUND,
219 WA_XFER_STATUS_INSUFFICIENT_RESOURCE,
220 WA_XFER_STATUS_TRANSACTION_ERROR,
221 WA_XFER_STATUS_ABORTED,
222 WA_XFER_STATUS_RPIPE_NOT_READY,
223 WA_XFER_INVALID_FORMAT,
224 WA_XFER_UNEXPECTED_SEGMENT_NUMBER,
225 WA_XFER_STATUS_RPIPE_TYPE_MISMATCH,
226};
227
228
229struct wa_xfer_result {
230 struct wa_notif_hdr hdr;
231 __le32 dwTransferID;
232 __le32 dwTransferLength;
233 u8 bTransferSegment;
234 u8 bTransferStatus;
235 __le32 dwNumOfPackets;
236} __attribute__((packed));
237
238
239
240
241
242
243
244
245
246
247
248struct usb_wa_descriptor {
249 u8 bLength;
250 u8 bDescriptorType;
251 u16 bcdWAVersion;
252 u8 bNumPorts;
253 u8 bmAttributes;
254 u16 wNumRPipes;
255 u16 wRPipeMaxBlock;
256 u8 bRPipeBlockSize;
257 u8 bPwrOn2PwrGood;
258 u8 bNumMMCIEs;
259 u8 DeviceRemovable;
260} __attribute__((packed));
261
262
263
264
265struct hwa_dev_info {
266 u8 bmDeviceAvailability[32];
267 u8 bDeviceAddress;
268 __le16 wPHYRates;
269 u8 bmDeviceAttribute;
270} __attribute__((packed));
271
272#endif
273