ReactOS 0.4.17-dev-1281-g065abb3
hubid.h
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: PnP identity, ACPI port description and connector map internals
5 * COPYRIGHT: Copyright 2026 Justin Miller <justin.miller@reactos.org>
6 */
7
8#pragma once
9
10/* Enumeration failure reasons the ids are chosen by (Child->m_EnumMessageId) */
11#define HUB_ENUM_DEVICE_DESCRIPTOR_FAILED 0x40010000
12#define HUB_ENUM_SET_ADDRESS_FAILED 0x40010001
13#define HUB_ENUM_PORT_RESET_FAILED 0x40010002
14#define HUB_ENUM_BAD_CONFIG_DESCRIPTOR 0x40010004
15#define HUB_ENUM_BAD_DEVICE_DESCRIPTOR 0x40010005
16#define HUB_ENUM_CONFIG_DESCRIPTOR_FAILED 0x40010007
17#define HUB_ENUM_SET_SEL_FAILED 0x4001000A
18#define HUB_ENUM_BOS_FAILED 0x4001000B
19#define HUB_ENUM_QUALIFIER_FAILED 0x4001000C
20#define HUB_ENUM_SERIAL_NUMBER_FAILED 0x4001000D
21#define HUB_ENUM_LANGUAGE_IDS_FAILED 0x4001000E
22#define HUB_ENUM_PRODUCT_STRING_FAILED 0x4001000F
23#define HUB_ENUM_MSOS_EXT_CONFIG_FAILED 0x40010010
24#define HUB_ENUM_MSOS_CONTAINER_ID_FAILED 0x40010011
25#define HUB_ENUM_BAD_BOS 0x40010012
26#define HUB_ENUM_BAD_QUALIFIER 0x40010013
27#define HUB_ENUM_BAD_LANGUAGE_IDS 0x40010014
28#define HUB_ENUM_BAD_MSOS_CONTAINER_ID 0x40010015
29#define HUB_ENUM_BAD_MSOS_EXT_CONFIG 0x40010016
30#define HUB_ENUM_BAD_PRODUCT_STRING 0x40010017
31#define HUB_ENUM_BAD_SERIAL_NUMBER 0x40010018
32#define HUB_ENUM_LINK_SS_INACTIVE 0x40010019
33#define HUB_ENUM_LINK_COMPLIANCE 0x4001001A
34#define HUB_ENUM_INCOMPATIBLE 0x4001001B
35#define HUB_ENUM_MSOS20_SET_FAILED 0x4001001C
36#define HUB_ENUM_BAD_MSOS20_SET 0x4001001D
37#define HUB_ENUM_ALT_ENUM_FAILED 0x4001001E
38#define HUB_ENUM_BAD_BILLBOARD_URL 0x4001001F
39#define HUB_ENUM_BAD_ALT_MODE_STRING 0x40010020
40
41/* Serial number decoration, in bytes */
42#define HUB_SERIAL_PREFIX_BYTES (6 * sizeof(WCHAR))
43
45struct HubSha1
46{
51};
52
53#define HUB_SHA1_DIGEST_BYTES 20
54
55VOID
59
60VOID
66
67VOID
72
73/* Port properties change after creation only here, so the updates are interlocked */
75VOID
80{
81 InterlockedOr((PLONG)&Port->m_Info.Properties, (LONG)Property);
82}
83
85VOID
90{
91 InterlockedAnd((PLONG)&Port->m_Info.Properties, ~(LONG)Property);
92}
93
94/* Connector map, portconn.cpp */
95
99HubConnectorRegisterPort(
100 _In_ HubPort* Port);
101
104NTAPI
105HubConnectorUnregisterPort(
106 _In_ HubPort* Port);
LONG NTSTATUS
Definition: precomp.h:26
#define _IRQL_requires_(irql)
Definition: driverspecs.h:229
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
CPPORT Port[4]
Definition: headless.c:38
FORCEINLINE VOID NTAPI HubClearPortProperty(_In_ HubPort *Port, _In_ PortProperty Property)
Definition: hubid.h:87
FORCEINLINE VOID NTAPI HubSetPortProperty(_In_ HubPort *Port, _In_ PortProperty Property)
Definition: hubid.h:77
VOID NTAPI HubSha1Init(_Out_ HubSha1 *Context)
Definition: hubsha1.cpp:90
VOID NTAPI HubSha1Update(_Inout_ HubSha1 *Context, _In_reads_bytes_(Length) const VOID *Data, _In_ SIZE_T Length)
Definition: hubsha1.cpp:103
VOID NTAPI HubSha1Final(_Inout_ HubSha1 *Context, _Out_writes_bytes_all_(HUB_SHA1_DIGEST_BYTES) PUCHAR Digest)
Definition: hubsha1.cpp:132
#define HUB_SHA1_DIGEST_BYTES
Definition: hubid.h:53
PortProperty
Definition: hubport.h:12
#define InterlockedOr
Definition: interlocked.h:239
#define InterlockedAnd
Definition: interlocked.h:77
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
unsigned __int64 ULONG64
Definition: imports.h:198
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _Out_writes_bytes_all_(s)
Definition: no_sal2.h:194
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
long LONG
Definition: pedump.c:60
Definition: hubid.h:46
UCHAR Block[64]
Definition: hubid.h:50
ULONG BlockUsed
Definition: hubid.h:49
ULONG64 TotalBytes
Definition: hubid.h:48
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t * PLONG
Definition: typedefs.h:58
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define FORCEINLINE
Definition: wdftypes.h:67