Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa esp -> esp_isa



details:   https://anonhg.NetBSD.org/src/rev/0cd7f6d66071
branches:  trunk
changeset: 483795:0cd7f6d66071
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sat Mar 18 21:49:33 2000 +0000

description:
esp -> esp_isa

diffstat:

 sys/dev/isa/esp_isa.c    |  133 +++++++++++++++++++++++-----------------------
 sys/dev/isa/esp_isavar.h |  119 ++++++++++++++++++++++++++++++++++++++++++
 sys/dev/isa/espvar.h     |  119 ------------------------------------------
 3 files changed, 185 insertions(+), 186 deletions(-)

diffs (truncated from 588 to 300 lines):

diff -r 25e5537d9d80 -r 0cd7f6d66071 sys/dev/isa/esp_isa.c
--- a/sys/dev/isa/esp_isa.c     Sat Mar 18 21:11:16 2000 +0000
+++ b/sys/dev/isa/esp_isa.c     Sat Mar 18 21:49:33 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: esp_isa.c,v 1.16 1998/11/19 21:53:32 thorpej Exp $     */
+/*     $NetBSD: esp_isa.c,v 1.17 2000/03/18 21:49:33 mycroft Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -136,42 +136,42 @@
 void   esp_isa_attach __P((struct device *, struct device *, void *));  
 
 struct cfattach esp_isa_ca = {
-       sizeof(struct esp_softc), esp_isa_match, esp_isa_attach
+       sizeof(struct esp_isa_softc), esp_isa_match, esp_isa_attach
 };
 
-struct scsipi_device esp_dev = {
+struct scsipi_device esp_isa_dev = {
        NULL,                   /* Use default error handler */
        NULL,                   /* have a queue, served by this */
        NULL,                   /* have no async handler */
        NULL,                   /* Use default 'done' routine */
 };
 
-int esp_debug = 0;     /* ESP_SHOWTRAC | ESP_SHOWREGS | ESP_SHOWMISC */
+int esp_isa_debug = 0; /* ESP_SHOWTRAC | ESP_SHOWREGS | ESP_SHOWMISC */
 
 /*
  * Functions and the switch for the MI code.
  */
