diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-11-23 08:55:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2000-11-23 08:55:36 +0000 |
commit | a224e2c56ccb4f022f22898222ee5f8aa5e423e0 (patch) | |
tree | 74474eea4976b50503ae44548b90ce1322647abf /sys | |
parent | 8aafc33162cd30ca331dae1c82c95f18e813fda2 (diff) |
fix lun support, not as nice as i would like
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 4 | ||||
-rw-r--r-- | sys/scsi/scsiconf.c | 7 | ||||
-rw-r--r-- | sys/scsi/scsiconf.h | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 150d93f35fc..fa252a0d9ba 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.7 2000/11/20 07:34:51 deraadt Exp $ */ +/* $OpenBSD: umass.c,v 1.8 2000/11/23 08:55:34 deraadt Exp $ */ /* $NetBSD: umass.c,v 1.33 2000/04/06 13:52:04 augustss Exp $ */ /*- * Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>, @@ -1084,7 +1084,7 @@ USB_ATTACH(umass) sc->u.sc_link.adapter_buswidth = 2; sc->u.sc_link.adapter_target = UMASS_SCSIID_HOST; - sc->u.sc_link.maxlun = sc->maxlun; + sc->u.sc_link.luns = sc->maxlun + 1; #endif sc->u.sc_link.adapter_softc = sc; diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index aa8433ead5b..5d2575b132f 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.53 2000/11/20 07:34:51 deraadt Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.54 2000/11/23 08:55:35 deraadt Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -163,6 +163,8 @@ scsibusattach(parent, self, aux) if (sb->adapter_link->adapter_buswidth == 0) sb->adapter_link->adapter_buswidth = 8; sb->sc_buswidth = sb->adapter_link->adapter_buswidth; + if (sb->adapter_link->luns == 0) + sb->adapter_link->luns = 8; printf(": %d targets\n", sb->sc_buswidth); @@ -292,7 +294,7 @@ scsi_probe_bus(bus, target, lun) } if (lun == -1) { - maxlun = scsi->adapter_link->maxlun; + maxlun = scsi->adapter_link->luns - 1; minlun = 0; } else { if (lun < 0 || lun > 7) @@ -810,7 +812,6 @@ scsi_probedev(scsi, target, lun) (sc_link->quirks & SDEV_FORCELUNS) == 0) sc_link->quirks |= SDEV_NOLUNS; sc_link->scsi_version = inqbuf.version; - sc_link->maxlun = 7; if ((sc_link->quirks & SDEV_NOLUNS) == 0) scsi->moreluns |= (1 << target); diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 45dceedc60f..6d0b04d669e 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.24 2000/11/20 07:34:51 deraadt Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.25 2000/11/23 08:55:35 deraadt Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -187,7 +187,7 @@ struct scsi_link { void *device_softc; /* needed for call to foo_start */ struct scsi_adapter *adapter; /* adapter entry points etc. */ void *adapter_softc; /* needed for call to foo_scsi_cmd */ - u_char maxlun; + u_char luns; }; int scsiprint __P((void *, const char *)); |