diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1998-09-28 01:56:59 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1998-09-28 01:56:59 +0000 |
commit | 2e434be595734504f61c90d3eba648f510242071 (patch) | |
tree | 7c9dc7e1ac916268fded8b5af5d254c00f07dd38 /sys/dev | |
parent | 3ff8eb7ddf08c874d646d58684a3ec9975777e8a (diff) |
Sync w/ NetBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/adv.c | 209 | ||||
-rw-r--r-- | sys/dev/ic/adv.h | 16 | ||||
-rw-r--r-- | sys/dev/ic/advlib.c | 18 | ||||
-rw-r--r-- | sys/dev/ic/advlib.h | 14 | ||||
-rw-r--r-- | sys/dev/ic/advmcode.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/advmcode.h | 8 | ||||
-rw-r--r-- | sys/dev/pci/adv_pci.c | 22 |
7 files changed, 134 insertions, 161 deletions
diff --git a/sys/dev/ic/adv.c b/sys/dev/ic/adv.c index e3220f1bece..f856e88bf38 100644 --- a/sys/dev/ic/adv.c +++ b/sys/dev/ic/adv.c @@ -1,8 +1,8 @@ -/* $OpenBSD: adv.c,v 1.1 1998/09/27 03:36:13 downsj Exp $ */ -/* $NetBSD: adv.c,v 1.3 1998/09/09 05:28:58 thorpej Exp $ */ +/* $OpenBSD: adv.c,v 1.2 1998/09/28 01:56:56 downsj Exp $ */ +/* $NetBSD: adv.c,v 1.4 1998/09/26 16:02:56 dante Exp $ */ /* - * Generic driver for the Advanced Systems Inc. SCSI controllers + * Generic driver for the Advanced Systems Inc. Narrow SCSI controllers * * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -19,8 +19,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @@ -462,84 +462,76 @@ adv_init(sc) { int warn; - if (ASC_IS_NARROW_BOARD(sc)) { - if (!AscFindSignature(sc->sc_iot, sc->sc_ioh)) - panic("adv_init: adv_find_signature failed"); + if (!AscFindSignature(sc->sc_iot, sc->sc_ioh)) + panic("adv_init: adv_find_signature failed"); - /* - * Read the board configuration - */ - AscInitASC_SOFTC(sc); - warn = AscInitFromEEP(sc); - if (warn) { - printf("%s -get: ", sc->sc_dev.dv_xname); - switch (warn) { - case -1: - printf("Chip is not halted\n"); - break; - - case -2: - printf("Couldn't get MicroCode Start" - " address\n"); - break; - - case ASC_WARN_IO_PORT_ROTATE: - printf("I/O port address modified\n"); - break; - - case ASC_WARN_AUTO_CONFIG: - printf("I/O port increment switch enabled\n"); - break; - - case ASC_WARN_EEPROM_CHKSUM: - printf("EEPROM checksum error\n"); - break; - - case ASC_WARN_IRQ_MODIFIED: - printf("IRQ modified\n"); - break; - - case ASC_WARN_CMD_QNG_CONFLICT: - printf("tag queuing enabled w/o disconnects\n"); - break; - - default: - printf("unknown warning %d\n", warn); - } - } - if (sc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) - sc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; + /* + * Read the board configuration + */ + AscInitASC_SOFTC(sc); + warn = AscInitFromEEP(sc); + if (warn) { + printf("%s -get: ", sc->sc_dev.dv_xname); + switch (warn) { + case -1: + printf("Chip is not halted\n"); + break; - /* - * Modify the board configuration - */ - warn = AscInitFromASC_SOFTC(sc); - if (warn) { - printf("%s -set: ", sc->sc_dev.dv_xname); - switch (warn) { - case ASC_WARN_CMD_QNG_CONFLICT: - printf("tag queuing enabled w/o disconnects\n"); - break; - - case ASC_WARN_AUTO_CONFIG: - printf("I/O port increment switch enabled\n"); - break; - - default: - printf("unknown warning %d\n", warn); - } + case -2: + printf("Couldn't get MicroCode Start" + " address\n"); + break; + + case ASC_WARN_IO_PORT_ROTATE: + printf("I/O port address modified\n"); + break; + + case ASC_WARN_AUTO_CONFIG: + printf("I/O port increment switch enabled\n"); + break; + + case ASC_WARN_EEPROM_CHKSUM: + printf("EEPROM checksum error\n"); + break; + + case ASC_WARN_IRQ_MODIFIED: + printf("IRQ modified\n"); + break; + + case ASC_WARN_CMD_QNG_CONFLICT: + printf("tag queuing enabled w/o disconnects\n"); + break; + + default: + printf("unknown warning %d\n", warn); } - sc->isr_callback = (ulong) adv_narrow_isr_callback; + } + if (sc->scsi_reset_wait > ASC_MAX_SCSI_RESET_WAIT) + sc->scsi_reset_wait = ASC_MAX_SCSI_RESET_WAIT; + + /* + * Modify the board configuration + */ + warn = AscInitFromASC_SOFTC(sc); + if (warn) { + printf("%s -set: ", sc->sc_dev.dv_xname); + switch (warn) { + case ASC_WARN_CMD_QNG_CONFLICT: + printf("tag queuing enabled w/o disconnects\n"); + break; + + case ASC_WARN_AUTO_CONFIG: + printf("I/O port increment switch enabled\n"); + break; - if (!(sc->overrun_buf = adv_alloc_overrunbuf(sc->sc_dev.dv_xname, - sc->sc_dmat))) { - return (1); + default: + printf("unknown warning %d\n", warn); } - } else - //IS_WIDE_BOARD - { - printf("%s: Wide boards are not supported yet\n", - sc->sc_dev.dv_xname); + } + sc->isr_callback = (ulong) adv_narrow_isr_callback; + + if (!(sc->overrun_buf = adv_alloc_overrunbuf(sc->sc_dev.dv_xname, + sc->sc_dmat))) { return (1); } @@ -553,37 +545,31 @@ adv_attach(sc) { int i, error; - if (ASC_IS_NARROW_BOARD(sc)) { - /* - * Initialize board RISC chip and enable interrupts. - */ - switch (AscInitDriver(sc)) { - case 0: - /* AllOK */ - break; + /* + * Initialize board RISC chip and enable interrupts. + */ + switch (AscInitDriver(sc)) { + case 0: + /* AllOK */ + break; - case 1: - panic("%s: bad signature", sc->sc_dev.dv_xname); - break; + case 1: + panic("%s: bad signature", sc->sc_dev.dv_xname); + break; - case 2: - panic("%s: unable to load MicroCode", - sc->sc_dev.dv_xname); - break; + case 2: + panic("%s: unable to load MicroCode", + sc->sc_dev.dv_xname); + break; - case 3: - panic("%s: unable to initialize MicroCode", - sc->sc_dev.dv_xname); - break; + case 3: + panic("%s: unable to initialize MicroCode", + sc->sc_dev.dv_xname); + break; - default: - panic("%s: unable to initialize board RISC chip", - sc->sc_dev.dv_xname); - } - } else - //Wide Boards - { - /* ToDo */ + default: + panic("%s: unable to initialize board RISC chip", + sc->sc_dev.dv_xname); } @@ -595,7 +581,7 @@ adv_attach(sc) sc->sc_link.adapter = &adv_switch; sc->sc_link.device = &adv_dev; sc->sc_link.openings = 4; - sc->sc_link.adapter_buswidth = ASC_IS_NARROW_BOARD(sc) ? 7 : 15; + sc->sc_link.adapter_buswidth = 7; TAILQ_INIT(&sc->sc_free_ccb); @@ -845,13 +831,7 @@ adv_intr(arg) ASC_SOFTC *sc = arg; struct scsi_xfer *xs; - if (ASC_IS_NARROW_BOARD(sc)) { - AscISR(sc); - } else - //Wide Boards - { - /* ToDo AdvISR */ - } + AscISR(sc); /* * If there are queue entries in the software queue, try to @@ -1026,8 +1006,9 @@ adv_narrow_isr_callback(sc, qdonep) s2 = &xs->sense; *s2 = *s1; xs->error = XS_SENSE; - } else + } else { xs->error = XS_DRIVER_STUFFUP; + } break; default: diff --git a/sys/dev/ic/adv.h b/sys/dev/ic/adv.h index da5e5d592fc..fc1bec4320e 100644 --- a/sys/dev/ic/adv.h +++ b/sys/dev/ic/adv.h @@ -1,9 +1,9 @@ -/* $OpenBSD: adv.h,v 1.1 1998/09/27 03:36:13 downsj Exp $ */ -/* $NetBSD: adv.h,v 1.2 1998/08/29 13:45:56 dante Exp $ */ +/* $OpenBSD: adv.h,v 1.2 1998/09/28 01:56:57 downsj Exp $ */ +/* $NetBSD: adv.h,v 1.3 1998/09/26 16:02:56 dante Exp $ */ /* * Generic driver definitions and exported functions for the Advanced - * Systems Inc. SCSI controllers + * Systems Inc. Narrow SCSI controllers * * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -20,8 +20,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @@ -39,8 +39,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _ADVANSYS_H_ -#define _ADVANSYS_H_ +#ifndef _ADVANSYS_NARROW_H_ +#define _ADVANSYS_NARROW_H_ #include <dev/ic/advlib.h> @@ -93,4 +93,4 @@ int adv_intr __P((void *arg)); /******************************************************************************/ -#endif /* _ADVANSYS_H_ */ +#endif /* _ADVANSYS_NARROW_H_ */ diff --git a/sys/dev/ic/advlib.c b/sys/dev/ic/advlib.c index 6140585592d..0b3d092b130 100644 --- a/sys/dev/ic/advlib.c +++ b/sys/dev/ic/advlib.c @@ -1,5 +1,5 @@ -/* $OpenBSD: advlib.c,v 1.1 1998/09/27 03:36:14 downsj Exp $ */ -/* $NetBSD: advlib.c,v 1.3 1998/08/29 13:45:57 dante Exp $ */ +/* $OpenBSD: advlib.c,v 1.2 1998/09/28 01:56:57 downsj Exp $ */ +/* $NetBSD: advlib.c,v 1.4 1998/09/26 16:02:56 dante Exp $ */ /* * Low level routines for the Advanced Systems Inc. SCSI controllers chips @@ -19,8 +19,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @@ -101,7 +101,7 @@ 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 ASC_SET_CHIP_SYNRegAtID __P((bus_space_tag_t, bus_space_handle_t, +static int AscSetChipSynRegAtID __P((bus_space_tag_t, bus_space_handle_t, u_int8_t, u_int8_t)); static int AscHostReqRiscHalt __P((bus_space_tag_t, bus_space_handle_t)); static int AscIsChipHalted __P((bus_space_tag_t, bus_space_handle_t)); @@ -897,7 +897,7 @@ AscSetRunChipSynRegAtID(iot, ioh, tid_no, sdtr_data) int retval = FALSE; if (AscHostReqRiscHalt(iot, ioh)) { - retval = ASC_SET_CHIP_SYNRegAtID(iot, ioh, tid_no, sdtr_data); + retval = AscSetChipSynRegAtID(iot, ioh, tid_no, sdtr_data); AscStartChip(iot, ioh); } return (retval); @@ -905,7 +905,7 @@ AscSetRunChipSynRegAtID(iot, ioh, tid_no, sdtr_data) static int -ASC_SET_CHIP_SYNRegAtID(iot, ioh, id, sdtr_data) +AscSetChipSynRegAtID(iot, ioh, id, sdtr_data) bus_space_tag_t iot; bus_space_handle_t ioh; u_int8_t id; @@ -2302,7 +2302,7 @@ AscSetChipSDTR(iot, ioh, sdtr_data, tid_no) u_int8_t sdtr_data; u_int8_t tid_no; { - ASC_SET_CHIP_SYNRegAtID(iot, ioh, tid_no, sdtr_data); + AscSetChipSynRegAtID(iot, ioh, tid_no, sdtr_data); AscWriteLramByte(iot, ioh, tid_no + ASCV_SDTR_DONE_BEG, sdtr_data); } @@ -3082,7 +3082,7 @@ AscResetBus(sc) for (i = 0; i <= ASC_MAX_TID; i++) { sc->cur_dvc_qng[i] = 0; if (sc->pci_fix_asyn_xfer & (ASC_SCSI_BIT_ID_TYPE) (0x01 << i)) - ASC_SET_CHIP_SYNRegAtID(iot, ioh, i, ASYN_SDTR_DATA_FIX_PCI_REV_AB); + AscSetChipSynRegAtID(iot, ioh, i, ASYN_SDTR_DATA_FIX_PCI_REV_AB); } ASC_SET_PC_ADDR(iot, ioh, ASC_MCODE_START_ADDR); diff --git a/sys/dev/ic/advlib.h b/sys/dev/ic/advlib.h index 7a05077569c..6d3bcec6bc6 100644 --- a/sys/dev/ic/advlib.h +++ b/sys/dev/ic/advlib.h @@ -1,5 +1,5 @@ -/* $OpenBSD: advlib.h,v 1.1 1998/09/27 03:36:14 downsj Exp $ */ -/* $NetBSD: advlib.h,v 1.2 1998/08/29 13:45:57 dante Exp $ */ +/* $OpenBSD: advlib.h,v 1.2 1998/09/28 01:56:57 downsj Exp $ */ +/* $NetBSD: advlib.h,v 1.3 1998/09/26 16:02:57 dante Exp $ */ /* * Definitions for low level routines and data structures @@ -20,8 +20,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. @@ -53,8 +53,8 @@ * modification. */ -#ifndef _ADVANSYS_LIBRARY_H_ -#define _ADVANSYS_LIBRARY_H_ +#ifndef _ADVANSYS_NARROW_LIBRARY_H_ +#define _ADVANSYS_NARROW_LIBRARY_H_ #include <dev/ic/adv.h> @@ -1315,4 +1315,4 @@ int AscResetDevice __P((ASC_SOFTC *, u_char)); /******************************************************************************/ -#endif /* _ADVANSYS_LIBRARY_H_ */ +#endif /* _ADVANSYS_NARROW_LIBRARY_H_ */ diff --git a/sys/dev/ic/advmcode.c b/sys/dev/ic/advmcode.c index 9665dbea312..cdb414f7c41 100644 --- a/sys/dev/ic/advmcode.c +++ b/sys/dev/ic/advmcode.c @@ -1,5 +1,5 @@ -/* $OpenBSD: advmcode.c,v 1.1 1998/09/27 03:36:14 downsj Exp $ */ -/* $NetBSD: advmcode.c,v 1.2 1998/08/29 13:45:57 dante Exp $ */ +/* $OpenBSD: advmcode.c,v 1.2 1998/09/28 01:56:58 downsj Exp $ */ +/* $NetBSD: advmcode.c,v 1.3 1998/09/26 16:02:57 dante Exp $ */ /* * Generic driver definitions and exported functions for the Advanced @@ -20,8 +20,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. diff --git a/sys/dev/ic/advmcode.h b/sys/dev/ic/advmcode.h index fece7325d67..67fefa67406 100644 --- a/sys/dev/ic/advmcode.h +++ b/sys/dev/ic/advmcode.h @@ -1,5 +1,5 @@ -/* $OpenBSD: advmcode.h,v 1.1 1998/09/27 03:36:14 downsj Exp $ */ -/* $NetBSD: advmcode.h,v 1.2 1998/08/29 13:45:57 dante Exp $ */ +/* $OpenBSD: advmcode.h,v 1.2 1998/09/28 01:56:58 downsj Exp $ */ +/* $NetBSD: advmcode.h,v 1.3 1998/09/26 16:02:57 dante Exp $ */ /* * Generic driver definitions and exported functions for the Advanced @@ -20,8 +20,8 @@ * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. diff --git a/sys/dev/pci/adv_pci.c b/sys/dev/pci/adv_pci.c index bdd6ef6c31b..3b21cb4cad2 100644 --- a/sys/dev/pci/adv_pci.c +++ b/sys/dev/pci/adv_pci.c @@ -1,5 +1,5 @@ -/* $OpenBSD: adv_pci.c,v 1.1 1998/09/27 03:38:09 downsj Exp $ */ -/* $NetBSD: adv_pci.c,v 1.4 1998/08/31 17:15:25 dante Exp $ */ +/* $OpenBSD: adv_pci.c,v 1.2 1998/09/28 01:56:58 downsj Exp $ */ +/* $NetBSD: adv_pci.c,v 1.5 1998/09/26 15:52:55 dante Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. @@ -40,11 +40,11 @@ * * Connectivity Products: * ABP920 - Bus-Master PCI (16 CDB) - * ABP930 - Bus-Master PCI (16 CDB) (Footnote 2) + * ABP930 - Bus-Master PCI (16 CDB) (Footnote 1) * ABP930U - Bus-Master PCI Ultra (16 CDB) * ABP930UA - Bus-Master PCI Ultra (16 CDB) - * ABP960 - Bus-Master PCI MAC/PC (16 CDB) (Footnote 1) - * ABP960U - Bus-Master PCI MAC/PC Ultra (16 CDB) (Footnote 1) + * ABP960 - Bus-Master PCI MAC/PC (16 CDB) (Footnote 2) + * ABP960U - Bus-Master PCI MAC/PC Ultra (16 CDB) (Footnote 2) * * Single Channel Products: * ABP940 - Bus-Master PCI (240 CDB) @@ -59,8 +59,8 @@ * ABP980U - Four Channel Bus-Master PCI Ultra (240 CDB Per Channel) * * Footnotes: - * 1. This board has been sold by Iomega as a Jaz Jet PCI adapter. - * 2. This board has been sold by SIIG as the Fast SCSI Pro PCI. + * 1. This board has been sold by SIIG as the Fast SCSI Pro PCI. + * 2. This board has been sold by Iomega as a Jaz Jet PCI adapter. */ #include <sys/types.h> @@ -117,8 +117,6 @@ adv_pci_match(parent, match, aux) case PCI_PRODUCT_ADVSYS_1200B: case PCI_PRODUCT_ADVSYS_ULTRA: return (1); - case PCI_PRODUCT_ADVSYS_2300: - return (0); } return 0; @@ -142,12 +140,6 @@ adv_pci_attach(parent, self, aux) int retval; sc->sc_flags = 0x0; - if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_ADVSYS) && - (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_ADVSYS_2300)) { - sc->sc_flags |= ASC_WIDE_BOARD; - printf("(unsupported wide board)"); - } - /* * Make sure IO/MEM/MASTER are enabled */ |