Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Oct 2010 23:30:44 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213439 - head/sys/dev/usb/storage
Message-ID:  <201010042330.o94NUiJu031079@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Oct  4 23:30:44 2010
New Revision: 213439
URL: http://svn.freebsd.org/changeset/base/213439

Log:
  Print out correct USB connection speed for USB 3.0 mass storage devices.
  
  Approved by:    thompsa (mentor)

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==============================================================================
--- head/sys/dev/usb/storage/umass.c	Mon Oct  4 23:25:38 2010	(r213438)
+++ head/sys/dev/usb/storage/umass.c	Mon Oct  4 23:30:44 2010	(r213439)
@@ -231,6 +231,7 @@ TUNABLE_INT("hw.usb.umass.debug", &umass
 /* Approximate maximum transfer speeds (assumes 33% overhead). */
 #define	UMASS_FULL_TRANSFER_SPEED	1000
 #define	UMASS_HIGH_TRANSFER_SPEED	40000
+#define	UMASS_SUPER_TRANSFER_SPEED	400000
 #define	UMASS_FLOPPY_TRANSFER_SPEED	20
 
 #define	UMASS_TIMEOUT			5000	/* ms */
@@ -2412,13 +2413,21 @@ umass_cam_action(struct cam_sim *sim, un
 				if (sc->sc_quirks & FLOPPY_SPEED) {
 					cpi->base_transfer_speed =
 					    UMASS_FLOPPY_TRANSFER_SPEED;
-				} else if (usbd_get_speed(sc->sc_udev) ==
-				    USB_SPEED_HIGH) {
-					cpi->base_transfer_speed =
-					    UMASS_HIGH_TRANSFER_SPEED;
 				} else {
-					cpi->base_transfer_speed =
-					    UMASS_FULL_TRANSFER_SPEED;
+					switch (usbd_get_speed(sc->sc_udev)) {
+					case USB_SPEED_SUPER:
+						cpi->base_transfer_speed =
+						    UMASS_SUPER_TRANSFER_SPEED;
+						break;
+					case USB_SPEED_HIGH:
+						cpi->base_transfer_speed =
+						    UMASS_HIGH_TRANSFER_SPEED;
+						break;
+					default:
+						cpi->base_transfer_speed =
+						    UMASS_FULL_TRANSFER_SPEED;
+						break;
+					}
 				}
 				cpi->max_lun = sc->sc_maxlun;
 			}



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