ReactOS 0.4.16-dev-88-ga65b6ae
usbhub.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS USB Hub Driver
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: USBHub declarations
5 * COPYRIGHT: Copyright 2017 Vadim Galyant <vgal@rambler.ru>
6 */
7
8#ifndef _USBHUB_H_
9#define _USBHUB_H_
10
11#include <ntddk.h>
12#include <windef.h>
13#include <stdio.h>
14#include <wmistr.h>
15#include <wmilib.h>
16#include <wdmguid.h>
17#include <ntstrsafe.h>
18#include <usb.h>
19#include <usbioctl.h>
20#include <hubbusif.h>
21#include <usbbusif.h>
22#include <usbdlib.h>
23#include <ks.h>
25
26#define USB_HUB_TAG 'BUHU'
27
28#define USBH_EXTENSION_TYPE_HUB 0x01
29#define USBH_EXTENSION_TYPE_PORT 0x02
30#define USBH_EXTENSION_TYPE_PARENT 0x04
31#define USBH_EXTENSION_TYPE_FUNCTION 0x08
32
33#define USBHUB_FDO_FLAG_DEVICE_STARTED (1 << 0)
34#define USBHUB_FDO_FLAG_DEVICE_STOPPING (1 << 2)
35#define USBHUB_FDO_FLAG_DEVICE_FAILED (1 << 3)
36#define USBHUB_FDO_FLAG_REMOTE_WAKEUP (1 << 4)
37#define USBHUB_FDO_FLAG_DEVICE_STOPPED (1 << 5)
38#define USBHUB_FDO_FLAG_HUB_BUSY (1 << 6)
39#define USBHUB_FDO_FLAG_PENDING_WAKE_IRP (1 << 7)
40#define USBHUB_FDO_FLAG_RESET_PORT_LOCK (1 << 8)
41#define USBHUB_FDO_FLAG_ESD_RECOVERING (1 << 9)
42#define USBHUB_FDO_FLAG_SET_D0_STATE (1 << 10)
43#define USBHUB_FDO_FLAG_NOT_D0_STATE (1 << 11)
44#define USBHUB_FDO_FLAG_WAIT_IDLE_REQUEST (1 << 12)
45#define USBHUB_FDO_FLAG_STATE_CHANGING (1 << 13)
46#define USBHUB_FDO_FLAG_DEVICE_REMOVED (1 << 14)
47#define USBHUB_FDO_FLAG_USB20_HUB (1 << 15)
48#define USBHUB_FDO_FLAG_DEFER_CHECK_IDLE (1 << 16)
49#define USBHUB_FDO_FLAG_WAKEUP_START (1 << 17)
50#define USBHUB_FDO_FLAG_MULTIPLE_TTS (1 << 18) // High-speed Operating Hub with Multiple TTs
51#define USBHUB_FDO_FLAG_ENUM_POST_RECOVER (1 << 19)
52#define USBHUB_FDO_FLAG_DO_ENUMERATION (1 << 20)
53#define USBHUB_FDO_FLAG_CHECK_IDLE_LOCK (1 << 21)
54#define USBHUB_FDO_FLAG_HIBERNATE_STATE (1 << 22)
55#define USBHUB_FDO_FLAG_NOT_ENUMERATED (1 << 23)
56#define USBHUB_FDO_FLAG_DO_SUSPENSE (1 << 24)
57#define USBHUB_FDO_FLAG_GOING_IDLE (1 << 25)
58#define USBHUB_FDO_FLAG_DEVICE_SUSPENDED (1 << 26)
59#define USBHUB_FDO_FLAG_WITEM_INIT (1 << 27)
60
61#define USBHUB_PDO_FLAG_HUB_DEVICE (1 << 0)
62#define USBHUB_PDO_FLAG_MULTI_INTERFACE (1 << 1)
63#define USBHUB_PDO_FLAG_INIT_PORT_FAILED (1 << 2)
64#define USBHUB_PDO_FLAG_PORT_LOW_SPEED (1 << 3)
65#define USBHUB_PDO_FLAG_REMOTE_WAKEUP (1 << 4)
66#define USBHUB_PDO_FLAG_WAIT_WAKE (1 << 5)
67#define USBHUB_PDO_FLAG_NOT_CONNECTED (1 << 6)
68#define USBHUB_PDO_FLAG_DELETE_PENDING (1 << 7)
69#define USBHUB_PDO_FLAG_POWER_D3 (1 << 8)
70#define USBHUB_PDO_FLAG_DEVICE_STARTED (1 << 9)
71#define USBHUB_PDO_FLAG_HS_USB1_DUALMODE (1 << 10)
72#define USBHUB_PDO_FLAG_REG_DEV_INTERFACE (1 << 11) // SymbolicLink
73#define USBHUB_PDO_FLAG_PORT_RESTORE_FAIL (1 << 12)
74#define USBHUB_PDO_FLAG_POWER_D1_OR_D2 (1 << 13)
75#define USBHUB_PDO_FLAG_OVERCURRENT_PORT (1 << 14)
76#define USBHUB_PDO_FLAG_REMOVING_PORT_PDO (1 << 15)
77#define USBHUB_PDO_FLAG_INSUFFICIENT_PWR (1 << 16)
78#define USBHUB_PDO_FLAG_ALLOC_BNDW_FAILED (1 << 18)
79#define USBHUB_PDO_FLAG_PORT_RESSETING (1 << 19)
80#define USBHUB_PDO_FLAG_IDLE_NOTIFICATION (1 << 22)
81#define USBHUB_PDO_FLAG_PORT_HIGH_SPEED (1 << 23)
82#define USBHUB_PDO_FLAG_ENUMERATED (1 << 26)
83
84#define USBHUB_ENUM_FLAG_DEVICE_PRESENT 0x01
85#define USBHUB_ENUM_FLAG_GHOST_DEVICE 0x02
86
87/* Hub Class Feature Selectors */
88#define USBHUB_FEATURE_C_HUB_LOCAL_POWER 0
89#define USBHUB_FEATURE_C_HUB_OVER_CURRENT 1
90
91#define USBHUB_FEATURE_PORT_CONNECTION 0
92#define USBHUB_FEATURE_PORT_ENABLE 1
93#define USBHUB_FEATURE_PORT_SUSPEND 2
94#define USBHUB_FEATURE_PORT_OVER_CURRENT 3
95#define USBHUB_FEATURE_PORT_RESET 4
96#define USBHUB_FEATURE_PORT_POWER 8
97#define USBHUB_FEATURE_PORT_LOW_SPEED 9
98#define USBHUB_FEATURE_C_PORT_CONNECTION 16
99#define USBHUB_FEATURE_C_PORT_ENABLE 17
100#define USBHUB_FEATURE_C_PORT_SUSPEND 18
101#define USBHUB_FEATURE_C_PORT_OVER_CURRENT 19
102#define USBHUB_FEATURE_C_PORT_RESET 20
103#define USBHUB_FEATURE_PORT_TEST 21
104#define USBHUB_FEATURE_PORT_INDICATOR 22
105
106#define USBHUB_MAX_CASCADE_LEVELS 6
107#define USBHUB_RESET_PORT_MAX_RETRY 3
108#define USBHUB_MAX_REQUEST_ERRORS 3
109
110
111#define USBHUB_FAIL_NO_FAIL 5
112#define USBHUB_FAIL_NESTED_TOO_DEEPLY 6
113#define USBHUB_FAIL_OVERCURRENT 7
114
116
117typedef struct _USBHUB_PORT_DATA {
123
125
126typedef VOID
128 IN PUSBHUB_FDO_EXTENSION HubExtension,
130
131typedef struct _USBHUB_IO_WORK_ITEM {
141
142typedef struct _COMMON_DEVICE_EXTENSION {
146
147typedef struct _USBHUB_FDO_EXTENSION {
172 PVOID SCEBitmap; // 11.12.4 Hub and Port Status Change Bitmap (USB 2.0 Specification)
198 USB_IDLE_CALLBACK_INFO IdleCallbackInfo;
202
215 LPWSTR SerialNumber; // serial number string
236
245
251
256
262
267
273
274/* debug.c */
275VOID
276NTAPI
279
280VOID
281NTAPI
284
285VOID
286NTAPI
288 IN PVOID Id);
289
290/* ioctl.c */
292NTAPI
294 IN PUSBHUB_FDO_EXTENSION HubExtension,
295 IN PIRP Irp);
296
298NTAPI
300 IN PUSBHUB_PORT_PDO_EXTENSION PortExtension,
301 IN PIRP Irp);
302
303/* pnp.c */
305NTAPI
307 IN PUSBHUB_PORT_PDO_EXTENSION PortExtension,
308 IN PUSBHUB_FDO_EXTENSION HubExtension);
309
311NTAPI
313 IN PUSBHUB_FDO_EXTENSION HubExtension,
314 IN PIRP Irp,
315 IN UCHAR Minor);
316
318NTAPI
320 IN PUSBHUB_PORT_PDO_EXTENSION PortExtension,
321 IN PIRP Irp,
322 IN UCHAR Minor,
323 OUT BOOLEAN * IsCompleteIrp);
324
325/* power.c */
326VOID
327NTAPI
329 IN PUSBHUB_FDO_EXTENSION HubExtension,
330 IN PIRP Irp,
331 IN NTSTATUS NtStatus);
332
334NTAPI
336 IN PUSBHUB_FDO_EXTENSION HubExtension);
337
339NTAPI
341 IN PUSBHUB_FDO_EXTENSION HubExtension,
342 IN PIRP Irp,
343 IN UCHAR Minor);
344
346NTAPI
348 IN PUSBHUB_PORT_PDO_EXTENSION PortExtension,
349 IN PIRP Irp,
350 IN UCHAR Minor);
351
352VOID
353NTAPI
355 IN PUSBHUB_FDO_EXTENSION HubExtension,
356 IN NTSTATUS NtStatus);
357
358VOID
359NTAPI
361 IN PUSBHUB_FDO_EXTENSION HubExtension,
362 IN PIRP Irp);
363
364VOID
365NTAPI
367 IN PUSBHUB_FDO_EXTENSION HubExtension,
369
370/* usbhub.c */
372NTAPI
374 IN ULONG Milliseconds);
375
376VOID
377NTAPI
379 IN PIRP Irp,
380 IN NTSTATUS CompleteStatus);
381
383NTAPI
386 IN PIRP Irp);
387
389NTAPI
390PdoExt(
392
394NTAPI
397 IN ULONG Data);
398
400NTAPI
404 IN PVOID Data,
406 IN ULONG Type,
408
410NTAPI
413 IN PURB Urb);
414
416NTAPI
418 IN PDEVICE_OBJECT FdoDevice,
419 IN PURB Urb);
420
422NTAPI
424 IN PUSBHUB_FDO_EXTENSION HubExtension,
425 IN USHORT Port);
426
428NTAPI
430 IN PUSBHUB_FDO_EXTENSION HubExtension,
432 OUT USB_DEVICE_TYPE * OutDeviceType);
433
435NTAPI
437 IN PUSBHUB_FDO_EXTENSION HubExtension);
438
440NTAPI
443 IN OUT PDEVICE_OBJECT * OutPdo1,
444 IN OUT PDEVICE_OBJECT * OutPdo2);
445
447NTAPI
450 IN OUT PULONG OutHubCount);
451
453NTAPI
456
458NTAPI
461 IN PUSB_DEVICE_DESCRIPTOR HubDeviceDescriptor);
462
464NTAPI
467 IN PUSB_CONFIGURATION_DESCRIPTOR * pConfigurationDescriptor);
468
470NTAPI
472 IN PUSBHUB_FDO_EXTENSION HubExtension);
473
475NTAPI
478 IN UCHAR Index,
479 IN USHORT LanguageId,
482 IN PULONG OutLength,
483 IN BOOLEAN IsValidateLength);
484
486NTAPI
488 IN PUSBHUB_FDO_EXTENSION HubExtension,
489 IN USHORT Port,
491 IN ULONG Length);
492
494NTAPI
496 IN PUSBHUB_FDO_EXTENSION HubExtension,
497 IN USHORT Port,
498 IN USHORT RequestValue);
499
501NTAPI
503 IN PUSBHUB_FDO_EXTENSION HubExtension);
504
506NTAPI
508 IN PUSBHUB_FDO_EXTENSION HubExtension,
509 IN USHORT Port);
510
512NTAPI
515 IN PUSB_CONFIGURATION_DESCRIPTOR HubConfigDescriptor);
516
518NTAPI
520 IN PUSBHUB_FDO_EXTENSION HubExtension);
521
523NTAPI
525 IN PUSBHUB_FDO_EXTENSION HubExtension,
526 IN PUSB_DEVICE_HANDLE * OutDeviceHandle,
527 IN USB_PORT_STATUS UsbPortStatus,
528 IN USHORT Port);
529
531NTAPI
533 IN PUSBHUB_FDO_EXTENSION HubExtension,
535 IN ULONG Flags);
536
538NTAPI
540 IN PUSBHUB_FDO_EXTENSION HubExtension,
546
547VOID
548NTAPI
550 IN PUSBHUB_FDO_EXTENSION HubExtension,
553
554VOID
555NTAPI
557 IN PUSBHUB_FDO_EXTENSION HubExtension);
558
560NTAPI
562 IN PUSBHUB_PORT_PDO_EXTENSION PortExtension,
563 IN PUSBHUB_FDO_EXTENSION HubExtension,
564 IN PUSB_NODE_CONNECTION_INFORMATION_EX Info,
567
569NTAPI
571 IN PUSBHUB_FDO_EXTENSION HubExtension,
574
576NTAPI
578 IN PUSBHUB_FDO_EXTENSION HubExtension,
579 OUT PUSBHUB_IO_WORK_ITEM * OutHubIoWorkItem,
582 OUT PVOID * OutHubWorkItemBuffer,
584
585VOID
586NTAPI
588 IN PUSBHUB_FDO_EXTENSION HubExtension,
589 IN PUSBHUB_IO_WORK_ITEM HubIoWorkItem);
590
591VOID
592NTAPI
594 IN PUSBHUB_IO_WORK_ITEM HubIoWorkItem);
595
597NTAPI
599 IN PUSBHUB_FDO_EXTENSION HubExtension);
600
602NTAPI
604 IN PUSBHUB_FDO_EXTENSION HubExtension);
605
606VOID
607NTAPI
609 IN PUSBHUB_FDO_EXTENSION HubExtension,
610 IN PIRP IdleIrp);
611
613NTAPI
615 IN PUSBHUB_FDO_EXTENSION HubExtension,
616 IN BOOLEAN IsWait,
617 IN BOOLEAN IsExtCheck);
618
619VOID
620NTAPI
622 IN PUSBHUB_FDO_EXTENSION HubExtension);
623
624VOID
625NTAPI
627 IN PUSBHUB_FDO_EXTENSION HubExtension);
628
630NTAPI
633 IN USHORT LanguageId);
634
636NTAPI
638 IN PUSBHUB_FDO_EXTENSION HubExtension,
639 IN USHORT Port,
640 IN USB_PORT_STATUS UsbPortStatus,
641 IN ULONG IsWait);
642
644NTAPI
646 IN PUSBHUB_FDO_EXTENSION HubExtension,
647 IN USHORT Port,
648 IN BOOLEAN IsKeepDeviceData,
649 IN BOOLEAN IsWait);
650
652NTAPI
656
657#endif /* _USBHUB_H_ */
DWORD Id
unsigned char BOOLEAN
Type
Definition: Type.h:7
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
unsigned int BOOL
Definition: ntddk_ex.h:94
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
Definition: fltkernel.h:1977
CPPORT Port[4]
Definition: headless.c:35
_Outptr_ PUSB_DEVICE_HANDLE * NewDeviceHandle
Definition: hubbusif.h:40
_Inout_ PUSB_DEVICE_HANDLE OldDeviceHandle
Definition: hubbusif.h:161
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
Definition: hubbusif.h:121
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
Definition: hubbusif.h:42
_In_ PVOID _In_ PDEVICE_OBJECT UsbDevicePdo
Definition: hubbusif.h:322
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR _Inout_ PULONG _Out_writes_bytes_to_ ConfigDescriptorBufferLength PUCHAR _Inout_ PULONG ConfigDescriptorBufferLength
Definition: hubbusif.h:153
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR DeviceDescriptorBuffer
Definition: hubbusif.h:148
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR _Inout_ PULONG _Out_writes_bytes_to_ ConfigDescriptorBufferLength PUCHAR ConfigDescriptorBuffer
Definition: hubbusif.h:151
_Inout_ PUSB_DEVICE_HANDLE _Out_writes_bytes_to_ DeviceDescriptorBufferLength PUCHAR _Inout_ PULONG DeviceDescriptorBufferLength
Definition: hubbusif.h:150
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4755
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1922
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define POWER_SYSTEM_MAXIMUM
Definition: ntpoapi.h:45
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
const KSDEVICE_DESCRIPTOR DeviceDescriptor
Definition: splitter.c:257
PDEVICE_OBJECT SelfDevice
Definition: usbhub.h:144
Definition: ketypes.h:699
Definition: typedefs.h:120
Definition: usb.h:529
PUSBHUB_PORT_DATA PortData
Definition: usbhub.h:167
LONG PendingRequestCount
Definition: usbhub.h:180
PDEVICE_OBJECT LowerPDO
Definition: usbhub.h:149
USB_DEVICE_DESCRIPTOR HubDeviceDescriptor
Definition: usbhub.h:163
POWER_STATE CurrentPowerState
Definition: usbhub.h:160
KSEMAPHORE HubSemaphore
Definition: usbhub.h:196
USB_BUS_INTERFACE_USBDI_V2 BusInterfaceUSBDI
Definition: usbhub.h:156
KEVENT PendingRequestEvent
Definition: usbhub.h:181
USB_PORT_STATUS_AND_CHANGE PortStatus
Definition: usbhub.h:199
KSEMAPHORE IdleSemaphore
Definition: usbhub.h:177
KSEMAPHORE ResetDeviceSemaphore
Definition: usbhub.h:182
KSEMAPHORE HubPortSemaphore
Definition: usbhub.h:184
PUSB_CONFIGURATION_DESCRIPTOR HubConfigDescriptor
Definition: usbhub.h:165
COMMON_DEVICE_EXTENSION Common
Definition: usbhub.h:148
KSPIN_LOCK CheckIdleSpinLock
Definition: usbhub.h:192
KEVENT LowerDeviceEvent
Definition: usbhub.h:153
SYSTEM_POWER_STATE SystemWake
Definition: usbhub.h:158
DEVICE_POWER_STATE DeviceWake
Definition: usbhub.h:159
KSPIN_LOCK WorkItemSpinLock
Definition: usbhub.h:191
PDEVICE_OBJECT LowerDevice
Definition: usbhub.h:150
PDEVICE_OBJECT RootHubPdo2
Definition: usbhub.h:152
PRKEVENT pResetPortEvent
Definition: usbhub.h:183
PUSBHUB_IO_WORK_ITEM WorkItemToQueue
Definition: usbhub.h:197
USB_BUS_INTERFACE_HUB_V5 BusInterface
Definition: usbhub.h:155
KEVENT RootHubNotificationEvent
Definition: usbhub.h:174
USB_IDLE_CALLBACK_INFO IdleCallbackInfo
Definition: usbhub.h:198
PUSB_HUB_DESCRIPTOR HubDescriptor
Definition: usbhub.h:166
USBD_CONFIGURATION_HANDLE ConfigHandle
Definition: usbhub.h:168
LIST_ENTRY WorkItemList
Definition: usbhub.h:190
PDEVICE_OBJECT RootHubPdo
Definition: usbhub.h:151
LIST_ENTRY PdoList
Definition: usbhub.h:179
struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST SCEWorkerUrb
Definition: usbhub.h:175
KEVENT StatusChangeEvent
Definition: usbhub.h:176
KSPIN_LOCK RelationsWorkerSpinLock
Definition: usbhub.h:178
USBD_PIPE_INFORMATION PipeInfo
Definition: usbhub.h:169
POWER_STATE SystemPowerState
Definition: usbhub.h:161
PUSBHUB_WORKER_ROUTINE HubWorkerRoutine
Definition: usbhub.h:138
PUSBHUB_FDO_EXTENSION HubExtension
Definition: usbhub.h:137
WORK_QUEUE_TYPE HubWorkItemType
Definition: usbhub.h:136
PVOID HubWorkItemBuffer
Definition: usbhub.h:139
LIST_ENTRY HubWorkItemLink
Definition: usbhub.h:133
PIO_WORKITEM HubWorkItem
Definition: usbhub.h:135
USB_CONNECTION_STATUS ConnectionStatus
Definition: usbhub.h:120
USB_PORT_STATUS_AND_CHANGE PortStatus
Definition: usbhub.h:118
ULONG PortAttributes
Definition: usbhub.h:121
PDEVICE_OBJECT DeviceObject
Definition: usbhub.h:119
LIST_ENTRY PortPowerList
Definition: usbhub.h:233
DEVICE_CAPABILITIES Capabilities
Definition: usbhub.h:223
KSPIN_LOCK PortPowerListSpinLock
Definition: usbhub.h:234
USB_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: usbhub.h:216
PUSB_DEVICE_HANDLE DeviceHandle
Definition: usbhub.h:211
PUSBHUB_FDO_EXTENSION HubExtension
Definition: usbhub.h:209
USB_INTERFACE_DESCRIPTOR InterfaceDescriptor
Definition: usbhub.h:219
COMMON_DEVICE_EXTENSION Common
Definition: usbhub.h:204
UNICODE_STRING SymbolicLinkName
Definition: usbhub.h:207
PUSBHUB_FDO_EXTENSION RootHubExtension
Definition: usbhub.h:210
USB_DEVICE_DESCRIPTOR OldDeviceDescriptor
Definition: usbhub.h:217
USB_CONFIGURATION_DESCRIPTOR ConfigDescriptor
Definition: usbhub.h:218
KSPIN_LOCK PortTimeoutSpinLock
Definition: usbhub.h:226
POWER_STATE CurrentPowerState
Definition: usbhub.h:222
PUSBHUB_PORT_PDO_EXTENSION PortExtension
Definition: usbhub.h:270
PUSBHUB_FDO_EXTENSION HubExtension
Definition: usbhub.h:249
KSPIN_LOCK UrbTimeoutSpinLock
Definition: usbhub.h:242
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
enum _USB_DEVICE_TYPE USB_DEVICE_TYPE
PUSBHUB_FDO_EXTENSION NTAPI USBH_GetRootHubExtension(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:699
VOID NTAPI USBH_HubCancelWakeIrp(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp)
Definition: power.c:43
struct _USBHUB_URB_TIMEOUT_CONTEXT * PUSBHUB_URB_TIMEOUT_CONTEXT
NTSTATUS NTAPI USBH_SubmitStatusChangeTransfer(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:2442
NTSTATUS NTAPI USBH_HubSetD0(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: power.c:77
VOID NTAPI USBH_HubCompletePortWakeIrps(IN PUSBHUB_FDO_EXTENSION HubExtension, IN NTSTATUS NtStatus)
Definition: power.c:217
VOID NTAPI USBH_CheckHubIdle(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:3808
PWSTR GenericUSBDeviceString
Definition: usbhub.c:19
struct _USBHUB_IDLE_PORT_CANCEL_CONTEXT USBHUB_IDLE_PORT_CANCEL_CONTEXT
NTSTATUS NTAPI USBH_AllocateWorkItem(IN PUSBHUB_FDO_EXTENSION HubExtension, OUT PUSBHUB_IO_WORK_ITEM *OutHubIoWorkItem, IN PUSBHUB_WORKER_ROUTINE WorkerRoutine, IN SIZE_T BufferLength, OUT PVOID *OutHubWorkItemBuffer, IN WORK_QUEUE_TYPE Type)
VOID NTAPI USBHUB_SetDeviceHandleData(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PDEVICE_OBJECT UsbDevicePdo, IN PVOID DeviceHandle)
Definition: usbhub.c:2601
VOID NTAPI USBHUB_DumpingIDs(IN PVOID Id)
Definition: debug.c:112
NTSTATUS NTAPI USBH_SyncGetHubDescriptor(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:1048
NTSTATUS NTAPI USBD_RemoveDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE DeviceHandle, IN ULONG Flags)
Definition: usbhub.c:2538
VOID NTAPI USBH_CompleteIrp(IN PIRP Irp, IN NTSTATUS CompleteStatus)
Definition: usbhub.c:63
struct _USBHUB_IDLE_PORT_CONTEXT USBHUB_IDLE_PORT_CONTEXT
NTSTATUS NTAPI USBH_PdoPnP(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp, IN UCHAR Minor, OUT BOOLEAN *IsCompleteIrp)
Definition: pnp.c:2594
NTSTATUS NTAPI USBH_DeviceControl(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp)
Definition: ioctl.c:1136
struct _USBHUB_RESET_PORT_CONTEXT * PUSBHUB_RESET_PORT_CONTEXT
struct _USBHUB_PORT_PDO_EXTENSION USBHUB_PORT_PDO_EXTENSION
NTSTATUS NTAPI USBD_UnRegisterRootHubCallBack(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:3008
NTSTATUS NTAPI USBH_FdoPower(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN UCHAR Minor)
Definition: power.c:460
struct _USBHUB_FDO_EXTENSION * PUSBHUB_FDO_EXTENSION
Definition: usbhub.h:124
NTSTATUS NTAPI USBH_PdoRemoveDevice(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: pnp.c:2180
NTSTATUS NTAPI USBH_CheckDeviceLanguage(IN PDEVICE_OBJECT DeviceObject, IN USHORT LanguageId)
Definition: usbhub.c:4242
NTSTATUS NTAPI USBH_GetDeviceDescriptor(IN PDEVICE_OBJECT DeviceObject, IN PUSB_DEVICE_DESCRIPTOR HubDeviceDescriptor)
Definition: usbhub.c:877
struct _USBHUB_FDO_EXTENSION USBHUB_FDO_EXTENSION
NTSTATUS NTAPI USBH_SyncGetRootHubPdo(IN PDEVICE_OBJECT DeviceObject, IN OUT PDEVICE_OBJECT *OutPdo1, IN OUT PDEVICE_OBJECT *OutPdo2)
Definition: usbhub.c:728
NTSTATUS NTAPI USBH_GetConfigurationDescriptor(IN PDEVICE_OBJECT DeviceObject, IN PUSB_CONFIGURATION_DESCRIPTOR *pConfigurationDescriptor)
Definition: usbhub.c:974
struct _USBHUB_PORT_DATA * PUSBHUB_PORT_DATA
NTSTATUS NTAPI USBH_Wait(IN ULONG Milliseconds)
Definition: usbhub.c:23
struct _USBHUB_IDLE_HUB_CONTEXT * PUSBHUB_IDLE_HUB_CONTEXT
struct _USBHUB_IO_WORK_ITEM USBHUB_IO_WORK_ITEM
VOID NTAPI USBH_CheckIdleDeferred(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:3957
struct _USBHUB_PORT_DATA USBHUB_PORT_DATA
VOID NTAPI USBH_FreeWorkItem(IN PUSBHUB_IO_WORK_ITEM HubIoWorkItem)
Definition: usbhub.c:2937
struct _USBHUB_STATUS_CHANGE_CONTEXT USBHUB_STATUS_CHANGE_CONTEXT
struct _USBHUB_PORT_PDO_EXTENSION * PUSBHUB_PORT_PDO_EXTENSION
NTSTATUS NTAPI USBH_SyncSubmitUrb(IN PDEVICE_OBJECT DeviceObject, IN PURB Urb)
Definition: usbhub.c:250
VOID NTAPI USBHUB_DumpingConfiguration(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor)
Definition: debug.c:41
NTSTATUS NTAPI USBH_SyncGetStringDescriptor(IN PDEVICE_OBJECT DeviceObject, IN UCHAR Index, IN USHORT LanguageId, IN PUSB_STRING_DESCRIPTOR Descriptor, IN ULONG NumberOfBytes, IN PULONG OutLength, IN BOOLEAN IsValidateLength)
Definition: usbhub.c:1248
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
VOID NTAPI USBH_QueueWorkItem(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSBHUB_IO_WORK_ITEM HubIoWorkItem)
Definition: usbhub.c:2917
NTSTATUS NTAPI USBD_InitializeDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE DeviceHandle, IN PUCHAR DeviceDescriptorBuffer, IN ULONG DeviceDescriptorBufferLength, IN PUCHAR ConfigDescriptorBuffer, IN ULONG ConfigDescriptorBufferLength)
Definition: usbhub.c:2562
NTSTATUS NTAPI USBH_SetPdoRegistryParameter(IN PDEVICE_OBJECT DeviceObject, IN PCWSTR SourceString, IN PVOID Data, IN ULONG DataSize, IN ULONG Type, IN ULONG DevInstKeyType)
Definition: usbhub.c:213
struct _USBHUB_RESET_PORT_CONTEXT USBHUB_RESET_PORT_CONTEXT
VOID NTAPI USBH_HubCancelIdleIrp(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP IdleIrp)
Definition: usbhub.c:3206
NTSTATUS NTAPI USBH_SyncGetPortStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus, IN ULONG Length)
Definition: usbhub.c:1414
PUSB_DEVICE_HANDLE NTAPI USBH_SyncGetDeviceHandle(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:832
VOID NTAPI USBHUB_FlushAllTransfers(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:2623
struct _USBHUB_IO_WORK_ITEM * PUSBHUB_IO_WORK_ITEM
NTSTATUS NTAPI USBD_RegisterRootHubCallBack(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:2986
NTSTATUS NTAPI USBH_CreateDevice(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN USB_PORT_STATUS UsbPortStatus, IN ULONG IsWait)
Definition: usbhub.c:4379
NTSTATUS NTAPI USBH_SyncDisablePort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port)
Definition: usbhub.c:1553
NTSTATUS NTAPI USBH_WriteFailReasonID(IN PDEVICE_OBJECT DeviceObject, IN ULONG Data)
Definition: usbhub.c:153
NTSTATUS NTAPI USBD_CreateDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE *OutDeviceHandle, IN USB_PORT_STATUS UsbPortStatus, IN USHORT Port)
Definition: usbhub.c:2508
NTSTATUS NTAPI USBH_ResetDevice(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN BOOLEAN IsKeepDeviceData, IN BOOLEAN IsWait)
Definition: usbhub.c:4615
NTSTATUS NTAPI USBD_RestoreDeviceEx(IN PUSBHUB_FDO_EXTENSION HubExtension, IN OUT PUSB_DEVICE_HANDLE OldDeviceHandle, IN OUT PUSB_DEVICE_HANDLE NewDeviceHandle)
Definition: usbhub.c:2761
VOID NTAPI USBH_IdleCancelPowerHubWorker(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
Definition: power.c:135
NTSTATUS NTAPI USBH_GetDeviceType(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_DEVICE_HANDLE DeviceHandle, OUT USB_DEVICE_TYPE *OutDeviceType)
Definition: usbhub.c:608
NTSTATUS NTAPI USBH_SyncResetPort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port)
Definition: usbhub.c:471
NTSTATUS NTAPI USBH_SyncGetHubCount(IN PDEVICE_OBJECT DeviceObject, IN OUT PULONG OutHubCount)
Definition: usbhub.c:781
struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
VOID NTAPI USBH_CompletePowerIrp(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN NTSTATUS NtStatus)
Definition: power.c:18
struct _USBHUB_IDLE_PORT_CONTEXT * PUSBHUB_IDLE_PORT_CONTEXT
struct _USBHUB_IDLE_HUB_CONTEXT USBHUB_IDLE_HUB_CONTEXT
NTSTATUS NTAPI USBH_PdoPower(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp, IN UCHAR Minor)
Definition: power.c:757
NTSTATUS NTAPI USBH_PdoInternalControl(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PIRP Irp)
Definition: ioctl.c:1280
VOID NTAPI USBHUB_DumpingDeviceDescriptor(IN PUSB_DEVICE_DESCRIPTOR DeviceDescriptor)
Definition: debug.c:15
struct _USBHUB_URB_TIMEOUT_CONTEXT USBHUB_URB_TIMEOUT_CONTEXT
NTSTATUS NTAPI USBH_FdoSyncSubmitUrb(IN PDEVICE_OBJECT FdoDevice, IN PURB Urb)
Definition: usbhub.c:355
VOID(NTAPI * PUSBHUB_WORKER_ROUTINE)(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PVOID Context)
Definition: usbhub.h:127
NTSTATUS NTAPI USBD_GetDeviceInformationEx(IN PUSBHUB_PORT_PDO_EXTENSION PortExtension, IN PUSBHUB_FDO_EXTENSION HubExtension, IN PUSB_NODE_CONNECTION_INFORMATION_EX Info, IN ULONG Length, IN PUSB_DEVICE_HANDLE DeviceHandle)
Definition: usbhub.c:2639
NTSTATUS NTAPI USBH_SyncPowerOnPorts(IN PUSBHUB_FDO_EXTENSION HubExtension)
Definition: usbhub.c:1522
NTSTATUS NTAPI USBH_FdoPnP(IN PUSBHUB_FDO_EXTENSION HubExtension, IN PIRP Irp, IN UCHAR Minor)
Definition: pnp.c:2362
BOOLEAN NTAPI USBH_CheckIdleAbort(IN PUSBHUB_FDO_EXTENSION HubExtension, IN BOOLEAN IsWait, IN BOOLEAN IsExtCheck)
Definition: usbhub.c:3221
NTSTATUS NTAPI USBH_PassIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: usbhub.c:79
struct _USBHUB_IDLE_PORT_CANCEL_CONTEXT * PUSBHUB_IDLE_PORT_CANCEL_CONTEXT
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
BOOLEAN NTAPI USBH_HubIsBusPowered(IN PDEVICE_OBJECT DeviceObject, IN PUSB_CONFIGURATION_DESCRIPTOR HubConfigDescriptor)
Definition: usbhub.c:1589
struct _USBHUB_STATUS_CHANGE_CONTEXT * PUSBHUB_STATUS_CHANGE_CONTEXT
NTSTATUS NTAPI USBH_SyncClearPortStatus(IN PUSBHUB_FDO_EXTENSION HubExtension, IN USHORT Port, IN USHORT RequestValue)
Definition: usbhub.c:1442
enum _USB_CONNECTION_STATUS USB_CONNECTION_STATUS
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFDEVICE _Out_ PWDF_DEVICE_STATE DeviceState
Definition: wdfdevice.h:1999
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING InstanceID
Definition: wdfpdo.h:309
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID ConfigDescriptor
Definition: wdfusb.h:1036
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Out_opt_ PULONG Minor
Definition: cmfuncs.h:44
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
_In_ ULONG DevInstKeyType
Definition: iofuncs.h:1125
DEVICE_CAPABILITIES
Definition: iotypes.h:965
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184