summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2010-02-13 02:09:41 +0000
committermartin <martin@NetBSD.org>2010-02-13 02:09:41 +0000
commit667f16d7f3453e8d3bf8468edc6be1b909facf69 (patch)
tree481612ace6925ad4248cd7081e284cea1881ff03 /sys/dev
parentde7c94ffb6d299ca727137cd4ffccfd3a56e91d8 (diff)
Remove UMASS_QUIRK_IGNORE_RESIDUE, instead max out the expected response
size at the actual transfer length. Fixes PR kern/42225 differently.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/umass.c11
-rw-r--r--sys/dev/usb/umass_quirks.c15
-rw-r--r--sys/dev/usb/umassvar.h3
3 files changed, 8 insertions, 21 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 93257df3f65..c527e761965 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -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 @@ umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
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 --git a/sys/dev/usb/umass_quirks.c b/sys/dev/usb/umass_quirks.c
index 8bc0777cee9..a8b5f6087b0 100644
--- a/sys/dev/usb/umass_quirks.c
+++ b/sys/dev/usb/umass_quirks.c
@@ -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 @@ Static const struct umass_quirk umass_quirks[] = {
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 --git a/sys/dev/usb/umassvar.h b/sys/dev/usb/umassvar.h
index d9e52d9be89..c95b770877f 100644
--- a/sys/dev/usb/umassvar.h
+++ b/sys/dev/usb/umassvar.h
@@ -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>,
* Nick Hibma <n_hibma@freebsd.org>
@@ -180,7 +180,6 @@ struct umass_softc {
#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