const XHCI_PCI_CLASS
pub const XHCI_PCI_CLASS = 0x0C用途
常量 XHCI_PCI_CLASS,定义了相关的协议或算法配置参数。
#core/xhci标准库包 `#core/xhci`。
const XHCI_PCI_CLASSpub const XHCI_PCI_CLASS = 0x0C常量 XHCI_PCI_CLASS,定义了相关的协议或算法配置参数。
const XHCI_PCI_SUBCLASSpub const XHCI_PCI_SUBCLASS = 0x03常量 XHCI_PCI_SUBCLASS,定义了相关的协议或算法配置参数。
const XHCI_PCI_PROGIFpub const XHCI_PCI_PROGIF = 0x30常量 XHCI_PCI_PROGIF,定义了相关的协议或算法配置参数。
const XHCI_USBCMD_RSpub const XHCI_USBCMD_RS = 0x1常量 XHCI_USBCMD_RS,定义了相关的协议或算法配置参数。
const XHCI_USBCMD_HCRSTpub const XHCI_USBCMD_HCRST = 0x2常量 XHCI_USBCMD_HCRST,定义了相关的协议或算法配置参数。
const XHCI_USBCMD_INTEpub const XHCI_USBCMD_INTE = 0x4常量 XHCI_USBCMD_INTE,定义了相关的协议或算法配置参数。
const XHCI_USBSTS_HCHpub const XHCI_USBSTS_HCH = 0x1常量 XHCI_USBSTS_HCH,定义了相关的协议或算法配置参数。
const XHCI_USBSTS_CNRpub const XHCI_USBSTS_CNR = 0x800常量 XHCI_USBSTS_CNR,定义了相关的协议或算法配置参数。
const XHCI_TRB_TYPE_SHIFTpub const XHCI_TRB_TYPE_SHIFT = 10常量 XHCI_TRB_TYPE_SHIFT,定义了相关的协议或算法配置参数。
const XHCI_TRB_LINKpub const XHCI_TRB_LINK = 6常量 XHCI_TRB_LINK,定义了相关的协议或算法配置参数。
const XHCI_TRB_ENABLE_SLOTpub const XHCI_TRB_ENABLE_SLOT = 9常量 XHCI_TRB_ENABLE_SLOT,定义了相关的协议或算法配置参数。
const XHCI_TRB_DISABLE_SLOTpub const XHCI_TRB_DISABLE_SLOT = 10常量 XHCI_TRB_DISABLE_SLOT,定义了相关的协议或算法配置参数。
const XHCI_TRB_ADDRESS_DEVICEpub const XHCI_TRB_ADDRESS_DEVICE = 11常量 XHCI_TRB_ADDRESS_DEVICE,定义了相关的协议或算法配置参数。
const XHCI_TRB_NOOP_CMDpub const XHCI_TRB_NOOP_CMD = 23常量 XHCI_TRB_NOOP_CMD,定义了相关的协议或算法配置参数。
const XHCI_TRB_CMD_COMPLETIONpub const XHCI_TRB_CMD_COMPLETION = 33常量 XHCI_TRB_CMD_COMPLETION,定义了相关的协议或算法配置参数。
const XHCI_TRB_PORT_STATUS_CHANGEpub const XHCI_TRB_PORT_STATUS_CHANGE = 34常量 XHCI_TRB_PORT_STATUS_CHANGE,定义了相关的协议或算法配置参数。
const XHCI_CC_SUCCESSpub const XHCI_CC_SUCCESS = 1常量 XHCI_CC_SUCCESS,定义了相关的协议或算法配置参数。
const XHCI_PORTSC_CCSpub const XHCI_PORTSC_CCS = 0x1常量 XHCI_PORTSC_CCS,定义了相关的协议或算法配置参数。
const XHCI_PORTSC_PEDpub const XHCI_PORTSC_PED = 0x2常量 XHCI_PORTSC_PED,定义了相关的协议或算法配置参数。
const XHCI_CMD_RING_TRBSpub const XHCI_CMD_RING_TRBS = 64常量 XHCI_CMD_RING_TRBS,定义了相关的协议或算法配置参数。
const XHCI_EVT_RING_TRBSpub const XHCI_EVT_RING_TRBS = 64常量 XHCI_EVT_RING_TRBS,定义了相关的协议或算法配置参数。
const XHCI_DMA_MIN_BYTESpub const XHCI_DMA_MIN_BYTES = 16384常量 XHCI_DMA_MIN_BYTES,定义了相关的协议或算法配置参数。
struct XhciTrbpub struct XhciTrb {
pub param u64
pub status u32
pub control u32
}承载 param、status、control 等属性的结构体。
param u64status u32control u32struct XhciErstEntrypub struct XhciErstEntry {
pub ring_base u64
pub ring_size u32
pub reserved u32
}承载 ring_base、ring_size、reserved 等属性的结构体。
ring_base u64ring_size u32reserved u32struct XhciControllerpub 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 u64op_base u64rt_base u64db_base u64hci_version u16max_slots u8max_ports u8dcbaa_pa u64cmd_ring_pa u64evt_ring_pa u64erst_pa u64cmd_enq u32cmd_cycle u8evt_deq u32evt_cycle u8xhci_trb_makepub fn xhci_trb_make(param u64, status u32, trb_type u32, slot_id u8, cycle bool) XhciTrb执行 xhci trb make 操作。
param u64status u32trb_type u32slot_id u8cycle boolXhciTrb — 该类型的值
xhci_trb_typepub fn xhci_trb_type(ctrl u32) u32执行 xhci trb type 操作。
ctrl u32u32 — 该类型的值
xhci_trb_ccpub fn xhci_trb_cc(status u32) u8执行 xhci trb cc 操作。
status u32u8 — 该类型的值
xhci_trb_slotpub fn xhci_trb_slot(ctrl u32) u8执行 xhci trb slot 操作。
ctrl u32u8 — 该类型的值
xhci_find_pcipub fn xhci_find_pci(out *raw pci.PciDevice) bool执行 xhci find pci 操作。
out *raw pci.PciDevicebool — 是否成立
xhci_controller_initpub fn xhci_controller_init(ctrl *raw XhciController, mmio_base u64, dma_base u64, dma_bytes u64) bool执行 xhci controller init 操作。
ctrl *raw XhciControllermmio_base u64dma_base u64dma_bytes u64bool — 是否成立
xhci_submit_cmdpub 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 XhciControllertrb_type u32param u64slot_id u8out_cc *raw u8out_slot *raw u8bool — 是否成立
xhci_nooppub fn xhci_noop(ctrl *raw XhciController) bool执行 xhci noop 操作。
ctrl *raw XhciControllerbool — 是否成立
xhci_enable_slotpub fn xhci_enable_slot(ctrl *raw XhciController, out_slot *raw u8) bool执行 xhci enable slot 操作。
ctrl *raw XhciControllerout_slot *raw u8bool — 是否成立
xhci_port_scpub fn xhci_port_sc(ctrl *raw XhciController, port_1based u32) u32执行 xhci port sc 操作。
ctrl *raw XhciControllerport_1based u32u32 — 该类型的值
xhci_port_connectedpub fn xhci_port_connected(ctrl *raw XhciController, port_1based u32) bool执行 xhci port connected 操作。
ctrl *raw XhciControllerport_1based u32bool — 是否成立
xhci_port_speedpub fn xhci_port_speed(ctrl *raw XhciController, port_1based u32) u8执行 xhci port speed 操作。
ctrl *raw XhciControllerport_1based u32u8 — 该类型的值