Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Remove UMASS_QUIRK_IGNORE_RESIDUE, instead max o...



details:   https://anonhg.NetBSD.org/src/rev/689a4ba4ec37
branches:  trunk
changeset: 752076:689a4ba4ec37
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Feb 13 02:09:41 2010 +0000

description:
Remove UMASS_QUIRK_IGNORE_RESIDUE, instead max out the expected response
size at the actual transfer length. Fixes PR kern/42225 differently.

diffstat:

 sys/dev/usb/umass.c        |  11 +++++------
 sys/dev/usb/umass_quirks.c |  15 ++-------------
 sys/dev/usb/umassvar.h     |   3 +--
 3 files changed, 8 insertions(+), 21 deletions(-)

diffs (85 lines):

diff -r 567bab7c0567 -r 689a4ba4ec37 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c       Sat Feb 13 00:14:00 2010 +0000
+++ b/sys/dev/usb/umass.c       Sat Feb 13 02:09:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass.c,v 1.136 2009/11/12 19:58:27 dyoung Exp $       */
+/*     $NetBSD: umass.c,v 1.137 2010/02/13 02:09:41 martin Exp $       */
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.136 2009/11/12 19:58:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.137 2010/02/13 02:09:41 martin Exp $");
 
 #include "atapibus.h"
 #include "scsibus.h"
@@ -1178,10 +1178,9 @@
 
                DIF(UDMASS_BBB, umass_bbb_dump_csw(sc, &sc->csw));
 
-               if (sc->sc_quirks & UMASS_QUIRK_IGNORE_RESIDUE)
-                    residue = sc->transfer_datalen - sc->transfer_actlen;
-                else
-                    residue = UGETDW(sc->csw.dCSWDataResidue);
+               residue = UGETDW(sc->csw.dCSWDataResidue);
+               if (residue < sc->transfer_datalen - sc->transfer_actlen)
+                   residue = sc->transfer_datalen - sc->transfer_actlen;
 
                /* Translate weird command-status signatures. */
                if ((sc->sc_quirks & UMASS_QUIRK_WRONG_CSWSIG) &&
diff -r 567bab7c0567 -r 689a4ba4ec37 sys/dev/usb/umass_quirks.c
--- a/sys/dev/usb/umass_quirks.c        Sat Feb 13 00:14:00 2010 +0000
+++ b/sys/dev/usb/umass_quirks.c        Sat Feb 13 02:09:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umass_quirks.c,v 1.78 2009/10/30 16:22:32 is Exp $     */
+/*     $NetBSD: umass_quirks.c,v 1.79 2010/02/13 02:09:41 martin Exp $ */
 
 /*
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.78 2009/10/30 16:22:32 is Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.79 2010/02/13 02:09:41 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -229,17 +229,6 @@
          UMATCH_VENDOR_PRODUCT,
          NULL, NULL
        },
-
-        /*
-         * Devices with bad residue.
-         */
-        { { USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDEBRIDGE },
-          UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
-          UMASS_QUIRK_IGNORE_RESIDUE,
-          0,
-          UMATCH_VENDOR_PRODUCT,
-          NULL, NULL
-        },
 };
 
 const struct umass_quirk *
diff -r 567bab7c0567 -r 689a4ba4ec37 sys/dev/usb/umassvar.h
--- a/sys/dev/usb/umassvar.h    Sat Feb 13 00:14:00 2010 +0000
+++ b/sys/dev/usb/umassvar.h    Sat Feb 13 02:09:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: umassvar.h,v 1.28 2009/10/30 16:22:32 is Exp $ */
+/*     $NetBSD: umassvar.h,v 1.29 2010/02/13 02:09:41 martin Exp $     */
 /*-
  * Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
  *                   Nick Hibma <n_hibma%freebsd.org@localhost>
@@ -180,7 +180,6 @@
 #define        UMASS_QUIRK_WRONG_CSWTAG        0x00000002
 #define        UMASS_QUIRK_RBC_PAD_TO_12       0x00000004
 #define        UMASS_QUIRK_NOGETMAXLUN         0x00000008
-#define UMASS_QUIRK_IGNORE_RESIDUE      0x00000010
 
 #define UMASS_QUIRK_USE_DEFAULTMATCH   -1
 



Home | Main Index | Thread Index | Old Index