ReactOS  0.4.15-dev-1068-g467feb9
usbehci.h File Reference
#include <ntddk.h>
#include <windef.h>
#include <stdio.h>
#include <hubbusif.h>
#include <usbbusif.h>
#include <usbdlib.h>
#include <drivers/usbport/usbmport.h>
#include "hardware.h"
Include dependency graph for usbehci.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _EHCI_PERIOD
 
struct  _EHCI_HCD_TD
 
struct  _EHCI_STATIC_QH
 
struct  _EHCI_HCD_QH
 
struct  _EHCI_ENDPOINT
 
struct  _EHCI_TRANSFER
 
struct  _EHCI_HC_RESOURCES
 
struct  _EHCI_EXTENSION
 

Macros

#define EHCI_MAX_CONTROL_TRANSFER_SIZE   0x10000
 
#define EHCI_MAX_INTERRUPT_TRANSFER_SIZE   0x1000
 
#define EHCI_MAX_BULK_TRANSFER_SIZE   0x400000
 
#define EHCI_MAX_FS_ISO_TRANSFER_SIZE   0x40000
 
#define EHCI_MAX_HS_ISO_TRANSFER_SIZE   0x180000
 
#define EHCI_MAX_FS_ISO_HEADER_BUFFER_SIZE   0x1000
 
#define EHCI_MAX_HS_ISO_HEADER_BUFFER_SIZE   0x40000
 
#define EHCI_MAX_CONTROL_TD_COUNT   6
 
#define EHCI_MAX_INTERRUPT_TD_COUNT   4
 
#define EHCI_MAX_BULK_TD_COUNT   209
 
#define EHCI_FRAMES   32
 
#define EHCI_MICROFRAMES   8
 
#define EHCI_MAX_HC_SYSTEM_ERRORS   256
 
#define EHCI_HCD_TD_FLAG_ALLOCATED   0x01
 
#define EHCI_HCD_TD_FLAG_PROCESSED   0x02
 
#define EHCI_HCD_TD_FLAG_DONE   0x08
 
#define EHCI_HCD_TD_FLAG_ACTIVE   0x10
 
#define EHCI_HCD_TD_FLAG_DUMMY   0x20
 
#define EHCI_QH_FLAG_IN_SCHEDULE   0x01
 
#define EHCI_QH_FLAG_CLOSED   0x02
 
#define EHCI_QH_FLAG_STATIC   0x04
 
#define EHCI_QH_FLAG_STATIC_FAST   0x08
 
#define EHCI_QH_FLAG_UPDATING   0x10
 
#define EHCI_QH_FLAG_NUKED   0x20
 
#define EHCI_DUMMYQH_MAX_PACKET_LENGTH   64
 
#define EHCI_FLAGS_CONTROLLER_SUSPEND   0x01
 
#define EHCI_FLAGS_IDLE_SUPPORT   0x20
 

Typedefs

typedef struct _EHCI_PERIOD EHCI_PERIOD
 
typedef struct _EHCI_PERIODPEHCI_PERIOD
 
typedef struct _EHCI_HCD_TD EHCI_HCD_TD
 
typedef struct _EHCI_HCD_TDPEHCI_HCD_TD
 
typedef struct _EHCI_STATIC_QH EHCI_STATIC_QH
 
typedef struct _EHCI_STATIC_QHPEHCI_STATIC_QH
 
typedef struct _EHCI_HCD_QH EHCI_HCD_QH
 
typedef struct _EHCI_HCD_QHPEHCI_HCD_QH
 
typedef struct _EHCI_ENDPOINT EHCI_ENDPOINT
 
typedef struct _EHCI_ENDPOINTPEHCI_ENDPOINT
 
typedef struct _EHCI_TRANSFER EHCI_TRANSFER
 
typedef struct _EHCI_TRANSFERPEHCI_TRANSFER
 
typedef struct _EHCI_HC_RESOURCES EHCI_HC_RESOURCES
 
typedef struct _EHCI_HC_RESOURCESPEHCI_HC_RESOURCES
 
typedef struct _EHCI_EXTENSION EHCI_EXTENSION
 
typedef struct _EHCI_EXTENSIONPEHCI_EXTENSION
 

Functions

 C_ASSERT (sizeof(EHCI_HCD_TD)==0x100)
 
 C_ASSERT (sizeof(EHCI_STATIC_QH)==0xA0)
 
 C_ASSERT (sizeof(EHCI_HCD_QH)==0x100)
 
VOID NTAPI EHCI_DumpHwTD (IN PEHCI_HCD_TD TD)
 
VOID NTAPI EHCI_DumpHwQH (IN PEHCI_HCD_QH QH)
 
MPSTATUS NTAPI EHCI_RH_ChirpRootPort (IN PVOID ehciExtension, IN USHORT Port)
 
VOID NTAPI EHCI_RH_GetRootHubData (IN PVOID ohciExtension, IN PVOID rootHubData)
 
