Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jan 2020 11:30:07 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r356680 - in stable/11/sys: dev/usb sys
Message-ID:  <202001131130.00DBU7xT055882@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Jan 13 11:30:07 2020
New Revision: 356680
URL: https://svnweb.freebsd.org/changeset/base/356680

Log:
  MFC r356409:
  Add own counter for cancelled USB transfers.
  Do not count these as errors.
  
  Bump the FreeBSD version to force recompilation of external modules.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/dev/usb/usb_device.h
  stable/11/sys/dev/usb/usb_transfer.c
  stable/11/sys/sys/param.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/usb_device.h
==============================================================================
--- stable/11/sys/dev/usb/usb_device.h	Mon Jan 13 11:27:30 2020	(r356679)
+++ stable/11/sys/dev/usb/usb_device.h	Mon Jan 13 11:30:07 2020	(r356680)
@@ -189,6 +189,7 @@ struct usb_device {
 	/* statistics */
 	struct usb_device_statistics stats_err;
 	struct usb_device_statistics stats_ok;
+  	struct usb_device_statistics stats_cancelled;
 
 	/* generic clear stall message */
 	struct usb_udev_msg cs_msg[2];

Modified: stable/11/sys/dev/usb/usb_transfer.c
==============================================================================
--- stable/11/sys/dev/usb/usb_transfer.c	Mon Jan 13 11:27:30 2020	(r356679)
+++ stable/11/sys/dev/usb/usb_transfer.c	Mon Jan 13 11:30:07 2020	(r356680)
@@ -2592,7 +2592,10 @@ usbd_transfer_done(struct usb_xfer *xfer, usb_error_t 
 	}
 #endif
 	/* keep some statistics */
-	if (xfer->error) {
+	if (xfer->error == USB_ERR_CANCELLED) {
+		info->udev->stats_cancelled.uds_requests
+		    [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++;
+	} else if (xfer->error != USB_ERR_NORMAL_COMPLETION) {
 		info->udev->stats_err.uds_requests
 		    [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++;
 	} else {

Modified: stable/11/sys/sys/param.h
==============================================================================
--- stable/11/sys/sys/param.h	Mon Jan 13 11:27:30 2020	(r356679)
+++ stable/11/sys/sys/param.h	Mon Jan 13 11:30:07 2020	(r356680)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1103506	/* Master, propagated to newvers */
+#define __FreeBSD_version 1103507	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001131130.00DBU7xT055882>