Module Name: src Committed By: martin Date: Fri Jan 2 22:44:34 UTC 2015
Modified Files: src/sys/dev/usb [netbsd-7]: xhci.c xhcireg.h Log Message: Pull up following revision(s) (requested by skrll in ticket #372): sys/dev/usb/xhcireg.h: revision 1.2 sys/dev/usb/xhci.c: revision 1.28 kern/49391: Fixes to XHCI driver command ring and status TRB CRCR needs 64byte aligned address Use usb_allocmem instead of usb_allocmem_flags(..., 0) Correct status stage TRB in xhci_device_ctrl_start - direction logic was wrong. Correct a typo in a comment To generate a diff of this commit: cvs rdiff -u -r1.23.2.2 -r1.23.2.3 src/sys/dev/usb/xhci.c cvs rdiff -u -r1.1 -r1.1.10.1 src/sys/dev/usb/xhcireg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.23.2.2 src/sys/dev/usb/xhci.c:1.23.2.3 --- src/sys/dev/usb/xhci.c:1.23.2.2 Wed Aug 13 21:47:18 2014 +++ src/sys/dev/usb/xhci.c Fri Jan 2 22:44:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.23.2.2 2014/08/13 21:47:18 riz Exp $ */ +/* $NetBSD: xhci.c,v 1.23.2.3 2015/01/02 22:44:34 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23.2.2 2014/08/13 21:47:18 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23.2.3 2015/01/02 22:44:34 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1338,7 +1338,7 @@ xhci_allocm(struct usbd_bus *bus, usb_dm DPRINTF(("%s\n", __func__)); - err = usb_allocmem_flags(&sc->sc_bus, size, 0, dma, 0); + err = usb_allocmem(&sc->sc_bus, size, 0, dma); #if 0 if (err == USBD_NOMEM) err = usb_reserve_allocm(&sc->sc_dma_reserve, dma, size); @@ -2433,7 +2433,7 @@ xhci_root_ctrl_done(usbd_xfer_handle xfe xfer->hcpriv = NULL; } -/* root hub intrerrupt */ +/* root hub interrupt */ static usbd_status xhci_root_intr_transfer(usbd_xfer_handle xfer) @@ -2589,9 +2589,9 @@ xhci_device_ctrl_start(usbd_xfer_handle no_data: parameter = 0; - status = XHCI_TRB_2_IRQ_SET(0) | XHCI_TRB_2_TDSZ_SET(1); + status = XHCI_TRB_2_IRQ_SET(0); /* the status stage has inverted direction */ - control = (isread ? 0 : XHCI_TRB_3_DIR_IN) | + control = ((isread && (len > 0)) ? 0 : XHCI_TRB_3_DIR_IN) | XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_STATUS_STAGE) | XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_ENT_BIT; xhci_trb_put(&xx->xx_trb[i++], parameter, status, control); Index: src/sys/dev/usb/xhcireg.h diff -u src/sys/dev/usb/xhcireg.h:1.1 src/sys/dev/usb/xhcireg.h:1.1.10.1 --- src/sys/dev/usb/xhcireg.h:1.1 Sat Sep 14 00:40:31 2013 +++ src/sys/dev/usb/xhcireg.h Fri Jan 2 22:44:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: xhcireg.h,v 1.1 2013/09/14 00:40:31 jakllsch Exp $ */ +/* $NetBSD: xhcireg.h,v 1.1.10.1 2015/01/02 22:44:34 martin Exp $ */ /* $FreeBSD$ */ /*- @@ -212,7 +212,7 @@ #define XHCI_STREAM_CONTEXT_ALIGN 16 #define XHCI_STREAM_ARRAY_ALIGN 16 #define XHCI_TRANSFER_RING_SEGMENTS_ALIGN 16 -#define XHCI_COMMAND_RING_SEGMENTS_ALIGN 16 +#define XHCI_COMMAND_RING_SEGMENTS_ALIGN 64 #define XHCI_EVENT_RING_SEGMENTS_ALIGN 64 #define XHCI_EVENT_RING_SEGMENT_TABLE_ALIGN 64 #define XHCI_SCRATCHPAD_BUFFER_ARRAY_ALIGN 64