diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-05-07 16:24:47 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-05-07 16:24:47 +0000 |
commit | 4b8b0f1f0a9fe45c2392ddc0983bf53ba30924fb (patch) | |
tree | b2f95a77ce1fad307cd450117abd02f659f264db /sys/scsi/sd_scsi.c | |
parent | df124124e635575e64cd0b0cb71ff568725422e0 (diff) |
Eliminate 'mode sense (n) returned nonsense' and 'could not mode sense
(4/5)' messages in favour of a single SC_DEBUG() message about the mode
sense error. Less useless verbiage.
As this eliminates the only SDEV_NOMODESENSE use in scsi/*, eliminate
all quirks table entries that used only SDEV_NOMODESENSE. Iomega Zip
tested by miod@ to ensure this did not break something.
Finally, only fake a geometry if scsi_size() can determine a disk size
to fake from.
Diffstat (limited to 'sys/scsi/sd_scsi.c')
-rw-r--r-- | sys/scsi/sd_scsi.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/sys/scsi/sd_scsi.c b/sys/scsi/sd_scsi.c index 4dd4b9e7203..5018fd55c8a 100644 --- a/sys/scsi/sd_scsi.c +++ b/sys/scsi/sd_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd_scsi.c,v 1.7 2005/04/05 12:13:16 krw Exp $ */ +/* $OpenBSD: sd_scsi.c,v 1.8 2005/05/07 16:24:46 krw Exp $ */ /* $NetBSD: sd_scsi.c,v 1.8 1998/10/08 20:21:13 thorpej Exp $ */ /*- @@ -260,29 +260,20 @@ sd_scsibus_get_parms(sd, dp, flags) } fake_it: - if ((sd->sc_link->quirks & SDEV_NOMODESENSE) == 0) { - if (error == 0) - printf("%s: mode sense (%d) returned nonsense", - sd->sc_dev.dv_xname, page); - else - printf("%s: could not mode sense (4/5)", - sd->sc_dev.dv_xname); - printf("; using fictitious geometry\n"); - } - /* - * use adaptec standard fictitious geometry - * this depends on which controller (e.g. 1542C is - * different. but we have to put SOMETHING here..) - */ + /* If we can get the disk size, fake a geometry. */ dp->disksize = scsi_size(sd->sc_link, flags); + if (dp->disksize == 0) + return (SDGP_RESULT_OFFLINE); + SC_DEBUG(sd->sc_link, SDEV_DB1, ("error %d on pg %d, fake geometry.\n", + error, page)); + + /* Use adaptec standard fictitious geometry. */ + dp->heads = 64; dp->sectors = 32; dp->cyls = dp->disksize / (64 * 32); dp->blksize = 512; - if (dp->disksize == 0) - return (SDGP_RESULT_OFFLINE); - return (SDGP_RESULT_OK); } |