Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
XHCIModule Class Reference

#include <xhci.hpp>

Inheritance diagram for XHCIModule:
IOforgePCI IOForge

Data Structures

struct  xhci_erst_entry
 
struct  xhci_slot
 

Public Member Functions

 XHCIModule ()
 
void load () override
 
void unload () override
 
void set_controller (ioforge_usb_controller_device *ctrl)
 
void send_async_with_response (uint8_t addr, uint8_t endpoint, uint32_t data_phys, size_t size, uint32_t response_phys, size_t response_size)
 
- Public Member Functions inherited from IOforgePCI
 IOforgePCI (const char *mod)
 
struct ioforge_pci_devicefindDevice (uint16_t vendor_id, uint16_t device_id)
 
- Public Member Functions inherited from IOForge
 IOForge (const char *mod)
 

Static Public Member Functions

static XHCIModulegetInstance ()
 
static void fireHandler ()
 

Private Member Functions

void reset_controller ()
 
void init_controller ()
 
void probe_ports ()
 
void send_command (struct xhci_trb *trb)
 
struct xhci_trb wait_for_event (uint8_t type)
 
uint8_t enable_slot ()
 
void address_device (uint8_t slot_id, uint8_t port_id)
 
struct xhci_trbcreate_transfer_ring (uintptr_t *phys)
 
struct XHCIModule::xhci_erst_entry __attribute__ ((packed)) *erst
 

Private Attributes

ioforge_pci_devicedevice
 
struct xhci_cap_regscap_regs
 
struct xhci_op_regsop_regs
 
struct xhci_runtime_regsruntime_regs
 
volatile uint32_tdoorbell_regs
 
uint32_t num_slots
 
uint32_t num_ports
 
uint32_t max_intrs
 
uint64_tdcbaa
 
uintptr_t dcbaa_phys
 
struct xhci_trbcmd_ring
 
uintptr_t cmd_ring_phys
 
uint32_t cmd_ring_index
 
uint8_t cmd_ring_pcs
 
struct xhci_trbevent_ring
 
uintptr_t event_ring_phys
 
uint32_t event_ring_index
 
uint8_t event_ring_pcs
 
struct XHCIModule::xhci_slot slots [256]
 
uintptr_t erst_phys
 
ioforge_usb_controller_device * controller
 

Static Private Attributes

static XHCIModule instance
 

Additional Inherited Members

- Protected Attributes inherited from IOForge
const char * mod
 

Detailed Description

Definition at line 123 of file xhci.hpp.

Constructor & Destructor Documentation

◆ XHCIModule()

XHCIModule::XHCIModule ( )

Definition at line 10 of file init.cpp.

References IOforgePCI::IOforgePCI().

Referenced by getInstance(), unload(), and wait_for_event().

Member Function Documentation

◆ __attribute__()

struct XHCIModule::xhci_erst_entry XHCIModule::__attribute__ ( (packed) )
private

References event_ring_pcs.

◆ address_device()

◆ create_transfer_ring()

struct xhci_trb * XHCIModule::create_transfer_ring ( uintptr_t * phys)
private

Definition at line 215 of file xhci.cpp.

References ring.

Referenced by address_device().

◆ enable_slot()

uint8_t XHCIModule::enable_slot ( )
private

◆ fireHandler()

void XHCIModule::fireHandler ( )
static

Definition at line 78 of file init.cpp.

Referenced by load().

◆ getInstance()

XHCIModule * XHCIModule::getInstance ( )
static

Definition at line 13 of file init.cpp.

References instance, and XHCIModule().

Referenced by __attribute__(), and xhci_send_async_stub().

◆ init_controller()

◆ load()

◆ probe_ports()

void XHCIModule::probe_ports ( )
private

Definition at line 82 of file xhci.cpp.

References address_device(), enable_slot(), log, IOForge::mod, num_ports, op_regs, reg, status, XHCI_PORT_CCS, XHCI_PORT_PED, and XHCI_PORT_PR.

Referenced by load().

◆ reset_controller()

void XHCIModule::reset_controller ( )
private

Definition at line 6 of file xhci.cpp.

References log, IOForge::mod, op_regs, XHCI_CMD_HCRST, XHCI_CMD_RS, XHCI_STS_CNR, and XHCI_STS_HCH.

Referenced by load().

◆ send_async_with_response()

