CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-12-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Dec 29 08:15:18 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Improve the transfer abort process.


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.29 -r1.32.2.30 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.29 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.30
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.29	Mon Dec  5 10:55:25 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Thu Dec 29 08:15:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.29 2016/12/05 10:55:25 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.30 2016/12/29 08:15:18 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.29 2016/12/05 10:55:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.30 2016/12/29 08:15:18 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -316,24 +316,30 @@ Static void
 dwc2_timeout(void *addr)
 {
 	struct usbd_xfer *xfer = addr;
-	struct dwc2_xfer *dxfer = DWC2_XFER2DXFER(xfer);
-// 	struct dwc2_pipe *dpipe = DWC2_XFER2DPIPE(xfer);
  	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
+	bool timeout = false;
 
 	DPRINTF("dxfer=%p\n", dxfer);
-
+	mutex_enter(>sc_lock);
 	if (sc->sc_dying) {
-		mutex_enter(>sc_lock);
-		dwc2_abort_xfer(>xfer, USBD_TIMEOUT);
 		mutex_exit(>sc_lock);
 		return;
 	}
+	if (xfer->ux_status != USBD_CANCELLED) {
+		xfer->ux_status = USBD_TIMEOUT;
+		timeout = true;
+	}
+	mutex_exit(>sc_lock);
+
+	if (timeout) {
+		struct usbd_device *dev = xfer->ux_pipe->up_dev;
 
-	/* Execute the abort in a process context. */
-	usb_init_task(>ux_aborttask, dwc2_timeout_task, addr,
-	USB_TASKQ_MPSAFE);
-	usb_add_task(dxfer->xfer.ux_pipe->up_dev, >ux_aborttask,
-	USB_TASKQ_HC);
+		/* Execute the abort in a process context. */
+		usb_init_task(>ux_aborttask, dwc2_timeout_task, addr,
+		USB_TASKQ_MPSAFE);
+		usb_add_task(dev, >ux_aborttask, USB_TASKQ_HC);
+
+	}
 }
 
 Static void
@@ -345,6 +351,7 @@ dwc2_timeout_task(void *addr)
 	DPRINTF("xfer=%p\n", xfer);
 
 	mutex_enter(>sc_lock);
+	KASSERT(xfer->ux_status == USBD_TIMEOUT);
 	dwc2_abort_xfer(xfer, USBD_TIMEOUT);
 	mutex_exit(>sc_lock);
 }
