Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
xhci.hpp File Reference
#include "ioforge/ioforge_pci.hpp"
#include "ioforge/ioforge_usb.h"
#include <type.h>

Go to the source code of this file.

Data Structures

struct  xhci_cap_regs
 
struct  xhci_op_regs
 
struct  xhci_intr_regs
 
struct  xhci_runtime_regs
 
struct  xhci_trb
 
struct  xhci_slot_ctx
 
struct  xhci_endpoint_ctx
 
struct  xhci_device_ctx
 
struct  xhci_input_control_ctx
 
struct  xhci_input_ctx
 
class  XHCIModule
 
struct  XHCIModule::xhci_slot
 
struct  XHCIModule::xhci_erst_entry
 

Macros

#define XHCI_VENDOR_ID   0x1b36
 
#define XHCI_DEVICE_ID   0x000d
 
#define XHCI_PORT_CCS   (1 << 0)
 
#define XHCI_PORT_PED   (1 << 1)
 
#define XHCI_PORT_PR   (1 << 4)
 
#define XHCI_PORT_PLS_MASK   (0xF << 5)
 
#define XHCI_PORT_PP   (1 << 9)
 
#define XHCI_PORT_SPEED_MASK   (0xF << 10)
 
#define XHCI_PORT_CSC   (1 << 17)
 
#define XHCI_PORT_PRC   (1 << 21)
 
#define XHCI_CMD_RS   (1 << 0)
 
#define XHCI_CMD_HCRST   (1 << 1)
 
#define XHCI_CMD_INTE   (1 << 2)
 
#define XHCI_STS_HCH   (1 << 0)
 
#define XHCI_STS_CNR   (1 << 11)
 
#define XHCI_TRB_NORMAL   1
 
#define XHCI_TRB_SETUP_STAGE   2
 
#define XHCI_TRB_DATA_STAGE   3
 
#define XHCI_TRB_STATUS_STAGE   4
 
#define XHCI_TRB_LINK   6
 
#define XHCI_TRB_ENABLE_SLOT_CMD   9
 
#define XHCI_TRB_ADDRESS_DEVICE_CMD   11
 
#define XHCI_TRB_CONFIGURE_ENDPOINT_CMD   12
 
#define XHCI_TRB_TRANSFER_EVENT   32
 
#define XHCI_TRB_COMMAND_COMPLETION_EVENT   33
 
#define XHCI_TRB_PORT_STATUS_CHANGE_EVENT   34
 

Functions

struct xhci_cap_regs __attribute__ ((packed))
 

Variables

uint8_t caplength
 
uint8_t reserved
 
uint16_t hciversion
 
uint32_t hcsparams1
 
uint32_t hcsparams2
 
uint32_t hcsparams3
 
uint32_t hccparams1
 
uint32_t dboff
 
uint32_t rtsoff
 
uint32_t hccparams2
 
volatile uint32_t usbcmd
 
volatile uint32_t usbsts
 
volatile uint32_t pagesize
 
uint32_t reserved1 [2]
 
volatile uint32_t dnctrl
 
volatile uint64_t crcr
 
uint32_t reserved2 [4]
 
volatile uint64_t dcbaap
 
volatile uint32_t config
 
volatile uint32_t iman
 
volatile uint32_t imod
 
volatile uint32_t erstsz
 
volatile uint64_t erstba
 
volatile uint64_t erdp
 
volatile uint32_t mfindex
 
struct xhci_intr_regs ir [1024]
 
uint64_t ptr
 
uint32_t status
 
uint32_t control
 
uint32_t info
 
uint32_t info2
 
uint64_t trdp
 
uint32_t info3
 
struct xhci_slot_ctx slot
 
struct xhci_endpoint_ctx ep [31]
 
uint32_t drop_flags
 
uint32_t add_flags
 
struct xhci_input_control_ctx input_control
 
struct xhci_device_ctx device
 
uint64_t ba
 
uint32_t size
 
XHCIModule __attribute__
 

Macro Definition Documentation

◆ XHCI_CMD_HCRST

#define XHCI_CMD_HCRST   (1 << 1)

Definition at line 66 of file xhci.hpp.

Referenced by XHCIModule::reset_controller().

◆ XHCI_CMD_INTE

#define XHCI_CMD_INTE   (1 << 2)

Definition at line 67 of file xhci.hpp.

◆ XHCI_CMD_RS

