diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-06-01 06:20:00 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-06-01 06:20:00 +0000 |
commit | ddc8f776d17ca84199ae6e5b90647e412907935e (patch) | |
tree | 39902165400c1a47f353c17e13f42576f640a390 /sys/dev/pci | |
parent | c5cd223cf265e2fe5b772003febe855ec0f6ad59 (diff) |
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/dev/pci')
-rw-r--r-- | sys/dev/pci/xhci_pci.c | 7 |
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; |