XU XUv0.16.0

#core/xhci

导入方式: #core/xhci

公开 API: 12 函数, 0 方法, 3 类型, 22 常量, 0 方法集

标准库包 `#core/xhci`。

const XHCI_PCI_CLASS

XuAPI
pub const XHCI_PCI_CLASS = 0x0C

用途

常量 XHCI_PCI_CLASS,定义了相关的协议或算法配置参数。

const XHCI_PCI_SUBCLASS

XuAPI
pub const XHCI_PCI_SUBCLASS = 0x03

用途

常量 XHCI_PCI_SUBCLASS,定义了相关的协议或算法配置参数。

const XHCI_PCI_PROGIF

XuAPI
pub const XHCI_PCI_PROGIF = 0x30

用途

常量 XHCI_PCI_PROGIF,定义了相关的协议或算法配置参数。

const XHCI_USBCMD_RS

XuAPI
pub const XHCI_USBCMD_RS = 0x1

用途

常量 XHCI_USBCMD_RS,定义了相关的协议或算法配置参数。

const XHCI_USBCMD_HCRST

XuAPI
pub const XHCI_USBCMD_HCRST = 0x2

用途

常量 XHCI_USBCMD_HCRST,定义了相关的协议或算法配置参数。

const XHCI_USBCMD_INTE

XuAPI
pub const XHCI_USBCMD_INTE = 0x4

用途

常量 XHCI_USBCMD_INTE,定义了相关的协议或算法配置参数。

const XHCI_USBSTS_HCH

XuAPI
pub const XHCI_USBSTS_HCH = 0x1

用途

常量 XHCI_USBSTS_HCH,定义了相关的协议或算法配置参数。

const XHCI_USBSTS_CNR

XuAPI
pub const XHCI_USBSTS_CNR = 0x800

用途

常量 XHCI_USBSTS_CNR,定义了相关的协议或算法配置参数。

const XHCI_TRB_TYPE_SHIFT

XuAPI
pub const XHCI_TRB_TYPE_SHIFT = 10

用途

常量 XHCI_TRB_TYPE_SHIFT,定义了相关的协议或算法配置参数。

const XHCI_TRB_ENABLE_SLOT

XuAPI
pub const XHCI_TRB_ENABLE_SLOT = 9

用途

常量 XHCI_TRB_ENABLE_SLOT,定义了相关的协议或算法配置参数。

const XHCI_TRB_DISABLE_SLOT

XuAPI
pub const XHCI_TRB_DISABLE_SLOT = 10

用途

常量 XHCI_TRB_DISABLE_SLOT,定义了相关的协议或算法配置参数。

const XHCI_TRB_ADDRESS_DEVICE

XuAPI
pub const XHCI_TRB_ADDRESS_DEVICE = 11

用途

常量 XHCI_TRB_ADDRESS_DEVICE,定义了相关的协议或算法配置参数。

const XHCI_TRB_NOOP_CMD

XuAPI
pub const XHCI_TRB_NOOP_CMD = 23

用途

常量 XHCI_TRB_NOOP_CMD,定义了相关的协议或算法配置参数。

const XHCI_TRB_CMD_COMPLETION

XuAPI
pub const XHCI_TRB_CMD_COMPLETION = 33

用途

常量 XHCI_TRB_CMD_COMPLETION,定义了相关的协议或算法配置参数。

const XHCI_TRB_PORT_STATUS_CHANGE

XuAPI
pub const XHCI_TRB_PORT_STATUS_CHANGE = 34

用途

常量 XHCI_TRB_PORT_STATUS_CHANGE,定义了相关的协议或算法配置参数。

const XHCI_CC_SUCCESS

XuAPI
pub const XHCI_CC_SUCCESS = 1

用途

常量 XHCI_CC_SUCCESS,定义了相关的协议或算法配置参数。

const XHCI_PORTSC_CCS

XuAPI
pub const XHCI_PORTSC_CCS = 0x1

用途

常量 XHCI_PORTSC_CCS,定义了相关的协议或算法配置参数。

const XHCI_PORTSC_PED

XuAPI
pub const XHCI_PORTSC_PED = 0x2

用途

常量 XHCI_PORTSC_PED,定义了相关的协议或算法配置参数。

const XHCI_CMD_RING_TRBS

XuAPI
pub const XHCI_CMD_RING_TRBS = 64

用途

常量 XHCI_CMD_RING_TRBS,定义了相关的协议或算法配置参数。

const XHCI_EVT_RING_TRBS

XuAPI
pub const XHCI_EVT_RING_TRBS = 64

用途

常量 XHCI_EVT_RING_TRBS,定义了相关的协议或算法配置参数。

const XHCI_DMA_MIN_BYTES

XuAPI
pub const XHCI_DMA_MIN_BYTES = 16384

用途

常量 XHCI_DMA_MIN_BYTES,定义了相关的协议或算法配置参数。

struct XhciTrb

XuAPI
pub struct XhciTrb {
    pub param u64
    pub status u32
    pub control u32
}

用途

承载 param、status、control 等属性的结构体。

公开字段

