source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/ddk/hubbusif.h@ 1175

Last change on this file since 1175 was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

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