@@ -455,11 +462,12 @@ dwc2_abort_xfer(struct usbd_xfer *xfer, 
 	DPRINTF("xfer=%p\n", xfer);
 
 	KASSERT(mutex_owned(>sc_lock));
-	KASSERT(!cpu_intr_p() && !cpu_softintr_p());
+	ASSERT_SLEEPABLE();
 
 	if (sc->sc_dying) {
 		xfer->ux_status = status;
-		callout_stop(>ux_callout);
+		callout_halt(>ux_callout, >sc_lock);
+		KASSERT(xfer->ux_status == status);
 		usb_transfer_complete(xfer);
 		return;
 	}
@@ -479,16 +487,26 @@ dwc2_abort_xfer(struct usbd_xfer *xfer, 
 	/*
 	 * Step 1: Make the stack ignore it and stop the callout.
 	 */
-	mutex_spin_enter(>lock);
 	xfer->ux_hcflags |= UXFER_ABORTING;
 
-	xfer->ux_status = status;	/* make software ignore it */
-	callout_stop(>ux_callout);
+	/*
+	 * Step 1: When cancelling a transfer make sure the timeout handler
+	 * didn't run or ran to the end and saw the USBD_CANCELLED status.
+	 * Otherwise we must have got here via a timeout.
+	 */
+	if (status == USBD_CANCELLED) {
+		xfer->ux_status = status;
+		callout_halt(>ux_callout, >sc_lock);
+	} else {
+		KASSERT(xfer->ux_status == USBD_TIMEOUT);
+	}
 
+	mutex_spin_enter(>lock);
 	/* XXXNH suboptimal */
 	TAILQ_FOREACH_SAFE(d, >sc_complete, xnext, tmp) {
 		if (d == dxfer) {
 			TAILQ_REMOVE(>sc_complete, dxfer, xnext);
+			break;
 		}
 	}
 



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar  5 13:03:00 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.22 -r1.32.2.23 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.22 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.23
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.22	Sat Mar  5 08:11:07 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Sat Mar  5 13:03:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.23 2016/03/05 13:03:00 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.23 2016/03/05 13:03:00 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1033,7 +1033,7 @@ dwc2_device_start(struct usbd_xfer *xfer
 		/* Copy request packet to our DMA buffer */
 		memcpy(KERNADDR(>req_dma, 0), req, sizeof(*req));
 		usb_syncmem(>req_dma, 0, sizeof(*req),
-			BUS_DMASYNC_PREWRITE);
+		BUS_DMASYNC_PREWRITE);
 		len = UGETW(req->wLength);
 		if ((req->bmRequestType & UT_READ) == UT_READ) {
 			dir = UE_DIR_IN;
@@ -1054,7 +1054,7 @@ dwc2_device_start(struct usbd_xfer *xfer
 
 	dwc2_urb = dxfer->urb;
 	if (!dwc2_urb)
-		return USBD_NOMEM;
+		return USBD_NOMEM;
 
 	KASSERT(dwc2_urb->packet_count == xfer->ux_nframes);
 	memset(dwc2_urb, 0, sizeof(*dwc2_urb) +
@@ -1064,7 +1064,7 @@ dwc2_device_start(struct usbd_xfer *xfer
 	dwc2_urb->packet_count = xfer->ux_nframes;
 
 	dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, addr, epnum, xfertype, dir,
-  mps);
+	mps);
 
 	if (xfertype == UE_CONTROL) {
 		dwc2_urb->setup_usbdma = >req_dma;



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar  5 13:01:47 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2var.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3.12.9 -r1.3.12.10 src/sys/external/bsd/dwc2/dwc2var.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/external/bsd/dwc2/dwc2var.h
diff -u src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.9 src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.10
--- src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.9	Tue Mar  1 15:19:37 2016
+++ src/sys/external/bsd/dwc2/dwc2var.h	Sat Mar  5 13:01:47 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2var.h,v 1.3.12.9 2016/03/01 15:19:37 skrll Exp $	*/
+/*	$NetBSD: dwc2var.h,v 1.3.12.10 2016/03/05 13:01:47 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@ struct dwc2_qtd;
 
 struct dwc2_xfer {
 	struct usbd_xfer xfer;			/* Needs to be first */
-	struct usb_task	abort_task;
+	struct usb_task abort_task;
 
 	struct dwc2_hcd_urb *urb;
 



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar  5 08:11:07 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Fix a KASSERT.

I've managed to record via uaudia(4) on Raspberry PI now.


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.21 -r1.32.2.22 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.21 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.22
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.21	Fri Mar  4 15:30:17 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Sat Mar  5 08:11:07 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.22 2016/03/05 08:11:07 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1129,7 +1129,7 @@ dwc2_device_start(struct usbd_xfer *xfer
 	xfer->ux_actlen = 0;
 
 	KASSERT(xfertype != UE_ISOCHRONOUS ||
-	xfer->ux_nframes < dwc2_urb->packet_count);
+	xfer->ux_nframes <= dwc2_urb->packet_count);
 	KASSERTMSG(xfer->ux_nframes == 0 || xfertype == UE_ISOCHRONOUS,
 	"nframes %d xfertype %d\n", xfer->ux_nframes, xfertype);
 



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Mar  4 15:30:17 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Appease KASSERTs


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.20 -r1.32.2.21 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.20 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.21
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.20	Tue Mar  1 14:45:10 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Fri Mar  4 15:30:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.21 2016/03/04 15:30:17 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -700,7 +700,10 @@ dwc2_root_intr_close(struct usbd_pipe *p
 Static void
 dwc2_root_intr_done(struct usbd_xfer *xfer)
 {
+	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
 
+	KASSERT(sc->sc_intrxfer != NULL);
+	sc->sc_intrxfer = NULL;
 	DPRINTF("\n");
 }
 



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  1 15:19:37 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2var.h

Log Message:
Remove unused struct member.


To generate a diff of this commit:
cvs rdiff -u -r1.3.12.8 -r1.3.12.9 src/sys/external/bsd/dwc2/dwc2var.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/external/bsd/dwc2/dwc2var.h
diff -u src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.8 src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.9
--- src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.8	Fri Feb 26 07:36:02 2016
+++ src/sys/external/bsd/dwc2/dwc2var.h	Tue Mar  1 15:19:37 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2var.h,v 1.3.12.8 2016/02/26 07:36:02 skrll Exp $	*/
+/*	$NetBSD: dwc2var.h,v 1.3.12.9 2016/03/01 15:19:37 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -42,7 +42,6 @@ struct dwc2_xfer {
 	struct usb_task	abort_task;
 
 	struct dwc2_hcd_urb *urb;
-	int packet_count;
 
 	TAILQ_ENTRY(dwc2_xfer) xnext;		/* list of complete xfers */
 };



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  1 14:45:10 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Re-initialise dwc2_urb->packet_count after the memset(dwc2_urb, 0, ...)


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.19 -r1.32.2.20 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.19 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.20
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.19	Tue Mar  1 14:38:47 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Tue Mar  1 14:45:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.19 2016/03/01 14:38:47 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.19 2016/03/01 14:38:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1053,10 +1053,12 @@ dwc2_device_start(struct usbd_xfer *xfer
 	if (!dwc2_urb)
 		return USBD_NOMEM;
 
+	KASSERT(dwc2_urb->packet_count == xfer->ux_nframes);
 	memset(dwc2_urb, 0, sizeof(*dwc2_urb) +
 	sizeof(dwc2_urb->iso_descs[0]) * dwc2_urb->packet_count);
 
 	dwc2_urb->priv = xfer;
+	dwc2_urb->packet_count = xfer->ux_nframes;
 
 	dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, addr, epnum, xfertype, dir,
   mps);



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-03-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar  1 14:38:47 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.18 -r1.32.2.19 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.18 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.19
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.18	Sun Feb 28 09:16:20 2016
+++ src/sys/external/bsd/dwc2/dwc2.c	Tue Mar  1 14:38:47 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.18 2016/02/28 09:16:20 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.19 2016/03/01 14:38:47 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.18 2016/02/28 09:16:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.19 2016/03/01 14:38:47 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -89,7 +89,7 @@ Static struct usbd_xfer *
 Static void		dwc2_freex(struct usbd_bus *, struct usbd_xfer *);
 Static void		dwc2_get_lock(struct usbd_bus *, kmutex_t **);
 Static int		dwc2_roothub_ctrl(struct usbd_bus *, usb_device_request_t *,
-void *, int);
+			void *, int);
 
 Static usbd_status	dwc2_root_intr_transfer(struct usbd_xfer *);
 Static usbd_status	dwc2_root_intr_start(struct usbd_xfer *);
@@ -136,7 +136,6 @@ Static void		dwc2_timeout(void *);
 Static void		dwc2_timeout_task(void *);
 
 
-
 static inline void
 dwc2_allocate_bus_bandwidth(struct dwc2_hsotg *hsotg, u16 bw,
 			struct usbd_xfer *xfer)
@@ -446,7 +445,8 @@ dwc2_open(struct usbd_pipe *pipe)
 		return USBD_INVAL;
 	}
 
-	dpipe->priv = NULL;	/* QH */
+	/* QH */
+	dpipe->priv = NULL;
 
 	return USBD_NORMAL_COMPLETION;
 }



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2016-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb 26 07:36:02 UTC 2016

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2var.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3.12.7 -r1.3.12.8 src/sys/external/bsd/dwc2/dwc2var.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/external/bsd/dwc2/dwc2var.h
diff -u src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.7 src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.8
--- src/sys/external/bsd/dwc2/dwc2var.h:1.3.12.7	Thu Oct 22 11:15:42 2015
+++ src/sys/external/bsd/dwc2/dwc2var.h	Fri Feb 26 07:36:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2var.h,v 1.3.12.7 2015/10/22 11:15:42 skrll Exp $	*/
+/*	$NetBSD: dwc2var.h,v 1.3.12.8 2016/02/26 07:36:02 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -97,7 +97,6 @@ typedef struct dwc2_softc {
 
 	TAILQ_HEAD(, dwc2_xfer) sc_complete;	/* complete transfers */
 
-
 	pool_cache_t sc_xferpool;
 	pool_cache_t sc_qhpool;
 	pool_cache_t sc_qtdpool;



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2015-10-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 22 12:07:48 UTC 2015

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Use __diagused


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.13 -r1.32.2.14 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.13 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.14
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.13	Sun Oct 11 09:17:51 2015
+++ src/sys/external/bsd/dwc2/dwc2.c	Thu Oct 22 12:07:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.13 2015/10/11 09:17:51 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.14 2015/10/22 12:07:48 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.13 2015/10/11 09:17:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.14 2015/10/22 12:07:48 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -961,9 +961,7 @@ dwc2_device_isoc_start(struct usbd_xfer 
 void
 dwc2_device_isoc_abort(struct usbd_xfer *xfer)
 {
-#ifdef DIAGNOSTIC
-	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
-#endif
+	struct dwc2_softc *sc __diagused = DWC2_XFER2SC(xfer);
 	KASSERT(mutex_owned(>sc_lock));
 
 	DPRINTF("xfer=%p\n", xfer);



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2015-10-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct  4 10:45:37 UTC 2015

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Adapt to usbroothub and use usbroothub defaults for some requests
rather than returning an error.


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.11 -r1.32.2.12 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.11 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.12
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.11	Tue Sep 22 12:06:06 2015
+++ src/sys/external/bsd/dwc2/dwc2.c	Sun Oct  4 10:45:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.11 2015/09/22 12:06:06 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.12 2015/10/04 10:45:37 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.11 2015/09/22 12:06:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.12 2015/10/04 10:45:37 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -604,6 +604,18 @@ dwc2_roothub_ctrl(struct usbd_bus *bus, 
 			return buflen;
 		}
 		break;
+
+	case C(UR_GET_CONFIG, UT_READ_DEVICE):
+	case C(UR_GET_INTERFACE, UT_READ_INTERFACE):
+	case C(UR_GET_STATUS, UT_READ_INTERFACE):
+	case C(UR_GET_STATUS, UT_READ_ENDPOINT):
+	case C(UR_SET_ADDRESS, UT_WRITE_DEVICE):
+	case C(UR_SET_CONFIG, UT_WRITE_DEVICE):
+		/* default from usbroothub */
+		DPRINTFN(4, "returning %d (usbroothub default)", buflen);
+
+		return buflen;
+
 	default:
 		/* Hub requests */
 		err = dwc2_hcd_hub_control(sc->sc_hsotg,



CVS commit: [nick-nhusb] src/sys/external/bsd/dwc2

2014-12-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec  3 11:25:51 UTC 2014

Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c

Log Message:
Remove dwc2_{alloc,free}m function declarations as these don't exist
anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.4 -r1.32.2.5 src/sys/external/bsd/dwc2/dwc2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.4 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.5
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.4	Wed Dec  3 11:24:44 2014
+++ src/sys/external/bsd/dwc2/dwc2.c	Wed Dec  3 11:25:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.32.2.4 2014/12/03 11:24:44 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.32.2.5 2014/12/03 11:25:51 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dwc2.c,v 1.32.2.4 2014/12/03 11:24:44 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: dwc2.c,v 1.32.2.5 2014/12/03 11:25:51 skrll Exp $);
 
 #include opt_usb.h
 
@@ -85,9 +85,6 @@ Static void		dwc2_poll(struct usbd_bus *
 Static void		dwc2_softintr(void *);
 Static void		dwc2_waitintr(struct dwc2_softc *, usbd_xfer_handle);
 
-Static usbd_status	dwc2_allocm(struct usbd_bus *, usb_dma_t *, uint32_t);
-Static void		dwc2_freem(struct usbd_bus *, usb_dma_t *);
-
 Static usbd_xfer_handle	dwc2_allocx(struct usbd_bus *);
 Static void		dwc2_freex(struct usbd_bus *, usbd_xfer_handle);
 Static void		dwc2_get_lock(struct usbd_bus *, kmutex_t **);