-/* $OpenBSD: aic7xxx.c,v 1.14 1996/11/28 23:27:43 niklas Exp $ */
+/* $OpenBSD: aic7xxx.c,v 1.15 1997/01/15 05:50:38 deraadt Exp $ */
/* $NetBSD: aic7xxx.c,v 1.17 1996/10/21 22:34:04 thorpej Exp $ */
/*
ahc->sc_link.fordriver = 0;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_link.adapter_target = ahc->our_id;
+#ifdef __OpenBSD__
+ if(ahc->type & AHC_WIDE)
+ ahc->sc_link.adapter_buswidth = 16;
+#endif
#ifndef __OpenBSD__
ahc->sc_link.channel = 0;
#endif
ahc->sc_link_b.fordriver = (void *)SELBUSB;
#elif defined(__NetBSD__) || defined(__OpenBSD__)
ahc->sc_link_b.adapter_target = ahc->our_id_b;
+#ifdef __OpenBSD__
+ if(ahc->type & AHC_WIDE)
+ ahc->sc_link.adapter_buswidth = 16;
+#endif
#ifndef __OpenBSD__
ahc->sc_link_b.channel = 1;
#endif
-/* $OpenBSD: ncr.c,v 1.22 1996/11/30 23:04:38 downsj Exp $ */
+/* $OpenBSD: ncr.c,v 1.23 1997/01/15 05:50:44 deraadt Exp $ */
/* $NetBSD: ncr.c,v 1.48 1996/10/25 21:33:33 cgd Exp $ */
/**************************************************************************
#if defined(__NetBSD__) || defined(__OpenBSD__)
np->sc_link.adapter_softc = np;
np->sc_link.adapter_target = np->myaddr;
+ np->sc_link.adapter_buswidth = MAX_TARGET;
np->sc_link.openings = 1;
#ifndef __OpenBSD__
np->sc_link.channel = SCSI_CHANNEL_ONLY_ONE;
-/* $OpenBSD: scsiconf.c,v 1.19 1996/11/28 13:20:37 niklas Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.20 1997/01/15 05:50:27 deraadt Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
{
struct scsibus_softc *sb = (struct scsibus_softc *)self;
struct scsi_link *sc_link_proto = aux;
+ int nbytes, i;
sc_link_proto->scsibus = sb->sc_dev.dv_unit;
sb->adapter_link = sc_link_proto;
- printf("\n");
+ if (sb->adapter_link->adapter_buswidth == 0)
+ sb->adapter_link->adapter_buswidth = 8;
+ sb->sc_buswidth = sb->adapter_link->adapter_buswidth;
+
+ printf(": %d targets\n", sb->sc_buswidth);
+
+ nbytes = sb->sc_buswidth * sizeof(struct scsi_link **);
+ sb->sc_link = (struct scsi_link ***)malloc(nbytes, M_DEVBUF, M_NOWAIT);
+ if (sb->sc_link == NULL)
+ panic("scsibusattach: can't allocate target links");
+ nbytes = 8 * sizeof(struct scsi_link *);
+ for (i = 0; i <= sb->sc_buswidth; i++) {
+ sb->sc_link[i] = (struct scsi_link **)malloc(nbytes,
+ M_DEVBUF, M_NOWAIT);
+ if (sb->sc_link[i] == NULL)
+ panic("scsibusattach: can't allocate lun links");
+ bzero(sb->sc_link[i], nbytes);
+ }
#if defined(SCSI_DELAY) && SCSI_DELAY > 2
printf("%s: waiting for scsi devices to settle\n",
scsi_addr = scsi->adapter_link->adapter_target;
if (target == -1) {
- maxtarget = 7;
+ maxtarget = scsi->adapter_link->adapter_buswidth - 1;
mintarget = 0;
} else {
- if (target < 0 || target > 7)
+ if (target < 0 ||
+ target >= scsi->adapter_link->adapter_buswidth)
return EINVAL;
maxtarget = mintarget = target;
}
-/* $OpenBSD: scsiconf.h,v 1.8 1996/10/31 01:09:25 niklas Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.9 1997/01/15 05:50:29 deraadt Exp $ */
/* $NetBSD: scsiconf.h,v 1.29 1996/03/19 03:07:50 mycroft Exp $ */
/*
u_int8_t target; /* targ of this dev */
u_int8_t lun; /* lun of this dev */
u_int8_t adapter_target; /* what are we on the scsi bus */
+ u_int8_t adapter_buswidth; /* 8 (regular) or 16 (wide). (0 becomes 8) */
u_int8_t openings; /* available operations */
u_int8_t active; /* operations in progress */
u_int16_t flags; /* flags that all devices have */
struct scsibus_softc {
struct device sc_dev;
struct scsi_link *adapter_link; /* prototype supplied by adapter */
- struct scsi_link *sc_link[8][8];
+ struct scsi_link ***sc_link;
u_int8_t moreluns;
+ u_int8_t sc_buswidth;
};
/*