summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1996-11-05 07:59:28 +0000
committergibbs <gibbs@FreeBSD.org>1996-11-05 07:59:28 +0000
commitff915b01647e6f5088f097917ca71db9b1654d13 (patch)
tree60723545bde72123e318cbeeece63e33e56a8b53 /sys
parentfd95d6b4791a6e2c35e7d151212bfd1c109afa22 (diff)
downloadFreeBSD-src-ff915b01647e6f5088f097917ca71db9b1654d13.zip
FreeBSD-src-ff915b01647e6f5088f097917ca71db9b1654d13.tar.gz
Clean up some code having to do with the 398X cards. We can't rely on the
7810 being either the last of the first device to be probed, so use a counting scheme instead to determine when one card ends and another begins. There may be a better way to do this by decoding the PCI tag, which I will investigate later. 2.2 Candidate.
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/aic7870.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/sys/pci/aic7870.c b/sys/pci/aic7870.c
index 3a22410..ca5f196 100644
--- a/sys/pci/aic7870.c
+++ b/sys/pci/aic7870.c
@@ -29,7 +29,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7870.c,v 1.40 1996/10/25 06:43:10 gibbs Exp $
+ * $Id: aic7870.c,v 1.41 1996/10/28 06:10:33 gibbs Exp $
*/
#if defined(__FreeBSD__)
@@ -377,6 +377,19 @@ ahc_pci_attach(parent, self, aux)
#ifdef AHC_SHARE_SCBS
shared_scb_data = first_398X->scb_data;
#endif
+ if (aic398X_count == 3) {
+ /*
+ * This is the last device on this RAID
+ * controller, so reset our counts.
+ * XXX This won't work for the multiple 3980
+ * controllers since they have only 2 channels,
+ * but I'm not even sure if Adaptec actually
+ * went through with their plans to produce
+ * this controller.
+ */
+ aic398X_count = 0;
+ first_398X = NULL;
+ }
break;
case PCI_DEVICE_ID_ADAPTEC_3940U:
case PCI_DEVICE_ID_ADAPTEC_3940:
@@ -414,12 +427,6 @@ ahc_pci_attach(parent, self, aux)
ahc_t = AHC_AIC7850;
break;
case PCI_DEVICE_ID_ADAPTEC_AIC7810:
- /*
- * This is the first device probed on a RAID
- * controller, so reset our counts.
- */
- aic398X_count = 0;
- first_398X = NULL;
printf("RAID functionality unsupported\n");
return;
default:
@@ -440,6 +447,20 @@ ahc_pci_attach(parent, self, aux)
ultra_enb = bus_io_read_1(pa->pa_bc, ioh, SXFRCTL0) & ULTRAEN;
#endif
+#if AHC_DEBUG
+ {
+ u_int32_t config_info;
+ config_info = pci_conf_read(config_id, DEVCONFIG);
+ printf("DEVCONF == 0x%x\n", config_info);
+
+ outb(io_port + HCNTRL, IRQMS|INTEN|PAUSE);
+ printf("SEECTL == 0x%x, BRDCTL == 0x%x\n"
+ "SXFRCTL0 == 0x%x, SXFRCTL1 == 0x%x\n",
+ inb(io_port + SEECTL), inb(io_port + 0x1D),
+ inb(io_port + SXFRCTL0), inb(io_port + SXFRCTL1));
+ }
+#endif
+
#if defined(__FreeBSD__)
ahc_reset(io_port);
#elif defined(__NetBSD__)
@@ -447,6 +468,7 @@ ahc_pci_attach(parent, self, aux)
ahc_reset(ahc->sc_dev.dv_xname, pa->pa_bc, ioh);
#endif
+#ifdef AHC_SHARE_SCBS
if (ahc_t & AHC_AIC7870) {
#if defined(__FreeBSD__)
u_int32_t devconfig = pci_conf_read(config_id, DEVCONFIG);
@@ -454,8 +476,6 @@ ahc_pci_attach(parent, self, aux)
u_int32_t devconfig =
pci_conf_read(pa->pa_pc, pa->pa_tag, DEVCONFIG);
#endif
-
-#ifdef AHC_SHARE_SCBS
if (devconfig & (RAMPSM)) {
/* XXX Assume 9bit SRAM and enable parity checking */
devconfig |= EXTSCBPEN;
@@ -476,8 +496,8 @@ ahc_pci_attach(parent, self, aux)
DEVCONFIG, devconfig);
#endif
}
-#endif
}
+#endif
#if defined(__FreeBSD__)
if ((ahc = ahc_alloc(unit, io_port, vaddr, ahc_t, ahc_f,
OpenPOWER on IntegriCloud