summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>2001-10-25 23:56:02 +0000
committeraugustss <augustss@NetBSD.org>2001-10-25 23:56:02 +0000
commitdddb1ab51dbac970ba185b95afa892a48dd20551 (patch)
treea91e197a3206136039797d4b3bc76cbf0511954f /sys/dev/usb
parent11f7f986bdf0e9d4c3c5c5d8773d39c667176e03 (diff)
Add some conditional compilation so we can have atapibus, but not scsibus.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/umassbus.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/usb/umassbus.c b/sys/dev/usb/umassbus.c
index 3ecb5ffab9a..2c0d0ab5a6f 100644
--- a/sys/dev/usb/umassbus.c
+++ b/sys/dev/usb/umassbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umassbus.c,v 1.9 2001/09/15 16:47:41 yamt Exp $ */
+/* $NetBSD: umassbus.c,v 1.10 2001/10/25 23:56:02 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,6 +39,7 @@
#include "atapibus.h"
+#include "scsibus.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -121,6 +122,7 @@ umass_attach_bus(struct umass_softc *sc)
switch (sc->cmd_proto) {
case CPROTO_RBC:
case CPROTO_SCSI:
+#if NSCSIBUS > 0
sc->bus.sc_channel.chan_bustype = &scsi_bustype;
sc->bus.sc_channel.chan_ntargets = UMASS_SCSIID_DEVICE + 1;
sc->bus.sc_channel.chan_nluns = sc->maxlun + 1;
@@ -128,11 +130,14 @@ umass_attach_bus(struct umass_softc *sc)
sc->bus.sc_channel.type = BUS_SCSI;
sc->bus.sc_child =
config_found(&sc->sc_dev, &sc->bus.sc_channel, scsipiprint);
+#else
+ printf("%s: scsibus not configured\n", USBDEVNAME(sc->sc_dev));
+#endif
break;
-#if NATAPIBUS > 0
case CPROTO_UFI:
case CPROTO_ATAPI:
+#if NATAPIBUS > 0
sc->bus.sc_channel.chan_bustype = &umass_atapi_bustype;
sc->bus.sc_channel.chan_ntargets = 2;
sc->bus.sc_channel.chan_nluns = 1;
@@ -146,8 +151,10 @@ umass_attach_bus(struct umass_softc *sc)
sc->bus.sc_channel.chan_defquirks |= PQUIRK_NOTUR;
sc->bus.sc_child =
config_found(&sc->sc_dev, &sc->bus.aa.sc_aa, scsipiprint);
- break;
+#else
+ printf("%s: atapibus not configured\n", USBDEVNAME(sc->sc_dev));
#endif
+ break;
default:
printf("%s: cmd proto=0x%x not supported yet\n",
@@ -168,9 +175,15 @@ scsipiprint(void *aux, const char *pnp)
{
struct scsipi_channel *chan = aux;
- if (chan->chan_bustype->bustype_type == SCSIPI_BUSTYPE_SCSI)
+ if (chan->chan_bustype->bustype_type == SCSIPI_BUSTYPE_SCSI) {
+#if NSCSIBUS > 0
return (scsiprint(aux, pnp));
- else {
+#else
+ if (pnp)
+ printf("scsibus at %s", pnp);
+ return (UNCONF);
+#endif
+ } else {
#if NATAPIBUS > 0
struct ata_atapi_attach *aa_link = aux;
#endif