Date: Mon, 19 Jan 2015 07:03:41 +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-9@freebsd.org Subject: svn commit: r277363 - stable/9/sys/dev/usb Message-ID: <201501190703.t0J73fpm040044@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon Jan 19 07:03:40 2015 New Revision: 277363 URL: https://svnweb.freebsd.org/changeset/base/277363 Log: MFC r277044: Increase the maximum number of dynamic USB quirks. USB memory stick devices which don't support the synchronize cache SCSI command are likely to also not support the prevent-allow medium removal SCSI command. PR: 185747 Modified: stable/9/sys/dev/usb/usb_freebsd.h stable/9/sys/dev/usb/usb_msctest.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/usb_freebsd.h ============================================================================== --- stable/9/sys/dev/usb/usb_freebsd.h Mon Jan 19 06:59:40 2015 (r277362) +++ stable/9/sys/dev/usb/usb_freebsd.h Mon Jan 19 07:03:40 2015 (r277363) @@ -71,7 +71,7 @@ #define USB_EP0_BUFSIZE 1024 /* bytes */ #define USB_CS_RESET_LIMIT 20 /* failures = 20 * 50 ms = 1sec */ -#define USB_MAX_AUTO_QUIRK 4 /* maximum number of dynamic quirks */ +#define USB_MAX_AUTO_QUIRK 8 /* maximum number of dynamic quirks */ typedef uint32_t usb_timeout_t; /* milliseconds */ typedef uint32_t usb_frlength_t; /* bytes */ Modified: stable/9/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/9/sys/dev/usb/usb_msctest.c Mon Jan 19 06:59:40 2015 (r277362) +++ stable/9/sys/dev/usb/usb_msctest.c Mon Jan 19 07:03:40 2015 (r277363) @@ -707,10 +707,11 @@ retry_sync_cache: if (err != ERR_CSW_FAILED) goto error; - DPRINTF("Device doesn't handle synchronize cache\n"); + DPRINTF("Device doesn't handle synchronize cache " + "and prevent allow medium removal\n"); usbd_add_dynamic_quirk(udev, UQ_MSC_NO_SYNC_CACHE); - + usbd_add_dynamic_quirk(udev, UQ_MSC_NO_PREVENT_ALLOW); } else { /* @@ -737,10 +738,13 @@ retry_sync_cache: goto retry_sync_cache; DPRINTF("Device most likely doesn't " - "handle synchronize cache\n"); + "handle synchronize cache nor" + "prevent allow medium removal\n"); usbd_add_dynamic_quirk(udev, UQ_MSC_NO_SYNC_CACHE); + usbd_add_dynamic_quirk(udev, + UQ_MSC_NO_PREVENT_ALLOW); } else { if (err != ERR_CSW_FAILED) goto error; @@ -784,6 +788,7 @@ error: DPRINTF("Device did not respond, enabling all quirks\n"); usbd_add_dynamic_quirk(udev, UQ_MSC_NO_SYNC_CACHE); + usbd_add_dynamic_quirk(udev, UQ_MSC_NO_PREVENT_ALLOW); usbd_add_dynamic_quirk(udev, UQ_MSC_NO_TEST_UNIT_READY); /* Need to re-enumerate the device */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501190703.t0J73fpm040044>