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