Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/eisa Puill up revision 1.5 (requested by ad):



details:   https://anonhg.NetBSD.org/src/rev/4796eaad1d0c
branches:  netbsd-1-5
changeset: 492648:4796eaad1d0c
user:      he <he%NetBSD.org@localhost>
date:      Tue Jan 29 23:30:45 2002 +0000

description:
Puill up revision 1.5 (requested by ad):
  Some fixes:
   o Always validate return value read from outbound FIFO
   o Copy access method into to softc to avoid double dereference
   o Remove static on functions
  Fixes PR#14453.

diffstat:

 sys/dev/eisa/cac_eisa.c |  36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diffs (119 lines):

diff -r 03c7a084e4b6 -r 4796eaad1d0c sys/dev/eisa/cac_eisa.c
--- a/sys/dev/eisa/cac_eisa.c   Tue Jan 29 23:24:15 2002 +0000
+++ b/sys/dev/eisa/cac_eisa.c   Tue Jan 29 23:30:45 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cac_eisa.c,v 1.2.12.2 2001/10/25 17:53:47 he Exp $     */
+/*     $NetBSD: cac_eisa.c,v 1.2.12.3 2002/01/29 23:30:45 he Exp $     */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -85,20 +85,20 @@
 #define CAC_EISA_IOSIZE                        0x0017
 #define CAC_EISA_IOCONF                        0x38
 
-static void    cac_eisa_attach(struct device *, struct device *, void *);
-static int     cac_eisa_match(struct device *, struct cfdata *, void *);
+void   cac_eisa_attach(struct device *, struct device *, void *);
+int    cac_eisa_match(struct device *, struct cfdata *, void *);
 
-static struct  cac_ccb *cac_eisa_l0_completed(struct cac_softc *);
-static int     cac_eisa_l0_fifo_full(struct cac_softc *);
-static void    cac_eisa_l0_intr_enable(struct cac_softc *, int);
-static int     cac_eisa_l0_intr_pending(struct cac_softc *);
-static void    cac_eisa_l0_submit(struct cac_softc *, struct cac_ccb *);
+struct cac_ccb *cac_eisa_l0_completed(struct cac_softc *);
+int    cac_eisa_l0_fifo_full(struct cac_softc *);
+void   cac_eisa_l0_intr_enable(struct cac_softc *, int);
+int    cac_eisa_l0_intr_pending(struct cac_softc *);
+void   cac_eisa_l0_submit(struct cac_softc *, struct cac_ccb *);
 
 struct cfattach cac_eisa_ca = {
        sizeof(struct cac_softc), cac_eisa_match, cac_eisa_attach
 };
 
-static struct cac_linkage cac_eisa_l0 = {
+static const struct cac_linkage cac_eisa_l0 = {
        cac_eisa_l0_completed,
        cac_eisa_l0_fifo_full,
        cac_eisa_l0_intr_enable,
@@ -109,7 +109,7 @@
 struct cac_eisa_type {
        const char      *ct_prodstr;
        const char      *ct_typestr;
-       struct  cac_linkage *ct_linkage;
+       const struct    cac_linkage *ct_linkage;
 } static cac_eisa_type[] = {
        { "CPQ4001",    "IDA",          &cac_eisa_l0 },
        { "CPQ4002",    "IDA-2",        &cac_eisa_l0 },
@@ -118,7 +118,7 @@
        { "CPQ4030",    "SMART-2/E",    &cac_l0 },
 };
 
-static int
+int
 cac_eisa_match(struct device *parent, struct cfdata *match, void *aux)
 {
        struct eisa_attach_args *ea;
@@ -133,7 +133,7 @@
        return (0);
 }
 
-static void
+void
 cac_eisa_attach(struct device *parent, struct device *self, void *aux)
 {
        struct eisa_attach_args *ea;
@@ -204,7 +204,7 @@
                        break;
 
        printf(": Compaq %s\n", cac_eisa_type[i].ct_typestr);
-       sc->sc_cl = cac_eisa_type[i].ct_linkage;
+       memcpy(&sc->sc_cl, cac_eisa_type[i].ct_linkage, sizeof(sc->sc_cl));
        cac_init(sc, intrstr, 0);
 }
 
@@ -212,7 +212,7 @@
  * Linkage specific to EISA boards.
  */
 
-static int
+int
 cac_eisa_l0_fifo_full(struct cac_softc *sc)
 {
 
@@ -220,7 +220,7 @@
            CAC_EISA_CHANNEL_CLEAR) == 0);
 }
 
-static void
+void
 cac_eisa_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
 {
        u_int16_t size;
@@ -241,7 +241,7 @@
        cac_outb(sc, CAC_EISAREG_LOCAL_DOORBELL, CAC_EISA_CHANNEL_BUSY);
 }
 
-static struct cac_ccb *
+struct cac_ccb *
 cac_eisa_l0_completed(struct cac_softc *sc)
 {
        struct cac_ccb *ccb;
@@ -270,7 +270,7 @@
        return (ccb);
 }
 
-static int
+int
 cac_eisa_l0_intr_pending(struct cac_softc *sc)
 {
 
@@ -278,7 +278,7 @@
            CAC_EISA_CHANNEL_BUSY);
 }
 
-static void
+void
 cac_eisa_l0_intr_enable(struct cac_softc *sc, int state)
 {
 



Home | Main Index | Thread Index | Old Index