From owner-svn-src-all@FreeBSD.ORG Mon Oct 4 23:30:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C36E9106566C; Mon, 4 Oct 2010 23:30:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B30D18FC1A; Mon, 4 Oct 2010 23:30:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o94NUiEB031081; Mon, 4 Oct 2010 23:30:44 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o94NUiJu031079; Mon, 4 Oct 2010 23:30:44 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010042330.o94NUiJu031079@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 4 Oct 2010 23:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213439 - head/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2010 23:30:44 -0000 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; }