[Voyageurs] XHCI Event Segment working with polling.
This commit is contained in:
parent
b41784b938
commit
4cb0b0b2ae
8 changed files with 181 additions and 21 deletions
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/memory/unique_ptr.h>
|
||||
#include <glacier/status/error_or.h>
|
||||
#include <mammoth/proc/thread.h>
|
||||
#include <mammoth/util/memory_region.h>
|
||||
#include <yellowstone/yellowstone.yunq.client.h>
|
||||
|
||||
|
|
@ -9,22 +11,27 @@
|
|||
|
||||
class XhciDriver {
|
||||
public:
|
||||
static glcr::ErrorOr<XhciDriver> InitiateDriver(
|
||||
static glcr::ErrorOr<glcr::UniquePtr<XhciDriver>> InitiateDriver(
|
||||
yellowstone::YellowstoneClient& yellowstone);
|
||||
|
||||
XhciDriver(const XhciDriver&) = delete;
|
||||
XhciDriver(XhciDriver&&) = default;
|
||||
|
||||
void DumpDebugInfo();
|
||||
|
||||
void InterruptLoop();
|
||||
|
||||
private:
|
||||
// MMIO Structures.
|
||||
mmth::OwnedMemoryRegion pci_region_;
|
||||
PciDeviceHeader* pci_device_header_;
|
||||
|
||||
mmth::OwnedMemoryRegion mmio_regions_;
|
||||
XhciCapabilities* capabilities_;
|
||||
XhciOperational* operational_;
|
||||
volatile XhciCapabilities* capabilities_;
|
||||
volatile XhciOperational* operational_;
|
||||
// TODO: Extended Capabilities.
|
||||
XhciRuntime* runtime_;
|
||||
// TODO: Doorbell Array.
|
||||
volatile XhciRuntime* runtime_;
|
||||
volatile XhciDoorbells* doorbells_;
|
||||
|
||||
// Host Memory Regions.
|
||||
TrbRingWriter command_ring_;
|
||||
|
|
@ -35,7 +42,8 @@ class XhciDriver {
|
|||
mmth::OwnedMemoryRegion event_ring_segment_table_mem_;
|
||||
XhciEventRingSegmentTableEntry* event_ring_segment_table_;
|
||||
|
||||
TrbRing event_ring_;
|
||||
TrbRingReader event_ring_;
|
||||
Thread interrupt_thread_;
|
||||
|
||||
XhciDriver(mmth::OwnedMemoryRegion&& pci_space);
|
||||
|
||||
|
|
@ -43,8 +51,13 @@ class XhciDriver {
|
|||
glcr::ErrorCode FreeExistingMemoryStructures() { return glcr::OK; }
|
||||
|
||||
glcr::ErrorCode ResetController();
|
||||
void StartInterruptThread();
|
||||
|
||||
glcr::ErrorCode InitiateCommandRing();
|
||||
glcr::ErrorCode InitiateDeviceContextBaseArray();
|
||||
glcr::ErrorCode InitiateEventRingSegmentTable();
|
||||
|
||||
glcr::ErrorCode InitiateDevices();
|
||||
|
||||
glcr::ErrorCode NoOpCommand();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue