summaryrefslogtreecommitdiff
path: root/sys/include/dev/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include/dev/usb')
-rw-r--r--sys/include/dev/usb/xhciregs.h5
-rw-r--r--sys/include/dev/usb/xhcivar.h42
2 files changed, 47 insertions, 0 deletions
diff --git a/sys/include/dev/usb/xhciregs.h b/sys/include/dev/usb/xhciregs.h
index 8c47739..0416601 100644
--- a/sys/include/dev/usb/xhciregs.h
+++ b/sys/include/dev/usb/xhciregs.h
@@ -73,6 +73,7 @@ struct xhci_opregs {
/* USBCMD bits */
#define USBCMD_RUN BIT(0) /* Run/stop */
#define USBCMD_HCRST BIT(1) /* xHC reset */
+#define USBCMD_INTE BIT(2) /* Interrupt Enable */
/* USBSTS bits */
#define USBSTS_HCH BIT(0) /* HC halted */
@@ -113,4 +114,8 @@ struct xhci_opregs {
#define XHCI_BIOS_SEM BIT(16)
#define XHCI_OS_SEM BIT(24)
+/* IMAN bits */
+#define XHCI_IMAN_IP BIT(0)
+#define XHCI_IMAN_IE BIT(1)
+
#endif /* !_USB_XHCIREGS_H_ */
diff --git a/sys/include/dev/usb/xhcivar.h b/sys/include/dev/usb/xhcivar.h
index cd445c8..6d0e185 100644
--- a/sys/include/dev/usb/xhcivar.h
+++ b/sys/include/dev/usb/xhcivar.h
@@ -39,6 +39,7 @@
#define XHCI_EVRING_LEN 16
#define XHCI_TRB_SIZE 16 /* In bytes */
#define XHCI_MAX_PROTOS 4
+#define XHCI_IMOD_DEFAULT 0
/*
* USB proto (USB 2.0 or 3.0)
@@ -49,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
*
@@ -77,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_ */