void XHCIModule::send_async_with_response ( uint8_t addr,
uint8_t endpoint,
uint32_t data_phys,
size_t size,
uint32_t response_phys,
size_t response_size )

◆ send_command()

void XHCIModule::send_command ( struct xhci_trb * trb)
private

◆ set_controller()

void XHCIModule::set_controller ( ioforge_usb_controller_device * ctrl)
inline

Definition at line 132 of file xhci.hpp.

References controller.

Referenced by __attribute__().

◆ unload()

void XHCIModule::unload ( )
overridevirtual

Implements IOforgePCI.

References XHCIModule().

◆ wait_for_event()

struct xhci_trb XHCIModule::wait_for_event ( uint8_t type)
private

Field Documentation

◆ cap_regs

struct xhci_cap_regs* XHCIModule::cap_regs
private

Definition at line 154 of file xhci.hpp.

Referenced by init_controller(), and load().

◆ cmd_ring

struct xhci_trb* XHCIModule::cmd_ring
private

Definition at line 166 of file xhci.hpp.

Referenced by init_controller(), and send_command().

◆ cmd_ring_index

uint32_t XHCIModule::cmd_ring_index
private

Definition at line 168 of file xhci.hpp.

Referenced by init_controller(), and send_command().

◆ cmd_ring_pcs

uint8_t XHCIModule::cmd_ring_pcs
private

Definition at line 169 of file xhci.hpp.

Referenced by init_controller(), and send_command().

◆ cmd_ring_phys

uintptr_t XHCIModule::cmd_ring_phys
private

Definition at line 167 of file xhci.hpp.

Referenced by init_controller().

◆ controller

ioforge_usb_controller_device* XHCIModule::controller
private

Definition at line 195 of file xhci.hpp.

Referenced by set_controller().

◆ dcbaa

uint64_t* XHCIModule::dcbaa
private

Definition at line 163 of file xhci.hpp.

Referenced by address_device(), and init_controller().

◆ dcbaa_phys

uintptr_t XHCIModule::dcbaa_phys
private

Definition at line 164 of file xhci.hpp.

Referenced by init_controller().

◆ device

ioforge_pci_device* XHCIModule::device
private

Definition at line 153 of file xhci.hpp.

Referenced by load().

◆ doorbell_regs

volatile uint32_t* XHCIModule::doorbell_regs
private

Definition at line 157 of file xhci.hpp.

Referenced by load(), send_async_with_response(), and send_command().

◆ erst_phys

uintptr_t XHCIModule::erst_phys
private

Definition at line 193 of file xhci.hpp.

Referenced by init_controller().

◆ event_ring

struct xhci_trb* XHCIModule::event_ring
private

Definition at line 171 of file xhci.hpp.

Referenced by init_controller(), and wait_for_event().

◆ event_ring_index

uint32_t XHCIModule::event_ring_index
private

Definition at line 173 of file xhci.hpp.

Referenced by init_controller(), and wait_for_event().

◆ event_ring_pcs

uint8_t XHCIModule::event_ring_pcs
private

Definition at line 174 of file xhci.hpp.

Referenced by __attribute__(), init_controller(), and wait_for_event().

◆ event_ring_phys

uintptr_t XHCIModule::event_ring_phys
private

Definition at line 172 of file xhci.hpp.

Referenced by init_controller(), and wait_for_event().

◆ instance

XHCIModule XHCIModule::instance
staticprivate

Definition at line 197 of file xhci.hpp.

Referenced by getInstance().

◆ max_intrs

uint32_t XHCIModule::max_intrs
private

Definition at line 161 of file xhci.hpp.

Referenced by init_controller().

◆ num_ports

uint32_t XHCIModule::num_ports
private

Definition at line 160 of file xhci.hpp.

Referenced by init_controller(), and probe_ports().

◆ num_slots

uint32_t XHCIModule::num_slots
private

Definition at line 159 of file xhci.hpp.

Referenced by init_controller().

◆ op_regs

struct xhci_op_regs* XHCIModule::op_regs
private

Definition at line 155 of file xhci.hpp.

Referenced by init_controller(), load(), probe_ports(), and reset_controller().

◆ runtime_regs

struct xhci_runtime_regs* XHCIModule::runtime_regs
private

Definition at line 156 of file xhci.hpp.

Referenced by init_controller(), load(), and wait_for_event().

◆ slots

struct XHCIModule::xhci_slot XHCIModule::slots[256]
private

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