]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
Let the xhci_hw_root structure span exactly XHCI_PAGE_SIZE bytes by increasing
authorHans Petter Selasky <hselasky@FreeBSD.org>
Sat, 10 Jul 2021 12:14:11 +0000 (14:14 +0200)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Thu, 17 Mar 2022 12:25:49 +0000 (13:25 +0100)
the number of completion event TRBs. This avoids wasting memory.

Sponsored by: NVIDIA Networking
Approved by: re (gjb)

(cherry picked from commit e036ee6ce2e4d6fe0564f8bb3aa99a2f61d48fc6)
(cherry picked from commit afeeccfbed271f4f6ba7b300d01eea34281395fd)

sys/dev/usb/controller/xhci.h

index c0427e0cf11f50e5bcc2a642099bd7847646e585..e8841a05b1341c2c0a38e14085e265d33a38e84b 100644 (file)
@@ -33,7 +33,7 @@
 #define        XHCI_MAX_DEVICES        MIN(USB_MAX_DEVICES, 128)
 #define        XHCI_MAX_ENDPOINTS      32      /* hardcoded - do not change */
 #define        XHCI_MAX_SCRATCHPADS    256     /* theoretical max is 1023 */
-#define        XHCI_MAX_EVENTS         (16 * 13)
+#define        XHCI_MAX_EVENTS         232
 #define        XHCI_MAX_COMMANDS       (16 * 1)
 #define        XHCI_MAX_RSEG           1
 #define        XHCI_MAX_TRANSFERS      4
@@ -383,6 +383,8 @@ struct xhci_hw_root {
        struct xhci_trb                 hwr_commands[XHCI_MAX_COMMANDS];
 };
 
+CTASSERT(sizeof(struct xhci_hw_root) == XHCI_PAGE_SIZE);
+
 struct xhci_endpoint_ext {
        struct xhci_trb         *trb;
        struct usb_xfer         *xfer[XHCI_MAX_TRANSFERS * XHCI_MAX_STREAMS];