|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include <xhci.hpp>
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_device * | findDevice (uint16_t vendor_id, uint16_t device_id) |
Public Member Functions inherited from IOForge | |
| IOForge (const char *mod) | |
Static Public Member Functions | |
| static XHCIModule * | getInstance () |
| 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_trb * | create_transfer_ring (uintptr_t *phys) |
| struct XHCIModule::xhci_erst_entry | __attribute__ ((packed)) *erst |
Private Attributes | |
| ioforge_pci_device * | device |
| struct xhci_cap_regs * | cap_regs |
| struct xhci_op_regs * | op_regs |
| struct xhci_runtime_regs * | runtime_regs |
| volatile uint32_t * | doorbell_regs |
| uint32_t | num_slots |
| uint32_t | num_ports |
| uint32_t | max_intrs |
| uint64_t * | dcbaa |
| uintptr_t | dcbaa_phys |
| struct xhci_trb * | cmd_ring |
| uintptr_t | cmd_ring_phys |
| uint32_t | cmd_ring_index |
| uint8_t | cmd_ring_pcs |
| struct xhci_trb * | event_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 |
| XHCIModule::XHCIModule | ( | ) |
Definition at line 10 of file init.cpp.
References IOforgePCI::IOforgePCI().
Referenced by getInstance(), unload(), and wait_for_event().
|
private |
References event_ring_pcs.
Definition at line 168 of file xhci.cpp.
References xhci_input_control_ctx::add_flags, cmd, create_transfer_ring(), dcbaa, xhci_input_ctx::device, xhci_device_ctx::ep, xhci_slot_ctx::info, xhci_endpoint_ctx::info2, xhci_slot_ctx::info2, xhci_input_ctx::input_control, ring, send_command(), xhci_device_ctx::slot, slots, xhci_endpoint_ctx::trdp, wait_for_event(), XHCI_TRB_ADDRESS_DEVICE_CMD, and XHCI_TRB_COMMAND_COMPLETION_EVENT.
Referenced by probe_ports().
|
private |
Definition at line 161 of file xhci.cpp.
References cmd, xhci_trb::control, send_command(), wait_for_event(), XHCI_TRB_COMMAND_COMPLETION_EVENT, and XHCI_TRB_ENABLE_SLOT_CMD.
Referenced by probe_ports().
|
static |
|
static |
Definition at line 13 of file init.cpp.
References instance, and XHCIModule().
Referenced by __attribute__(), and xhci_send_async_stub().
|
private |
Definition at line 24 of file xhci.cpp.
References cap_regs, cmd_ring, cmd_ring_index, cmd_ring_pcs, cmd_ring_phys, dcbaa, dcbaa_phys, erst_phys, event_ring, event_ring_index, event_ring_pcs, event_ring_phys, log, max_intrs, IOForge::mod, num_ports, num_slots, op_regs, runtime_regs, XHCI_CMD_RS, and XHCI_STS_HCH.
Referenced by load().
|
overridevirtual |
Implements IOforgePCI.
Definition at line 17 of file init.cpp.
References bar, cap_regs, device, doorbell_regs, IOforgePCI::findDevice(), fireHandler(), init_controller(), log, IOForge::mod, op_regs, probe_ports(), reset_controller(), runtime_regs, XHCI_DEVICE_ID, and XHCI_VENDOR_ID.
|
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().
|
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().
| 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 ) |
Definition at line 222 of file xhci.cpp.
References addr, doorbell_regs, idx, ring, slots, wait_for_event(), XHCI_TRB_DATA_STAGE, XHCI_TRB_SETUP_STAGE, XHCI_TRB_STATUS_STAGE, and XHCI_TRB_TRANSFER_EVENT.
Referenced by xhci_send_async_stub().
|
private |
Definition at line 113 of file xhci.cpp.
References cmd_ring, cmd_ring_index, cmd_ring_pcs, xhci_trb::control, doorbell_regs, xhci_trb::ptr, and xhci_trb::status.
Referenced by address_device(), and enable_slot().
|
inline |
|
overridevirtual |
Implements IOforgePCI.
References XHCIModule().
Definition at line 132 of file xhci.cpp.
References event_ring, event_ring_index, event_ring_pcs, event_ring_phys, runtime_regs, type, wait_for_event(), and XHCIModule().
Referenced by address_device(), enable_slot(), send_async_with_response(), and wait_for_event().
|
private |
Definition at line 154 of file xhci.hpp.
Referenced by init_controller(), and load().
|
private |
Definition at line 166 of file xhci.hpp.
Referenced by init_controller(), and send_command().
|
private |
Definition at line 168 of file xhci.hpp.
Referenced by init_controller(), and send_command().
|
private |
Definition at line 169 of file xhci.hpp.
Referenced by init_controller(), and send_command().
|
private |
Definition at line 167 of file xhci.hpp.
Referenced by init_controller().
|
private |
Definition at line 195 of file xhci.hpp.
Referenced by set_controller().
|
private |
Definition at line 163 of file xhci.hpp.
Referenced by address_device(), and init_controller().
|
private |
Definition at line 164 of file xhci.hpp.
Referenced by init_controller().
|
private |
|
private |
Definition at line 157 of file xhci.hpp.
Referenced by load(), send_async_with_response(), and send_command().
|
private |
Definition at line 193 of file xhci.hpp.
Referenced by init_controller().
|
private |
Definition at line 171 of file xhci.hpp.
Referenced by init_controller(), and wait_for_event().
|
private |
Definition at line 173 of file xhci.hpp.
Referenced by init_controller(), and wait_for_event().
|
private |
Definition at line 174 of file xhci.hpp.
Referenced by __attribute__(), init_controller(), and wait_for_event().
|
private |
Definition at line 172 of file xhci.hpp.
Referenced by init_controller(), and wait_for_event().
|
staticprivate |
Definition at line 197 of file xhci.hpp.
Referenced by getInstance().
|
private |
Definition at line 161 of file xhci.hpp.
Referenced by init_controller().
|
private |
Definition at line 160 of file xhci.hpp.
Referenced by init_controller(), and probe_ports().
|
private |
Definition at line 159 of file xhci.hpp.
Referenced by init_controller().
|
private |
Definition at line 155 of file xhci.hpp.
Referenced by init_controller(), load(), probe_ports(), and reset_controller().
|
private |
Definition at line 156 of file xhci.hpp.
Referenced by init_controller(), load(), and wait_for_event().
|
private |
Referenced by address_device(), and send_async_with_response().