From c7d979e85dca9e6a480b44c0ccb0ef8cc60f7e6b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 8 Jan 2025 22:02:03 -0500 Subject: kernel: xhci: Add TRB definitions Signed-off-by: Ian Moffett --- sys/include/dev/usb/xhcivar.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'sys/include/dev/usb') diff --git a/sys/include/dev/usb/xhcivar.h b/sys/include/dev/usb/xhcivar.h index 4b0f1bf..6d0e185 100644 --- a/sys/include/dev/usb/xhcivar.h +++ b/sys/include/dev/usb/xhcivar.h @@ -50,6 +50,43 @@ struct xhci_proto { uint8_t port_count; /* Number of ports */ }; +struct xhci_nop_trb { + uint32_t reserved; + uint32_t reserved1; + uint32_t reserved2; + uint8_t cycle : 1; + uint16_t reserved3 : 9; + uint8_t type : 6; + uint16_t reserved4; +}; + +struct xhci_enableslot_trb { + uint32_t reserved; + uint32_t reserved1; + uint32_t reserved2; + uint8_t cycle : 1; + uint16_t reserved3 : 9; + uint8_t type : 6; + uint8_t slot_type : 5; + uint16_t reserved4 : 10; +}; + +/* + * xHCI Transfer Request Block + */ +struct xhci_trb { + union { + struct xhci_nop_trb nop; + struct xhci_enableslot_trb enableslot; + struct { + uint32_t dword0; + uint32_t dword1; + uint32_t dword2; + uint32_t dword3; + }; + }; +}; + /* * xHCI event ring segment * @@ -78,4 +115,8 @@ struct xhci_hc { struct xhci_proto protos[XHCI_MAX_PROTOS]; }; +/* TRB types */ +#define XHCI_ENABLE_SLOT 9 +#define XHCI_LINK 6 + #endif /* !_USB_XHCIVAR_H_ */ -- cgit v1.2.3