-u_char esp_read_reg __P((struct ncr53c9x_softc *, int));
-void   esp_write_reg __P((struct ncr53c9x_softc *, int, u_char));
-int    esp_dma_isintr __P((struct ncr53c9x_softc *));
-void   esp_dma_reset __P((struct ncr53c9x_softc *));
-int    esp_dma_intr __P((struct ncr53c9x_softc *));
-int    esp_dma_setup __P((struct ncr53c9x_softc *, caddr_t *,
+u_char esp_isa_read_reg __P((struct ncr53c9x_softc *, int));
+void   esp_isa_write_reg __P((struct ncr53c9x_softc *, int, u_char));
+int    esp_isa_dma_isintr __P((struct ncr53c9x_softc *));
+void   esp_isa_dma_reset __P((struct ncr53c9x_softc *));
+int    esp_isa_dma_intr __P((struct ncr53c9x_softc *));
+int    esp_isa_dma_setup __P((struct ncr53c9x_softc *, caddr_t *,
            size_t *, int, size_t *));
-void   esp_dma_go __P((struct ncr53c9x_softc *));
-void   esp_dma_stop __P((struct ncr53c9x_softc *));
-int    esp_dma_isactive __P((struct ncr53c9x_softc *));
+void   esp_isa_dma_go __P((struct ncr53c9x_softc *));
+void   esp_isa_dma_stop __P((struct ncr53c9x_softc *));
+int    esp_isa_dma_isactive __P((struct ncr53c9x_softc *));
 
-struct ncr53c9x_glue esp_glue = {
-       esp_read_reg,
-       esp_write_reg,
-       esp_dma_isintr,
-       esp_dma_reset,
-       esp_dma_intr,
-       esp_dma_setup,
-       esp_dma_go,
-       esp_dma_stop,
-       esp_dma_isactive,
+struct ncr53c9x_glue esp_isa_glue = {
+       esp_isa_read_reg,
+       esp_isa_write_reg,
+       esp_isa_dma_isintr,
+       esp_isa_dma_reset,
+       esp_isa_dma_intr,
+       esp_isa_dma_setup,
+       esp_isa_dma_go,
+       esp_isa_dma_stop,
+       esp_isa_dma_isactive,
        NULL,                   /* gl_clear_latched_intr */
 };
 
@@ -179,17 +179,17 @@
  * Look for the board
  */
 int
-esp_find(iot, ioh, epd)
+esp_isa_find(iot, ioh, epd)
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
-       struct esp_probe_data *epd;
+       struct esp_isa_probe_data *epd;
 {
        u_int vers;
        u_int p1;
        u_int p2;
        u_int jmp;
 
-       ESP_TRACE(("[esp_find] "));
+       ESP_TRACE(("[esp_isa_find] "));
 
        /* reset card before we probe? */
 
@@ -211,7 +211,7 @@
        p1 = bus_space_read_1(iot, ioh, NCR_SIGNTR) & SIG_MASK;
        p2 = bus_space_read_1(iot, ioh, NCR_SIGNTR) & SIG_MASK;
 
-       ESP_MISC(("esp_find: 0x%0x 0x%0x 0x%0x\n", vers, p1, p2));
+       ESP_MISC(("esp_isa_find: 0x%0x 0x%0x 0x%0x\n", vers, p1, p2));
 
        if (!((p1 == M1 && p2 == M2) || (p1 == M2 && p2 == M1)))
                return 0;
@@ -259,18 +259,18 @@
 }
 
 void
-esp_init(esc, epd)
-       struct esp_softc *esc;
-       struct esp_probe_data *epd;
+esp_isa_init(esc, epd)
+       struct esp_isa_softc *esc;
+       struct esp_isa_probe_data *epd;
 {
        struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
 
-       ESP_TRACE(("[esp_init] "));
+       ESP_TRACE(("[esp_isa_init] "));
 
        /*
         * Set up the glue for MI code early; we use some of it here.
         */
-       sc->sc_glue = &esp_glue;
+       sc->sc_glue = &esp_isa_glue;
 
        sc->sc_rev = epd->sc_rev;
        sc->sc_id = epd->sc_id;
@@ -329,18 +329,18 @@
        struct isa_attach_args *ia = aux;
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
-       struct esp_probe_data epd;
+       struct esp_isa_probe_data epd;
        int rv;
 
        ESP_TRACE(("[esp_isa_match] "));
 
-       if (ia->ia_iobase != 0x230 && ia->ia_iobase != 0x330)
+       if (ia->ia_iobase == -1)
                return 0;
 
        if (bus_space_map(iot, ia->ia_iobase, ESP_ISA_IOSIZE, 0, &ioh))
                return 0;
 
-       rv = esp_find(iot, ioh, &epd);
+       rv = esp_isa_find(iot, ioh, &epd);
 
        bus_space_unmap(iot, ioh, ESP_ISA_IOSIZE);
 
@@ -369,11 +369,11 @@
        void *aux;
 {
        struct isa_attach_args *ia = aux;
-       struct esp_softc *esc = (void *)self;
+       struct esp_isa_softc *esc = (void *)self;
        struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
-       struct esp_probe_data epd;
+       struct esp_isa_probe_data epd;
        isa_chipset_tag_t ic = ia->ia_ic;
        int error;
 
@@ -385,8 +385,8 @@
                return;
        }
 
-       if (!esp_find(iot, ioh, &epd)) {
-               printf("%s: esp_find failed\n", sc->sc_dev.dv_xname);
+       if (!esp_isa_find(iot, ioh, &epd)) {
+               printf("%s: esp_isa_find failed\n", sc->sc_dev.dv_xname);
                return;
        }
 
@@ -406,10 +406,9 @@
                return;
        }
 
-       esp_init(esc, &epd);
-
        esc->sc_ioh = ioh;
        esc->sc_iot = iot;
+       esp_isa_init(esc, &epd);
 
        printf("%s:%ssync,%sparity\n", sc->sc_dev.dv_xname,
            epd.sc_sync ? " " : " no ", epd.sc_parity ? " " : " no ");
@@ -420,23 +419,23 @@
         */
        sc->sc_adapter.scsipi_cmd = ncr53c9x_scsi_cmd;
        sc->sc_adapter.scsipi_minphys = minphys;
-       ncr53c9x_attach(sc, &esp_dev);
+       ncr53c9x_attach(sc, &esp_isa_dev);
 }
 
 /*
  * Glue functions.
  */
 u_char
-esp_read_reg(sc, reg)
+esp_isa_read_reg(sc, reg)
        struct ncr53c9x_softc *sc;
        int reg;
 {
-       struct esp_softc *esc = (struct esp_softc *)sc;
+       struct esp_isa_softc *esc = (struct esp_isa_softc *)sc;
        u_char v;
 
        v =  bus_space_read_1(esc->sc_iot, esc->sc_ioh, reg);
 
-       ESP_REGS(("[esp_read_reg CRS%c 0x%02x=0x%02x] ",
+       ESP_REGS(("[esp_isa_read_reg CRS%c 0x%02x=0x%02x] ",
            (bus_space_read_1(esc->sc_iot, esc->sc_ioh, NCR_CFG4) &
            NCRCFG4_CRS1) ? '1' : '0', reg, v));
 
@@ -444,19 +443,19 @@
 }
 
 void
-esp_write_reg(sc, reg, val)
+esp_isa_write_reg(sc, reg, val)
        struct ncr53c9x_softc *sc;
        int reg;
        u_char val;
 {
-       struct esp_softc *esc = (struct esp_softc *)sc;
+       struct esp_isa_softc *esc = (struct esp_isa_softc *)sc;
        u_char v = val;
 
        if (reg == NCR_CMD && v == (NCRCMD_TRANS|NCRCMD_DMA)) {
                v = NCRCMD_TRANS;
        }
 
-       ESP_REGS(("[esp_write_reg CRS%c 0x%02x=0x%02x] ",
+       ESP_REGS(("[esp_isa_write_reg CRS%c 0x%02x=0x%02x] ",
            (bus_space_read_1(esc->sc_iot, esc->sc_ioh, NCR_CFG4) &
            NCRCFG4_CRS1) ? '1' : '0', reg, v));
 
@@ -464,36 +463,36 @@
 }
 
 int
-esp_dma_isintr(sc)
+esp_isa_dma_isintr(sc)
        struct ncr53c9x_softc *sc;
 {
-       ESP_TRACE(("[esp_dma_isintr] "));
+       ESP_TRACE(("[esp_isa_dma_isintr] "));
 
        return NCR_READ_REG(sc, NCR_STAT) & NCRSTAT_INT;
 }
 
 void
-esp_dma_reset(sc)
+esp_isa_dma_reset(sc)
        struct ncr53c9x_softc *sc;
 {
-       struct esp_softc *esc = (struct esp_softc *)sc;
+       struct esp_isa_softc *esc = (struct esp_isa_softc *)sc;
 
-       ESP_TRACE(("[esp_dma_reset] "));
+       ESP_TRACE(("[esp_isa_dma_reset] "));
 
        esc->sc_active = 0;
        esc->sc_tc = 0;
 }
 
 int
-esp_dma_intr(sc)
+esp_isa_dma_intr(sc)
        struct ncr53c9x_softc *sc;
 {
-       struct esp_softc *esc = (struct esp_softc *)sc;
+       struct esp_isa_softc *esc = (struct esp_isa_softc *)sc;
        u_char  *p;
        u_int   espphase, espstat, espintr;
        int     cnt;
 
-       ESP_TRACE(("[esp_dma_intr] "));
+       ESP_TRACE(("[esp_isa_dma_intr] "));
 
        if (esc->sc_active == 0) {
                printf("%s: dma_intr--inactive DMA\n", sc->sc_dev.dv_xname);
@@ -558,16 +557,16 @@
 }
 
 int
-esp_dma_setup(sc, addr, len, datain, dmasize)
+esp_isa_dma_setup(sc, addr, len, datain, dmasize)
        struct ncr53c9x_softc *sc;
        caddr_t *addr;
        size_t *len;
        int datain;
        size_t *dmasize;
 {
-       struct esp_softc *esc = (struct esp_softc *)sc;
+       struct esp_isa_softc *esc = (struct esp_isa_softc *)sc;
 
-       ESP_TRACE(("[esp_dma_setup] "));
+       ESP_TRACE(("[esp_isa_dma_setup] "));



Home | Main Index | Thread Index | Old Index