Merge trunk HEAD (46152)
[reactos.git] / include / ddk / hubbusif.h
1 #pragma once
2
3 #if (NTDDI_VERSION >= NTDDI_WINXP)
4
5 typedef PVOID PUSB_DEVICE_HANDLE;
6
7 typedef struct _ROOTHUB_PDO_EXTENSION {
8 ULONG Signature;
9 } ROOTHUB_PDO_EXTENSION, *PROOTHUB_PDO_EXTENSION;
10
11 #define USBD_DEVHACK_SLOW_ENUMERATION 0x00000001
12 #define USBD_DEVHACK_DISABLE_SN 0x00000002
13 #define USBD_DEVHACK_SET_DIAG_ID 0x00000004
14
15 #ifndef USB_BUSIFFN
16 #define USB_BUSIFFN __stdcall
17 #endif
18
19 #define CD_ERR_V1 0x00000001
20
21 #define ID_ERR_V1 0x00000001
22
23 #define USBD_KEEP_DEVICE_DATA 0x00000001
24 #define USBD_MARK_DEVICE_BUSY 0x00000002
25
26 #define USB_IDLE_NOT_READY 0
27 #define USB_IDLE_READY 1
28
29 typedef
30 NTSTATUS
31 USB_BUSIFFN
32 USB_BUSIFFN_CREATE_USB_DEVICE (
33 IN PVOID BusContext,
34 OUT PUSB_DEVICE_HANDLE *NewDeviceHandle,
35 IN PUSB_DEVICE_HANDLE HubDeviceHandle,
36 IN USHORT PortStatus,
37 IN USHORT PortNumber);
38
39 typedef USB_BUSIFFN_CREATE_USB_DEVICE *PUSB_BUSIFFN_CREATE_USB_DEVICE;
40
41 typedef enum _USBPORT_CREATEDEV_ERROR {
42 CreateDevErrNotSet = 0,
43 CreateDevBadHubDevHandle,
44 CreateDevFailedAllocDevHandle,
45 CreateDevFailedOpenEndpoint,
46 CreateDevFailedAllocDsBuff,
47 CreateDevFailedGetDs,
48 CreateDevTtNotFound,
49 CreateDevBadDevHandlePtr
50 } USBPORT_CREATEDEV_ERROR;
51
52 typedef struct _USB_CD_ERROR_INFORMATION {
53 ULONG Version;
54 USBPORT_CREATEDEV_ERROR PathError;
55 ULONG UlongArg1;
56 ULONG UlongArg2;
57 NTSTATUS NtStatus;
58 UCHAR XtraInfo[64];
59 } USB_CD_ERROR_INFORMATION, *PUSB_CD_ERROR_INFORMATION;
60
61 typedef
62 NTSTATUS
63 USB_BUSIFFN
64 USB_BUSIFFN_CREATE_USB_DEVICE_EX (
65 IN PVOID BusContext,
66 OUT PUSB_DEVICE_HANDLE *NewDeviceHandle,
67 IN PUSB_DEVICE_HANDLE HsHubDeviceHandle,
68 IN USHORT PortStatus,
69 IN USHORT PortNumber,
70 OUT PUSB_CD_ERROR_INFORMATION CdErrorInfo,
71 IN USHORT TtPortNumber);
72
73 typedef USB_BUSIFFN_CREATE_USB_DEVICE_EX *PUSB_BUSIFFN_CREATE_USB_DEVICE_EX;
74
75 typedef struct _USB_PORT_PATH {
76 ULONG PortPathDepth;
77 ULONG PortPath[6];
78 } USB_PORT_PATH, *PUSB_PORT_PATH;
79
80 typedef
81 NTSTATUS
82 USB_BUSIFFN
83 USB_BUSIFFN_CREATE_USB_DEVICE_V7 (
84 IN PVOID BusContext,
85 OUT PUSB_DEVICE_HANDLE *NewDeviceHandle,
86 IN PUSB_DEVICE_HANDLE HsHubDeviceHandle,
87 IN USHORT PortStatus,
88 IN PUSB_PORT_PATH PortPath,
89 OUT PUSB_CD_ERROR_INFORMATION CdErrorInfo,
90 IN USHORT TtPortNumber,
91 IN PDEVICE_OBJECT PdoDeviceObject,
92 IN PUNICODE_STRING PhysicalDeviceObjectName);
93
94 typedef USB_BUSIFFN_CREATE_USB_DEVICE_V7 *PUSB_BUSIFFN_CREATE_USB_DEVICE_V7;
95
96 typedef enum _USBPORT_INITDEV_ERROR {
97 InitDevErrNotSet = 0,
98 InitDevFailedSetAddress,
99 InitDevFailedPokeEndpoint,
100 InitDevBadDeviceDescriptor
101 } USBPORT_INITDEV_ERROR;
102
103 typedef struct _USB_ID_ERROR_INFORMATION {
104 ULONG Version;
105 USBPORT_INITDEV_ERROR PathError;
106 ULONG Arg1;
107 ULONG UsbAddress;
108 NTSTATUS NtStatus;
109 USBD_STATUS UsbdStatus;
110 UCHAR XtraInfo[64];
111 } USB_ID_ERROR_INFORMATION, *PUSB_ID_ERROR_INFORMATION;
112
113 typedef
114 NTSTATUS
115 USB_BUSIFFN
116 USB_BUSIFFN_INITIALIZE_USB_DEVICE (
117 IN PVOID BusContext,
118 IN OUT PUSB_DEVICE_HANDLE DeviceHandle);
119
120 typedef USB_BUSIFFN_INITIALIZE_USB_DEVICE *PUSB_BUSIFFN_INITIALIZE_USB_DEVICE;
121
122 typedef
123 NTSTATUS
124 USB_BUSIFFN
125 USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX (
126 IN PVOID BusContext,
127 IN OUT PUSB_DEVICE_HANDLE DeviceHandle,
128 OUT PUSB_ID_ERROR_INFORMATION IdErrInfo);
129
130 typedef USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX *PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX;
131
132 typedef
133 NTSTATUS
134 USB_BUSIFFN
135 USB_BUSIFFN_REMOVE_USB_DEVICE (
136 IN PVOID BusContext,
137 IN OUT PUSB_DEVICE_HANDLE DeviceHandle,
138 IN ULONG Flags);
139
140 typedef USB_BUSIFFN_REMOVE_USB_DEVICE *PUSB_BUSIFFN_REMOVE_USB_DEVICE;
141
142 typedef
143 NTSTATUS
144 USB_BUSIFFN
145 USB_BUSIFFN_GET_USB_DESCRIPTORS (
146 IN PVOID BusContext,
147 IN OUT PUSB_DEVICE_HANDLE DeviceHandle,
148 OUT PUCHAR DeviceDescriptorBuffer,
149 IN OUT PULONG DeviceDescriptorBufferLength,
150 OUT PUCHAR ConfigDescriptorBuffer,
151 IN OUT PULONG ConfigDescriptorBufferLength);
152
153 typedef USB_BUSIFFN_GET_USB_DESCRIPTORS *PUSB_BUSIFFN_GET_USB_DESCRIPTORS;
154
155 typedef
156 NTSTATUS
157 USB_BUSIFFN
158 USB_BUSIFFN_RESTORE_DEVICE (
159 IN PVOID BusContext,
160 IN OUT PUSB_DEVICE_HANDLE OldDeviceHandle,
161 IN OUT PUSB_DEVICE_HANDLE NewDeviceHandle);
162
163 typedef USB_BUSIFFN_RESTORE_DEVICE *PUSB_BUSIFFN_RESTORE_DEVICE;
164
165 typedef
166 NTSTATUS
167 USB_BUSIFFN
168 USB_BUSIFFN_GET_POTRTHACK_FLAGS (
169 IN PVOID BusContext,
170 IN OUT PULONG Flags);
171
172 typedef USB_BUSIFFN_GET_POTRTHACK_FLAGS *PUSB_BUSIFFN_GET_POTRTHACK_FLAGS;
173
174 typedef
175 NTSTATUS
176 USB_BUSIFFN
177 USB_BUSIFFN_GET_DEVICE_INFORMATION (
178 IN PVOID BusContext,
179 IN PUSB_DEVICE_HANDLE DeviceHandle,
180 OUT PVOID DeviceInformationBuffer,
181 IN ULONG DeviceInformationBufferLength,
182 IN OUT PULONG LengthOfDataCopied);
183
184 typedef USB_BUSIFFN_GET_DEVICE_INFORMATION *PUSB_BUSIFFN_GET_DEVICE_INFORMATION;
185
186 typedef
187 NTSTATUS
188 USB_BUSIFFN
189 USB_BUSIFFN_GET_CONTROLLER_INFORMATION (
190 IN PVOID BusContext,
191 IN OUT PVOID ControllerInformationBuffer,
192 IN ULONG ControllerInformationBufferLength,
193 IN OUT PULONG LengthOfDataCopied);
194
195 typedef USB_BUSIFFN_GET_CONTROLLER_INFORMATION *PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION;
196
197 typedef
198 NTSTATUS
199 USB_BUSIFFN
200 USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND (
201 IN PVOID BusContext,
202 IN BOOLEAN Enable);
203
204 typedef USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND *PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND;
205
206 typedef
207 NTSTATUS
208 USB_BUSIFFN
209 USB_BUSIFFN_GET_EXTENDED_HUB_INFO (
210 IN PVOID BusContext,
211 IN PDEVICE_OBJECT HubPhysicalDeviceObject,
212 IN PVOID HubInformationBuffer,
213 IN ULONG HubInformationBufferLength,
214 OUT PULONG LengthOfDataCopied);
215
216 typedef USB_BUSIFFN_GET_EXTENDED_HUB_INFO *PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO;
217
218 typedef
219 NTSTATUS
220 USB_BUSIFFN
221 USB_BUSIFFN_GET_ROOTHUB_SYM_NAME (
222 IN PVOID BusContext,
223 IN PVOID HubSymNameBuffer,
224 IN ULONG HubSymNameBufferLength,
225 OUT PULONG HubSymNameActualLength);
226
227 typedef USB_BUSIFFN_GET_ROOTHUB_SYM_NAME *PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME;
228
229 typedef
230 PVOID
231 USB_BUSIFFN
232 USB_BUSIFFN_GET_DEVICE_BUSCONTEXT (
233 IN PVOID HubBusContext,
234 IN PVOID DeviceHandle);
235
236 typedef USB_BUSIFFN_GET_DEVICE_BUSCONTEXT *PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT;
237
238 typedef
239 NTSTATUS
240 USB_BUSIFFN
241 USB_BUSIFFN_INITIALIZE_20HUB (
242 IN PVOID BusContext,
243 IN PUSB_DEVICE_HANDLE HubDeviceHandle,
244 IN ULONG TtCount);
245
246 typedef USB_BUSIFFN_INITIALIZE_20HUB *PUSB_BUSIFFN_INITIALIZE_20HUB;
247
248 typedef
249 BOOLEAN
250 USB_BUSIFFN
251 USB_BUSIFFN_IS_ROOT (
252 IN PVOID BusContext,
253 IN PVOID DeviceObject);
254
255 typedef USB_BUSIFFN_IS_ROOT *PUSB_BUSIFFN_IS_ROOT;
256
257 typedef
258 VOID
259 USB_BUSIFFN
260 USB_BUSIFFN_ACQUIRE_SEMAPHORE (
261 IN PVOID BusContext);
262
263 typedef USB_BUSIFFN_ACQUIRE_SEMAPHORE *PUSB_BUSIFFN_ACQUIRE_SEMAPHORE;
264
265 typedef
266 VOID
267 USB_BUSIFFN
268 USB_BUSIFFN_RELEASE_SEMAPHORE (
269 IN PVOID BusContext);
270
271 typedef USB_BUSIFFN_RELEASE_SEMAPHORE *PUSB_BUSIFFN_RELEASE_SEMAPHORE;
272
273 typedef
274 VOID
275 __stdcall
276 RH_INIT_CALLBACK (
277 IN PVOID CallBackContext);
278
279 typedef RH_INIT_CALLBACK *PRH_INIT_CALLBACK;
280
281 typedef
282 NTSTATUS
283 USB_BUSIFFN
284 USB_BUSIFFN_ROOTHUB_INIT_NOTIFY (
285 IN PVOID BusContext,
286 IN PVOID CallbackContext,
287 IN PRH_INIT_CALLBACK CallbackRoutine);
288
289 typedef USB_BUSIFFN_ROOTHUB_INIT_NOTIFY *PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY;
290
291 typedef
292 VOID
293 USB_BUSIFFN
294 USB_BUSIFFN_FLUSH_TRANSFERS (
295 IN PVOID BusContext,
296 IN PVOID DeviceHandle);
297
298 typedef USB_BUSIFFN_FLUSH_TRANSFERS *PUSB_BUSIFFN_FLUSH_TRANSFERS;
299
300 typedef
301 ULONG
302 USB_BUSIFFN
303 USB_BUSIFFN_CALC_PIPE_BANDWIDTH (
304 IN PVOID BusContext,
305 IN PUSBD_PIPE_INFORMATION PipeInfo,
306 IN USB_DEVICE_SPEED DeviceSpeed);
307
308 typedef USB_BUSIFFN_CALC_PIPE_BANDWIDTH *PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH;
309
310 typedef
311 VOID
312 USB_BUSIFFN
313 USB_BUSIFFN_SET_BUS_WAKE_MODE (
314 IN PVOID BusContext,
315 IN ULONG Mode);
316
317 typedef USB_BUSIFFN_SET_BUS_WAKE_MODE *PUSB_BUSIFFN_SET_BUS_WAKE_MODE;
318
319 typedef
320 VOID
321 USB_BUSIFFN
322 USB_BUSIFFN_SET_DEVICE_FLAG (
323 IN PVOID BusContext,
324 IN GUID *DeviceFlagGuid,
325 IN PVOID ValueData,
326 IN ULONG ValueLength);
327
328 typedef USB_BUSIFFN_SET_DEVICE_FLAG *PUSB_BUSIFFN_SET_DEVICE_FLAG;
329
330 typedef
331 VOID
332 USB_BUSIFFN
333 USB_BUSIFFN_SET_DEVHANDLE_DATA (
334 IN PVOID BusContext,
335 IN PVOID DeviceHandle,
336 IN PDEVICE_OBJECT UsbDevicePdo);
337
338 typedef USB_BUSIFFN_SET_DEVHANDLE_DATA *PUSB_BUSIFFN_SET_DEVHANDLE_DATA;
339
340 typedef
341 NTSTATUS
342 USB_BUSIFFN
343 USB_BUSIFFN_TEST_POINT (
344 IN PVOID BusContext,
345 IN PVOID DeviceHandle,
346 IN ULONG Opcode,
347 IN PVOID TestData);
348
349 typedef USB_BUSIFFN_TEST_POINT *PUSB_BUSIFFN_TEST_POINT;
350
351 typedef
352 NTSTATUS
353 USB_BUSIFFN
354 USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO (
355 IN PVOID BusContext,
356 IN PUSB_DEVICE_HANDLE DeviceHandle,
357 OUT PVOID DeviceInformationBuffer,
358 IN ULONG DeviceInformationBufferLength,
359 IN OUT PULONG LengthOfDataCopied);
360
361 typedef USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO *PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO;
362
363 typedef
364 NTSTATUS
365 USB_BUSIFFN
366 USB_BUSIFFN_WAIT_ASYNC_POWERUP (
367 IN PVOID BusContext);
368
369 typedef USB_BUSIFFN_WAIT_ASYNC_POWERUP *PUSB_BUSIFFN_WAIT_ASYNC_POWERUP;
370
371 typedef
372 NTSTATUS
373 USB_BUSIFFN
374 USB_BUSIFFN_GET_DEVICE_ADDRESS (
375 IN PVOID BusContext,
376 IN PUSB_DEVICE_HANDLE DeviceHandle,
377 OUT PUSHORT DeviceAddress);
378
379 typedef USB_BUSIFFN_GET_DEVICE_ADDRESS *PUSB_BUSIFFN_GET_DEVICE_ADDRESS;
380
381 typedef
382 VOID
383 USB_BUSIFFN
384 USB_BUSIFFN_DEREF_DEVICE_HANDLE (
385 IN PVOID BusContext,
386 IN PUSB_DEVICE_HANDLE DeviceHandle,
387 IN PVOID Object,
388 IN ULONG Tag);
389
390 typedef USB_BUSIFFN_DEREF_DEVICE_HANDLE *PUSB_BUSIFFN_DEREF_DEVICE_HANDLE;
391
392 typedef
393 NTSTATUS
394 USB_BUSIFFN
395 USB_BUSIFFN_REF_DEVICE_HANDLE (
396 IN PVOID BusContext,
397 IN PUSB_DEVICE_HANDLE DeviceHandle,
398 IN PVOID Object,
399 IN ULONG Tag);
400
401 typedef USB_BUSIFFN_REF_DEVICE_HANDLE *PUSB_BUSIFFN_REF_DEVICE_HANDLE;
402
403 typedef
404 ULONG
405 USB_BUSIFFN
406 USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE (
407 IN PVOID BusContext,
408 IN PUSB_DEVICE_HANDLE DeviceHandle,
409 IN ULONG NewIdleReadyState);
410
411 typedef USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE *PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE;
412
413 typedef
414 NTSTATUS
415 USB_BUSIFFN
416 USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT (
417 IN PVOID BusContext,
418 IN USHORT PortNumber,
419 OUT LPGUID ContainerId);
420
421 typedef USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT *PUSB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT;
422
423 typedef
424 VOID
425 USB_BUSIFFN
426 USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT (
427 IN PVOID BusContext,
428 IN USHORT PortNumber,
429 IN LPGUID ContainerId);
430
431 typedef USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT *PUSB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT;
432
433 typedef
434 NTSTATUS
435 USB_BUSIFFN
436 USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES (
437 IN PVOID BusContext,
438 IN PUSB_DEVICE_HANDLE DeviceHandle);
439
440 typedef USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES *PUSB_BUSIFFN_ABORT_ALL_DEVICE_PIPES;
441
442 #define ERRATA_FLAG_RESET_TT_ON_CANCEL 1
443 #define ERRATA_FLAG_NO_CLEAR_TT_BUFFER_ON_CANCEL 2
444
445 #define USB_BUSIF_HUB_VERSION_0 0x0000
446 #define USB_BUSIF_HUB_VERSION_1 0x0001
447 #define USB_BUSIF_HUB_VERSION_2 0x0002
448 #define USB_BUSIF_HUB_VERSION_3 0x0003
449 #define USB_BUSIF_HUB_VERSION_4 0x0004
450 #define USB_BUSIF_HUB_VERSION_5 0x0005
451 #define USB_BUSIF_HUB_VERSION_6 0x0006
452 #define USB_BUSIF_HUB_VERSION_7 0x0007
453
454 #define USB_BUSIF_HUB_MIDUMP_VERSION_0 0x0000
455
456 #define USB_BUSIF_HUB_SS_VERSION_0 0x0000
457
458 typedef
459 VOID
460 USB_BUSIFFN
461 USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG (
462 IN PVOID BusContext,
463 IN PUSB_DEVICE_HANDLE DeviceHandle,
464 IN ULONG DeviceErrataFlag);
465
466 typedef USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG *PUSB_BUSIFFN_SET_DEVICE_ERRATA_FLAG;
467
468 DEFINE_GUID(USB_BUS_INTERFACE_HUB_GUID,
469 0xb2bb8c0a, 0x5ab4, 0x11d3, 0xa8, 0xcd, 0x0, 0xc0, 0x4f, 0x68, 0x74, 0x7a);
470
471 typedef struct _USB_BUS_INTERFACE_HUB_V0 {
472 USHORT Size;
473 USHORT Version;
474 PVOID BusContext;
475 PINTERFACE_REFERENCE InterfaceReference;
476 PINTERFACE_DEREFERENCE InterfaceDereference;
477 } USB_BUS_INTERFACE_HUB_V0, *PUSB_BUS_INTERFACE_HUB_V0;
478
479 typedef struct _USB_BUS_INTERFACE_HUB_V1 {
480 USHORT Size;
481 USHORT Version;
482 PVOID BusContext;
483 PINTERFACE_REFERENCE InterfaceReference;
484 PINTERFACE_DEREFERENCE InterfaceDereference;
485 PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice;
486 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice;
487 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
488 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
489 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
490 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
491 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
492 } USB_BUS_INTERFACE_HUB_V1, *PUSB_BUS_INTERFACE_HUB_V1;
493
494 typedef struct _USB_BUS_INTERFACE_HUB_V2 {
495 USHORT Size;
496 USHORT Version;
497 PVOID BusContext;
498 PINTERFACE_REFERENCE InterfaceReference;
499 PINTERFACE_DEREFERENCE InterfaceDereference;
500 PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice;
501 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice;
502 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
503 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
504 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
505 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
506 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
507 PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation;
508 PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend;
509 PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation;
510 PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName;
511 PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext;
512 PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub;
513 } USB_BUS_INTERFACE_HUB_V2, *PUSB_BUS_INTERFACE_HUB_V2;
514
515 typedef struct _USB_BUS_INTERFACE_HUB_V3 {
516 USHORT Size;
517 USHORT Version;
518 PVOID BusContext;
519 PINTERFACE_REFERENCE InterfaceReference;
520 PINTERFACE_DEREFERENCE InterfaceDereference;
521 PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice;
522 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice;
523 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
524 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
525 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
526 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
527 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
528 PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation;
529 PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend;
530 PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation;
531 PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName;
532 PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext;
533 PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub;
534 PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification;
535 } USB_BUS_INTERFACE_HUB_V3, *PUSB_BUS_INTERFACE_HUB_V3;
536
537 typedef struct _USB_BUS_INTERFACE_HUB_V4 {
538 USHORT Size;
539 USHORT Version;
540 PVOID BusContext;
541 PINTERFACE_REFERENCE InterfaceReference;
542 PINTERFACE_DEREFERENCE InterfaceDereference;
543 PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice;
544 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice;
545 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
546 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
547 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
548 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
549 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
550 PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation;
551 PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend;
552 PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation;
553 PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName;
554 PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext;
555 PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub;
556 PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification;
557 PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers;
558 } USB_BUS_INTERFACE_HUB_V4, *PUSB_BUS_INTERFACE_HUB_V4;
559
560 typedef struct _USB_BUS_INTERFACE_HUB_V5 {
561 USHORT Size;
562 USHORT Version;
563 PVOID BusContext;
564 PINTERFACE_REFERENCE InterfaceReference;
565 PINTERFACE_DEREFERENCE InterfaceDereference;
566 PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice;
567 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice;
568 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
569 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
570 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
571 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
572 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
573 PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation;
574 PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend;
575 PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation;
576 PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName;
577 PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext;
578 PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub;
579 PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification;
580 PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers;
581 PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData;
582 } USB_BUS_INTERFACE_HUB_V5, *PUSB_BUS_INTERFACE_HUB_V5;
583
584 typedef struct _USB_BUS_INTERFACE_HUB_V6 {
585 USHORT Size;
586 USHORT Version;
587 PVOID BusContext;
588 PINTERFACE_REFERENCE InterfaceReference;
589 PINTERFACE_DEREFERENCE InterfaceDereference;
590 PUSB_BUSIFFN_CREATE_USB_DEVICE_EX CreateUsbDevice;
591 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX InitializeUsbDevice;
592 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
593 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
594 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
595 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
596 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
597 PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation;
598 PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend;
599 PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation;
600 PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName;
601 PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext;
602 PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub;
603 PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification;
604 PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers;
605 PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData;
606 PUSB_BUSIFFN_IS_ROOT HubIsRoot;
607 PUSB_BUSIFFN_ACQUIRE_SEMAPHORE AcquireBusSemaphore;
608 PUSB_BUSIFFN_RELEASE_SEMAPHORE ReleaseBusSemaphore;
609 PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH CaculatePipeBandwidth;
610 PUSB_BUSIFFN_SET_BUS_WAKE_MODE SetBusSystemWakeMode;
611 PUSB_BUSIFFN_SET_DEVICE_FLAG SetDeviceFlag;
612 PUSB_BUSIFFN_TEST_POINT HubTestPoint;
613 PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO GetDevicePerformanceInfo;
614 PUSB_BUSIFFN_WAIT_ASYNC_POWERUP WaitAsyncPowerUp;
615 PUSB_BUSIFFN_GET_DEVICE_ADDRESS GetDeviceAddress;
616 PUSB_BUSIFFN_REF_DEVICE_HANDLE RefDeviceHandle;
617 PUSB_BUSIFFN_DEREF_DEVICE_HANDLE DerefDeviceHandle;
618 PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE SetDeviceHandleIdleReadyState;
619 } USB_BUS_INTERFACE_HUB_V6, *PUSB_BUS_INTERFACE_HUB_V6;
620
621 typedef struct _USB_BUS_INTERFACE_HUB_V7 {
622 USHORT Size;
623 USHORT Version;
624 PVOID BusContext;
625 PINTERFACE_REFERENCE InterfaceReference;
626 PINTERFACE_DEREFERENCE InterfaceDereference;
627 PUSB_BUSIFFN_CREATE_USB_DEVICE_EX CreateUsbDevice;
628 PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX InitializeUsbDevice;
629 PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors;
630 PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice;
631 PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice;
632 PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags;
633 PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation;
634 PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation;
635 PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend;
636 PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation;
637 PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName;
638 PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext;
639 PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub;
640 PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification;
641 PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers;
642 PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData;
643 PUSB_BUSIFFN_IS_ROOT HubIsRoot;
644 PUSB_BUSIFFN_ACQUIRE_SEMAPHORE AcquireBusSemaphore;
645 PUSB_BUSIFFN_RELEASE_SEMAPHORE ReleaseBusSemaphore;
646 PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH CaculatePipeBandwidth;
647 PUSB_BUSIFFN_SET_BUS_WAKE_MODE SetBusSystemWakeMode;
648 PUSB_BUSIFFN_SET_DEVICE_FLAG SetDeviceFlag;
649 PUSB_BUSIFFN_TEST_POINT HubTestPoint;
650 PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO GetDevicePerformanceInfo;
651 PUSB_BUSIFFN_WAIT_ASYNC_POWERUP WaitAsyncPowerUp;
652 PUSB_BUSIFFN_GET_DEVICE_ADDRESS GetDeviceAddress;
653 PUSB_BUSIFFN_REF_DEVICE_HANDLE RefDeviceHandle;
654 PUSB_BUSIFFN_DEREF_DEVICE_HANDLE DerefDeviceHandle;
655 PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE SetDeviceHandleIdleReadyState;
656 PUSB_BUSIFFN_CREATE_USB_DEVICE_V7 CreateUsbDeviceV7;
657 PUSB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT GetContainerIdForPort;
658 PUSB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT SetContainerIdForPort;
659 PUSB_BUSIFFN_ABORT_ALL_DEVICE_PIPES AbortAllDevicePipes;
660 PUSB_BUSIFFN_SET_DEVICE_ERRATA_FLAG SetDeviceErrataFlag;
661 } USB_BUS_INTERFACE_HUB_V7, *PUSB_BUS_INTERFACE_HUB_V7;
662
663 DEFINE_GUID(USB_BUS_INTERFACE_HUB_MINIDUMP_GUID,
664 0xc5485f21, 0x4e81, 0x4a23, 0xa8, 0xf9, 0xd8, 0x51, 0x8a, 0xf4, 0x5c, 0x38);
665
666 typedef VOID
667 (USB_BUSIFFN *PUSB_BUSIFFN_SET_MINIDUMP_FLAGS) (
668 IN PVOID);
669
670 typedef struct _USB_BUS_INTERFACE_HUB_MINIDUMP {
671 USHORT Size;
672 USHORT Version;
673 PVOID BusContext;
674 PINTERFACE_REFERENCE InterfaceReference;
675 PINTERFACE_DEREFERENCE InterfaceDereference;
676 PUSB_BUSIFFN_SET_MINIDUMP_FLAGS SetUsbPortMiniDumpFlags;
677 } USB_BUS_INTERFACE_HUB_MINIDUMP, *PUSB_BUS_INTERFACE_HUB_MINIDUMP;
678
679 DEFINE_GUID(USB_BUS_INTERFACE_HUB_SS_GUID,
680 0xbfc3f363, 0x8ba1, 0x4c7b, 0x97, 0xba, 0x9b, 0x12, 0xb1, 0xca, 0x13, 0x2f);
681
682 typedef NTSTATUS
683 (USB_BUSIFFN *PUSB_BUSIFFN_SUSPEND_HUB) (
684 PDEVICE_OBJECT Pdo);
685
686 typedef NTSTATUS
687 (USB_BUSIFFN *PUSB_BUSIFFN_RESUME_HUB) (
688 PDEVICE_OBJECT Pdo);
689
690 typedef struct _USB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND {
691 USHORT Size;
692 USHORT Version;
693 PVOID BusContext;
694 PINTERFACE_REFERENCE InterfaceReference;
695 PINTERFACE_DEREFERENCE InterfaceDereference;
696 PUSB_BUSIFFN_SUSPEND_HUB SuspendHub;
697 PUSB_BUSIFFN_RESUME_HUB ResumeHub;
698 } USB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND, *PUSB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND;
699
700 #include <pshpack1.h>
701
702 typedef struct _USB_PIPE_INFORMATION_0 {
703 USB_ENDPOINT_DESCRIPTOR EndpointDescriptor;
704 UCHAR ED_Pad[1];
705 ULONG ScheduleOffset;
706 } USB_PIPE_INFORMATION_0, *PUSB_PIPE_INFORMATION_0;
707
708 typedef struct _USB_LEVEL_INFORMATION {
709 ULONG InformationLevel;
710 ULONG ActualLength;
711 } USB_LEVEL_INFORMATION, *PUSB_LEVEL_INFORMATION;
712
713 typedef struct _USB_DEVICE_INFORMATION_0 {
714 ULONG InformationLevel;
715 ULONG ActualLength;
716 ULONG PortNumber;
717 USB_DEVICE_DESCRIPTOR DeviceDescriptor;
718 UCHAR DD_pad[2];
719 UCHAR CurrentConfigurationValue;
720 UCHAR ReservedMBZ;
721 USHORT DeviceAddress;
722 ULONG HubAddress;
723 USB_DEVICE_SPEED DeviceSpeed;
724 USB_DEVICE_TYPE DeviceType;
725 ULONG NumberOfOpenPipes;
726 USB_PIPE_INFORMATION_0 PipeList[1];
727 } USB_DEVICE_INFORMATION_0, *PUSB_DEVICE_INFORMATION_0;
728
729 typedef struct _USB_CONTROLLER_INFORMATION_0 {
730 ULONG InformationLevel;
731 ULONG ActualLength;
732 BOOLEAN SelectiveSuspendEnabled;
733 BOOLEAN IsHighSpeedController;
734 } USB_CONTROLLER_INFORMATION_0, *PUSB_CONTROLLER_INFORMATION_0;
735
736 typedef struct _USB_CONTROLLER_INFORMATION_1 {
737 ULONG InformationLevel;
738 ULONG ActualLength;
739 BOOLEAN SelectiveSuspendEnabled;
740 BOOLEAN IsHighSpeedController;
741 ULONG HcBusNumber;
742 ULONG HcBusDevice;
743 ULONG HcBusFunction;
744 } USB_CONTROLLER_INFORMATION_1, *PUSB_CONTROLLER_INFORMATION_1;
745
746 typedef struct _USB_EXTPORT_INFORMATION_0 {
747 ULONG PhysicalPortNumber;
748 ULONG PortLabelNumber;
749 USHORT VidOverride;
750 USHORT PidOverride;
751 ULONG PortAttributes;
752 } USB_EXTPORT_INFORMATION_0, *PUSB_EXTPORT_INFORMATION;
753
754 typedef struct _USB_EXTHUB_INFORMATION_0 {
755 ULONG InformationLevel;
756 ULONG NumberOfPorts;
757 USB_EXTPORT_INFORMATION_0 Port[255];
758 } USB_EXTHUB_INFORMATION_0, *PUSB_EXTHUB_INFORMATION_0;
759
760 typedef struct _USB_DEVICE_PERFORMANCE_INFO_0 {
761 ULONG InformationLevel;
762 ULONG ActualLength;
763 ULONG BulkBytes;
764 ULONG BulkUrbCount;
765 ULONG ControlDataBytes;
766 ULONG ControlUrbCount;
767 ULONG IsoBytes;
768 ULONG IsoUrbCount;
769 ULONG InterruptBytes;
770 ULONG InterruptUrbCount;
771 ULONG AllocedInterrupt[6];
772 ULONG AllocedIso;
773 ULONG Total32secBandwidth;
774 ULONG TotalTtBandwidth;
775 ULONG TotalIsoLatency;
776 ULONG DroppedIsoPackets;
777 ULONG TransferErrors;
778 } USB_DEVICE_PERFORMANCE_INFO_0, *PUSB_DEVICE_PERFORMANCE_INFO_0;
779
780 #include <poppack.h>
781
782 #endif