ReactOS 0.4.17-dev-1281-g065abb3
devmisc.cpp File Reference
#include "usbhub3.h"
#include <debug.h>
Include dependency graph for devmisc.cpp:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define DEVICE_DUPLICATE_RETRY_LIMIT   10
 
#define DEVICE_FAST_RESET_WINDOW   (1LL * 1000 * 1000 * 10)
 
#define HUB_VALIDATION_DUPLICATE_SERIAL   234
 
#define DEVICE_ENUM_RETRY_LIMIT   3
 
#define PS_LOW_SPEED   0x0200
 
#define PS_HIGH_SPEED   0x0400
 

Functions

static VOID NTAPI HubForgetMsOs20 (_Inout_ HubChild *Child)
 
VOID NTAPI HubLogDeviceValidationError (_In_ HubChild *Child, _In_ ULONG Code)
 

Macro Definition Documentation

◆ DEVICE_DUPLICATE_RETRY_LIMIT

#define DEVICE_DUPLICATE_RETRY_LIMIT   10

Definition at line 14 of file devmisc.cpp.

◆ DEVICE_ENUM_RETRY_LIMIT

#define DEVICE_ENUM_RETRY_LIMIT   3

Definition at line 23 of file devmisc.cpp.

◆ DEVICE_FAST_RESET_WINDOW

#define DEVICE_FAST_RESET_WINDOW   (1LL * 1000 * 1000 * 10)

Definition at line 17 of file devmisc.cpp.

◆ HUB_VALIDATION_DUPLICATE_SERIAL

#define HUB_VALIDATION_DUPLICATE_SERIAL   234

Definition at line 20 of file devmisc.cpp.

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file devmisc.cpp.

◆ PS_HIGH_SPEED

#define PS_HIGH_SPEED   0x0400

Definition at line 27 of file devmisc.cpp.

◆ PS_LOW_SPEED

#define PS_LOW_SPEED   0x0200

Definition at line 26 of file devmisc.cpp.

Function Documentation

◆ HubForgetMsOs20()

static VOID NTAPI HubForgetMsOs20 ( _Inout_ HubChild *  Child)
static

Forgets everything learned from the MS OS 2.0 descriptor set so the next attempt starts clean.

Definition at line 39 of file devmisc.cpp.

41{
42 if (Child->m_MsOs20Set != NULL)
44
45 Child->m_MsOs20Set = NULL;
46 Child->m_MsOs20SetLength = 0;
47 RtlZeroMemory(&Child->m_MsOs20, sizeof(Child->m_MsOs20));
48 RtlZeroMemory(&Child->m_MsOs20SetInfo, sizeof(Child->m_MsOs20SetInfo));
49 RtlZeroMemory(&Child->m_OriginalDeviceDescriptor, sizeof(Child->m_OriginalDeviceDescriptor));
50 Child->m_AltEnumCached = FALSE;
51 Child->m_HasResumeRecoveryTime = FALSE;
52 Child->m_ResumeRecoveryTime = 0;
53 Child->m_ResumeSignalingTime = 0;
56}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
@ AltEnumCommandSent
#define HUB_TAG_DEVICE
Definition: hubutil.h:13
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Referenced by DeviceMachine::EnumRetriesUsedUp().

◆ HubLogDeviceValidationError()

VOID NTAPI HubLogDeviceValidationError ( _In_ HubChild *  Child,
_In_ ULONG  Code 
)

Records a descriptor validation code against the device.

Definition at line 483 of file devmisc.cpp.

486{
487 RtlSetBit(&Child->m_ValidationBitmap, Code);
488}
#define RtlSetBit
Definition: dbgbitmap.h:344
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1707

Referenced by DeviceMachine::AddChildToHub().