Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Minor changes to PCI configuration
details: https://anonhg.NetBSD.org/src/rev/64870387bf64
branches: trunk
changeset: 485896:64870387bf64
user: dante <dante%NetBSD.org@localhost>
date: Mon May 08 17:11:54 2000 +0000
description:
Minor changes to PCI configuration
diffstat:
sys/dev/pci/adw_pci.c | 57 +++++++++++++-------------------------------------
1 files changed, 15 insertions(+), 42 deletions(-)
diffs (119 lines):
diff -r 706be188ba89 -r 64870387bf64 sys/dev/pci/adw_pci.c
--- a/sys/dev/pci/adw_pci.c Mon May 08 17:06:48 2000 +0000
+++ b/sys/dev/pci/adw_pci.c Mon May 08 17:11:54 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adw_pci.c,v 1.5 2000/04/30 18:52:14 dante Exp $ */
+/* $NetBSD: adw_pci.c,v 1.6 2000/05/08 17:11:54 dante Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -75,8 +75,8 @@
/******************************************************************************/
-int adw_pci_match __P((struct device *, struct cfdata *, void *));
-void adw_pci_attach __P((struct device *, struct device *, void *));
+static int adw_pci_match __P((struct device *, struct cfdata *, void *));
+static void adw_pci_attach __P((struct device *, struct device *, void *));
struct cfattach adw_pci_ca =
{
@@ -89,7 +89,7 @@
* If we find one, note it's address (slot) and call
* the actual probe routine to check it out.
*/
-int
+static int
adw_pci_match(parent, match, aux)
struct device *parent;
struct cfdata *match;
@@ -100,9 +100,7 @@
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_ADVSYS)
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_ADVSYS_WIDE:
- return (1);
case PCI_PRODUCT_ADVSYS_U2W:
- return (1);
case PCI_PRODUCT_ADVSYS_U3W:
return (1);
}
@@ -111,7 +109,7 @@
}
-void
+static void
adw_pci_attach(parent, self, aux)
struct device *parent, *self;
void *aux;
@@ -135,12 +133,12 @@
case PCI_PRODUCT_ADVSYS_U2W:
sc->chip_type = ADV_CHIP_ASC38C0800;
- printf(": AdvanSys ASB-3940U2W SCSI adapter\n");
+ printf(": AdvanSys ASB-3940U2W-00 SCSI adapter\n");
break;
case PCI_PRODUCT_ADVSYS_U3W:
sc->chip_type = ADV_CHIP_ASC38C1600;
- printf(": AdvanSys ASB-3940U3W SCSI adapter\n");
+ printf(": AdvanSys ASB-3940U3W-00 SCSI adapter\n");
break;
default:
@@ -153,38 +151,11 @@
* Make sure IO/MEM/MASTER are enabled
*/
command = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
- if ((command & (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE |
- PCI_COMMAND_MASTER_ENABLE)) !=
- (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE |
- PCI_COMMAND_MASTER_ENABLE)) {
- pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
- command | (PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE |
- PCI_COMMAND_MASTER_ENABLE));
- }
- /*
- * Latency timer settings.
- */
- {
- u_int32_t bhlcr;
-
- bhlcr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_BHLC_REG);
+ command |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE |
+ PCI_COMMAND_MASTER_ENABLE;
+ pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, command);
- if( ((PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_WIDE) ||
- (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_U2W) ||
- (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_U3W)) &&
- (PCI_LATTIMER(bhlcr) < 0x20)) {
- bhlcr &= 0xFFFF00FFUL;
- bhlcr |= 0x00002000UL;
- pci_conf_write(pa->pa_pc, pa->pa_tag,
- PCI_BHLC_REG, bhlcr);
- }
- }
-
-
- if (((PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_WIDE) ||
- (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_U2W) ||
- (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_U3W)) &&
- (command & PCI_COMMAND_PARITY_ENABLE) == 0) {
+ if ( (command & PCI_COMMAND_PARITY_ENABLE) == 0) {
sc->cfg.control_flag |= CONTROL_FLAG_IGNORE_PERR;
}
/*
@@ -203,8 +174,10 @@
/*
* Initialize the board
*/
- if (adw_init(sc))
- panic("adw_pci_attach: adw_init failed");
+ if (adw_init(sc)) {
+ printf("%s: adw_init failed", sc->sc_dev.dv_xname);
+ return;
+ }
/*
* Map Interrupt line
Home |
Main Index |
Thread Index |
Old Index