summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-06-01 06:19:59 +0000
committermpi <mpi@openbsd.org>2016-06-01 06:19:59 +0000
commitc09be22776c8938ec4b9e20619e263d9546b48f1 (patch)
treedde4f8f3683dcff1d7a2b15103e9094347c2d1b7 /sys
parentmove all the art_node initialisation to art_get in art.c (diff)
downloadwireguard-openbsd-c09be22776c8938ec4b9e20619e263d9546b48f1.tar.xz
wireguard-openbsd-c09be22776c8938ec4b9e20619e263d9546b48f1.zip
Fix the loop iterating on extended capabilities. It turns out that we
never did the handoff between the BIOS and the OS correctly. Should make xhci(4) usable on machines with xHCI BIOS support like most of the recent DELL. Tested by Hrvoje Popovski and David Hill. ok kettenis@, mikeb@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/xhci_pci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/xhci_pci.c b/sys/dev/pci/xhci_pci.c
index d08ccbaa618..9c81902221b 100644
--- a/sys/dev/pci/xhci_pci.c
+++ b/sys/dev/pci/xhci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xhci_pci.c,v 1.7 2015/11/02 14:53:10 mpi Exp $ */
+/* $OpenBSD: xhci_pci.c,v 1.8 2016/06/01 06:19:59 mpi Exp $ */
/*
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -258,8 +258,9 @@ xhci_pci_takecontroller(struct xhci_pci_softc *psc, int silent)
eec = -1;
/* Synchronise with the BIOS if it owns the controller. */
- for (xecp = XHCI_HCC_XECP(cparams) << 2; xecp != 0;
- xecp = XHCI_XECP_NEXT(eec) << 2) {
+ for (xecp = XHCI_HCC_XECP(cparams) << 2;
+ xecp != 0 && XHCI_XECP_NEXT(eec);
+ xecp += XHCI_XECP_NEXT(eec) << 2) {
eec = XREAD4(&psc->sc, xecp);
if (XHCI_XECP_ID(eec) != XHCI_ID_USB_LEGACY)
continue;