ReactOS  0.4.14-dev-358-gbef841c
CUSBHardwareDevice Class Reference
Inheritance diagram for CUSBHardwareDevice:
Collaboration diagram for CUSBHardwareDevice:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
IMP_IUSBHARDWAREDEVICE IMP_IUSBEHCIHARDWARE BOOLEAN InterruptService ()
 
VOID PrintCapabilities ()
 
NTSTATUS StartController ()
 
NTSTATUS StopController ()
 
NTSTATUS ResetController ()
 
 CUSBHardwareDevice (IUnknown *OuterUnknown)
 
virtual ~CUSBHardwareDevice ()
 
STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
IMP_IUSBHARDWAREDEVICE IMP_IUSBOHCIHARDWAREDEVICE NTSTATUS StartController ()
 
NTSTATUS StopController ()
 
BOOLEAN InterruptService ()
 
NTSTATUS InitializeController ()
 
NTSTATUS AllocateEndpointDescriptor (OUT POHCI_ENDPOINT_DESCRIPTOR *OutDescriptor)
 
 CUSBHardwareDevice (IUnknown *OuterUnknown)
 
virtual ~CUSBHardwareDevice ()
 
STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
IMP_IUSBHARDWAREDEVICE IMP_IUHCIHARDWAREDEVICE NTSTATUS StartController ()
 
NTSTATUS StopController ()
 
NTSTATUS ResetController ()
 
VOID GlobalReset ()
 
BOOLEAN InterruptService ()
 
NTSTATUS InitializeController ()
 
VOID WriteRegister8 (IN ULONG Register, IN UCHAR value)
 
VOID WriteRegister16 (ULONG Register, USHORT Value)
 
VOID WriteRegister32 (ULONG Register, ULONG Value)
 
UCHAR ReadRegister8 (ULONG Register)
 
USHORT ReadRegister16 (ULONG Register)
 
ULONG ReadRegister32 (ULONG Register)
 
 CUSBHardwareDevice (IUnknown *OuterUnknown)
 
virtual ~CUSBHardwareDevice ()
 

Protected Member Functions

ULONG EHCI_READ_REGISTER_ULONG (ULONG Offset)
 
VOID EHCI_WRITE_REGISTER_ULONG (ULONG Offset, ULONG Value)
 

Protected Attributes

LONG m_Ref
 
PDRIVER_OBJECT m_DriverObject
 
PDEVICE_OBJECT m_PhysicalDeviceObject
 
PDEVICE_OBJECT m_FunctionalDeviceObject
 
PDEVICE_OBJECT m_NextDeviceObject
 
KSPIN_LOCK m_Lock
 
PKINTERRUPT m_Interrupt
 
KDPC m_IntDpcObject
 
PVOID VirtualBase
 
PHYSICAL_ADDRESS PhysicalAddress
 
PULONG m_Base
 
PDMA_ADAPTER m_Adapter
 
ULONG m_MapRegisters
 
EHCI_CAPS m_Capabilities
 
USHORT m_VendorID
 
USHORT m_DeviceID
 
PQUEUE_HEAD AsyncQueueHead
 
PEHCIQUEUE m_UsbQueue
 
PDMAMEMORYMANAGER m_MemoryManager
 
HD_INIT_CALLBACKm_SCECallBack
 
PVOID m_SCEContext
 
BOOLEAN m_DoorBellRingInProgress
 
WORK_QUEUE_ITEM m_StatusChangeWorkItem
 
volatile LONG m_StatusChangeWorkItemStatus
 
ULONG m_SyncFramePhysAddr
 
BUS_INTERFACE_STANDARD m_BusInterface
 
BOOLEAN m_PortResetInProgress [0xF]
 
POHCIQUEUE m_UsbQueue
 
POHCIHCCA m_HCCA
 
PHYSICAL_ADDRESS m_HCCAPhysicalAddress
 
POHCI_ENDPOINT_DESCRIPTOR m_ControlEndpointDescriptor
 
POHCI_ENDPOINT_DESCRIPTOR m_BulkEndpointDescriptor
 
POHCI_ENDPOINT_DESCRIPTOR m_IsoEndpointDescriptor
 
POHCI_ENDPOINT_DESCRIPTOR m_InterruptEndpoints [OHCI_STATIC_ENDPOINT_COUNT]
 
ULONG m_NumberOfPorts
 
ULONG m_IntervalValue
 
PUHCIQUEUE m_UsbQueue
 
ULONG m_InterruptMask
 
ULONG m_PortResetChange
 
PULONG m_FrameList
 
PHYSICAL_ADDRESS m_FrameListPhysicalAddress
 
PUSHORT m_FrameBandwidth
 
PUHCI_QUEUE_HEAD m_QueueHead [5]
 
PHYSICAL_ADDRESS m_StrayDescriptorPhysicalAddress
 
PUHCI_TRANSFER_DESCRIPTOR m_StrayDescriptor
 
KTIMER m_SCETimer
 
KDPC m_SCETimerDpc
 

Friends

BOOLEAN NTAPI InterruptServiceRoutine (IN PKINTERRUPT Interrupt, IN PVOID ServiceContext)
 
