ReactOS 0.4.17-dev-1281-g065abb3
hubutil.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: Shared helpers
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
14VOID
16HubWaitForPnpEvent(
20{
21 LARGE_INTEGER Timeout = RTL_CONSTANT_LARGE_INTEGER(-60LL * 1000 * 1000 * 10);
23
25
27 {
28 Minutes++;
29 DbgPrint("USBHUB3 Watchdog: Thread 0x%p has waited %lu minutes for %s to complete for WDF object 0x%p\n",
31 }
32}
33
34/* Hub numbers come from usbd.sys; 0 means none was free */
38HubAllocateHubNumber(
39 _Out_ PULONG HubNumber)
40{
41 *HubNumber = USBD_AllocateHubNumber();
42 if (*HubNumber == 0)
43 DPRINT1("No free hub number\n");
44
45 return STATUS_SUCCESS;
46}
47
49VOID
51HubReleaseHubNumber(
52 _In_ ULONG HubNumber)
53{
54 USBD_ReleaseHubNumber(HubNumber);
55}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define STATUS_TIMEOUT
Definition: d3dkmdt.h:49
_Check_return_ _In_ DXGK_EVENT_TYPE _In_ ULONG Event
Definition: dispmprt.h:1287
#define FALSE
Definition: types.h:117
#define _IRQL_requires_(irql)
Definition: driverspecs.h:229
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define DbgPrint
Definition: hal.h:12
#define KeGetCurrentThread
Definition: hal.h:55
VOID NTAPI USBD_ReleaseHubNumber(_In_ ULONG HubNumber)
Definition: hubsup.c:117
ULONG NTAPI USBD_AllocateHubNumber(VOID)
Definition: hubsup.c:96
_In_ PCSTR What
Definition: hubutil.cpp:18
PAGED_CODE()
ULONG Minutes
Definition: hubutil.cpp:22
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
Definition: ndissys.h:37
#define KernelMode
Definition: asm.h:38
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
static ULONG Timeout
Definition: ping.c:61
#define STATUS_SUCCESS
Definition: shellext.h:65
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
@ Executive
Definition: ketypes.h:467