#define XHCI_CMD_RS   (1 << 0)

Definition at line 65 of file xhci.hpp.

Referenced by XHCIModule::init_controller(), and XHCIModule::reset_controller().

◆ XHCI_DEVICE_ID

#define XHCI_DEVICE_ID   0x000d

Definition at line 9 of file xhci.hpp.

Referenced by XHCIModule::load().

◆ XHCI_PORT_CCS

#define XHCI_PORT_CCS   (1 << 0)

Definition at line 55 of file xhci.hpp.

Referenced by XHCIModule::probe_ports().

◆ XHCI_PORT_CSC

#define XHCI_PORT_CSC   (1 << 17)

Definition at line 61 of file xhci.hpp.

◆ XHCI_PORT_PED

#define XHCI_PORT_PED   (1 << 1)

Definition at line 56 of file xhci.hpp.

Referenced by XHCIModule::probe_ports().

◆ XHCI_PORT_PLS_MASK

#define XHCI_PORT_PLS_MASK   (0xF << 5)

Definition at line 58 of file xhci.hpp.

◆ XHCI_PORT_PP

#define XHCI_PORT_PP   (1 << 9)

Definition at line 59 of file xhci.hpp.

◆ XHCI_PORT_PR

#define XHCI_PORT_PR   (1 << 4)

Definition at line 57 of file xhci.hpp.

Referenced by XHCIModule::probe_ports().

◆ XHCI_PORT_PRC

#define XHCI_PORT_PRC   (1 << 21)

Definition at line 62 of file xhci.hpp.

◆ XHCI_PORT_SPEED_MASK

#define XHCI_PORT_SPEED_MASK   (0xF << 10)

Definition at line 60 of file xhci.hpp.

◆ XHCI_STS_CNR

#define XHCI_STS_CNR   (1 << 11)

Definition at line 71 of file xhci.hpp.

Referenced by XHCIModule::reset_controller().

◆ XHCI_STS_HCH

#define XHCI_STS_HCH   (1 << 0)

Definition at line 70 of file xhci.hpp.

Referenced by XHCIModule::init_controller(), and XHCIModule::reset_controller().

◆ XHCI_TRB_ADDRESS_DEVICE_CMD

#define XHCI_TRB_ADDRESS_DEVICE_CMD   11

Definition at line 80 of file xhci.hpp.

Referenced by XHCIModule::address_device().

◆ XHCI_TRB_COMMAND_COMPLETION_EVENT

#define XHCI_TRB_COMMAND_COMPLETION_EVENT   33

Definition at line 83 of file xhci.hpp.

Referenced by XHCIModule::address_device(), and XHCIModule::enable_slot().

◆ XHCI_TRB_CONFIGURE_ENDPOINT_CMD

#define XHCI_TRB_CONFIGURE_ENDPOINT_CMD   12

Definition at line 81 of file xhci.hpp.

◆ XHCI_TRB_DATA_STAGE

#define XHCI_TRB_DATA_STAGE   3

Definition at line 76 of file xhci.hpp.

Referenced by XHCIModule::send_async_with_response().

◆ XHCI_TRB_ENABLE_SLOT_CMD

#define XHCI_TRB_ENABLE_SLOT_CMD   9

Definition at line 79 of file xhci.hpp.

Referenced by XHCIModule::enable_slot().

◆ XHCI_TRB_LINK

#define XHCI_TRB_LINK   6

Definition at line 78 of file xhci.hpp.

◆ XHCI_TRB_NORMAL

#define XHCI_TRB_NORMAL   1

Definition at line 74 of file xhci.hpp.

◆ XHCI_TRB_PORT_STATUS_CHANGE_EVENT

#define XHCI_TRB_PORT_STATUS_CHANGE_EVENT   34

Definition at line 84 of file xhci.hpp.

◆ XHCI_TRB_SETUP_STAGE

#define XHCI_TRB_SETUP_STAGE   2

Definition at line 75 of file xhci.hpp.

Referenced by XHCIModule::send_async_with_response().

◆ XHCI_TRB_STATUS_STAGE

#define XHCI_TRB_STATUS_STAGE   4

Definition at line 77 of file xhci.hpp.

Referenced by XHCIModule::send_async_with_response().

◆ XHCI_TRB_TRANSFER_EVENT

#define XHCI_TRB_TRANSFER_EVENT   32