VOID NTAPI EhciDeferredRoutine (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
VOID NTAPI StatusChangeWorkItemRoutine (PVOID Context)
 
BOOLEAN NTAPI InterruptServiceRoutine (IN PKINTERRUPT Interrupt, IN PVOID ServiceContext)
 
VOID NTAPI OhciDeferredRoutine (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
VOID NTAPI StatusChangeWorkItemRoutine (PVOID Context)
 
BOOLEAN NTAPI InterruptServiceRoutine (IN PKINTERRUPT Interrupt, IN PVOID ServiceContext)
 
VOID NTAPI UhciDeferredRoutine (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
VOID NTAPI TimerDpcRoutine (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
VOID NTAPI StatusChangeWorkItemRoutine (PVOID Context)
 

Detailed Description

Definition at line 36 of file hardware.cpp.

Constructor & Destructor Documentation

◆ CUSBHardwareDevice() [1/3]

CUSBHardwareDevice::CUSBHardwareDevice ( IUnknown OuterUnknown)
inline

Definition at line 73 of file hardware.cpp.

73 {}

◆ ~CUSBHardwareDevice() [1/3]

virtual CUSBHardwareDevice::~CUSBHardwareDevice ( )
inlinevirtual

Definition at line 74 of file hardware.cpp.

74 {}

◆ CUSBHardwareDevice() [2/3]

CUSBHardwareDevice::CUSBHardwareDevice ( IUnknown OuterUnknown)
inline

Definition at line 74 of file hardware.cpp.

74 {}

◆ ~CUSBHardwareDevice() [2/3]

virtual CUSBHardwareDevice::~CUSBHardwareDevice ( )
inlinevirtual

Definition at line 75 of file hardware.cpp.

75 {}

◆ CUSBHardwareDevice() [3/3]

CUSBHardwareDevice::CUSBHardwareDevice ( IUnknown OuterUnknown)
inline

Definition at line 93 of file hardware.cpp.

93 {}

◆ ~CUSBHardwareDevice() [3/3]

virtual CUSBHardwareDevice::~CUSBHardwareDevice ( )
inlinevirtual

Definition at line 94 of file hardware.cpp.

94 {}

Member Function Documentation

◆ AllocateEndpointDescriptor()

NTSTATUS CUSBHardwareDevice::AllocateEndpointDescriptor ( OUT POHCI_ENDPOINT_DESCRIPTOR OutDescriptor)

Definition at line 783 of file hardware.cpp.

785 {
787  PHYSICAL_ADDRESS DescriptorAddress;
789 
790  //
791  // allocate descriptor
792  //
793  Status = m_MemoryManager->Allocate(sizeof(OHCI_ENDPOINT_DESCRIPTOR), (PVOID*)&Descriptor, &DescriptorAddress);
794  if (!NT_SUCCESS(Status))
795  {
796  //
797  // failed to allocate descriptor
798  //
799  return Status;
800  }
801 
802  //
803  // initialize descriptor
804  //
806  Descriptor->HeadPhysicalDescriptor = 0;
807  Descriptor->NextPhysicalEndpoint = 0;
808  Descriptor->TailPhysicalDescriptor = 0;
809  Descriptor->PhysicalAddress.QuadPart = DescriptorAddress.QuadPart;
810 
811  //
812  // store result
813  //
814  *OutDescriptor = Descriptor;
815 
816  //
817  // done
818  //
819  return STATUS_SUCCESS;
820 }
LONG NTSTATUS
Definition: precomp.h:26
PDMAMEMORYMANAGER m_MemoryManager
Definition: hardware.cpp:95
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define OHCI_ENDPOINT_SKIP
Definition: hardware.h:229
Status
Definition: gdiplustypes.h:24
return STATUS_SUCCESS
Definition: btrfs.c:2938
LONGLONG QuadPart
Definition: typedefs.h:112
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

Referenced by InitializeController().

◆ EHCI_READ_REGISTER_ULONG()

ULONG CUSBHardwareDevice::EHCI_READ_REGISTER_ULONG ( ULONG  Offset)
protected

Definition at line 237 of file hardware.cpp.

238 {
240 }
unsigned char * PUCHAR
Definition: retypes.h:3
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned int * PULONG
Definition: retypes.h:1

Referenced by StartController(), and StopController().

◆ EHCI_WRITE_REGISTER_ULONG()

VOID CUSBHardwareDevice::EHCI_WRITE_REGISTER_ULONG ( ULONG  Offset,
ULONG  Value 
)
protected

Definition at line 243 of file hardware.cpp.

244 {
246 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
unsigned char * PUCHAR
Definition: retypes.h:3
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned int * PULONG
Definition: retypes.h:1

Referenced by StartController(), and StopController().

◆ GlobalReset()

VOID CUSBHardwareDevice::GlobalReset ( )

Definition at line 554 of file hardware.cpp.

555 {
557 
558  //
559  // back up start of modify register
560  //
561  ASSERT(m_Base);
563 
564  //
565  // perform global reset
566  //
568 
569  //
570  // delay is 10 ms
571  //
572  Timeout.QuadPart = 10;
573  DPRINT("Waiting %lu milliseconds for global reset\n", Timeout.LowPart);
574 
575  //
576  // convert to 100 ns units (absolute)
577  //
578  Timeout.QuadPart *= -10000;
579 
580  //
581  // perform the wait
582  //
584 
585  //
586  // clear command register
587  //
590 
591 
592  //
593  // restore start of modify register
594  //
596 }
unsigned char * PUCHAR
Definition: retypes.h:3
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
void DPRINT(...)
Definition: polytest.cpp:61
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID WriteRegister16(ULONG Register, USHORT Value)
Definition: hardware.cpp:1348
static ULONG Timeout
Definition: ping.c:61
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
#define UHCI_USBCMD_GRESET
Definition: hardware.h:39
USHORT ReadRegister16(ULONG Register)
Definition: hardware.cpp:1374
#define UHCI_SOFMOD
Definition: hardware.h:32
#define UHCI_USBCMD
Definition: hardware.h:27
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99

◆ InitializeController() [1/2]

NTSTATUS CUSBHardwareDevice::InitializeController ( )

Definition at line 876 of file hardware.cpp.

877 {
879  ULONG Index, Interval, IntervalIndex, InsertIndex;
881 
882  //
883  // first allocate the hcca area
884  //
886  if (!NT_SUCCESS(Status))
887  {
888  //
889  // no memory
890  //
891  return Status;
892  }
893 
894  //
895  // now allocate an endpoint for control transfers
896  // this endpoint will never be removed
897  //
899  if (!NT_SUCCESS(Status))
900  {
901  //
902  // no memory
903  //
904  return Status;
905  }
906 
907  //
908  // now allocate an endpoint for bulk transfers
909  // this endpoint will never be removed
910  //
912  if (!NT_SUCCESS(Status))
913  {
914  //
915  // no memory
916  //
917  return Status;
918  }
919 
920  //
921  // now allocate an endpoint for iso transfers
922  // this endpoint will never be removed
923  //
925  if (!NT_SUCCESS(Status))
926  {
927  //
928  // no memory
929  //
930  return Status;
931  }
932 
933  //
934  // now allocate endpoint descriptors for iso / interrupt transfers interval is 1,2,4,8,16,32
935  //
937  {
938  //
939  // allocate endpoint descriptor
940  //
942  if (!NT_SUCCESS(Status))
943  {
944  //
945  // no memory
946  //
947  return Status;
948  }
949 
950  //
951  // save in array
952  //
954  }
955 
956 
957  //
958  // now link the descriptors, taken from Haiku
959  //
961  IntervalIndex = OHCI_STATIC_ENDPOINT_COUNT - 1;
962  while (Interval > 1)
963  {
964  InsertIndex = Interval / 2;
965  while (InsertIndex < OHCI_BIGGEST_INTERVAL)
966  {
967  //
968  // assign endpoint address
969  //
970  m_HCCA->InterruptTable[InsertIndex] = m_InterruptEndpoints[IntervalIndex]->PhysicalAddress.LowPart;
971  InsertIndex += Interval;
972  }
973 
974  IntervalIndex--;
975  Interval /= 2;
976  }
977 
978  //
979  // link all endpoint descriptors to first descriptor in array
980  //
983  {
984  //
985  // link descriptor
986  //
988  }
989 
990  //
991  // Now link the first endpoint to the isochronous endpoint
992  //
994 
995  //
996  // set iso endpoint type
997  //
999 
1000  //
1001  // done
1002  //
1003  return STATUS_SUCCESS;
1004 }
#define OHCI_STATIC_ENDPOINT_COUNT
Definition: hardware.h:193
POHCI_ENDPOINT_DESCRIPTOR m_IsoEndpointDescriptor
Definition: hardware.cpp:98
LONG NTSTATUS
Definition: precomp.h:26
POHCI_ENDPOINT_DESCRIPTOR m_BulkEndpointDescriptor
Definition: hardware.cpp:97
ULONG InterruptTable[OHCI_NUMBER_OF_INTERRUPTS]
Definition: hardware.h:198
#define OHCI_BIGGEST_INTERVAL
Definition: hardware.h:194
PDMAMEMORYMANAGER m_MemoryManager
Definition: hardware.cpp:95
DWORD Interval
Definition: netstat.c:33
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const UCHAR Index[8]
Definition: usbohci.c:18
ULONG LowPart
Definition: typedefs.h:104
Status
Definition: gdiplustypes.h:24
POHCIHCCA m_HCCA
Definition: hardware.cpp:94
NTSTATUS AllocateEndpointDescriptor(OUT POHCI_ENDPOINT_DESCRIPTOR *OutDescriptor)
Definition: hardware.cpp:783
POHCI_ENDPOINT_DESCRIPTOR m_InterruptEndpoints[OHCI_STATIC_ENDPOINT_COUNT]
Definition: hardware.cpp:99
#define OHCI_ENDPOINT_ISOCHRONOUS_FORMAT
Definition: hardware.h:241
PHYSICAL_ADDRESS PhysicalAddress
Definition: hardware.h:221
unsigned int ULONG
Definition: retypes.h:1
POHCI_ENDPOINT_DESCRIPTOR m_ControlEndpointDescriptor
Definition: hardware.cpp:96
PHYSICAL_ADDRESS m_HCCAPhysicalAddress
Definition: hardware.cpp:95
return STATUS_SUCCESS
Definition: btrfs.c:2938
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

◆ InitializeController() [2/2]

NTSTATUS CUSBHardwareDevice::InitializeController ( )

◆ InterruptService() [1/3]

IMP_IUSBHARDWAREDEVICE IMP_IUSBEHCIHARDWARE BOOLEAN CUSBHardwareDevice::InterruptService ( )

◆ InterruptService() [2/3]

BOOLEAN CUSBHardwareDevice::InterruptService ( )

◆ InterruptService() [3/3]

BOOLEAN CUSBHardwareDevice::InterruptService ( )

◆ PrintCapabilities()

VOID CUSBHardwareDevice::PrintCapabilities ( )

Definition at line 249 of file hardware.cpp.

250 {
252  {
253  DPRINT1("Controller EHCI has Port Power Control\n");
254  }
255 
256  DPRINT1("Controller Port Routing Rules %lu\n", m_Capabilities.HCSParams.PortRouteRules);
257  DPRINT1("Number of Ports per Companion Controller %lu\n", m_Capabilities.HCSParams.PortPerCHC);
258  DPRINT1("Number of Companion Controller %lu\n", m_Capabilities.HCSParams.CHCCount);
259 
261  {
262  DPRINT1("Controller has Port Indicators Support\n");
263  }
264 
266  {
267  DPRINT1("Controller has Debug Port Support At Port %x\n", m_Capabilities.HCSParams.DbgPortNum);
268  }
269 
271  {
272  DPRINT1("Controller has Extended Capabilities Support\n");
273  }
274 
276  {
277  DPRINT1("Controller supports Asynchronous Schedule Park\n");
278  }
279 
281  {
282  DPRINT1("Controller supports Programmable Frame List Size\n");
283  }
284 
286  {
287  DPRINT1("Controller uses 64-Bit Addressing\n");
288  }
289 }
ULONG PortPowerControl
Definition: hardware.h:263
ULONG PortRouteRules
Definition: hardware.h:265
EHCI_HCS_CONTENT HCSParams
Definition: hardware.h:293
ULONG PortIndicator
Definition: hardware.h:268
EHCI_HCC_CONTENT HCCParams
Definition: hardware.h:298
#define DPRINT1
Definition: precomp.h:8
EHCI_CAPS m_Capabilities
Definition: hardware.cpp:90
ULONG VarFrameList
Definition: hardware.h:278

◆ QueryInterface() [1/3]

STDMETHODIMP CUSBHardwareDevice::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

◆ QueryInterface() [2/3]

STDMETHODIMP CUSBHardwareDevice::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

◆ QueryInterface() [3/3]

STDMETHODIMP CUSBHardwareDevice::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

◆ ReadRegister16()

USHORT CUSBHardwareDevice::ReadRegister16 ( ULONG  Register)

Definition at line 1374 of file hardware.cpp.

1376 {
1377  return READ_PORT_USHORT((PUSHORT)((PUCHAR)m_Base + Register));
1378 }
unsigned char * PUCHAR
Definition: retypes.h:3
USHORT NTAPI READ_PORT_USHORT(IN PUSHORT Port)
Definition: portio.c:63
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by GlobalReset().

◆ ReadRegister32()

ULONG CUSBHardwareDevice::ReadRegister32 ( ULONG  Register)

Definition at line 1382 of file hardware.cpp.

1384 {
1385  return READ_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register));
1386 }
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG NTAPI READ_PORT_ULONG(IN PULONG Port)
Definition: portio.c:70
unsigned int * PULONG
Definition: retypes.h:1

◆ ReadRegister8()

UCHAR CUSBHardwareDevice::ReadRegister8 ( ULONG  Register)

Definition at line 1366 of file hardware.cpp.

1368 {
1369  return READ_PORT_UCHAR((PUCHAR)((PUCHAR)m_Base + Register));
1370 }
unsigned char * PUCHAR
Definition: retypes.h:3
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528

◆ ResetController() [1/2]

NTSTATUS CUSBHardwareDevice::ResetController ( void  )

Definition at line 866 of file hardware.cpp.

867 {
868  EHCI_USBCMD_CONTENT UsbCmd;
869  ULONG FailSafe;
870 
871  GetCommandRegister(&UsbCmd);
872  UsbCmd.HCReset = TRUE;
873  SetCommandRegister(&UsbCmd);
874 
875  for (FailSafe = 100; FailSafe > 1; FailSafe--)
876  {
878  GetCommandRegister(&UsbCmd);
879  if (!UsbCmd.HCReset)
880  break;
881  }
882 
883  if (UsbCmd.HCReset)
884  {
885  DPRINT1("EHCI ERROR: Controller is not responding to reset request!\n");
886  return STATUS_UNSUCCESSFUL;
887  }
888 
889  return STATUS_SUCCESS;
890 }
#define TRUE
Definition: types.h:120
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99

Referenced by StartController().

◆ ResetController() [2/2]

NTSTATUS CUSBHardwareDevice::ResetController ( )

◆ StartController() [1/3]

IMP_IUSBHARDWAREDEVICE IMP_IUSBOHCIHARDWAREDEVICE NTSTATUS CUSBHardwareDevice::StartController ( )

◆ StartController() [2/3]

NTSTATUS CUSBHardwareDevice::StartController ( void  )

Definition at line 550 of file hardware.cpp.

551 {
552  EHCI_USBCMD_CONTENT UsbCmd;
553  ULONG UsbSts, FailSafe, ExtendedCapsSupport, Caps, Index;
554  UCHAR Value;
556 
557  //
558  // are extended caps supported
559  //
560  ExtendedCapsSupport = (m_Capabilities.HCCParamsLong >> EHCI_ECP_SHIFT) & EHCI_ECP_MASK;
561  if (ExtendedCapsSupport)
562  {
563  DPRINT1("[EHCI] Extended Caps Support detected!\n");
564 
565  //
566  // sanity check
567  //
568  ASSERT(ExtendedCapsSupport >= PCI_COMMON_HDR_LENGTH);
569  m_BusInterface.GetBusData(m_BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Caps, ExtendedCapsSupport, sizeof(ULONG));
570 
571  //
572  // OS Handoff Synchronization support capability. EHCI 5.1
573  //
575  {
576  //
577  // is it bios owned
578  //
579  if ((Caps & EHCI_LEGSUP_BIOSOWNED))
580  {
581  DPRINT1("[EHCI] Controller is BIOS owned, acquiring control\n");
582 
583  //
584  // acquire ownership
585  //
586  Value = 1;
588 
589  for(Index = 0; Index < 20; Index++)
590  {
591  //
592  // get status
593  //
594  m_BusInterface.GetBusData(m_BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Caps, ExtendedCapsSupport, sizeof(ULONG));
595  if ((Caps & EHCI_LEGSUP_BIOSOWNED))
596  {
597  //
598  // lets wait a bit
599  //
600  Timeout.QuadPart = 50;
601  DPRINT1("Waiting %lu milliseconds for port reset\n", Timeout.LowPart);
602 
603  //
604  // convert to 100 ns units (absolute)
605  //
606  Timeout.QuadPart *= -10000;
607 
608  //
609  // perform the wait
610  //
612  }
613  }
614  if ((Caps & EHCI_LEGSUP_BIOSOWNED))
615  {
616  //
617  // failed to acquire ownership
618  //
619  DPRINT1("[EHCI] failed to acquire ownership\n");
620  }
621  else if ((Caps & EHCI_LEGSUP_OSOWNED))
622  {
623  //
624  // HC OS Owned Semaphore EHCI 2.1.7
625  //
626  DPRINT1("[EHCI] acquired ownership\n");
627  }
628 #if 0
629  //
630  // explicitly clear the bios owned flag 2.1.7
631  //
632  Value = 0;
634 
635  //
636  // clear SMI interrupt EHCI 2.1.8
637  //
638  Caps = 4;
639  m_BusInterface.SetBusData(m_BusInterface.Context, PCI_WHICHSPACE_CONFIG, &Caps, ExtendedCapsSupport+4, sizeof(ULONG));
640 #endif
641  }
642  }
643  }
644 
645  //
646  // get command register
647  //
648  GetCommandRegister(&UsbCmd);
649 
650  //
651  // disable running schedules
652  //
653  UsbCmd.PeriodicEnable = FALSE;
654  UsbCmd.AsyncEnable = FALSE;
655  SetCommandRegister(&UsbCmd);
656 
657  //
658  // Wait for execution to start
659  //
660  for (FailSafe = 100; FailSafe > 1; FailSafe--)
661  {
664 
665  if (!(UsbSts & EHCI_STS_PSS) && (UsbSts & EHCI_STS_ASS))
666  {
667  break;
668  }
669  }
670 
671  if ((UsbSts & (EHCI_STS_PSS | EHCI_STS_ASS)))
672  {
673  DPRINT1("Failed to stop running schedules %x\n", UsbSts);
674  //ASSERT(FALSE);
675  }
676 
677 
678  //
679  // Stop the controller if its running
680  //
682  if (!(UsbSts & EHCI_STS_HALT))
683  {
684  DPRINT1("Stopping Controller %x\n", UsbSts);
685  StopController();
686  }
687 
688  //
689  // Reset the controller
690  //
691  ResetController();
692 
693  //
694  // check caps
695  //
697  {
698  //
699  // disable 64-bit addressing
700  //
702  }
703 
704  //
705  // Enable Interrupts and start execution
706  //
709 
711 
713 
714  DPRINT1("Interrupt Mask %x\n", Status);
715  ASSERT((Status & Mask) == Mask);
716 
717  //
718  // Assign the SyncList Register
719  //
721 
722  //
723  // Set Schedules to Enable and Interrupt Threshold to 1ms.
724  //
725  RtlZeroMemory(&UsbCmd, sizeof(EHCI_USBCMD_CONTENT));
726 
727  UsbCmd.PeriodicEnable = TRUE;
728  UsbCmd.IntThreshold = 0x8; //1ms
729  UsbCmd.Run = TRUE;
730  UsbCmd.FrameListSize = 0x0; //1024
731 
733  {
734  //
735  // enable async park mode
736  //
737  UsbCmd.AsyncParkEnable = TRUE;
738  UsbCmd.AsyncParkCount = 3;
739  }
740 
741  SetCommandRegister(&UsbCmd);
742 
743 
744  //
745  // Wait for execution to start
746  //
747  for (FailSafe = 100; FailSafe > 1; FailSafe--)
748  {
751 
752  if (!(UsbSts & EHCI_STS_HALT) && (UsbSts & EHCI_STS_PSS))
753  {
754  break;
755  }
756  }
757 
758  if (UsbSts & EHCI_STS_HALT)
759  {
760  DPRINT1("Could not start execution on the controller\n");
761  //ASSERT(FALSE);
762  return STATUS_UNSUCCESSFUL;
763  }
764 
765  if (!(UsbSts & EHCI_STS_PSS))
766  {
767  DPRINT1("Could not enable periodic scheduling\n");
768  //ASSERT(FALSE);
769  return STATUS_UNSUCCESSFUL;
770  }
771 
772  //
773  // Assign the AsyncList Register
774  //
776 
777  //
778  // get command register
779  //
780  GetCommandRegister(&UsbCmd);
781 
782  //
783  // preserve bits
784  //
785  UsbCmd.AsyncEnable = TRUE;
786 
787  //
788  // enable async
789  //
790  SetCommandRegister(&UsbCmd);
791 
792  //
793  // Wait for execution to start
794  //
795  for (FailSafe = 100; FailSafe > 1; FailSafe--)
796  {
799 
800  if ((UsbSts & EHCI_STS_ASS))
801  {
802  break;
803  }
804  }
805 
806  if (!(UsbSts & EHCI_STS_ASS))
807  {
808  DPRINT1("Failed to enable async schedule UsbSts %x\n", UsbSts);
809  //ASSERT(FALSE);
810  return STATUS_UNSUCCESSFUL;
811  }
812 
813  DPRINT1("UsbSts %x\n", UsbSts);
814  GetCommandRegister(&UsbCmd);
815 
816  DPRINT1("UsbCmd.PeriodicEnable %x\n", UsbCmd.PeriodicEnable);
817  DPRINT1("UsbCmd.AsyncEnable %x\n", UsbCmd.AsyncEnable);
818  DPRINT1("UsbCmd.IntThreshold %x\n", UsbCmd.IntThreshold);
819  DPRINT1("UsbCmd.Run %x\n", UsbCmd.Run);
820  DPRINT1("UsbCmd.FrameListSize %x\n", UsbCmd.FrameListSize);
821 
822  //
823  // Set port routing to EHCI controller
824  //
826 
827  DPRINT1("EHCI Started!\n");
828  return STATUS_SUCCESS;
829 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define EHCI_CTRLDSSEGMENT
Definition: hardware.h:31
#define TRUE
Definition: types.h:120
GLint x0
Definition: linetemp.h:95
#define EHCI_USBINTR_ERR
Definition: hardware.h:41
ULONG HCCParamsLong
Definition: hardware.h:299
NTSTATUS StopController()
Definition: hardware.cpp:832
#define EHCI_LEGSUP_CAPID_MASK
Definition: hardware.h:18
NTSTATUS NTAPI KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Interval OPTIONAL)
Definition: wait.c:283
#define EHCI_ASYNCLISTBASE
Definition: hardware.h:33
NTSTATUS ResetController()
Definition: hardware.cpp:866
#define EHCI_STS_ASS
Definition: hardware.h:61
#define EHCI_USBINTR_PC
Definition: hardware.h:42
BUS_INTERFACE_STANDARD m_BusInterface
Definition: hardware.cpp:102
VOID EHCI_WRITE_REGISTER_ULONG(ULONG Offset, ULONG Value)
Definition: hardware.cpp:243
#define EHCI_LEGSUP_CAPID
Definition: hardware.h:19
static const UCHAR Index[8]
Definition: usbohci.c:18
#define EHCI_USBINTR_ASYNC
Definition: hardware.h:45
ULONG m_SyncFramePhysAddr
Definition: hardware.cpp:101
#define EHCI_STS_HALT
Definition: hardware.h:58
PGET_SET_DEVICE_DATA GetBusData
Definition: iotypes.h:884
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3288
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
unsigned char UCHAR
Definition: xmlstorage.h:181
#define EHCI_USBINTR_INTE
Definition: hardware.h:40
ULONG PhysicalAddr
Definition: hardware.h:219
#define EHCI_LEGSUP_BIOSOWNED
Definition: hardware.h:21
PQUEUE_HEAD AsyncQueueHead
Definition: hardware.cpp:93
ULONG EHCI_READ_REGISTER_ULONG(ULONG Offset)
Definition: hardware.cpp:237
PGET_SET_DEVICE_DATA SetBusData
Definition: iotypes.h:883
Status
Definition: gdiplustypes.h:24
#define EHCI_ECP_SHIFT
Definition: hardware.h:16
#define EHCI_ECP_MASK
Definition: hardware.h:17
static ULONG Timeout
Definition: ping.c:61
#define EHCI_CONFIGFLAG
Definition: hardware.h:34
EHCI_HCC_CONTENT HCCParams
Definition: hardware.h:298
#define DPRINT1
Definition: precomp.h:8
EHCI_CAPS m_Capabilities
Definition: hardware.cpp:90
#define EHCI_USBINTR_HSERR
Definition: hardware.h:44
#define EHCI_USBSTS
Definition: hardware.h:28
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define EHCI_PERIODICLISTBASE
Definition: hardware.h:32
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define EHCI_USBINTR
Definition: hardware.h:29
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99
#define EHCI_STS_PSS
Definition: hardware.h:60
#define EHCI_LEGSUP_OSOWNED
Definition: hardware.h:20
#define PCI_COMMON_HDR_LENGTH
Definition: iotypes.h:3238

◆ StartController() [3/3]

IMP_IUSBHARDWAREDEVICE IMP_IUHCIHARDWAREDEVICE NTSTATUS CUSBHardwareDevice::StartController ( )

◆ STDMETHODIMP_() [1/6]

CUSBHardwareDevice::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 41 of file hardware.cpp.

42  {
44  return m_Ref;
45  }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [2/6]

CUSBHardwareDevice::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 41 of file hardware.cpp.

42  {
44  return m_Ref;
45  }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [3/6]

CUSBHardwareDevice::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 46 of file hardware.cpp.

47  {
49 
50  if (!m_Ref)
51  {
52  delete this;
53  return 0;
54  }
55  return m_Ref;
56  }
#define InterlockedDecrement
Definition: armddk.h:52

◆ STDMETHODIMP_() [4/6]

CUSBHardwareDevice::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 46 of file hardware.cpp.

47  {
49 
50  if (!m_Ref)
51  {
52  delete this;
53  return 0;
54  }
55  return m_Ref;
56  }
#define InterlockedDecrement
Definition: armddk.h:52

◆ STDMETHODIMP_() [5/6]

CUSBHardwareDevice::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 52 of file hardware.cpp.

53  {
55  return m_Ref;
56  }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [6/6]

CUSBHardwareDevice::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 57 of file hardware.cpp.

58  {
60 
61  if (!m_Ref)
62  {
63  delete this;
64  return 0;
65  }
66  return m_Ref;
67  }
#define InterlockedDecrement
Definition: armddk.h:52

◆ StopController() [1/3]

NTSTATUS CUSBHardwareDevice::StopController ( )

◆ StopController() [2/3]

NTSTATUS CUSBHardwareDevice::StopController ( void  )

Definition at line 832 of file hardware.cpp.

833 {
834  EHCI_USBCMD_CONTENT UsbCmd;
835  ULONG UsbSts, FailSafe;
836 
837  //
838  // Disable Interrupts and stop execution
839  //
841 
842  GetCommandRegister(&UsbCmd);
843  UsbCmd.Run = FALSE;
844  SetCommandRegister(&UsbCmd);
845 
846  for (FailSafe = 100; FailSafe > 1; FailSafe--)
847  {
850  if (UsbSts & EHCI_STS_HALT)
851  {
852  break;
853  }
854  }
855 
856  if (!(UsbSts & EHCI_STS_HALT))
857  {
858  DPRINT1("EHCI ERROR: Controller is not responding to Stop request!\n");
859  return STATUS_UNSUCCESSFUL;
860  }
861 
862  return STATUS_SUCCESS;
863 }
VOID EHCI_WRITE_REGISTER_ULONG(ULONG Offset, ULONG Value)
Definition: hardware.cpp:243
#define EHCI_STS_HALT
Definition: hardware.h:58
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
ULONG EHCI_READ_REGISTER_ULONG(ULONG Offset)
Definition: hardware.cpp:237
#define DPRINT1
Definition: precomp.h:8
#define EHCI_USBSTS
Definition: hardware.h:28
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define EHCI_USBINTR
Definition: hardware.h:29
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99

Referenced by StartController().

◆ StopController() [3/3]

NTSTATUS CUSBHardwareDevice::StopController ( )

◆ WriteRegister16()

VOID CUSBHardwareDevice::WriteRegister16 ( ULONG  Register,
USHORT  Value 
)

Definition at line 1348 of file hardware.cpp.

1351 {
1352  WRITE_PORT_USHORT((PUSHORT)((PUCHAR)m_Base + Register), Value);
1353 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115
unsigned char * PUCHAR
Definition: retypes.h:3
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by GlobalReset().

◆ WriteRegister32()

VOID CUSBHardwareDevice::WriteRegister32 ( ULONG  Register,
ULONG  Value 
)

Definition at line 1357 of file hardware.cpp.

1360 {
1361  WRITE_PORT_ULONG((PULONG)((PUCHAR)m_Base + Register), Value);
1362 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
unsigned char * PUCHAR
Definition: retypes.h:3
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
unsigned int * PULONG
Definition: retypes.h:1

◆ WriteRegister8()

VOID CUSBHardwareDevice::WriteRegister8 ( IN ULONG  Register,
IN UCHAR  value 
)

Definition at line 1339 of file hardware.cpp.

1342 {
1343  WRITE_PORT_UCHAR((PUCHAR)((PUCHAR)m_Base + Register), Value);
1344 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
unsigned char * PUCHAR
Definition: retypes.h:3
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

Friends And Related Function Documentation

◆ EhciDeferredRoutine

VOID NTAPI EhciDeferredRoutine ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)
friend

Definition at line 1290 of file hardware.cpp.

1295 {
1297  ULONG CStatus, PortStatus, PortCount, i, ShouldRingDoorBell, QueueSCEWorkItem;
1299  EHCI_USBCMD_CONTENT UsbCmd;
1300 
1302  CStatus = PtrToUlong(SystemArgument2);
1303 
1304  DPRINT("EhciDeferredRoutine CStatus %lx\n", CStatus);
1305 
1306  //
1307  // check for completion of async schedule
1308  //
1309  if (CStatus & (EHCI_STS_RECL| EHCI_STS_INT | EHCI_ERROR_INT))
1310  {
1311  //
1312  // check if there is a door bell ring in progress
1313  //
1314  if (This->m_DoorBellRingInProgress == FALSE)
1315  {
1316  if (CStatus & EHCI_ERROR_INT)
1317  {
1318  //
1319  // controller reported error
1320  //
1321  DPRINT1("CStatus %lx\n", CStatus);
1322  //ASSERT(FALSE);
1323  }
1324 
1325  //
1326  // inform IUSBQueue of a completed queue head
1327  //
1328  This->m_UsbQueue->InterruptCallback(Status, &ShouldRingDoorBell);
1329 
1330  //
1331  // was a queue head completed?
1332  //
1333  if (ShouldRingDoorBell)
1334  {
1335  //
1336  // set door ring bell in progress status flag
1337  //
1338  This->m_DoorBellRingInProgress = TRUE;
1339 
1340  //
1341  // get command register
1342  //
1343  This->GetCommandRegister(&UsbCmd);
1344 
1345  //
1346  // set door rang bell bit
1347  //
1348  UsbCmd.DoorBell = TRUE;
1349 
1350  //
1351  // update command status
1352  //
1353  This->SetCommandRegister(&UsbCmd);
1354  }
1355  }
1356  }
1357 
1358  //
1359  // check if the controller has acknowledged the door bell
1360  //
1361  if (CStatus & EHCI_STS_IAA)
1362  {
1363  //
1364  // controller has acknowledged, assert we rang the bell
1365  //
1366  PC_ASSERT(This->m_DoorBellRingInProgress == TRUE);
1367 
1368  //
1369  // now notify IUSBQueue that it can free completed requests
1370  //
1371  This->m_UsbQueue->CompleteAsyncRequests();
1372 
1373  //
1374  // door ring bell completed
1375  //
1376  This->m_DoorBellRingInProgress = FALSE;
1377  }
1378 
1379  This->GetDeviceDetails(NULL, NULL, &PortCount, NULL);
1380  if (CStatus & EHCI_STS_PCD)
1381  {
1382  QueueSCEWorkItem = FALSE;
1383  for (i = 0; i < PortCount; i++)
1384  {
1385  PortStatus = This->EHCI_READ_REGISTER_ULONG(EHCI_PORTSC + (4 * i));
1386 
1387  //
1388  // Device connected or removed
1389  //
1391  {
1393  {
1394  DPRINT1("Device connected on port %lu\n", i);
1395 
1396  if (This->m_Capabilities.HCSParams.CHCCount)
1397  {
1399  {
1400  DPRINT1("Misbehaving controller. Port should be disabled at this point\n");
1401  }
1402 
1404  {
1405  DPRINT1("Low speed device connected. Releasing ownership\n");
1406  This->EHCI_WRITE_REGISTER_ULONG(EHCI_PORTSC + (4 * i), PortStatus | EHCI_PRT_RELEASEOWNERSHIP);
1407  continue;
1408  }
1409  }
1410 
1411  //
1412  // work to do
1413  //
1414  QueueSCEWorkItem = TRUE;
1415  }
1416  else
1417  {
1418  DPRINT1("Device disconnected on port %lu\n", i);
1419 
1420  //
1421  // work to do
1422  //
1423  QueueSCEWorkItem = TRUE;
1424  }
1425  }
1426  }
1427 
1428  //
1429  // is there a status change callback and a high speed device connected / disconnected
1430  //
1431  if (QueueSCEWorkItem && This->m_SCECallBack != NULL)
1432  {
1433  if (InterlockedCompareExchange(&This->m_StatusChangeWorkItemStatus, 1, 0) == 0)
1434  {
1435  //
1436  // queue work item for processing
1437  //
1438  ExQueueWorkItem(&This->m_StatusChangeWorkItem, DelayedWorkQueue);
1439  }
1440  }
1441  }
1442  return;
1443 }
#define EHCI_PORTSC
Definition: hardware.h:35
#define EHCI_PRT_ENABLED
Definition: hardware.h:69
CProgressDialog * This
#define TRUE
Definition: types.h:120
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:717
#define PC_ASSERT(exp)
Definition: usbehci.h:17
LONG NTSTATUS
Definition: precomp.h:26
#define EHCI_PRT_RELEASEOWNERSHIP
Definition: hardware.h:79
#define InterlockedCompareExchange
Definition: interlocked.h:104
#define EHCI_STS_PCD
Definition: hardware.h:53
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define EHCI_STS_INT
Definition: hardware.h:51
void DPRINT(...)
Definition: polytest.cpp:61
#define EHCI_ERROR_INT
Definition: hardware.h:62
#define PtrToUlong(u)
Definition: config.h:107
#define EHCI_PRT_CONNECTSTATUSCHANGE
Definition: hardware.h:68
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
#define EHCI_IS_LOW_SPEED(x)
Definition: hardware.h:83
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
Definition: hubbusif.h:40
Status
Definition: gdiplustypes.h:24
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
#define DPRINT1
Definition: precomp.h:8
#define EHCI_PRT_CONNECTED
Definition: hardware.h:67
unsigned int ULONG
Definition: retypes.h:1
#define EHCI_STS_RECL
Definition: hardware.h:59
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define EHCI_STS_IAA
Definition: hardware.h:56

◆ InterruptServiceRoutine [1/3]

BOOLEAN NTAPI InterruptServiceRoutine ( IN PKINTERRUPT  Interrupt,
IN PVOID  ServiceContext 
)
friend

Definition at line 1242 of file hardware.cpp.

1245 {
1247  ULONG CStatus;
1248 
1250  CStatus = This->EHCI_READ_REGISTER_ULONG(EHCI_USBSTS);
1251 
1253  DPRINT("InterruptServiceRoutine CStatus %lx\n", CStatus);
1254 
1255  //
1256  // Check that it belongs to EHCI
1257  //
1258  if (!CStatus)
1259  return FALSE;
1260 
1261  //
1262  // Clear the Status
1263  //
1264  This->EHCI_WRITE_REGISTER_ULONG(EHCI_USBSTS, CStatus);
1265 
1266  if (CStatus & EHCI_STS_FATAL)
1267  {
1268  This->StopController();
1269  DPRINT1("EHCI: Host System Error!\n");
1270  return TRUE;
1271  }
1272 
1273  if (CStatus & EHCI_ERROR_INT)
1274  {
1275  DPRINT1("EHCI Status = 0x%x\n", CStatus);
1276  }
1277 
1278  if (CStatus & EHCI_STS_HALT)
1279  {
1280  DPRINT1("Host Error Unexpected Halt\n");
1281  // FIXME: Reset controller\n");
1282  return TRUE;
1283  }
1284 
1285  KeInsertQueueDpc(&This->m_IntDpcObject, This, UlongToPtr(CStatus));
1286  return TRUE;
1287 }
CProgressDialog * This
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:724
#define EHCI_STS_PCD
Definition: hardware.h:53
#define EHCI_STS_FLR
Definition: hardware.h:54
#define EHCI_STS_INT
Definition: hardware.h:51
void DPRINT(...)
Definition: polytest.cpp:61
#define EHCI_ERROR_INT
Definition: hardware.h:62
#define UlongToPtr(u)
Definition: config.h:106
#define EHCI_STS_HALT
Definition: hardware.h:58
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID ServiceContext
Definition: iofuncs.h:798
#define DPRINT1
Definition: precomp.h:8
#define EHCI_USBSTS
Definition: hardware.h:28
unsigned int ULONG
Definition: retypes.h:1
#define EHCI_STS_FATAL
Definition: hardware.h:55
#define EHCI_STS_IAA
Definition: hardware.h:56

◆ InterruptServiceRoutine [2/3]

BOOLEAN NTAPI InterruptServiceRoutine ( IN PKINTERRUPT  Interrupt,
IN PVOID  ServiceContext 
)
friend

Definition at line 1242 of file hardware.cpp.

1245 {
1247  ULONG CStatus;
1248 
1250  CStatus = This->EHCI_READ_REGISTER_ULONG(EHCI_USBSTS);
1251 
1253  DPRINT("InterruptServiceRoutine CStatus %lx\n", CStatus);
1254 
1255  //
1256  // Check that it belongs to EHCI
1257  //
1258  if (!CStatus)
1259  return FALSE;
1260 
1261  //
1262  // Clear the Status
1263  //
1264  This->EHCI_WRITE_REGISTER_ULONG(EHCI_USBSTS, CStatus);
1265 
1266  if (CStatus & EHCI_STS_FATAL)
1267  {
1268  This->StopController();
1269  DPRINT1("EHCI: Host System Error!\n");
1270  return TRUE;
1271  }
1272 
1273  if (CStatus & EHCI_ERROR_INT)
1274  {
1275  DPRINT1("EHCI Status = 0x%x\n", CStatus);
1276  }
1277 
1278  if (CStatus & EHCI_STS_HALT)
1279  {
1280  DPRINT1("Host Error Unexpected Halt\n");
1281  // FIXME: Reset controller\n");
1282  return TRUE;
1283  }
1284 
1285  KeInsertQueueDpc(&This->m_IntDpcObject, This, UlongToPtr(CStatus));
1286  return TRUE;
1287 }
CProgressDialog * This
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:724
#define EHCI_STS_PCD
Definition: hardware.h:53
#define EHCI_STS_FLR
Definition: hardware.h:54
#define EHCI_STS_INT
Definition: hardware.h:51
void DPRINT(...)
Definition: polytest.cpp:61
#define EHCI_ERROR_INT
Definition: hardware.h:62
#define UlongToPtr(u)
Definition: config.h:106
#define EHCI_STS_HALT
Definition: hardware.h:58
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID ServiceContext
Definition: iofuncs.h:798
#define DPRINT1
Definition: precomp.h:8
#define EHCI_USBSTS
Definition: hardware.h:28
unsigned int ULONG
Definition: retypes.h:1
#define EHCI_STS_FATAL
Definition: hardware.h:55
#define EHCI_STS_IAA
Definition: hardware.h:56

◆ InterruptServiceRoutine [3/3]

BOOLEAN NTAPI InterruptServiceRoutine ( IN PKINTERRUPT  Interrupt,
IN PVOID  ServiceContext 
)
friend

Definition at line 1242 of file hardware.cpp.

1245 {
1247  ULONG CStatus;
1248 
1250  CStatus = This->EHCI_READ_REGISTER_ULONG(EHCI_USBSTS);
1251 
1253  DPRINT("InterruptServiceRoutine CStatus %lx\n", CStatus);
1254 
1255  //
1256  // Check that it belongs to EHCI
1257  //
1258  if (!CStatus)
1259  return FALSE;
1260 
1261  //
1262  // Clear the Status
1263  //
1264  This->EHCI_WRITE_REGISTER_ULONG(EHCI_USBSTS, CStatus);
1265 
1266  if (CStatus & EHCI_STS_FATAL)
1267  {
1268  This->StopController();
1269  DPRINT1("EHCI: Host System Error!\n");
1270  return TRUE;
1271  }
1272 
1273  if (CStatus & EHCI_ERROR_INT)
1274  {
1275  DPRINT1("EHCI Status = 0x%x\n", CStatus);
1276  }
1277 
1278  if (CStatus & EHCI_STS_HALT)
1279  {
1280  DPRINT1("Host Error Unexpected Halt\n");
1281  // FIXME: Reset controller\n");
1282  return TRUE;
1283  }
1284 
1285  KeInsertQueueDpc(&This->m_IntDpcObject, This, UlongToPtr(CStatus));
1286  return TRUE;
1287 }
CProgressDialog * This
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI KeInsertQueueDpc(IN PKDPC Dpc, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: dpc.c:724
#define EHCI_STS_PCD
Definition: hardware.h:53
#define EHCI_STS_FLR
Definition: hardware.h:54
#define EHCI_STS_INT
Definition: hardware.h:51
void DPRINT(...)
Definition: polytest.cpp:61
#define EHCI_ERROR_INT
Definition: hardware.h:62
#define UlongToPtr(u)
Definition: config.h:106
#define EHCI_STS_HALT
Definition: hardware.h:58
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID ServiceContext
Definition: iofuncs.h:798
#define DPRINT1
Definition: precomp.h:8
#define EHCI_USBSTS
Definition: hardware.h:28
unsigned int ULONG
Definition: retypes.h:1
#define EHCI_STS_FATAL
Definition: hardware.h:55
#define EHCI_STS_IAA
Definition: hardware.h:56

◆ OhciDeferredRoutine

VOID NTAPI OhciDeferredRoutine ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)
friend

Definition at line 1425 of file hardware.cpp.

1430 {
1432  ULONG CStatus, Index, PortStatus;
1433  ULONG DoneHead, QueueSCEWorkItem;
1434 
1435  //
1436  // get parameters
1437  //
1439  CStatus = PtrToUlong(SystemArgument1);
1440  DoneHead = PtrToUlong(SystemArgument2);
1441 
1442  DPRINT("OhciDeferredRoutine Status %x DoneHead %x\n", CStatus, DoneHead);
1443 
1444  if (CStatus & OHCI_WRITEBACK_DONE_HEAD)
1445  {
1446  //
1447  // notify queue of event
1448  //
1449  This->m_UsbQueue->TransferDescriptorCompletionCallback(DoneHead);
1450  }
1451  if (CStatus & OHCI_ROOT_HUB_STATUS_CHANGE)
1452  {
1453  //
1454  // device connected, lets check which port
1455  //
1456  QueueSCEWorkItem = FALSE;
1457  for(Index = 0; Index < This->m_NumberOfPorts; Index++)
1458  {
1459  //
1460  // read port status
1461  //
1463 
1464  //
1465  // check if there is a status change
1466  //
1468  {
1469  //
1470  // did a device connect
1471  //
1473  {
1474  //
1475  // device connected
1476  //
1477  DPRINT1("New device arrival at Port %lu LowSpeed %x\n", Index, (PortStatus & OHCI_RH_PORTSTATUS_LSDA));
1478 
1479  //
1480  // enable port
1481  //
1483  }
1484  else
1485  {
1486  //
1487  // device disconnected
1488  //
1489  DPRINT1("Device disconnected at Port %x\n", Index);
1490  }
1491 
1492  //
1493  // work to do
1494  //
1495  QueueSCEWorkItem = TRUE;
1496  }
1498  {
1499  //
1500  // device disconnected or some error condition
1501  //
1503 
1504  //
1505  // work to do
1506  //
1507  QueueSCEWorkItem = TRUE;
1508  }
1510  {
1511  //
1512  // This is a port reset complete interrupt
1513  //
1514  DPRINT1("Port %lu completed reset\n", Index);
1515 
1516  //
1517  // Queue a work item
1518  //
1519  QueueSCEWorkItem = TRUE;
1520  }
1521  }
1522 
1523  //
1524  // is there a status change callback and a device connected / disconnected
1525  //
1526  if (QueueSCEWorkItem && This->m_SCECallBack != NULL)
1527  {
1528  if (InterlockedCompareExchange(&This->m_StatusChangeWorkItemStatus, 1, 0) == 0)
1529  {
1530  //
1531  // queue work item for processing
1532  //
1533  ExQueueWorkItem(&This->m_StatusChangeWorkItem, DelayedWorkQueue);
1534  }
1535  }
1536  }
1537 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
CProgressDialog * This
#define TRUE
Definition: types.h:120
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:717
#define OHCI_RH_PORTSTATUS_LSDA
Definition: hardware.h:137
unsigned char * PUCHAR
Definition: retypes.h:3
#define InterlockedCompareExchange
Definition: interlocked.h:104
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
#define OHCI_ROOT_HUB_STATUS_CHANGE
Definition: hardware.h:55
#define OHCI_RH_PORTSTATUS_CCS
Definition: hardware.h:131
#define OHCI_WRITEBACK_DONE_HEAD
Definition: hardware.h:50
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define OHCI_RH_PORTSTATUS_PES
Definition: hardware.h:132
#define PtrToUlong(u)
Definition: config.h:107
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
#define OHCI_RH_PORTSTATUS_PRSC
Definition: hardware.h:142
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define OHCI_RH_PORT_STATUS(n)
Definition: hardware.h:130
#define OHCI_RH_PORTSTATUS_PESC
Definition: hardware.h:139
#define OHCI_RH_PORTSTATUS_CSC
Definition: hardware.h:138
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
Definition: hubbusif.h:40
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
unsigned int * PULONG
Definition: retypes.h:1
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675

◆ StatusChangeWorkItemRoutine [1/3]

VOID NTAPI StatusChangeWorkItemRoutine ( PVOID  Context)
friend

Definition at line 1447 of file hardware.cpp.

1449 {
1450  //
1451  // cast to hardware object
1452  //
1454 
1455  //
1456  // is there a callback
1457  //
1458  if (This->m_SCECallBack)
1459  {
1460  //
1461  // issue callback
1462  //
1463  This->m_SCECallBack(This->m_SCEContext);
1464  }
1465 
1466  //
1467  // reset active status
1468  //
1469  InterlockedDecrement(&This->m_StatusChangeWorkItemStatus);
1470 }
#define InterlockedDecrement
Definition: armddk.h:52

◆ StatusChangeWorkItemRoutine [2/3]

VOID NTAPI StatusChangeWorkItemRoutine ( PVOID  Context)
friend

Definition at line 1447 of file hardware.cpp.

1449 {
1450  //
1451  // cast to hardware object
1452  //
1454 
1455  //
1456  // is there a callback
1457  //
1458  if (This->m_SCECallBack)
1459  {
1460  //
1461  // issue callback
1462  //
1463  This->m_SCECallBack(This->m_SCEContext);
1464  }
1465 
1466  //
1467  // reset active status
1468  //
1469  InterlockedDecrement(&This->m_StatusChangeWorkItemStatus);
1470 }
#define InterlockedDecrement
Definition: armddk.h:52

◆ StatusChangeWorkItemRoutine [3/3]

VOID NTAPI StatusChangeWorkItemRoutine ( PVOID  Context)
friend

Definition at line 1447 of file hardware.cpp.

1449 {
1450  //
1451  // cast to hardware object
1452  //
1454 
1455  //
1456  // is there a callback
1457  //
1458  if (This->m_SCECallBack)
1459  {
1460  //
1461  // issue callback
1462  //
1463  This->m_SCECallBack(This->m_SCEContext);
1464  }
1465 
1466  //
1467  // reset active status
1468  //
1469  InterlockedDecrement(&This->m_StatusChangeWorkItemStatus);
1470 }
#define InterlockedDecrement
Definition: armddk.h:52

◆ TimerDpcRoutine

VOID NTAPI TimerDpcRoutine ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)
friend

Definition at line 61 of file dispatch.c.

65 {
66  HEADLESS_RSP_GET_BYTE ByteValue;
67  SIZE_T ValueSize;
68  BOOLEAN GotChar;
70  PSAC_DEVICE_EXTENSION SacExtension;
71 
72  /* Update our counter */
74 
75  /* Set defaults and loop for new characters */
76  GotChar = FALSE;
77  ValueSize = sizeof(ByteValue);
78  do
79  {
80  /* Ask the kernel for a byte */
82  NULL,
83  0,
84  &ByteValue,
85  &ValueSize);
86 
87  /* Break out if there's nothing interesting */
88  if (!NT_SUCCESS(Status)) break;
89  if (!ByteValue.Value) break;
90 
91  /* Update the serial port buffer */
93  GotChar = TRUE;
94 
95  /* Update the index, let it roll-over if needed */
99  } while (ByteValue.Value);
100 
101  /* Did we get anything */
102  if (GotChar)
103  {
104  /* Signal the worker thread that there is work to do */
105  SacExtension = DeferredContext;
106  KeSetEvent(&SacExtension->Event, SacExtension->PriorityBoost, FALSE);
107  }
108 }
#define TRUE
Definition: types.h:120
PCHAR SerialPortBuffer
Definition: util.c:35
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
LONG NTSTATUS
Definition: precomp.h:26
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
NTSTATUS NTAPI HeadlessDispatch(IN HEADLESS_CMD Command, IN PVOID InputBuffer, IN SIZE_T InputBufferSize, OUT PVOID OutputBuffer, OUT PSIZE_T OutputBufferSize)
Definition: hdlsterm.c:570
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
LONG TimerDpcCount
Definition: dispatch.c:15
KPRIORITY PriorityBoost
Definition: sacdrv.h:512
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define SAC_SERIAL_PORT_BUFFER_SIZE
Definition: sacdrv.h:154
long __cdecl _InterlockedExchangeAdd(_Interlocked_operand_ long volatile *_Addend, long _Value)
LONG SerialPortProducerIndex
Definition: util.c:34
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675

◆ UhciDeferredRoutine

VOID NTAPI UhciDeferredRoutine ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)
friend

Definition at line 1406 of file hardware.cpp.

1411 {
1413  ULONG Status;
1414 
1415  //
1416  // get parameters
1417  //
1419 
1420  DPRINT("UhciDeferredRoutine\n");
1421 
1422  //
1423  // get status
1424  //
1427  {
1428  //
1429  // a transfer finished, inform the queue
1430  //
1431  This->m_UsbQueue->TransferInterrupt(Status & UHCI_USBSTS_USBINT);
1432  return;
1433  }
1434 
1435  //
1436  // other event
1437  //
1438  DPRINT1("[USBUHCI] Status %x not handled\n", Status);
1439 }
CProgressDialog * This
#define UHCI_USBSTS_USBINT
Definition: hardware.h:47
void DPRINT(...)
Definition: polytest.cpp:61
#define PtrToUlong(u)
Definition: config.h:107
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
Status
Definition: gdiplustypes.h:24
#define DPRINT1
Definition: precomp.h:8
#define UHCI_USBSTS_ERRINT
Definition: hardware.h:48
unsigned int ULONG
Definition: retypes.h:1
_In_opt_ PVOID DeferredContext
Definition: ketypes.h:675

Member Data Documentation

◆ AsyncQueueHead

PQUEUE_HEAD CUSBHardwareDevice::AsyncQueueHead
protected

Definition at line 93 of file hardware.cpp.

Referenced by StartController().

◆ m_Adapter

PDMA_ADAPTER CUSBHardwareDevice::m_Adapter
protected

Definition at line 88 of file hardware.cpp.

◆ m_Base

◆ m_BulkEndpointDescriptor

POHCI_ENDPOINT_DESCRIPTOR CUSBHardwareDevice::m_BulkEndpointDescriptor
protected

Definition at line 97 of file hardware.cpp.

Referenced by InitializeController().

◆ m_BusInterface

BUS_INTERFACE_STANDARD CUSBHardwareDevice::m_BusInterface
protected

Definition at line 102 of file hardware.cpp.

Referenced by StartController().

◆ m_Capabilities

EHCI_CAPS CUSBHardwareDevice::m_Capabilities
protected

Definition at line 90 of file hardware.cpp.

Referenced by PrintCapabilities(), and StartController().

◆ m_ControlEndpointDescriptor

POHCI_ENDPOINT_DESCRIPTOR CUSBHardwareDevice::m_ControlEndpointDescriptor
protected

Definition at line 96 of file hardware.cpp.

Referenced by InitializeController().

◆ m_DeviceID

USHORT CUSBHardwareDevice::m_DeviceID
protected

Definition at line 92 of file hardware.cpp.

◆ m_DoorBellRingInProgress

BOOLEAN CUSBHardwareDevice::m_DoorBellRingInProgress
protected

Definition at line 98 of file hardware.cpp.

◆ m_DriverObject

PDRIVER_OBJECT CUSBHardwareDevice::m_DriverObject
protected

Definition at line 78 of file hardware.cpp.

◆ m_FrameBandwidth

PUSHORT CUSBHardwareDevice::m_FrameBandwidth
protected

Definition at line 122 of file hardware.cpp.

◆ m_FrameList

PULONG CUSBHardwareDevice::m_FrameList
protected

Definition at line 120 of file hardware.cpp.

◆ m_FrameListPhysicalAddress

PHYSICAL_ADDRESS CUSBHardwareDevice::m_FrameListPhysicalAddress
protected

Definition at line 121 of file hardware.cpp.

◆ m_FunctionalDeviceObject

PDEVICE_OBJECT CUSBHardwareDevice::m_FunctionalDeviceObject
protected

Definition at line 80 of file hardware.cpp.

◆ m_HCCA

POHCIHCCA CUSBHardwareDevice::m_HCCA
protected

Definition at line 94 of file hardware.cpp.

Referenced by InitializeController().

◆ m_HCCAPhysicalAddress

PHYSICAL_ADDRESS CUSBHardwareDevice::m_HCCAPhysicalAddress
protected

Definition at line 95 of file hardware.cpp.

Referenced by InitializeController().

◆ m_IntDpcObject

KDPC CUSBHardwareDevice::m_IntDpcObject
protected

Definition at line 84 of file hardware.cpp.

◆ m_Interrupt

PKINTERRUPT CUSBHardwareDevice::m_Interrupt
protected

Definition at line 83 of file hardware.cpp.

◆ m_InterruptEndpoints

POHCI_ENDPOINT_DESCRIPTOR CUSBHardwareDevice::m_InterruptEndpoints[OHCI_STATIC_ENDPOINT_COUNT]
protected

Definition at line 99 of file hardware.cpp.

Referenced by InitializeController().

◆ m_InterruptMask

ULONG CUSBHardwareDevice::m_InterruptMask
protected

Definition at line 118 of file hardware.cpp.

◆ m_IntervalValue

ULONG CUSBHardwareDevice::m_IntervalValue
protected

Definition at line 107 of file hardware.cpp.

◆ m_IsoEndpointDescriptor

POHCI_ENDPOINT_DESCRIPTOR CUSBHardwareDevice::m_IsoEndpointDescriptor
protected

Definition at line 98 of file hardware.cpp.

Referenced by InitializeController().

◆ m_Lock

KSPIN_LOCK CUSBHardwareDevice::m_Lock
protected

Definition at line 82 of file hardware.cpp.

◆ m_MapRegisters

ULONG CUSBHardwareDevice::m_MapRegisters
protected

Definition at line 89 of file hardware.cpp.

◆ m_MemoryManager

PDMAMEMORYMANAGER CUSBHardwareDevice::m_MemoryManager
protected

Definition at line 95 of file hardware.cpp.

Referenced by AllocateEndpointDescriptor(), and InitializeController().

◆ m_NextDeviceObject

PDEVICE_OBJECT CUSBHardwareDevice::m_NextDeviceObject
protected

Definition at line 81 of file hardware.cpp.

◆ m_NumberOfPorts

ULONG CUSBHardwareDevice::m_NumberOfPorts
protected

Definition at line 100 of file hardware.cpp.

◆ m_PhysicalDeviceObject

PDEVICE_OBJECT CUSBHardwareDevice::m_PhysicalDeviceObject
protected

Definition at line 79 of file hardware.cpp.

◆ m_PortResetChange

ULONG CUSBHardwareDevice::m_PortResetChange
protected

Definition at line 119 of file hardware.cpp.

◆ m_PortResetInProgress

BOOLEAN CUSBHardwareDevice::m_PortResetInProgress[0xF]
protected

Definition at line 103 of file hardware.cpp.

◆ m_QueueHead

PUHCI_QUEUE_HEAD CUSBHardwareDevice::m_QueueHead[5]
protected

Definition at line 123 of file hardware.cpp.

◆ m_Ref

LONG CUSBHardwareDevice::m_Ref
protected

Definition at line 77 of file hardware.cpp.

Referenced by STDMETHODIMP_().

◆ m_SCECallBack

HD_INIT_CALLBACK * CUSBHardwareDevice::m_SCECallBack
protected

Definition at line 96 of file hardware.cpp.

◆ m_SCEContext

PVOID CUSBHardwareDevice::m_SCEContext
protected

Definition at line 97 of file hardware.cpp.

◆ m_SCETimer

KTIMER CUSBHardwareDevice::m_SCETimer
protected

Definition at line 126 of file hardware.cpp.

◆ m_SCETimerDpc

KDPC CUSBHardwareDevice::m_SCETimerDpc
protected

Definition at line 127 of file hardware.cpp.

◆ m_StatusChangeWorkItem

WORK_QUEUE_ITEM CUSBHardwareDevice::m_StatusChangeWorkItem
protected

Definition at line 99 of file hardware.cpp.

◆ m_StatusChangeWorkItemStatus

volatile LONG CUSBHardwareDevice::m_StatusChangeWorkItemStatus
protected

Definition at line 100 of file hardware.cpp.

◆ m_StrayDescriptor

PUHCI_TRANSFER_DESCRIPTOR CUSBHardwareDevice::m_StrayDescriptor
protected

Definition at line 125 of file hardware.cpp.

◆ m_StrayDescriptorPhysicalAddress

PHYSICAL_ADDRESS CUSBHardwareDevice::m_StrayDescriptorPhysicalAddress
protected

Definition at line 124 of file hardware.cpp.

◆ m_SyncFramePhysAddr

ULONG CUSBHardwareDevice::m_SyncFramePhysAddr
protected

Definition at line 101 of file hardware.cpp.

Referenced by StartController().

◆ m_UsbQueue [1/3]

POHCIQUEUE CUSBHardwareDevice::m_UsbQueue
protected

Definition at line 93 of file hardware.cpp.

◆ m_UsbQueue [2/3]

PEHCIQUEUE CUSBHardwareDevice::m_UsbQueue
protected

Definition at line 94 of file hardware.cpp.

◆ m_UsbQueue [3/3]

PUHCIQUEUE CUSBHardwareDevice::m_UsbQueue
protected

Definition at line 112 of file hardware.cpp.

◆ m_VendorID

USHORT CUSBHardwareDevice::m_VendorID
protected

Definition at line 91 of file hardware.cpp.

◆ PhysicalAddress

PHYSICAL_ADDRESS CUSBHardwareDevice::PhysicalAddress
protected

Definition at line 86 of file hardware.cpp.

◆ VirtualBase

PVOID CUSBHardwareDevice::VirtualBase
protected

Definition at line 85 of file hardware.cpp.


The documentation for this class was generated from the following file: