diff options
author | gibbs <gibbs@FreeBSD.org> | 1995-08-23 23:03:34 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1995-08-23 23:03:34 +0000 |
commit | ae1e6673d90921816b6cdd6c732b2c8d0f5afcfa (patch) | |
tree | 261944881099a051f944dac2c7d547a51654fee4 /sys/pci | |
parent | 11e9122e645e253373e8b159fc45d1a53fc1ac4d (diff) | |
download | FreeBSD-src-ae1e6673d90921816b6cdd6c732b2c8d0f5afcfa.zip FreeBSD-src-ae1e6673d90921816b6cdd6c732b2c8d0f5afcfa.tar.gz |
Remove hard coded assumption that SCSI busses have 7 targets.
This change forces the controller drivers to allocate a scsibus_data struct
via a call to scsi_alloc_bus(), fill in the adapter_link field, and optionally
modify any other fields of the struct. Scsi_alloc_bus() initializes all fields
to the default, so the changes in most drivers are very minimal. For drivers
that support Wide controllers, the maxtarg field will have to be updated to
allow probing of all targets (for an example, look at the aic7xxx driver).
Scsi_attachdevs() now takes a scsibus_data* as its argument instead of an
sc_link*. This allows us to expand the role of the scsibus_data struct for
other bus level configuration setings (max number of transactions, current
transaction opennings, etc for better tagged queuing support).
Reviewed by: Rodney Grimes <rgrimes>, Peter Dufault <dufault>, Julian Elischer <julian>
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/ncr.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index 5c2302c..9a07edc 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: ncr.c,v 1.40 1995/08/13 14:59:38 se Exp $ +** $Id: ncr.c,v 1.41 1995/08/15 20:19:14 se Exp $ ** ** Device driver for the NCR 53C810 PCI-SCSI-Controller. ** @@ -1223,7 +1223,7 @@ static void ncr_attach (pcici_t tag, int unit); static char ident[] = - "\n$Id: ncr.c,v 1.40 1995/08/13 14:59:38 se Exp $\n"; + "\n$Id: ncr.c,v 1.41 1995/08/15 20:19:14 se Exp $\n"; u_long ncr_version = NCR_VERSION + (u_long) sizeof (struct ncb) @@ -3204,6 +3204,10 @@ static void ncr_attach (pcici_t config_id, int unit) extern unsigned bio_imask; #endif +#if (__FreeBSD__ >= 2) + struct scsibus_data *scbus; +#endif + /* ** allocate structure */ @@ -3380,7 +3384,17 @@ static void ncr_attach (pcici_t config_id, int unit) #ifdef __NetBSD__ config_found(self, &np->sc_link, ncr_print); #else /* !__NetBSD__ */ +#if (__FreeBSD__ >= 2) + scbus = scsi_alloc_bus(); + if(!scbus) + return; + /* XXX scbus->maxtarg should be adjusted based on bus width */ + scbus->adapter_link = &np->sc_link; + scsi_attachdevs (scbus); + scbus = NULL; /* Upper-level SCSI code owns this now */ +#else scsi_attachdevs (&np->sc_link); +#endif /* !__FreeBSD__ >= 2 */ #endif /* !__NetBSD__ */ /* |