MPSTATUS NTAPI EHCI_RH_GetStatus (IN PVOID ohciExtension, IN PUSHORT Status)
 
MPSTATUS NTAPI EHCI_RH_GetPortStatus (IN PVOID ohciExtension, IN USHORT Port, IN PUSB_PORT_STATUS_AND_CHANGE PortStatus)
 
MPSTATUS NTAPI EHCI_RH_GetHubStatus (IN PVOID ohciExtension, IN PUSB_HUB_STATUS_AND_CHANGE HubStatus)
 
MPSTATUS NTAPI EHCI_RH_SetFeaturePortReset (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_SetFeaturePortPower (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_SetFeaturePortEnable (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_SetFeaturePortSuspend (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortEnable (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortPower (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortSuspend (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortEnableChange (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortConnectChange (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortResetChange (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortSuspendChange (IN PVOID ohciExtension, IN USHORT Port)
 
MPSTATUS NTAPI EHCI_RH_ClearFeaturePortOvercurrentChange (IN PVOID ohciExtension, IN USHORT Port)
 
VOID NTAPI EHCI_RH_DisableIrq (IN PVOID ohciExtension)
 
VOID NTAPI EHCI_RH_EnableIrq (IN PVOID ohciExtension)
 

Variables

USBPORT_REGISTRATION_PACKET RegPacket
 

Macro Definition Documentation

◆ EHCI_DUMMYQH_MAX_PACKET_LENGTH

#define EHCI_DUMMYQH_MAX_PACKET_LENGTH   64

Definition at line 116 of file usbehci.h.

◆ EHCI_FLAGS_CONTROLLER_SUSPEND

#define EHCI_FLAGS_CONTROLLER_SUSPEND   0x01

Definition at line 168 of file usbehci.h.

◆ EHCI_FLAGS_IDLE_SUPPORT

#define EHCI_FLAGS_IDLE_SUPPORT   0x20

Definition at line 169 of file usbehci.h.

◆ EHCI_FRAMES

#define EHCI_FRAMES   32

Definition at line 35 of file usbehci.h.

◆ EHCI_HCD_TD_FLAG_ACTIVE

#define EHCI_HCD_TD_FLAG_ACTIVE   0x10

Definition at line 50 of file usbehci.h.

◆ EHCI_HCD_TD_FLAG_ALLOCATED

#define EHCI_HCD_TD_FLAG_ALLOCATED   0x01

Definition at line 47 of file usbehci.h.

◆ EHCI_HCD_TD_FLAG_DONE

#define EHCI_HCD_TD_FLAG_DONE   0x08

Definition at line 49 of file usbehci.h.

◆ EHCI_HCD_TD_FLAG_DUMMY

#define EHCI_HCD_TD_FLAG_DUMMY   0x20

Definition at line 51 of file usbehci.h.

◆ EHCI_HCD_TD_FLAG_PROCESSED

#define EHCI_HCD_TD_FLAG_PROCESSED   0x02

Definition at line 48 of file usbehci.h.

◆ EHCI_MAX_BULK_TD_COUNT

#define EHCI_MAX_BULK_TD_COUNT   209

Definition at line 33 of file usbehci.h.

◆ EHCI_MAX_BULK_TRANSFER_SIZE

#define EHCI_MAX_BULK_TRANSFER_SIZE   0x400000

Definition at line 24 of file usbehci.h.

◆ EHCI_MAX_CONTROL_TD_COUNT

#define EHCI_MAX_CONTROL_TD_COUNT   6

Definition at line 31 of file usbehci.h.

◆ EHCI_MAX_CONTROL_TRANSFER_SIZE

#define EHCI_MAX_CONTROL_TRANSFER_SIZE   0x10000

Definition at line 22 of file usbehci.h.

◆ EHCI_MAX_FS_ISO_HEADER_BUFFER_SIZE

#define EHCI_MAX_FS_ISO_HEADER_BUFFER_SIZE   0x1000

Definition at line 28 of file usbehci.h.

◆ EHCI_MAX_FS_ISO_TRANSFER_SIZE

#define EHCI_MAX_FS_ISO_TRANSFER_SIZE   0x40000

Definition at line 25 of file usbehci.h.

◆ EHCI_MAX_HC_SYSTEM_ERRORS

#define EHCI_MAX_HC_SYSTEM_ERRORS   256

Definition at line 38 of file usbehci.h.

◆ EHCI_MAX_HS_ISO_HEADER_BUFFER_SIZE

#define EHCI_MAX_HS_ISO_HEADER_BUFFER_SIZE   0x40000

Definition at line 29 of file usbehci.h.

◆ EHCI_MAX_HS_ISO_TRANSFER_SIZE

#define EHCI_MAX_HS_ISO_TRANSFER_SIZE   0x180000

Definition at line 26 of file usbehci.h.

◆ EHCI_MAX_INTERRUPT_TD_COUNT

#define EHCI_MAX_INTERRUPT_TD_COUNT   4

Definition at line 32 of file usbehci.h.

◆ EHCI_MAX_INTERRUPT_TRANSFER_SIZE

#define EHCI_MAX_INTERRUPT_TRANSFER_SIZE   0x1000

Definition at line 23 of file usbehci.h.

◆ EHCI_MICROFRAMES

#define EHCI_MICROFRAMES   8

Definition at line 36 of file usbehci.h.

◆ EHCI_QH_FLAG_CLOSED

#define EHCI_QH_FLAG_CLOSED   0x02

Definition at line 81 of file usbehci.h.

◆ EHCI_QH_FLAG_IN_SCHEDULE

#define EHCI_QH_FLAG_IN_SCHEDULE   0x01

Definition at line 80 of file usbehci.h.

◆ EHCI_QH_FLAG_NUKED

#define EHCI_QH_FLAG_NUKED   0x20

Definition at line 85 of file usbehci.h.

◆ EHCI_QH_FLAG_STATIC

#define EHCI_QH_FLAG_STATIC   0x04

Definition at line 82 of file usbehci.h.

◆ EHCI_QH_FLAG_STATIC_FAST

#define EHCI_QH_FLAG_STATIC_FAST   0x08

Definition at line 83 of file usbehci.h.

◆ EHCI_QH_FLAG_UPDATING

#define EHCI_QH_FLAG_UPDATING   0x10

Definition at line 84 of file usbehci.h.

Typedef Documentation

◆ EHCI_ENDPOINT

◆ EHCI_EXTENSION

◆ EHCI_HC_RESOURCES

◆ EHCI_HCD_QH

◆ EHCI_HCD_TD

◆ EHCI_PERIOD

◆ EHCI_STATIC_QH

◆ EHCI_TRANSFER

◆ PEHCI_ENDPOINT

◆ PEHCI_EXTENSION

◆ PEHCI_HC_RESOURCES

◆ PEHCI_HCD_QH

◆ PEHCI_HCD_TD

◆ PEHCI_PERIOD

◆ PEHCI_STATIC_QH

◆ PEHCI_TRANSFER

Function Documentation

◆ C_ASSERT() [1/3]

C_ASSERT ( sizeof(EHCI_HCD_TD = =0x100)

◆ C_ASSERT() [2/3]

C_ASSERT ( sizeof(EHCI_STATIC_QH = =0xA0)

◆ C_ASSERT() [3/3]

C_ASSERT ( sizeof(EHCI_HCD_QH = =0x100)

◆ EHCI_DumpHwQH()

VOID NTAPI EHCI_DumpHwQH ( IN PEHCI_HCD_QH  QH)

Definition at line 31 of file debug.c.

32 {
33  if (!QH)
34  return;
35 
36  DPRINT(": QH->sqh.HwQH.CurrentTD - %lx\n", QH->sqh.HwQH.CurrentTD);
37  DPRINT(": QH->sqh.HwQH.NextTD - %lx\n", QH->sqh.HwQH.NextTD);
38  DPRINT(": QH->sqh.HwQH.AlternateNextTD - %lx\n", QH->sqh.HwQH.AlternateNextTD);
39  DPRINT(": QH->sqh.HwQH.Token.AsULONG - %lx\n", QH->sqh.HwQH.Token.AsULONG);
40 }
void DPRINT(...)
Definition: polytest.cpp:61

Referenced by EHCI_PollHaltedAsyncEndpoint().

◆ EHCI_DumpHwTD()

VOID NTAPI EHCI_DumpHwTD ( IN PEHCI_HCD_TD  TD)

Definition at line 15 of file debug.c.

16 {
17  while (TD)
18  {
19  DPRINT(": TD - %p\n", TD);
20  DPRINT(": TD->PhysicalAddress - %lx\n", TD->PhysicalAddress);
21  DPRINT(": TD->HwTD.NextTD - %lx\n", TD->HwTD.NextTD);
22  DPRINT(": TD->HwTD.AlternateNextTD - %lx\n", TD->HwTD.AlternateNextTD);
23  DPRINT(": TD->HwTD.Token.AsULONG - %lx\n", TD->HwTD.Token.AsULONG);
24 
25  TD = TD->NextHcdTD;
26  }
27 }
void DPRINT(...)
Definition: polytest.cpp:61

◆ EHCI_RH_ChirpRootPort()

MPSTATUS NTAPI EHCI_RH_ChirpRootPort ( IN PVOID  ehciExtension,
IN USHORT  Port 
)

Definition at line 18 of file roothub.c.

20 {
21  PEHCI_EXTENSION EhciExtension = ehciExtension;
22  PULONG PortStatusReg;
24  ULONG PortBit;
25  ULONG ix;
26 
27  DPRINT_RH("EHCI_RH_ChirpRootPort: Port - %x\n", Port);
28  ASSERT(Port != 0);
29 
30  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
31  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
32  DPRINT_RH("EHCI_RH_ChirpRootPort: PortSC - %X\n", PortSC.AsULONG);
33 
34  PortBit = 1 << (Port - 1);
35 
36  if (PortBit & EhciExtension->ResetPortBits)
37  {
38  DPRINT_RH("EHCI_RH_ChirpRootPort: Skip port - %x\n", Port);
39  return MP_STATUS_SUCCESS;
40  }
41 
42  if (PortSC.PortPower == 0)
43  {
44  DPRINT_RH("EHCI_RH_ChirpRootPort: Skip port - %x\n", Port);
45  return MP_STATUS_SUCCESS;
46  }
47 
48  if (PortSC.CurrentConnectStatus == 0 ||
49  PortSC.PortEnabledDisabled == 1 ||
51  {
52  DPRINT_RH("EHCI_RH_ChirpRootPort: No port - %x\n", Port);
53  return MP_STATUS_SUCCESS;
54  }
55 
57  PortSC.Suspend == 0 &&
58  PortSC.CurrentConnectStatus == 1)
59  {
60  /* Attached device is not a high-speed device.
61  Release ownership of the port to a selected HC.
62  Companion HC owns and controls the port. Section 4.2 */
64  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
65 
66  DPRINT_RH("EHCI_RH_ChirpRootPort: Companion HC port - %x\n", Port);
67  return MP_STATUS_SUCCESS;
68  }
69 
70  DPRINT("EHCI_RH_ChirpRootPort: EhciExtension - %p, Port - %x\n",
71  EhciExtension,
72  Port);
73 
74  PortSC.PortEnabledDisabled = 0;
75  PortSC.PortReset = 1;
76  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
77 
78  RegPacket.UsbPortWait(EhciExtension, 10);
79 
80  do
81  {
82  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
83 
84  PortSC.ConnectStatusChange = 0;
85  PortSC.PortEnableDisableChange = 0;
86  PortSC.OverCurrentChange = 0;
87  PortSC.PortReset = 0;
88 
89  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
90 
91  for (ix = 0; ix <= 500; ix += 20)
92  {
94  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
95 
96  DPRINT_RH("EHCI_RH_ChirpRootPort: Reset port - %x\n", Port);
97 
98  if (PortSC.PortReset == 0)
99  break;
100  }
101  }
102  while (PortSC.PortReset == 1);
103 
104  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
105 
106  if (PortSC.PortEnabledDisabled == 1)
107  {
108  PortSC.ConnectStatusChange = 0;
109  PortSC.PortEnabledDisabled = 0;
110  PortSC.PortEnableDisableChange = 0;
111  PortSC.OverCurrentChange = 0;
112 
113  RegPacket.UsbPortWait(EhciExtension, 10);
114 
115  EhciExtension->ResetPortBits |= PortBit;
116 
117  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
118  DPRINT_RH("EHCI_RH_ChirpRootPort: Disable port - %x\n", Port);
119  }
120  else
121  {
123  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
124  DPRINT_RH("EHCI_RH_ChirpRootPort: Companion HC port - %x\n", Port);
125  }
126 
127  return MP_STATUS_SUCCESS;
128 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
USBPORT_REGISTRATION_PACKET RegPacket
Definition: usbehci.c:16
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
void DPRINT(...)
Definition: polytest.cpp:61
ULONG ResetPortBits
Definition: usbehci.h:197
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define EHCI_LINE_STATUS_K_STATE_LOW_SPEED
Definition: hardware.h:137
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134
unsigned int ULONG
Definition: retypes.h:1
#define EHCI_PORT_OWNER_COMPANION_CONTROLLER
Definition: hardware.h:138
PUSBPORT_WAIT UsbPortWait
Definition: usbmport.h:622
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:95

Referenced by DriverEntry(), and EHCI_StartController().

◆ EHCI_RH_ClearFeaturePortConnectChange()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortConnectChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 591 of file roothub.c.

593 {
594  PEHCI_EXTENSION EhciExtension = ehciExtension;
595  PULONG PortStatusReg;
597 
598  DPRINT_RH("EHCI_RH_ClearFeaturePortConnectChange: Port - %x\n", Port);
599  ASSERT(Port != 0);
600 
601  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
602 
603  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
604 
605  if (PortSC.ConnectStatusChange)
606  {
607  PortSC.ConnectStatusChange = 1;
608  PortSC.PortEnableDisableChange = 0;
609  PortSC.OverCurrentChange = 0;
610 
611  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
612  }
613 
614  EhciExtension->ConnectPortBits &= ~(1 << (Port - 1));
615 
616  return MP_STATUS_SUCCESS;
617 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
ULONG ConnectPortBits
Definition: usbehci.h:195
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortEnable()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortEnable ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 462 of file roothub.c.

464 {
465  PEHCI_EXTENSION EhciExtension = ehciExtension;
466  PULONG PortStatusReg;
468 
469  DPRINT("EHCI_RH_ClearFeaturePortEnable: Port - %x\n", Port);
470  ASSERT(Port != 0);
471 
472  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
473 
474  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
475 
476  PortSC.ConnectStatusChange = 0;
477  PortSC.PortEnabledDisabled = 0;
478  PortSC.PortEnableDisableChange = 0;
479  PortSC.OverCurrentChange = 0;
480 
481  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
482 
483  return MP_STATUS_SUCCESS;
484 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
void DPRINT(...)
Definition: polytest.cpp:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortEnableChange()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortEnableChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 566 of file roothub.c.

568 {
569  PEHCI_EXTENSION EhciExtension = ehciExtension;
570  PULONG PortStatusReg;
572 
573  DPRINT("EHCI_RH_ClearFeaturePortEnableChange: Port - %p\n", Port);
574  ASSERT(Port != 0);
575 
576  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
577 
578  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
579 
580  PortSC.ConnectStatusChange = 0;
581  PortSC.OverCurrentChange = 0;
582  PortSC.PortEnableDisableChange = 1;
583 
584  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
585 
586  return MP_STATUS_SUCCESS;
587 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
void DPRINT(...)
Definition: polytest.cpp:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortOvercurrentChange()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortOvercurrentChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 649 of file roothub.c.

651 {
652  PEHCI_EXTENSION EhciExtension = ehciExtension;
653  PULONG PortStatusReg;
655 
656  DPRINT_RH("EHCI_RH_ClearFeaturePortOvercurrentChange: Port - %x\n", Port);
657  ASSERT(Port != 0);
658 
659  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
660 
661  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
662 
663  PortSC.ConnectStatusChange = 0;
664  PortSC.PortEnableDisableChange = 0;
665  PortSC.OverCurrentChange = 1;
666 
667  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
668 
669  return MP_STATUS_SUCCESS;
670 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortPower()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortPower ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 488 of file roothub.c.

490 {
491  PEHCI_EXTENSION EhciExtension = ehciExtension;
492  PULONG PortStatusReg;
494 
495  DPRINT("EHCI_RH_ClearFeaturePortPower: Port - %x\n", Port);
496  ASSERT(Port != 0);
497 
498  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
499 
500  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
501  PortSC.PortPower = 0;
502  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
503 
504  return MP_STATUS_SUCCESS;
505 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
void DPRINT(...)
Definition: polytest.cpp:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortResetChange()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortResetChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 621 of file roothub.c.

623 {
624  PEHCI_EXTENSION EhciExtension = ehciExtension;
625 
626  DPRINT("EHCI_RH_ClearFeaturePortConnectChange: Port - %x\n", Port);
627  ASSERT(Port != 0);
628 
629  EhciExtension->FinishResetPortBits &= ~(1 << (Port - 1));
630  return MP_STATUS_SUCCESS;
631 }
CPPORT Port[4]
Definition: headless.c:34
void DPRINT(...)
Definition: polytest.cpp:61
ULONG FinishResetPortBits
Definition: usbehci.h:198
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortSuspend()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortSuspend ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 538 of file roothub.c.

540 {
541  PEHCI_EXTENSION EhciExtension = ehciExtension;
542  PULONG PortStatusReg;
544 
545  DPRINT("EHCI_RH_ClearFeaturePortSuspend: Port - %x\n", Port);
546  ASSERT(Port != 0);
547 
548  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
549  EhciExtension->ResetPortBits |= 1 << (Port - 1);
550 
551  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
552  PortSC.ForcePortResume = 1;
553  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
554 
556  50, // TimerValue
557  &Port,
558  sizeof(Port),
560 
561  return MP_STATUS_SUCCESS;
562 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
USBPORT_REGISTRATION_PACKET RegPacket
Definition: usbehci.c:16
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
VOID NTAPI EHCI_RH_PortResumeComplete(IN PVOID ehciExtension, IN PVOID Context)
Definition: roothub.c:509
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
PUSBPORT_REQUEST_ASYNC_CALLBACK UsbPortRequestAsyncCallback
Definition: usbmport.h:620
void DPRINT(...)
Definition: polytest.cpp:61
ULONG ResetPortBits
Definition: usbehci.h:197
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_ClearFeaturePortSuspendChange()

MPSTATUS NTAPI EHCI_RH_ClearFeaturePortSuspendChange ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 635 of file roothub.c.

637 {
638  PEHCI_EXTENSION EhciExtension = ehciExtension;
639 
640  DPRINT("EHCI_RH_ClearFeaturePortSuspendChange: Port - %x\n", Port);
641  ASSERT(Port != 0);
642 
643  EhciExtension->SuspendPortBits &= ~(1 << (Port - 1));
644  return MP_STATUS_SUCCESS;
645 }
CPPORT Port[4]
Definition: headless.c:34
void DPRINT(...)
Definition: polytest.cpp:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134
ULONG SuspendPortBits
Definition: usbehci.h:196

Referenced by DriverEntry().

◆ EHCI_RH_DisableIrq()

VOID NTAPI EHCI_RH_DisableIrq ( IN PVOID  ohciExtension)

Definition at line 674 of file roothub.c.

675 {
676  PEHCI_EXTENSION EhciExtension = ehciExtension;
677  PULONG IntrStsReg;
678  EHCI_INTERRUPT_ENABLE IntrSts;
679 
680  DPRINT_RH("EHCI_RH_DisableIrq: ... \n");
681 
682  IntrStsReg = &EhciExtension->OperationalRegs->HcInterruptEnable.AsULONG;
683  IntrSts.AsULONG = READ_REGISTER_ULONG(IntrStsReg);
684 
685  EhciExtension->InterruptMask.PortChangeInterrupt = 0;
686  IntrSts.PortChangeInterrupt = 0;
687 
688  if (IntrSts.Interrupt)
689  WRITE_REGISTER_ULONG(IntrStsReg, IntrSts.AsULONG);
690 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
EHCI_INTERRUPT_ENABLE InterruptMask
Definition: usbehci.h:183
EHCI_INTERRUPT_ENABLE HcInterruptEnable
Definition: hardware.h:176
unsigned int * PULONG
Definition: retypes.h:1

Referenced by DriverEntry().

◆ EHCI_RH_EnableIrq()

VOID NTAPI EHCI_RH_EnableIrq ( IN PVOID  ohciExtension)

Definition at line 694 of file roothub.c.

695 {
696  PEHCI_EXTENSION EhciExtension = ehciExtension;
697  PULONG IntrStsReg;
698  EHCI_INTERRUPT_ENABLE IntrSts;
699 
700  DPRINT_RH("EHCI_RH_EnableIrq: ... \n");
701 
702  IntrStsReg = &EhciExtension->OperationalRegs->HcInterruptEnable.AsULONG;
703  IntrSts.AsULONG = READ_REGISTER_ULONG(IntrStsReg);
704 
705  EhciExtension->InterruptMask.PortChangeInterrupt = 1;
706  IntrSts.PortChangeInterrupt = 1;
707 
708  if (IntrSts.Interrupt)
709  WRITE_REGISTER_ULONG(IntrStsReg, IntrSts.AsULONG);
710 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
EHCI_INTERRUPT_ENABLE InterruptMask
Definition: usbehci.h:183
EHCI_INTERRUPT_ENABLE HcInterruptEnable
Definition: hardware.h:176
unsigned int * PULONG
Definition: retypes.h:1

Referenced by DriverEntry().

◆ EHCI_RH_GetHubStatus()

MPSTATUS NTAPI EHCI_RH_GetHubStatus ( IN PVOID  ohciExtension,
IN PUSB_HUB_STATUS_AND_CHANGE  HubStatus 
)

Definition at line 269 of file roothub.c.

271 {
272  DPRINT_RH("EHCI_RH_GetHubStatus: ... \n");
273  HubStatus->AsUlong32 = 0;
274  return MP_STATUS_SUCCESS;
275 }
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_GetPortStatus()

MPSTATUS NTAPI EHCI_RH_GetPortStatus ( IN PVOID  ohciExtension,
IN USHORT  Port,
IN PUSB_PORT_STATUS_AND_CHANGE  PortStatus 
)

Definition at line 187 of file roothub.c.

190 {
191  PEHCI_EXTENSION EhciExtension = ehciExtension;
192  PULONG PortStatusReg;
195  ULONG PortMaskBits;
196 
197  ASSERT(Port != 0);
198 
199  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
200  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
201 
202  if (PortSC.CurrentConnectStatus)
203  {
204  DPRINT_RH("EHCI_RH_GetPortStatus: Port - %x, PortSC.AsULONG - %X\n",
205  Port,
206  PortSC.AsULONG);
207  }
208 
209  PortStatus->AsUlong32 = 0;
210 
213  (PortSC.PortEnabledDisabled | PortSC.Suspend) && // Enable or Suspend
214  PortSC.CurrentConnectStatus == 1) // Device is present
215  {
216  DPRINT("EHCI_RH_GetPortStatus: LowSpeed device detected\n");
217  PortSC.PortOwner = EHCI_PORT_OWNER_COMPANION_CONTROLLER; // release ownership
218  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
219  return MP_STATUS_SUCCESS;
220  }
221 
222  status.AsUlong32 = 0;
223 
224  status.PortStatus.Usb20PortStatus.CurrentConnectStatus = PortSC.CurrentConnectStatus;
225  status.PortStatus.Usb20PortStatus.PortEnabledDisabled = PortSC.PortEnabledDisabled;
226  status.PortStatus.Usb20PortStatus.Suspend = PortSC.Suspend;
227  status.PortStatus.Usb20PortStatus.OverCurrent = PortSC.OverCurrentActive;
228  status.PortStatus.Usb20PortStatus.Reset = PortSC.PortReset;
229  status.PortStatus.Usb20PortStatus.PortPower = PortSC.PortPower;
231  status.PortStatus.Usb20PortStatus.Reserved1 = USB20_PORT_STATUS_RESERVED1_OWNED_BY_COMPANION;
232 
233  status.PortChange.Usb20PortChange.PortEnableDisableChange = PortSC.PortEnableDisableChange;
234  status.PortChange.Usb20PortChange.OverCurrentIndicatorChange = PortSC.OverCurrentChange;
235 
236  PortMaskBits = 1 << (Port - 1);
237 
238  if (status.PortStatus.Usb20PortStatus.CurrentConnectStatus)
239  status.PortStatus.Usb20PortStatus.LowSpeedDeviceAttached = 0;
240 
241  status.PortStatus.Usb20PortStatus.HighSpeedDeviceAttached = 1;
242 
243  if (PortSC.ConnectStatusChange)
244  EhciExtension->ConnectPortBits |= PortMaskBits;
245 
246  if (EhciExtension->FinishResetPortBits & PortMaskBits)
247  status.PortChange.Usb20PortChange.ResetChange = 1;
248 
249  if (EhciExtension->ConnectPortBits & PortMaskBits)
250  status.PortChange.Usb20PortChange.ConnectStatusChange = 1;
251 
252  if (EhciExtension->SuspendPortBits & PortMaskBits)
253  status.PortChange.Usb20PortChange.SuspendChange = 1;
254 
255  *PortStatus = status;
256 
257  if (status.PortStatus.Usb20PortStatus.CurrentConnectStatus)
258  {
259  DPRINT_RH("EHCI_RH_GetPortStatus: Port - %x, status.AsULONG - %X\n",
260  Port,
261  status.AsUlong32);
262  }
263 
264  return MP_STATUS_SUCCESS;
265 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
ULONG ConnectPortBits
Definition: usbehci.h:195
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
void DPRINT(...)
Definition: polytest.cpp:61
#define USB20_PORT_STATUS_RESERVED1_OWNED_BY_COMPANION
Definition: usbmport.h:288
ULONG FinishResetPortBits
Definition: usbehci.h:198
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
Definition: hubbusif.h:40
#define EHCI_LINE_STATUS_K_STATE_LOW_SPEED
Definition: hardware.h:137
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134
unsigned int ULONG
Definition: retypes.h:1
#define EHCI_PORT_OWNER_COMPANION_CONTROLLER
Definition: hardware.h:138
ULONG SuspendPortBits
Definition: usbehci.h:196
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by DriverEntry().

◆ EHCI_RH_GetRootHubData()

VOID NTAPI EHCI_RH_GetRootHubData ( IN PVOID  ohciExtension,
IN PVOID  rootHubData 
)

Definition at line 132 of file roothub.c.

134 {
135  PEHCI_EXTENSION EhciExtension = ehciExtension;
136  PUSBPORT_ROOT_HUB_DATA RootHubData;
137  USBPORT_HUB_20_CHARACTERISTICS HubCharacteristics;
138 
139  DPRINT_RH("EHCI_RH_GetRootHubData: EhciExtension - %p, rootHubData - %p\n",
140  EhciExtension,
141  rootHubData);
142 
143  RootHubData = rootHubData;
144 
145  RootHubData->NumberOfPorts = EhciExtension->NumberOfPorts;
146 
147  HubCharacteristics.AsUSHORT = 0;
148 
149  /* Logical Power Switching Mode */
150  if (EhciExtension->PortPowerControl == 1)
151  {
152  /* Individual port power switching */
153  HubCharacteristics.PowerControlMode = 1;
154  }
155  else
156  {
157  /* Ganged power switching (all portsí power at once) */
158  HubCharacteristics.PowerControlMode = 0;
159  }
160 
161  HubCharacteristics.NoPowerSwitching = 0;
162 
163  /* EHCI RH is not part of a compound device */
164  HubCharacteristics.PartOfCompoundDevice = 0;
165 
166  /* Global Over-current Protection */
167  HubCharacteristics.OverCurrentProtectionMode = 0;
168 
169  RootHubData->HubCharacteristics.Usb20HubCharacteristics = HubCharacteristics;
170 
171  RootHubData->PowerOnToPowerGood = 2; // Time (in 2 ms intervals)
172  RootHubData->HubControlCurrent = 0;
173 }
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
USBPORT_HUB_CHARACTERISTICS HubCharacteristics
Definition: usbmport.h:697
USHORT PortPowerControl
Definition: usbehci.h:182
USBPORT_HUB_20_CHARACTERISTICS Usb20HubCharacteristics
Definition: usbmport.h:689
USHORT NumberOfPorts
Definition: usbehci.h:181

Referenced by DriverEntry().

◆ EHCI_RH_GetStatus()

MPSTATUS NTAPI EHCI_RH_GetStatus ( IN PVOID  ohciExtension,
IN PUSHORT  Status 
)

Definition at line 177 of file roothub.c.

179 {
180  DPRINT_RH("EHCI_RH_GetStatus: ... \n");
182  return MP_STATUS_SUCCESS;
183 }
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
Status
Definition: gdiplustypes.h:24
#define USB_GETSTATUS_SELF_POWERED
Definition: usb100.h:45
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_SetFeaturePortEnable()

MPSTATUS NTAPI EHCI_RH_SetFeaturePortEnable ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 425 of file roothub.c.

427 {
428  DPRINT_RH("EHCI_RH_SetFeaturePortEnable: Not supported\n");
429  ASSERT(Port != 0);
430  return MP_STATUS_SUCCESS;
431 }
CPPORT Port[4]
Definition: headless.c:34
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_SetFeaturePortPower()

MPSTATUS NTAPI EHCI_RH_SetFeaturePortPower ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 399 of file roothub.c.

401 {
402  PEHCI_EXTENSION EhciExtension = ehciExtension;
403  PULONG PortStatusReg;
405 
406  DPRINT_RH("EHCI_RH_SetFeaturePortPower: Port - %x\n", Port);
407  ASSERT(Port != 0);
408 
409  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
410 
411  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
412 
413  PortSC.ConnectStatusChange = 0;
414  PortSC.PortEnableDisableChange = 0;
415  PortSC.OverCurrentChange = 0;
416  PortSC.PortPower = 1;
417 
418  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
419 
420  return MP_STATUS_SUCCESS;
421 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
#define DPRINT_RH(...)
Definition: dbg_ehci.h:46
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry(), and EHCI_StartController().

◆ EHCI_RH_SetFeaturePortReset()

MPSTATUS NTAPI EHCI_RH_SetFeaturePortReset ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 364 of file roothub.c.

366 {
367  PEHCI_EXTENSION EhciExtension = ehciExtension;
368  PULONG PortStatusReg;
370 
371  DPRINT("EHCI_RH_SetFeaturePortReset: Port - %x\n", Port);
372  ASSERT(Port != 0);
373 
374  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
375 
376  EhciExtension->ResetPortBits |= 1 << (Port - 1);
377 
378  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
379 
380  PortSC.ConnectStatusChange = 0;
381  PortSC.PortEnabledDisabled = 0;
382  PortSC.PortEnableDisableChange = 0;
383  PortSC.OverCurrentChange = 0;
384  PortSC.PortReset = 1;
385 
386  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
387 
389  50, // TimerValue
390  &Port,
391  sizeof(Port),
393 
394  return MP_STATUS_SUCCESS;
395 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
USBPORT_REGISTRATION_PACKET RegPacket
Definition: usbehci.c:16
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
PUSBPORT_REQUEST_ASYNC_CALLBACK UsbPortRequestAsyncCallback
Definition: usbmport.h:620
void DPRINT(...)
Definition: polytest.cpp:61
ULONG ResetPortBits
Definition: usbehci.h:197
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI EHCI_RH_PortResetComplete(IN PVOID ehciExtension, IN PVOID Context)
Definition: roothub.c:318
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134

Referenced by DriverEntry().

◆ EHCI_RH_SetFeaturePortSuspend()

MPSTATUS NTAPI EHCI_RH_SetFeaturePortSuspend ( IN PVOID  ohciExtension,
IN USHORT  Port 
)

Definition at line 435 of file roothub.c.

437 {
438  PEHCI_EXTENSION EhciExtension = ehciExtension;
439  PULONG PortStatusReg;
441 
442  DPRINT("EHCI_RH_SetFeaturePortSuspend: Port - %x\n", Port);
443  ASSERT(Port != 0);
444 
445  PortStatusReg = &EhciExtension->OperationalRegs->PortControl[Port - 1].AsULONG;
446 
447  PortSC.AsULONG = READ_REGISTER_ULONG(PortStatusReg);
448 
449  PortSC.ConnectStatusChange = 0;
450  PortSC.PortEnableDisableChange = 0;
451  PortSC.OverCurrentChange = 0;
452  PortSC.Suspend = 1;
453 
454  WRITE_REGISTER_ULONG(PortStatusReg, PortSC.AsULONG);
456 
457  return MP_STATUS_SUCCESS;
458 }
EHCI_PORT_STATUS_CONTROL PortControl[15]
Definition: hardware.h:183
CPPORT Port[4]
Definition: headless.c:34
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
PEHCI_HW_REGISTERS OperationalRegs
Definition: usbehci.h:176
void DPRINT(...)
Definition: polytest.cpp:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
#define MP_STATUS_SUCCESS
Definition: usbmport.h:134
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:95

Referenced by DriverEntry().

Variable Documentation

◆ RegPacket

Definition at line 16 of file usbehci.c.