diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme68k/dev/vs.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vsdma.c | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 4 | ||||
-rw-r--r-- | sys/dev/atapiscsi/atapiscsi.c | 4 | ||||
-rw-r--r-- | sys/dev/ieee1394/fwscsi.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/umass_quirks.c | 10 | ||||
-rw-r--r-- | sys/dev/usb/umass_scsi.c | 5 | ||||
-rw-r--r-- | sys/dev/usb/usb_port.h | 4 | ||||
-rw-r--r-- | sys/scsi/scsiconf.c | 215 | ||||
-rw-r--r-- | sys/scsi/scsiconf.h | 5 |
10 files changed, 59 insertions, 200 deletions
diff --git a/sys/arch/mvme68k/dev/vs.c b/sys/arch/mvme68k/dev/vs.c index eaa6ba364a0..45388bfe98c 100644 --- a/sys/arch/mvme68k/dev/vs.c +++ b/sys/arch/mvme68k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.12 2003/11/07 10:16:45 jmc Exp $ */ +/* $OpenBSD: vs.c,v 1.13 2004/01/14 02:00:41 krw Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. @@ -253,7 +253,6 @@ vs_scsicmd(xs) scsi_done(xs); } - slp->quirks |= SDEV_NOLUNS; flags = xs->flags; #ifdef SDEBUG printf("scsi_cmd() "); diff --git a/sys/arch/mvme68k/dev/vsdma.c b/sys/arch/mvme68k/dev/vsdma.c index 5769a128bdf..584b968abd1 100644 --- a/sys/arch/mvme68k/dev/vsdma.c +++ b/sys/arch/mvme68k/dev/vsdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vsdma.c,v 1.5 2002/04/27 23:21:05 miod Exp $ */ +/* $OpenBSD: vsdma.c,v 1.6 2004/01/14 02:00:41 krw Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -115,6 +115,7 @@ vsattach(parent, self, auxp) sc->sc_link.adapter_target = 7; sc->sc_link.adapter = &vs_scsiswitch; sc->sc_link.device = &vs_scsidev; + sc->sc_link.luns = 1; sc->sc_link.openings = 1; sc->sc_ih_n.ih_fn = vs_nintr; diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index c7db92bcbf8..6a4c97763bc 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.25 2004/01/02 23:38:37 miod Exp $ */ +/* $OpenBSD: vs.c,v 1.26 2004/01/14 02:00:41 krw Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. @@ -136,6 +136,7 @@ vsattach(parent, self, auxp) sc->sc_link.adapter_target = 7; sc->sc_link.adapter = &vs_scsiswitch; sc->sc_link.device = &vs_scsidev; + sc->sc_link.luns = 1; sc->sc_link.openings = roundup(NUM_IOPB, 8) / 8; sc->sc_ih_n.ih_fn = vs_nintr; @@ -283,7 +284,6 @@ vs_scsicmd(xs) M328_IOPB *iopb; M328_CMD *m328_cmd; - slp->quirks |= SDEV_NOLUNS; flags = xs->flags; #ifdef SDEBUG 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 */ diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 584faf8b56e..e2a48841eab 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.76 2004/01/07 18:11:16 krw Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.77 2004/01/14 02:00:41 krw Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -74,7 +74,8 @@ /* * Declarations */ -void scsi_probedev(struct scsibus_softc *, int, int); +void scsi_probedev(struct scsibus_softc *, struct scsi_inquiry_data *, int, + int); int scsi_probe_bus(int bus, int target, int lun); struct scsi_device probe_switch = { @@ -273,9 +274,10 @@ int scsi_probe_bus(bus, target, lun) int bus, target, lun; { + struct scsi_inquiry_data inqbuflun0; struct scsibus_softc *scsi; - int maxtarget, mintarget, maxlun, minlun; u_int16_t scsi_addr; + int maxtarget, mintarget, maxlun, minlun; if (bus < 0 || bus >= scsibus_cd.cd_ndevs) return ENXIO; @@ -304,19 +306,13 @@ scsi_probe_bus(bus, target, lun) maxlun = minlun = lun; } - for (target = mintarget; target <= maxtarget; target++) { - if (target == scsi_addr) - continue; - for (lun = minlun; lun <= maxlun; lun++) { - /* - * See if there's a device present, and configure it. - */ - scsi_probedev(scsi, target, lun); - if ((scsi->moreluns & (1 << target)) == 0) - break; - /* otherwise something says we should look further */ + for (target = mintarget; target <= maxtarget; target++) + if (target != scsi_addr) { + bzero(&inqbuflun0, sizeof inqbuflun0); + for (lun = minlun; lun <= maxlun; lun++) + scsi_probedev(scsi, &inqbuflun0, target, lun); } - } + return 0; } @@ -381,78 +377,14 @@ struct scsi_quirk_inquiry_pattern { const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { {{T_CDROM, T_REMOV, - "CHINON ", "CD-ROM CDS-431 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "Chinon ", "CD-ROM CDS-525 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "CHINON ", "CD-ROM CDS-535 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "DEC ", "RRD42 (C) DEC ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "DENON ", "DRD-25X ", "V"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "HP ", "C4324/C4325 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "IMS ", "CDD521/10 ", "2.06"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "MATSHITA", "CD-ROM CR-5XX ", "1.0b"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "MEDAVIS ", "RENO CD-ROMX2A ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "MEDIAVIS", "CDR-H93MV ", "1.3"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "NEC ", "CD-ROM DRIVE:55 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "NEC ", "CD-ROM DRIVE:83 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "NEC ", "CD-ROM DRIVE:84 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "NEC ", "CD-ROM DRIVE:210", "1.0"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "NEC ", "CD-ROM DRIVE:501", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "NEC ", "CD-ROM DRIVE:841", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "PIONEER ", "CD-ROM DR-124X ", "1.01"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "SONY ", "CD-ROM CDU-541 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "SONY ", "CD-ROM CDU-55S ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "SONY ", "CD-ROM CDU-561 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "SONY ", "CD-ROM CDU-8003A", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "SONY ", "CD-ROM CDU-8012 ", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "TEAC ", "CD-ROM ", "1.06"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "TEAC ", "CD-ROM CD-56S ", "1.0B"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "TEXEL ", "CD-ROM ", "1.06"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "TEXEL ", "CD-ROM DM-XX24 K", "1.10"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "TOSHIBA ", "XM-4101TASUNSLCD", "1755"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "ShinaKen", "CD-ROM DM-3x1S", "1.04"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "JVC ", "R2626 ", "1.55"}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, - "CyberDrv", "", ""}, SDEV_NOLUNS}, - {{T_CDROM, T_REMOV, "PLEXTOR", "CD-ROM PX-40TS", "1.01"}, SDEV_NOSYNC}, - {{T_OPTICAL, T_REMOV, - "EPSON ", "OMD-5010 ", "3.08"}, SDEV_NOLUNS}, {{T_OPTICAL, T_REMOV, "FUJITSU", "M2513A", "0800"}, SDEV_NOMODESENSE}, {{T_OPTICAL, T_REMOV, "DELTIS ", "MOS321 ", "3.30"}, SDEV_NOMODESENSE}, {{T_OPTICAL, T_REMOV, - "EPSON ", "OMD-5010 ", "3.08"}, SDEV_NOLUNS}, - {{T_OPTICAL, T_REMOV, "FUJITSU", "M2513A", "0800"}, SDEV_NOMODESENSE}, {{T_OPTICAL, T_REMOV, "DELTIS ", "MOS321 ", "3.30"}, SDEV_NOMODESENSE}, @@ -462,7 +394,7 @@ const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { {{T_DIRECT, T_FIXED, "DEC ", "RZ55 (C) DEC", ""}, SDEV_AUTOSAVE}, {{T_DIRECT, T_FIXED, - "EMULEX ", "MD21/S2 ESDI", "A00"}, SDEV_FORCELUNS|SDEV_AUTOSAVE}, + "EMULEX ", "MD21/S2 ESDI", "A00"}, SDEV_AUTOSAVE}, /* Gives non-media hardware failure in response to start-unit command */ {{T_DIRECT, T_FIXED, "HITACHI", "DK515C", "CP15"}, SDEV_NOSTARTUNIT}, @@ -475,58 +407,18 @@ const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { {{T_DIRECT, T_FIXED, "IBM", "0664", ""}, SDEV_AUTOSAVE}, {{T_DIRECT, T_FIXED, - "IBM ", "H3171-S2", ""}, SDEV_NOLUNS|SDEV_AUTOSAVE}, + "IBM ", "H3171-S2", ""}, SDEV_AUTOSAVE}, {{T_DIRECT, T_FIXED, "IBM ", "KZ-C", ""}, SDEV_AUTOSAVE}, /* Broken IBM disk */ {{T_DIRECT, T_FIXED, "" , "DFRSS2F", ""}, SDEV_AUTOSAVE}, {{T_DIRECT, T_FIXED, - "MAXTOR ", "XT-3280 ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "XT-4380S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "MXT-1240S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "XT-4170S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "XT-8760S", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "LXT-213S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "LXT-213S SUN0207", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MAXTOR ", "LXT-200S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "MST ", "SnapLink ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "NEC ", "D3847 ", "0307"}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, "QUANTUM ", "ELS85S ", ""}, SDEV_AUTOSAVE}, {{T_DIRECT, T_FIXED, - "QUANTUM ", "LPS525S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "QUANTUM ", "P105S 910-10-94x", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "QUANTUM ", "PD1225S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "QUANTUM ", "PD210S SUN0207", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "RODIME ", "RO3000S ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "SEAGATE ", "ST125N ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "SEAGATE ", "ST157N ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "SEAGATE ", "ST296 ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, - "SEAGATE ", "ST296N ", ""}, SDEV_NOLUNS}, - {{T_DIRECT, T_FIXED, "SEAGATE ", "ST19171FC", ""}, SDEV_NOMODESENSE}, {{T_DIRECT, T_FIXED, "SEAGATE ", "ST34501FC ", ""}, SDEV_NOMODESENSE}, - {{T_DIRECT, T_FIXED, - "TOSHIBA ", "MK538FB ", "6027"}, SDEV_NOLUNS}, {{T_DIRECT, T_REMOV, "iomega", "jaz 1GB", ""}, SDEV_NOMODESENSE|SDEV_NOTAGS}, {{T_DIRECT, T_REMOV, @@ -538,8 +430,6 @@ const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { /* Letting the motor run kills floppy drives and disks quit fast. */ {{T_DIRECT, T_REMOV, "TEAC", "FC-1", ""}, SDEV_NOSTARTUNIT}, - {{T_DIRECT, T_FIXED, - "NEC ", "SD120S-200 ", "0001"}, SDEV_NOLUNS}, {{T_DIRECT, T_FIXED, "MICROP", "4421-07", ""}, SDEV_NOTAGS}, {{T_DIRECT, T_FIXED, @@ -549,56 +439,15 @@ const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = { {{T_DIRECT, T_FIXED, "IBM", "DCAS", ""}, SDEV_NOTAGS}, - /* XXX: QIC-36 tape behind Emulex adapter. Very broken. */ - {{T_SEQUENTIAL, T_REMOV, - " ", " ", " "}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "CALIPER ", "CP150 ", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "DEC ", "TZ30 ", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "DEC ", "TK50 ", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "EXABYTE ", "EXB-8200 ", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "SONY ", "SDT-2000 ", "2.09"}, SDEV_NOLUNS}, {{T_SEQUENTIAL, T_REMOV, "SONY ", "SDT-5000 ", "3."}, SDEV_NOSYNC|SDEV_NOWIDE}, {{T_SEQUENTIAL, T_REMOV, - "SONY ", "SDT-5200 ", "3."}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "TANDBERG", " TDC 3600 ", ""}, SDEV_NOLUNS}, - /* Following entry reported as a Tandberg 3600; ref. PR1933 */ - {{T_SEQUENTIAL, T_REMOV, - "ARCHIVE ", "VIPER 150 21247", ""}, SDEV_NOLUNS}, - /* Following entry for a Cipher ST150S */ - {{T_SEQUENTIAL, T_REMOV, - "ARCHIVE ", "VIPER 1500 21247", "2.2G"}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "ARCHIVE ", "Python 28454-XXX", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "WANGTEK ", "5099ES SCSI", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, - "WANGTEK ", "5150ES SCSI", ""}, SDEV_NOLUNS}, - {{T_SEQUENTIAL, T_REMOV, "WangDAT ", "Model 1300 ", "02.4"}, SDEV_NOSYNC|SDEV_NOWIDE}, {{T_SEQUENTIAL, T_REMOV, "WangDAT ", "Model 2600 ", "01.7"}, SDEV_NOSYNC|SDEV_NOWIDE}, {{T_SEQUENTIAL, T_REMOV, "WangDAT ", "Model 3200 ", "02.2"}, SDEV_NOSYNC|SDEV_NOWIDE}, - {{T_SCANNER, T_FIXED, - "RICOH ", "IS60 ", "1R08"}, SDEV_NOLUNS}, - {{T_SCANNER, T_FIXED, - "UMAX ", "Astra 1200S ", "V2.9"}, SDEV_NOLUNS}, - {{T_SCANNER, T_FIXED, - "ULTIMA ", "AT3 1.60 ", ""}, SDEV_NOLUNS}, - {{T_SCANNER, T_FIXED, - "UMAX ", "SuperVista S-12 ", "V1.9"}, SDEV_NOLUNS}, - - {{T_ENCLOSURE, T_FIXED, - "SUN ", "SENA", ""}, SDEV_NOLUNS}, - /* ATAPI device quirks */ {{T_CDROM, T_REMOV, "ALPS ELECTRIC CO.,LTD. DC544C", "", "SW03D"}, ADEV_NOTUR}, @@ -757,8 +606,9 @@ scsibusprint(aux, pnp) * entry. */ void -scsi_probedev(scsi, target, lun) +scsi_probedev(scsi, inqbuflun0, target, lun) struct scsibus_softc *scsi; + struct scsi_inquiry_data *inqbuflun0; int target, lun; { struct scsi_link *sc_link; @@ -800,9 +650,6 @@ scsi_probedev(scsi, target, lun) sc_link->flags |= scsidebug_level; #endif /* SCSIDEBUG */ - (void) scsi_test_unit_ready(sc_link, TEST_READY_RETRIES_DEFAULT, - scsi_autoconf | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_NOT_READY | SCSI_IGNORE_MEDIA_CHANGE); - #ifdef SCSI_2_DEF /* Some devices need to be told to go to SCSI2. */ /* However some just explode if you tell them this... leave it out. */ @@ -820,10 +667,36 @@ scsi_probedev(scsi, target, lun) if (scsi_inquire(sc_link, &inqbuf, scsi_autoconf | SCSI_SILENT) != 0) goto bad; + if (lun == 0) { + /* + * Save the INQUIRY page of LUN 0 to compare to the remaining + * LUN's. If the INQUIRY data is the same as LUN 0 it *is* LUN + * 0 and threfore we can safely ignore it. This is to cover + * stupid SCSI devices that don't handle the IDENTIFY message. + */ + bcopy(&inqbuf, inqbuflun0, sizeof *inqbuflun0); + } else { + if (memcmp(&inqbuf, inqbuflun0, sizeof inqbuf) == 0) { + /* + * Stupid SCSI device that does not handle the IDENTIFY + * message. Mark this LUN as not there. + */ +#ifdef SCSIDEBUG + scsibusprint(&sa, scsi->sc_dev.dv_xname); + printf(" doesn't support IDENTIFY message.\n"); +#endif /* SCSIDEBUG */ + goto bad; + } + } + switch (inqbuf.device & SID_QUAL) { case SID_QUAL_RSVD: case SID_QUAL_BAD_LU: case SID_QUAL_LU_OFFLINE: +#ifdef SCSIDEBUG + scsibusprint(&sa, scsi->sc_dev.dv_xname); + printf(" Residue in PERIPHERAL QUALIFIER; invalid LUN.\n"); +#endif /* SCSIDEBUG */ goto bad; case SID_QUAL_LU_OK: @@ -857,14 +730,8 @@ scsi_probedev(scsi, target, lun) */ if (priority != 0) sc_link->quirks |= finger->quirks; - if ((inqbuf.version & SID_ANSII) == 0 && - (sc_link->quirks & SDEV_FORCELUNS) == 0) - sc_link->quirks |= SDEV_NOLUNS; sc_link->scsi_version = inqbuf.version; - if ((sc_link->quirks & SDEV_NOLUNS) == 0) - scsi->moreluns |= (1 << target); - /* * Save INQUIRY "flags" (SID_Linked, etc.) for low-level drivers. */ diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 6b8a239a841..db545035d8d 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.39 2003/05/18 16:06:35 mickey Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.40 2004/01/14 02:00:41 krw Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -175,8 +175,6 @@ struct scsi_link { #define SDEV_NOSYNC 0x0002 /* does not grok SDTR */ #define SDEV_NOWIDE 0x0004 /* does not grok WDTR */ #define SDEV_NOTAGS 0x0008 /* lies about having tagged queueing */ -#define SDEV_NOLUNS 0x0010 /* does not grok LUNs */ -#define SDEV_FORCELUNS 0x0020 /* prehistoric drive/ctlr groks LUNs */ #define SDEV_NOMODESENSE 0x0040 /* removable media/optical drives */ #define SDEV_NOSTARTUNIT 0x0080 /* do not issue start unit requests in sd.c */ #define SDEV_NOSYNCCACHE 0x0100 /* no SYNCHRONIZE_CACHE */ @@ -221,7 +219,6 @@ struct scsibus_softc { struct device sc_dev; struct scsi_link *adapter_link; /* prototype supplied by adapter */ struct scsi_link ***sc_link; - u_int16_t moreluns; u_int16_t sc_buswidth; }; |