Definition at line 82 of file xhci.hpp.

Referenced by XHCIModule::send_async_with_response().

◆ XHCI_VENDOR_ID

#define XHCI_VENDOR_ID   0x1b36

Definition at line 8 of file xhci.hpp.

Referenced by XHCIModule::load().

Function Documentation

◆ __attribute__()

struct xhci_cap_regs __attribute__ ( (packed) )

Definition at line 1 of file tcp.h.

Variable Documentation

◆ __attribute__

XHCIModule __attribute__

◆ add_flags

uint32_t add_flags

Definition at line 1 of file xhci.hpp.

◆ ba

Definition at line 0 of file xhci.hpp.

◆ caplength

uint8_t caplength

Definition at line 0 of file xhci.hpp.

◆ config

volatile uint32_t config

Definition at line 8 of file xhci.hpp.

Referenced by EHCIModule::probe().

◆ control

uint32_t control

Definition at line 2 of file xhci.hpp.

◆ crcr

volatile uint64_t crcr

Definition at line 5 of file xhci.hpp.

◆ dboff

uint32_t dboff

Definition at line 7 of file xhci.hpp.

◆ dcbaap

volatile uint64_t dcbaap

Definition at line 7 of file xhci.hpp.

◆ device

struct xhci_device_ctx device

Definition at line 1 of file xhci.hpp.

◆ dnctrl

volatile uint32_t dnctrl

Definition at line 4 of file xhci.hpp.

◆ drop_flags

uint32_t drop_flags

Definition at line 0 of file xhci.hpp.

◆ ep

struct xhci_endpoint_ctx ep[31]

Definition at line 1 of file xhci.hpp.

◆ erdp

volatile uint64_t erdp

Definition at line 5 of file xhci.hpp.

◆ erstba

volatile uint64_t erstba

Definition at line 4 of file xhci.hpp.

◆ erstsz

volatile uint32_t erstsz

Definition at line 2 of file xhci.hpp.

◆ hccparams1

uint32_t hccparams1

Definition at line 6 of file xhci.hpp.

◆ hccparams2

uint32_t hccparams2

Definition at line 9 of file xhci.hpp.

◆ hciversion

uint16_t hciversion

Definition at line 2 of file xhci.hpp.

◆ hcsparams1

uint32_t hcsparams1

Definition at line 3 of file xhci.hpp.

◆ hcsparams2

uint32_t hcsparams2

Definition at line 4 of file xhci.hpp.

◆ hcsparams3

uint32_t hcsparams3

Definition at line 5 of file xhci.hpp.

◆ iman

volatile uint32_t iman

Definition at line 0 of file xhci.hpp.

◆ imod

volatile uint32_t imod

Definition at line 1 of file xhci.hpp.

◆ info

uint32_t info

Definition at line 0 of file xhci.hpp.

Referenced by ATAPIModule::identify().

◆ info2

uint32_t info2

Definition at line 1 of file xhci.hpp.

◆ info3

uint32_t info3

Definition at line 3 of file xhci.hpp.

◆ input_control

struct xhci_input_control_ctx input_control

Definition at line 0 of file xhci.hpp.

◆ ir

struct xhci_intr_regs ir[1024]

Definition at line 2 of file xhci.hpp.

◆ mfindex

volatile uint32_t mfindex

Definition at line 0 of file xhci.hpp.

◆ pagesize

volatile uint32_t pagesize

Definition at line 2 of file xhci.hpp.

◆ ptr

◆ reserved

uint32_t reserved

Definition at line 1 of file xhci.hpp.

◆ reserved1

uint32_t reserved1[2]

Definition at line 3 of file xhci.hpp.

◆ reserved2

uint32_t reserved2[4]

Definition at line 6 of file xhci.hpp.

◆ rtsoff

uint32_t rtsoff

Definition at line 8 of file xhci.hpp.

◆ size

uint32_t size

Definition at line 1 of file xhci.hpp.

◆ slot

struct xhci_slot_ctx slot

◆ status

uint32_t status

Definition at line 1 of file xhci.hpp.

Referenced by XHCIModule::probe_ports().

◆ trdp

uint64_t trdp

Definition at line 2 of file xhci.hpp.

◆ usbcmd

volatile uint32_t usbcmd

Definition at line 0 of file xhci.hpp.

◆ usbsts

volatile uint32_t usbsts

Definition at line 1 of file xhci.hpp.