summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2004-01-14 02:00:42 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2004-01-14 02:00:42 +0000
commitf7cc5b8655c9095d9f23aa77c1baec172c8b4598 (patch)
tree98e1c8baa14b2f29b38626b97795d69e7a91ec61 /sys/dev
parent7d99d1eb35ee8d037e426b4bb8e04e943a7c16da (diff)
Nuke SDEV_NOLUNS, SDEV_FORCELUNS, and PQUIRK_FORCELUNS quirks. Also
moreluns field in scsi_link structure. Instead, treat an INQUIRY result that duplicates the INQUIRY result of LUN 0 as proof the LUN does not exist. Compensate for lack of SDEV_NOLUNS where necessary by setting sc_link->luns to 1, which has the same effect. From Marco Peereboom. Don't issue Test Unit Ready command before INQUIRY command - not necessary and potentially harmful to devices with ADEV_NOTUR quirk since quirks have not been set yet. From mycroft@NetBSD ok deraadt@, mvme* changes by miod@.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c4
-rw-r--r--sys/dev/ieee1394/fwscsi.c6
-rw-r--r--sys/dev/usb/umass_quirks.c10
-rw-r--r--sys/dev/usb/umass_scsi.c5
-rw-r--r--sys/dev/usb/usb_port.h4
5 files changed, 12 insertions, 17 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index c192fc709ed..4eb6aec0e29 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.68 2004/01/09 21:32:23 brad Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.69 2004/01/14 02:00:41 krw Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -248,9 +248,9 @@ atapiscsi_attach(parent, self, aux)
as->sc_adapterlink.adapter_buswidth = 2;
as->sc_adapterlink.adapter = &atapiscsi_switch;
as->sc_adapterlink.device = &atapiscsi_dev;
+ as->sc_adapterlink.luns = 1;
as->sc_adapterlink.openings = 1;
as->sc_adapterlink.flags = SDEV_ATAPI;
- as->sc_adapterlink.quirks = SDEV_NOLUNS;
strncpy(drvp->drive_name, as->sc_dev.dv_xname,
sizeof(drvp->drive_name) - 1);
diff --git a/sys/dev/ieee1394/fwscsi.c b/sys/dev/ieee1394/fwscsi.c
index 79e6bfdac0b..a60dd6fae77 100644
--- a/sys/dev/ieee1394/fwscsi.c
+++ b/sys/dev/ieee1394/fwscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fwscsi.c,v 1.13 2003/05/17 03:55:06 itojun Exp $ */
+/* $OpenBSD: fwscsi.c,v 1.14 2004/01/14 02:00:41 krw Exp $ */
/*
* Copyright (c) 2002 Thierry Deval. All rights reserved.
@@ -302,8 +302,7 @@ fwscsi_attach(struct device *parent, struct device *self, void *aux)
sc->sc_adapter_link.flags = 0;
sc->sc_adapter_link.inquiry_flags = 0;
sc->sc_adapter_link.inquiry_flags2 = 0;
- sc->sc_adapter_link.quirks |=
- SDEV_NOLUNS | SDEV_NOTAGS | SDEV_ONLYBIG;
+ sc->sc_adapter_link.quirks |= SDEV_NOTAGS | SDEV_ONLYBIG;
sc->sc_speed = fwsc->sc_sc1394.sc1394_link_speed;
sc->sc_maxpayload = fwsc->sc_sc1394.sc1394_max_receive - 1;
@@ -393,7 +392,6 @@ fwscsi_config_thread(void *arg)
dev = config_found((void *)sc, &sc->sc_adapter_link, scsiprint);
sc->sc_bus = (struct scsibus_softc *)dev;
if (sc->sc_bus != NULL) {
- sc->sc_bus->moreluns = 0;
sc->sc_bus->sc_buswidth = 8;
}
diff --git a/sys/dev/usb/umass_quirks.c b/sys/dev/usb/umass_quirks.c
index 0bb484e5893..b3350e69239 100644
--- a/sys/dev/usb/umass_quirks.c
+++ b/sys/dev/usb/umass_quirks.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass_quirks.c,v 1.8 2003/12/03 09:11:37 markus Exp $ */
+/* $OpenBSD: umass_quirks.c,v 1.9 2004/01/14 02:00:41 krw Exp $ */
/* $NetBSD: umass_quirks.c,v 1.39 2003/05/08 15:19:47 augustss Exp $ */
/*
@@ -243,7 +243,7 @@ Static const struct umass_quirk umass_quirks[] = {
{ { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND3050 },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
0,
- PQUIRK_NOMODESENSE | PQUIRK_FORCELUNS,
+ PQUIRK_NOMODESENSE,
UMATCH_VENDOR_PRODUCT,
NULL, NULL
},
@@ -251,7 +251,7 @@ Static const struct umass_quirk umass_quirks[] = {
{ { USB_VENDOR_NEODIO, USB_PRODUCT_NEODIO_ND5010 },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
0,
- PQUIRK_NOMODESENSE | PQUIRK_FORCELUNS,
+ PQUIRK_NOMODESENSE,
UMATCH_VENDOR_PRODUCT,
NULL, NULL
},
@@ -299,7 +299,7 @@ Static const struct umass_quirk umass_quirks[] = {
{ { USB_VENDOR_PEN, USB_PRODUCT_PEN_MOBILEDRIVE },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
0,
- PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK | PQUIRK_FORCELUNS,
+ PQUIRK_NOMODESENSE | PQUIRK_NODOORLOCK,
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, NULL
},
@@ -323,7 +323,7 @@ Static const struct umass_quirk umass_quirks[] = {
{ { USB_VENDOR_PILOTECH, USB_PRODUCT_PILOTECH_CRW600 },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
0,
- PQUIRK_NOMODESENSE | PQUIRK_FORCELUNS,
+ PQUIRK_NOMODESENSE,
UMATCH_VENDOR_PRODUCT,
NULL, NULL
},
diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c
index 3fed7806119..dd6d993d132 100644
--- a/sys/dev/usb/umass_scsi.c
+++ b/sys/dev/usb/umass_scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass_scsi.c,v 1.5 2004/01/10 09:10:51 grange Exp $ */
+/* $OpenBSD: umass_scsi.c,v 1.6 2004/01/14 02:00:41 krw Exp $ */
/* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -126,8 +126,8 @@ umass_atapi_attach(struct umass_softc *sc)
scbus = umass_scsi_setup(sc);
scbus->sc_link.adapter_target = UMASS_SCSIID_HOST;
scbus->sc_link.luns = 1;
+ scbus->sc_link.openings = 1;
scbus->sc_link.flags |= SDEV_ATAPI;
- scbus->sc_link.quirks |= SDEV_NOLUNS;
scbus->sc_link.device = &umass_atapiscsi_dev;
DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: ATAPI\n"
@@ -161,7 +161,6 @@ umass_scsi_setup(struct umass_softc *sc)
/* Fill in the link. */
scbus->sc_link.adapter_buswidth = 2;
- scbus->sc_link.openings = 1;
scbus->sc_link.adapter = &scbus->sc_adapter;
scbus->sc_link.adapter_softc = sc;
scbus->sc_link.openings = 1;
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index 56362ceb94d..d48638c069b 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_port.h,v 1.46 2003/12/15 23:36:14 cedric Exp $ */
+/* $OpenBSD: usb_port.h,v 1.47 2004/01/14 02:00:41 krw Exp $ */
/* $NetBSD: usb_port.h,v 1.62 2003/02/15 18:33:30 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -238,8 +238,6 @@ int __CONCAT(dname,_detach)(struct device *self, int flags)
#define UMASS_ATAPISTR "atapiscsi"
/* periph_quirks */
-#define PQUIRK_FORCELUNS SDEV_FORCELUNS /* prehistoric device groks
- LUNs */
#define PQUIRK_NOMODESENSE SDEV_NOMODESENSE/* device doesn't do MODE SENSE
properly */
#define PQUIRK_NOTUR ADEV_NOTUR /* no TEST UNIT READY */