Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Clean up some stuff
details: https://anonhg.NetBSD.org/src/rev/c72f610d4526
branches: trunk
changeset: 473647:c72f610d4526
user: dante <dante%NetBSD.org@localhost>
date: Sat Jun 12 12:09:01 1999 +0000
description:
Clean up some stuff
Remove chip version check
Now compile again on 68k based systems
diffstat:
sys/dev/ic/advlib.c | 52 ++++++++++++++--------------------------------------
1 files changed, 14 insertions(+), 38 deletions(-)
diffs (160 lines):
diff -r 49cf0df729ad -r c72f610d4526 sys/dev/ic/advlib.c
--- a/sys/dev/ic/advlib.c Sat Jun 12 11:24:35 1999 +0000
+++ b/sys/dev/ic/advlib.c Sat Jun 12 12:09:01 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advlib.c,v 1.9 1999/06/06 17:33:18 dante Exp $ */
+/* $NetBSD: advlib.c,v 1.10 1999/06/12 12:09:01 dante Exp $ */
/*
* Low level routines for the Advanced Systems Inc. SCSI controllers chips
@@ -89,8 +89,9 @@
static void AscInitQLinkVar __P((ASC_SOFTC *));
static int AscResetChipAndScsiBus __P((bus_space_tag_t, bus_space_handle_t));
static u_int16_t AscGetChipBusType __P((bus_space_tag_t, bus_space_handle_t));
+/*
static u_int16_t AscGetEisaChipCfg __P((bus_space_tag_t, bus_space_handle_t));
-
+*/
/* Chip register routines */
static void AscSetBank __P((bus_space_tag_t, bus_space_handle_t, u_int8_t));
@@ -100,8 +101,6 @@
static u_int8_t AscSetChipScsiID __P((bus_space_tag_t, bus_space_handle_t,
u_int8_t));
static u_int8_t AscGetChipScsiCtrl __P((bus_space_tag_t, bus_space_handle_t));
-static u_int8_t AscGetChipVersion __P((bus_space_tag_t, bus_space_handle_t,
- u_int16_t));
static int AscSetRunChipSynRegAtID __P((bus_space_tag_t, bus_space_handle_t,
u_int8_t, u_int8_t));
static int AscSetChipSynRegAtID __P((bus_space_tag_t, bus_space_handle_t,
@@ -255,7 +254,6 @@
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
int i;
- u_int8_t chip_version;
ASC_SET_CHIP_CONTROL(iot, ioh, ASC_CC_HALT);
@@ -284,10 +282,8 @@
sc->chip_scsi_id = ASC_DEF_CHIP_SCSI_ID;
sc->lib_serial_no = ASC_LIB_SERIAL_NUMBER;
sc->lib_version = (ASC_LIB_VERSION_MAJOR << 8) | ASC_LIB_VERSION_MINOR;
- chip_version = AscGetChipVersion(iot, ioh, sc->bus_type);
- sc->chip_version = chip_version;
if ((sc->bus_type & ASC_IS_PCI) &&
- (chip_version >= ASC_CHIP_VER_PCI_ULTRA_3150)) {
+ (sc->chip_version >= ASC_CHIP_VER_PCI_ULTRA_3150)) {
sc->bus_type = ASC_IS_PCI_ULTRA;
sc->sdtr_period_tbl[0] = SYN_ULTRA_XFER_NS_0;
sc->sdtr_period_tbl[1] = SYN_ULTRA_XFER_NS_1;
@@ -306,10 +302,10 @@
sc->sdtr_period_tbl[14] = SYN_ULTRA_XFER_NS_14;
sc->sdtr_period_tbl[15] = SYN_ULTRA_XFER_NS_15;
sc->max_sdtr_index = 15;
- if (chip_version == ASC_CHIP_VER_PCI_ULTRA_3150)
+ if (sc->chip_version == ASC_CHIP_VER_PCI_ULTRA_3150)
ASC_SET_EXTRA_CONTROL(iot, ioh,
(SEC_ACTIVE_NEGATE | SEC_SLEW_RATE));
- else if (chip_version >= ASC_CHIP_VER_PCI_ULTRA_3050)
+ else if (sc->chip_version >= ASC_CHIP_VER_PCI_ULTRA_3050)
ASC_SET_EXTRA_CONTROL(iot, ioh,
(SEC_ACTIVE_NEGATE | SEC_ENABLE_FILTER));
} else {
@@ -415,8 +411,7 @@
eep_config->cfg_lsw |= ASC_CFG0_HOST_INT_ON;
if (chksum != eep_config->chksum) {
- if (AscGetChipVersion(iot, ioh, sc->bus_type) ==
- ASC_CHIP_VER_PCI_ULTRA_3050) {
+ if (sc->chip_version == ASC_CHIP_VER_PCI_ULTRA_3050) {
eep_config->init_sdtr = 0xFF;
eep_config->disc_enable = 0xFF;
eep_config->start_motor = 0xFF;
@@ -564,8 +559,7 @@
}
}
} else if (sc->bus_type == ASC_IS_ISAPNP) {
- if (AscGetChipVersion(iot, ioh, sc->bus_type) ==
- ASC_CHIP_VER_ASYN_BUG) {
+ if (sc->chip_version == ASC_CHIP_VER_ASYN_BUG) {
sc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN;
}
}
@@ -743,7 +737,7 @@
u_int16_t chip_ver;
chip_ver = ASC_GET_CHIP_VER_NO(iot, ioh);
- if ((chip_ver >= ASC_CHIP_MIN_VER_VL) &&
+/* if ((chip_ver >= ASC_CHIP_MIN_VER_VL) &&
(chip_ver <= ASC_CHIP_MAX_VER_VL)) {
if(((ioh & 0x0C30) == 0x0C30) || ((ioh & 0x0C50) == 0x0C50)) {
return (ASC_IS_EISA);
@@ -752,7 +746,7 @@
return (ASC_IS_VL);
}
}
- if ((chip_ver >= ASC_CHIP_MIN_VER_ISA) &&
+*/ if ((chip_ver >= ASC_CHIP_MIN_VER_ISA) &&
(chip_ver <= ASC_CHIP_MAX_VER_ISA)) {
if (chip_ver >= ASC_CHIP_MIN_VER_ISA_PNP)
return (ASC_IS_ISAPNP);
@@ -765,7 +759,7 @@
return (0);
}
-
+/*
static u_int16_t
AscGetEisaChipCfg(iot, ioh)
bus_space_tag_t iot;
@@ -776,7 +770,7 @@
eisa_cfg_iop = ASC_GET_EISA_SLOT(ioh) | (ASC_EISA_CFG_IOP_MASK);
return (inw(eisa_cfg_iop));
}
-
+*/
/******************************************************************************/
/* Chip register routines */
@@ -852,24 +846,6 @@
static u_int8_t
-AscGetChipVersion(iot, ioh, bus_type)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
- u_int16_t bus_type;
-{
- u_int16_t eisa_iop;
- u_int8_t revision;
-
- if (bus_type & ASC_IS_EISA) {
- eisa_iop = ASC_GET_EISA_SLOT(ioh) | ASC_EISA_REV_IOP_MASK;
- revision = inb(eisa_iop);
- return((ASC_CHIP_MIN_VER_EISA - 1) + revision);
- }
- return (ASC_GET_CHIP_VER_NO(iot, ioh));
-}
-
-
-static u_int8_t
AscSetChipScsiID(iot, ioh, new_id)
bus_space_tag_t iot;
bus_space_handle_t ioh;
@@ -2106,14 +2082,14 @@
u_int8_t chip_irq;
- if (bus_type & ASC_IS_EISA) {
+/* if (bus_type & ASC_IS_EISA) {
cfg_lsw = AscGetEisaChipCfg(iot, ioh);
chip_irq = ((cfg_lsw >> 8) & 0x07) + 10;
if((chip_irq == 13) || (chip_irq > 15))
return (0);
return(chip_irq);
}
- if ((bus_type & ASC_IS_VL) != 0) {
+*/ if ((bus_type & ASC_IS_VL) != 0) {
cfg_lsw = ASC_GET_CHIP_CFG_LSW(iot, ioh);
chip_irq = (cfg_lsw >> 2) & 0x07;
if ((chip_irq == 0) ||
Home |
Main Index |
Thread Index |
Old Index