diff options
Diffstat (limited to 'src/sys/include/io/usb')
-rw-r--r-- | src/sys/include/io/usb/xhciregs.h | 14 | ||||
-rw-r--r-- | src/sys/include/io/usb/xhcivar.h | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/sys/include/io/usb/xhciregs.h b/src/sys/include/io/usb/xhciregs.h index f2e572b..f849c54 100644 --- a/src/sys/include/io/usb/xhciregs.h +++ b/src/sys/include/io/usb/xhciregs.h @@ -32,6 +32,7 @@ #include <sys/types.h> #include <sys/cdefs.h> +#include <sys/param.h> /* * XHCI capability registers @@ -69,4 +70,17 @@ struct __packed xhci_opregs { volatile uint32_t reserved2; }; +/* + * USB command register bits + * + * See section 5.4.1 of the xHCI spec + */ +#define USBCMD_HCRST BIT(1) + +/* + * Macros to get various register spaces + */ +#define XHCI_OPBASE(CAPBASE) \ + PTR_OFFSET(CAPBASE, (CAPBASE)->caplength) + #endif /* !_XHCIREGS_H_ */ diff --git a/src/sys/include/io/usb/xhcivar.h b/src/sys/include/io/usb/xhcivar.h index 5067063..c0b3a39 100644 --- a/src/sys/include/io/usb/xhcivar.h +++ b/src/sys/include/io/usb/xhcivar.h @@ -39,7 +39,9 @@ * @io: I/O space */ struct xhci_hcd { - volatile void *io; + struct xhci_capregs *capspace; }; +#define XHCI_TIMEOUT_MSEC 500 + #endif /* !_USB_XHCIVAR_H_ */ |