ReactOS 0.4.17-dev-1281-g065abb3
portxfer.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS SuperSpeed USB Hub Driver
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Port control transfers and the port change decisions
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8#include "usbhub3.h"
9
10#define NDEBUG
11#include <debug.h>
12
13/* Over current recovery gives up after this many inside the window */
14#define PORT_OVER_CURRENT_LIMIT 5
15#define PORT_OVER_CURRENT_WINDOW (3LL * 1000 * 1000 * 10)
16
17static EVT_WDF_REQUEST_COMPLETION_ROUTINE PortControlComplete;
18
19/*
20 * USBXHCI answers a root port GET_STATUS with "operation pending" while it
21 * finishes a resume itself; the hub must not idle in that window.
22 */
23static
24VOID
28 _In_ USBD_STATUS UrbStatus)
29{
30 HubFdo* Hub = Port->m_Hub;
31
33 {
36 {
37 DPRINT("Hub %p port %u resume pending, hub kept awake\n", Hub, Port->Number());
39 }
40 }
42 {
45 }
46}
47
48/* The hub never reports a change for these, so the cache is updated by hand */
49static
50VOID
54{
55 const UCHAR* Setup = Port->m_Control.Urb.SetupPacket;
56 USHORT Feature = Setup[2] | (Setup[3] << 8);
57 USHORT LinkState = Setup[5];
58 USHORT* Current = &Port->m_Current.StatusChange.PortStatus.AsUshort16;
59
61 {
62 Port->m_PreviousStatus |= PS_SUSPENDED;
64 }
65 else if (Feature == PORT_F_LINK_STATE && (LinkState == LINK_U3 || LinkState == LINK_SS_DISABLED))
66 {
67 Port->m_PreviousStatus = (Port->m_PreviousStatus & ~PS_LINK_MASK) | (LinkState << PS_LINK_SHIFT);
68 *Current = (*Current & ~PS_LINK_MASK) | (LinkState << PS_LINK_SHIFT);
69 }
70}
71
72static
73VOID
76 _In_ WDFREQUEST Request,
77 _In_ WDFIOTARGET Target,
80{
82 NTSTATUS Status = Params->IoStatus.Status;
83 UCHAR RequestCode = Port->m_Control.Urb.SetupPacket[1];
84
87
88 if (!NT_SUCCESS(Status))
89 {
90 DPRINT1("Hub %p port %u control request 0x%x failed 0x%lx, URB status 0x%lx\n",
91 Port->m_Hub, Port->Number(), RequestCode, Status, Port->m_Control.Urb.Hdr.Status);
92 Port->m_Hub->m_FailureMessageId = HUB_MSG_CONTROL_TRANSFER_FAILED;
93 }
94 else if (RequestCode == HUB_REQUEST_GET_STATUS)
95 {
96 DPRINT("Hub %p port %u status 0x%x change 0x%x\n",
97 Port->m_Hub, Port->Number(),
98 Port->m_Current.StatusChange.PortStatus.AsUshort16, Port->m_Current.StatusChange.PortChange.AsUshort16);
99 PortTrackPendingOperation(Port, Port->m_Control.Urb.Hdr.Status);
100 }
101 else if (RequestCode == HUB_REQUEST_SET_FEATURE)
102 {
104 }
105
106 Port->m_Control.Reuse();
108}
109
110static
111VOID
112NTAPI
121{
122 HubFdo* Hub = Port->m_Hub;
124
125 Port->m_Control.SetSetup(RequestType, Request, Value, Index, Length);
126 DPRINT("Hub %p port %u request 0x%x value %u index 0x%x\n", Hub, Port->Number(), Request, Value, Index);
127
128 Status = Port->m_Control.Send(Hub->m_RootHubTarget,
129 Hub->UsbDevice(),
131 Port,
132 Buffer,
133 Length,
134 FALSE,
136 if (!NT_SUCCESS(Status))
138}
139
140/* wIndex with the port number in the low byte and a selector in the high byte */
141static
142USHORT
143NTAPI
147{
148 return (USHORT)((Port->Number() & 0xFF) | (High << 8));
149}
150
151VOID
153{
154 BOOLEAN Extended = m_Port->HasProperty(PortProperty::EnhancedSuperSpeed);
155
157 0xA3,
159 Extended ? 2 : 0,
160 m_Port->Number(),
162 Extended ? sizeof(m_Port->m_Current) : sizeof(m_Port->m_Current.StatusChange));
163}
164
165/* The selection is cleared before sending so a fast completion cannot race it */
166VOID
168{
170
173}
174
175/* A reset starts the SS.Inactive error suppression over */
176VOID
178{
179 m_Port->m_LastChange = PortEvent::ChangeNone;
181}
182
183VOID
185{
186 m_Port->m_LastChange = PortEvent::ChangeNone;
188}
189
190VOID
192{
194}
195
196VOID
198{
199 if (m_Port->IsUsb30())
201 else
203}
204
205VOID
207{
208 if (m_Port->IsUsb30())
210 else
212}
213
214VOID
216{
218}
219
220VOID
222{
224}
225
226/* Powering the port again ends an over current episode for user mode */
227VOID
229{
232
234}
235
236/* Only sent while a device is attached */
237VOID
239{
241 0x23,
245 NULL,
246 0);
247}
248
249VOID
251{
253 0x23,
257 NULL,
258 0);
259}
260
261/* Wake on connect, disconnect and over current, or none */
262VOID
265{
267 0x23,
270 PortIndex(m_Port, Enable ? 0x07 : 0x00),
271 NULL,
272 0);
273}
274
275/* Change selection */
276
277/* Order of the changes, 2.0 and 3.0 column by column */
279{
284};
285
287{
294};
295
296/*
297 * Bits already acked since the last accumulator reset are ignored, so a
298 * hub that keeps reporting one change cannot loop the port.
299 */
302{
304 USHORT Bit;
305 ULONG Index;
306
307 *Change &= ~m_Port->m_ChangeAccumulator;
308
309 for (Index = 0; Index < RTL_NUMBER_OF(PortChanges); Index++)
310 {
312 if (Bit == 0 || !(*Change & Bit))
313 continue;
314
315 *Change &= ~Bit;
318
319 if (Bit == PC_OVER_CURRENT)
321
322 return PsmPendingChange;
323 }
324
325 if (*Change != 0)
326 DPRINT1("Hub %p port %u reports unknown change 0x%x\n", m_Port->m_Hub, m_Port->Number(), *Change);
327
328 return (*Change != 0) ? PsmPendingError : PsmPendingNone;
329}
330
331/* Change decisions */
332
333/* Some hubs lose a change if they idle before reporting it */
334static
335VOID
336NTAPI
339{
340 if (!Port->m_InitialConnectPowerReference)
341 return;
342
343 WdfDeviceResumeIdle(Port->m_Hub->m_Device);
344 Port->m_InitialConnectPowerReference = FALSE;
345}
346
347/* The 2.0 flavor never answers "no change"; it answers an error where the 3.0 flavor would */
348static
350NTAPI
356{
358
360 {
361 Port->m_ConnectionStatus = DeviceCausedOvercurrent;
363 }
364
366 {
369
370 Port->m_ConnectionStatus = DeviceCausedOvercurrent;
372 }
373
374 if (!(Status & PS_POWER_20))
376
377 if ((Change & PC_CONNECT) || ((Status ^ Previous) & PS_CONNECTED))
379
380 if ((Status & PS_RESET) || !(Status & PS_CONNECTED))
382
383 if (Change & PC_RESET)
385
386 if (Change & PC_SUSPEND)
388
390}
391
392static
394NTAPI
400{
401 HubFdo* Hub = Port->m_Hub;
403 USHORT PreviousLink = HubLinkState(Previous);
404 BOOLEAN Connected = (Status & PS_CONNECTED) != 0;
405 BOOLEAN ConnectChanged = (Change & PC_CONNECT) || ((Status ^ Previous) & PS_CONNECTED);
406
408 {
409 Port->m_ConnectionStatus = DeviceCausedOvercurrent;
411 }
412
414 {
417
418 Port->m_ConnectionStatus = DeviceCausedOvercurrent;
420 }
421
422 if (!(Status & PS_POWER_30))
424
425 /* Caught in the middle of a reset */
426 if (Status & PS_RESET)
427 {
430 if (Connected)
432 return ConnectChanged ? PortEvent::ChangeConnect : PortEvent::ChangeNone;
433 }
434
435 /* A disconnect can pass through Rx.Detect, or park in Polling on re-driver systems */
436 if (!Connected && (Previous & PS_POWER_30))
437 {
438 if (Link == LINK_RX_DETECT && PreviousLink != LINK_RX_DETECT)
440 if (Link == LINK_POLLING && PreviousLink != LINK_POLLING)
442 }
443
444 if (Link == LINK_LOOPBACK)
446
447 if (Link == LINK_SS_DISABLED && PreviousLink != LINK_SS_DISABLED)
449
450 if (Link == LINK_COMPLIANCE)
452
453 /* The same SS.Inactive error is reported once until a reset */
454 if (Link == LINK_SS_INACTIVE)
455 {
458 if (Port->m_LastChange == PortEvent::ChangeLinkError)
459 {
460 DPRINT1("Hub %p port %u still in SS.Inactive, already reported\n", Hub, Port->Number());
462 }
466 }
467
468 if (ConnectChanged)
470
471 if (!Connected)
472 {
473 if (Status & PS_ENABLED)
475 if (Link <= LINK_U3)
478 }
479
480 if (Link == LINK_RX_DETECT)
482
483 if (!(Status & PS_ENABLED))
485
486 if (Link > LINK_U3 && Link != LINK_RECOVERY)
488
489 if (Change & PC_RESET)
491
492 if (PreviousLink == LINK_U3 && Link != LINK_U3)
494
496}
497
498/* Port status the hub should not report, and disconnects */
499static
500VOID
501NTAPI
508{
509 const char* What;
510
511 switch (Result)
512 {
514 What = "over current";
515 break;
516
518 /* An empty 2.0 port with no change also answers ChangeError */
519 if (!(Status & PS_CONNECTED) && Change == 0)
520 {
521 DPRINT("Hub %p port %u empty, no change\n", Port->m_Hub, Port->Number());
522 return;
523 }
524
525 What = "invalid status";
526 break;
527
529 What = "invalid status, hub reset";
530 break;
531
533 What = "link error, port reset";
534 break;
535
537 if (Status & PS_CONNECTED)
538 {
539 DPRINT("Hub %p port %u connect change\n", Port->m_Hub, Port->Number());
540 return;
541 }
542
543 What = "disconnect";
544 break;
545
546 default:
547 return;
548 }
549
550 DPRINT1("Hub %p port %u %s: status 0x%x previous 0x%x change 0x%x\n",
551 Port->m_Hub, Port->Number(), What, Status, Previous, Change);
552}
553
556{
561
564
565 if (!m_Usb3)
566 {
570 return Result;
571 }
572
575
576 if (Result == PortEvent::ChangeLinkError)
578
579 if (Result == PortEvent::ChangeNeedsHubReset)
580 {
583 }
584
585 if (Result != PortEvent::ChangeNone)
587
588 return Result;
589}
590
591/* A connect change still in flight holds a single idle reference until it arrives */
594{
598 PortEvent Result = PortEvent::SubDone;
599
601
602 if ((Status ^ Previous) & PS_CONNECTED)
603 {
604 if (!(Change & PC_CONNECT))
605 {
606 Result = PortEvent::ChangeConnect;
607 }
610 {
612 }
613 }
615 {
617 Result = PortEvent::ChangeOverCurrent;
618 }
620 {
622 Result = PortEvent::ChangeOverCurrentCleared;
623 DPRINT1("Hub %p port %u over current cleared without a change\n", m_Port->m_Hub, m_Port->Number());
624 }
625 else if (!(Status & PS_ENABLED) && (Previous & PS_ENABLED) && !(Change & PC_ENABLE))
626 {
627 Result = PortEvent::ChangeDisabled;
628 }
629 else if (!(Status & PS_SUSPENDED) && (Previous & PS_SUSPENDED) && !(Change & PC_SUSPEND))
630 {
631 Result = PortEvent::ChangeResumed;
632 }
633
636 return Result;
637}
638
641{
644
645 DPRINT1("Hub %p port %u bad status during reset: status 0x%x change 0x%x\n",
647
648 if (Change & PC_CONNECT)
649 return (Status & PS_CONNECTED) ? PortEvent::ErrorIgnore : PortEvent::ErrorCycle;
650
651 if (Change & PC_RESET)
652 {
653 if (!(Status & PS_CONNECTED))
654 return (Status & PS_ENABLED) ? PortEvent::ErrorCycle : PortEvent::ChangeNeedsHubReset;
655
656 if (Status & PS_SUSPENDED)
657 return PortEvent::ErrorCycle;
658
660 {
662 return PortEvent::ChangeOverCurrent;
663 }
664 }
665
666 if (Change & PC_ENABLE)
667 return (Status & PS_ENABLED) ? PortEvent::ErrorEnabledWhileReset : PortEvent::ErrorIgnore;
668
669 return PortEvent::ErrorIgnore;
670}
671
674{
677 {
678 return PortEvent::ErrorCycle;
679 }
680
681 return PortEvent::ErrorIgnore;
682}
683
684VOID
686{
688}
689
690/* Intentionally empty; no port state needs fixing */
691VOID
693{
694}
695
698{
699 return m_Port->m_Hub->HasFlag(HubFlag::DisableSuperSpeed);
700}
701
702/* More than five over currents, each within three seconds of the last */
705{
707
709
712
715}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:834
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HubFdo * Hub
Definition: bootdev.cpp:261
USHORT Change
Definition: bootdev.cpp:133
_In_ ULONG const Usable
Definition: cdrom.h:1084
_In_ ULONG const _In_ FEATURE_NUMBER const Feature
Definition: cdrom.h:1077
_In_ DsmEvent _In_ PCSTR What
Definition: childpdo.cpp:261
Definition: bufpool.h:45
UCHAR m_U1Timeout
Definition: hubchild.h:421
UCHAR m_U2Timeout
Definition: hubchild.h:422
Definition: fdo.h:132
WDFDEVICE m_Device
Definition: fdo.h:349
WDFIOTARGET m_RootHubTarget
Definition: fdo.h:368
ULONG m_LastResetPortStatus
Definition: fdo.h:438
BOOLEAN HasFlag(_In_ HubFlag Flag) const
Definition: fdo.h:153
ULONG m_FailureMessageId
Definition: fdo.h:402
UCXUSBDEVICE UsbDevice() const
Definition: fdo.h:180
BOOLEAN NeedsForwardProgress() const
Definition: fdo.h:208
UCHAR m_OverCurrentCount
Definition: hubport.h:250
BOOLEAN HasProperty(_In_ PortProperty Property) const
Definition: hubport.h:206
HubChild * m_Child
Definition: hubport.h:236
USHORT m_ChangeAccumulator
Definition: hubport.h:246
USHORT Number() const
Definition: hubport.h:213
USHORT m_PreviousStatus
Definition: hubport.h:245
PortEvent m_LastChange
Definition: hubport.h:248
USHORT m_SelectedFeature
Definition: hubport.h:247
LARGE_INTEGER m_LastOverCurrentTime
Definition: hubport.h:251
ULONG m_LinkErrorCount
Definition: hubport.h:249
BOOLEAN m_InitialConnectPowerReference
Definition: hubport.h:252
BOOLEAN IsUsb30() const
Definition: hubport.h:219
USB_CONNECTION_STATUS m_ConnectionStatus
Definition: hubport.h:254
HubPortStatus m_Current
Definition: hubport.h:244
HubFdo * m_Hub
Definition: hubport.h:228
VOID SendRemoteWake(_In_ BOOLEAN Enable)
Definition: portxfer.cpp:263
PortEvent ErrorResponseDuringReset()
Definition: portxfer.cpp:640
VOID SendReset()
Definition: portxfer.cpp:177
HubPort * m_Port
Definition: portsm.h:950
VOID SendSuspend()
Definition: portxfer.cpp:206
VOID SendWarmReset()
Definition: portxfer.cpp:184
VOID SendAckChange()
Definition: portxfer.cpp:167
VOID SendLinkDisable()
Definition: portxfer.cpp:215
BOOLEAN SuperSpeedBlocked()
Definition: portxfer.cpp:697
BOOLEAN OverCurrentPersists()
Definition: portxfer.cpp:704
VOID SendLinkRxDetect()
Definition: portxfer.cpp:221
VOID SendDisable()
Definition: portxfer.cpp:191
VOID FixPortStateAfterPowerUp()
Definition: portxfer.cpp:692
PSM_PENDING PendingChange()
Definition: portxfer.cpp:301
VOID ClearPortStatus()
Definition: portxfer.cpp:685
PortEvent NextChange()
Definition: portxfer.cpp:555
VOID SendGetStatus()
Definition: portxfer.cpp:152
VOID SendU2Timeout()
Definition: portxfer.cpp:250
VOID SendPortPower()
Definition: portxfer.cpp:228
PortEvent ErrorResponse()
Definition: portxfer.cpp:673
PortEvent LostChange()
Definition: portxfer.cpp:593
VOID SendU1Timeout()
Definition: portxfer.cpp:238
BOOLEAN m_Usb3
Definition: portsm.h:951
VOID SendResume()
Definition: portxfer.cpp:197
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
Status
Definition: gdiplustypes.h:24
CPPORT Port[4]
Definition: headless.c:38
@ PendingHubPowerReference
Previous
HubUxdSettings Current
#define PORT_F_U1_TIMEOUT
Definition: hubreq.h:106
#define HUB_REQUEST_CLEAR_FEATURE
Definition: hubreq.h:86
#define PORT_F_U2_TIMEOUT
Definition: hubreq.h:107
#define PORT_F_POWER
Definition: hubreq.h:100
#define PS_SUSPENDED
Definition: hubreq.h:128
#define PC_RESET
Definition: hubreq.h:140
#define PORT_C_LINK_STATE
Definition: hubreq.h:108
#define LINK_LOOPBACK
Definition: hubreq.h:123
#define HUB_MSG_CONTROL_TRANSFER_FAILED
Definition: hubreq.h:151
#define PORT_F_SUSPEND
Definition: hubreq.h:97
#define PC_OVER_CURRENT
Definition: hubreq.h:139
#define LINK_RX_DETECT
Definition: hubreq.h:118
#define LINK_RECOVERY
Definition: hubreq.h:121
#define PC_SUSPEND
Definition: hubreq.h:138
#define PORT_F_ENABLE
Definition: hubreq.h:96
#define LINK_SS_INACTIVE
Definition: hubreq.h:119
#define PORT_F_REMOTE_WAKE_MASK
Definition: hubreq.h:110
#define PORT_F_BH_RESET
Definition: hubreq.h:111
#define PC_CONNECT
Definition: hubreq.h:136
#define PS_OVER_CURRENT
Definition: hubreq.h:129
#define HUB_REQUEST_GET_STATUS
Definition: hubreq.h:85
#define PC_BH_RESET
Definition: hubreq.h:141
#define PS_CONNECTED
Definition: hubreq.h:126
#define PS_RESET
Definition: hubreq.h:130
#define PS_LINK_SHIFT
Definition: hubreq.h:131
#define PC_CONFIG_ERROR
Definition: hubreq.h:143
#define PS_POWER_20
Definition: hubreq.h:133
#define LINK_POLLING
Definition: hubreq.h:120
#define PC_LINK_STATE
Definition: hubreq.h:142
#define LINK_SS_DISABLED
Definition: hubreq.h:117
#define PORT_C_CONNECTION
Definition: hubreq.h:101
#define PORT_C_RESET
Definition: hubreq.h:105
#define HUB_MSG_INVALID_PORT_STATUS
Definition: hubreq.h:150
#define PC_ENABLE
Definition: hubreq.h:137
#define HUB_REQUEST_SET_FEATURE
Definition: hubreq.h:87
#define PORT_C_OVER_CURRENT
Definition: hubreq.h:104
#define PORT_C_BH_RESET
Definition: hubreq.h:112
#define PS_POWER_30
Definition: hubreq.h:134
#define LINK_U0
Definition: hubreq.h:115
#define PORT_C_ENABLE
Definition: hubreq.h:102
#define PORT_C_SUSPEND
Definition: hubreq.h:103
#define PS_ENABLED
Definition: hubreq.h:127
#define PORT_C_CONFIG_ERROR
Definition: hubreq.h:109
FORCEINLINE USHORT NTAPI HubLinkState(_In_ USHORT Status)
Definition: hubreq.h:159
#define PORT_F_RESET
Definition: hubreq.h:98
#define LINK_U3
Definition: hubreq.h:116
#define PORT_F_LINK_STATE
Definition: hubreq.h:99
#define HUB_FEATURE_NONE
Definition: hubreq.h:14
#define LINK_COMPLIANCE
Definition: hubreq.h:122
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
#define _In_
Definition: no_sal2.h:158
#define _In_reads_bytes_opt_(s)
Definition: no_sal2.h:224
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
unsigned short USHORT
Definition: pedump.c:61
PortEvent
Definition: portsm.h:15
@ ChangeNeedsHubReset
@ ChangeOverCurrent
@ PsmPendingNone
Definition: portsm.h:109
@ PsmPendingError
Definition: portsm.h:110
@ PsmPendingChange
Definition: portsm.h:108
enum _PSM_PENDING PSM_PENDING
static const PortChangeOrder PortChanges[]
Definition: portxfer.cpp:286
static EVT_WDF_REQUEST_COMPLETION_ROUTINE PortControlComplete
Definition: portxfer.cpp:17
#define PORT_OVER_CURRENT_WINDOW
Definition: portxfer.cpp:15
static PortEvent NTAPI PortNextChange20(_In_ HubPort *Port, _In_ USHORT Status, _In_ USHORT Previous, _In_ USHORT Change)
Definition: portxfer.cpp:351
static VOID NTAPI PortTrackPendingOperation(_In_ HubPort *Port, _In_ USBD_STATUS UrbStatus)
Definition: portxfer.cpp:26
static PortEvent NTAPI PortNextChange30(_In_ HubPort *Port, _In_ USHORT Status, _In_ USHORT Previous, _In_ USHORT Change)
Definition: portxfer.cpp:395
#define PORT_OVER_CURRENT_LIMIT
Definition: portxfer.cpp:14
static VOID NTAPI PortDropInitialConnectReference(_In_ HubPort *Port)
Definition: portxfer.cpp:337
static VOID NTAPI PortCacheSetFeature(_In_ HubPort *Port)
Definition: portxfer.cpp:52
static VOID NTAPI PortReportChange(_In_ HubPort *Port, _In_ PortEvent Result, _In_ USHORT Status, _In_ USHORT Previous, _In_ USHORT Change)
Definition: portxfer.cpp:502
static VOID NTAPI PortSendControl(_In_ HubPort *Port, _In_ UCHAR RequestType, _In_ UCHAR Request, _In_ USHORT Value, _In_ USHORT Index, _In_reads_bytes_opt_(Length) PVOID Buffer, _In_ USHORT Length)
Definition: portxfer.cpp:113
static USHORT NTAPI PortIndex(_In_ HubPort *Port, _In_ UCHAR High)
Definition: portxfer.cpp:144
struct tm * Now
Definition: output.c:19
#define DPRINT
Definition: sndvol32.h:73
@ High
Definition: strmini.h:378
USB_PORT_STATUS_AND_CHANGE StatusChange
Definition: hubport.h:56
USHORT Feature20
Definition: portxfer.cpp:281
USHORT Feature30
Definition: portxfer.cpp:283
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFREQUEST Request
LONGLONG QuadPart
Definition: typedefs.h:114
USHORT AsUshort16
Definition: usb200.h:231
USB_PORT_STATUS PortStatus
Definition: usb200.h:241
USB_PORT_CHANGE PortChange
Definition: usb200.h:242
USHORT AsUshort16
Definition: usb200.h:223
@ ToleratesU0WhileDetached
@ IgnoreEnabledInSsInactive
@ DiscardEnableDuringReset
#define USBD_STATUS_PORT_OPERATION_PENDING
Definition: usb.h:178
LONG USBD_STATUS
Definition: usb.h:172
@ DeviceCausedOvercurrent
Definition: usbioctl.h:282
@ NoDeviceConnected
Definition: usbioctl.h:278
_In_ WDFCOLLECTION _In_ ULONG Index
#define WdfDeviceStopIdle(Device, WaitForD0)
Definition: wdfdevice.h:1977
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFQUEUE _In_ _Strict_type_match_ WDF_REQUEST_TYPE RequestType
Definition: wdfdevice.h:4239
#define WdfDeviceResumeIdle(Device)
Definition: wdfdevice.h:1983
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409