summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/controller/xhci.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-06-29 10:21:45 +0000
committerhselasky <hselasky@FreeBSD.org>2016-06-29 10:21:45 +0000
commit30127456997ac49731bda4c63b4ab6ae9d8a2e8a (patch)
tree785d9e8d4b572ab301d82c9d2979a07ec13cc80c /sys/dev/usb/controller/xhci.c
parentc04eec0cf0d22693afb178c43250f77699c18964 (diff)
downloadFreeBSD-src-30127456997ac49731bda4c63b4ab6ae9d8a2e8a.zip
FreeBSD-src-30127456997ac49731bda4c63b4ab6ae9d8a2e8a.tar.gz
MFC r302076:
Update the definition for number of scratch pages to match the latest version of the XHCI specification. Make sure the code can handle the maximum number of allowed scratch pages. Submitted by: Shichun_Ma@Dell.com
Diffstat (limited to 'sys/dev/usb/controller/xhci.c')
-rw-r--r--sys/dev/usb/controller/xhci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c
index 18f871e..0b708b8 100644
--- a/sys/dev/usb/controller/xhci.c
+++ b/sys/dev/usb/controller/xhci.c
@@ -215,7 +215,7 @@ static void
xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
{
struct xhci_softc *sc = XHCI_BUS2SC(bus);
- uint8_t i;
+ uint16_t i;
cb(bus, &sc->sc_hw.root_pc, &sc->sc_hw.root_pg,
sizeof(struct xhci_hw_root), XHCI_PAGE_SIZE);
@@ -223,7 +223,7 @@ xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
cb(bus, &sc->sc_hw.ctx_pc, &sc->sc_hw.ctx_pg,
sizeof(struct xhci_dev_ctx_addr), XHCI_PAGE_SIZE);
- for (i = 0; i != XHCI_MAX_SCRATCHPADS; i++) {
+ for (i = 0; i != sc->sc_noscratch; i++) {
cb(bus, &sc->sc_hw.scratch_pc[i], &sc->sc_hw.scratch_pg[i],
XHCI_PAGE_SIZE, XHCI_PAGE_SIZE);
}
OpenPOWER on IntegriCloud