param u64
字段(u64)
status u32
字段(u32)
control u32
字段(u32)

struct XhciErstEntry

XuAPI
pub struct XhciErstEntry {
    pub ring_base u64
    pub ring_size u32
    pub reserved u32
}

用途

承载 ring_base、ring_size、reserved 等属性的结构体。

公开字段

ring_base u64
字段(u64)
ring_size u32
字段(u32)
reserved u32
字段(u32)

struct XhciController

XuAPI
pub struct XhciController {
    pub mmio_base u64
    pub op_base u64
    pub rt_base u64
    pub db_base u64
    pub hci_version u16
    pub max_slots u8
    pub max_ports u8
    pub dcbaa_pa u64
    pub cmd_ring_pa u64
    pub evt_ring_pa u64
    pub erst_pa u64
    pub cmd_enq u32
    pub cmd_cycle u8
    pub evt_deq u32
    pub evt_cycle u8
}

用途

承载 mmio_base、op_base、rt_base、db_base、hci_version 等属性的结构体。

公开字段

mmio_base u64
字段(u64)
op_base u64
字段(u64)
rt_base u64
字段(u64)
db_base u64
字段(u64)
hci_version u16
字段(u16)
max_slots u8
字段(u8)
max_ports u8
字段(u8)
dcbaa_pa u64
字段(u64)
cmd_ring_pa u64
字段(u64)
evt_ring_pa u64
字段(u64)
erst_pa u64
字段(u64)
cmd_enq u32
字段(u32)
cmd_cycle u8
字段(u8)
evt_deq u32
字段(u32)
evt_cycle u8
字段(u8)

xhci_trb_make

XuAPI
pub fn xhci_trb_make(param u64, status u32, trb_type u32, slot_id u8, cycle bool) XhciTrb

用途

执行 xhci trb make 操作。

参数

param u64
param(u64)
status u32
status(u32)
trb_type u32
trb_type(u32)
slot_id u8
slot_id(u8)
cycle bool
cycle(bool)

返回值

XhciTrb — 该类型的值

xhci_trb_type

XuAPI
pub fn xhci_trb_type(ctrl u32) u32

用途

执行 xhci trb type 操作。

参数

ctrl u32
ctrl(u32)

返回值

u32 — 该类型的值

xhci_trb_cc

XuAPI
pub fn xhci_trb_cc(status u32) u8

用途

执行 xhci trb cc 操作。

参数

status u32
status(u32)

返回值

u8 — 该类型的值

xhci_trb_slot

XuAPI
pub fn xhci_trb_slot(ctrl u32) u8

用途

执行 xhci trb slot 操作。

参数

ctrl u32
ctrl(u32)

返回值

u8 — 该类型的值

xhci_find_pci

XuAPI
pub fn xhci_find_pci(out *raw pci.PciDevice) bool

用途

执行 xhci find pci 操作。

参数

out *raw pci.PciDevice
out(*raw pci.PciDevice)

返回值

bool — 是否成立

xhci_controller_init

XuAPI
pub fn xhci_controller_init(ctrl *raw XhciController, mmio_base u64, dma_base u64, dma_bytes u64) bool

用途

执行 xhci controller init 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)
mmio_base u64
mmio_base(u64)
dma_base u64
dma_base(u64)
dma_bytes u64
dma_bytes(u64)

返回值

bool — 是否成立

xhci_submit_cmd

XuAPI
pub fn xhci_submit_cmd( ctrl *raw XhciController, trb_type u32, param u64, slot_id u8, out_cc *raw u8, out_slot *raw u8 ) bool

用途

执行 xhci submit cmd 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)
trb_type u32
trb_type(u32)
param u64
param(u64)
slot_id u8
slot_id(u8)
out_cc *raw u8
out_cc(*raw u8)
out_slot *raw u8
out_slot(*raw u8)

返回值

bool — 是否成立

xhci_noop

XuAPI
pub fn xhci_noop(ctrl *raw XhciController) bool

用途

执行 xhci noop 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)

返回值

bool — 是否成立

xhci_enable_slot

XuAPI
pub fn xhci_enable_slot(ctrl *raw XhciController, out_slot *raw u8) bool

用途

执行 xhci enable slot 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)
out_slot *raw u8
out_slot(*raw u8)

返回值

bool — 是否成立

xhci_port_sc

XuAPI
pub fn xhci_port_sc(ctrl *raw XhciController, port_1based u32) u32

用途

执行 xhci port sc 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)
port_1based u32
port_1based(u32)

返回值

u32 — 该类型的值

xhci_port_connected

XuAPI
pub fn xhci_port_connected(ctrl *raw XhciController, port_1based u32) bool

用途

执行 xhci port connected 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)
port_1based u32
port_1based(u32)

返回值

bool — 是否成立

xhci_port_speed

XuAPI
pub fn xhci_port_speed(ctrl *raw XhciController, port_1based u32) u8

用途

执行 xhci port speed 操作。

参数

ctrl *raw XhciController
ctrl(*raw XhciController)
port_1based u32
port_1based(u32)

返回值

u8 — 该类型的值