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/pci Pull up revisions 1.62-1.63, 1.66, 1.68 (requ...



details:   https://anonhg.NetBSD.org/src/rev/f7be4e5af925
branches:  netbsd-1-5
changeset: 490878:f7be4e5af925
user:      he <he%NetBSD.org@localhost>
date:      Fri Mar 16 19:08:42 2001 +0000

description:
Pull up revisions 1.62-1.63,1.66,1.68 (requested by mjacob):
  Fix pathnames in comment.  Apply -Wformat changes.
  Set default HBA role (to ISP_ROLE_INITIATOR).

diffstat:

 sys/dev/pci/isp_pci.c |  126 +++++++++++++++++++------------------------------
 1 files changed, 48 insertions(+), 78 deletions(-)

diffs (283 lines):

diff -r 437562256237 -r f7be4e5af925 sys/dev/pci/isp_pci.c
--- a/sys/dev/pci/isp_pci.c     Wed Mar 14 23:44:23 2001 +0000
+++ b/sys/dev/pci/isp_pci.c     Fri Mar 16 19:08:42 2001 +0000
@@ -1,18 +1,17 @@
-/* $NetBSD: isp_pci.c,v 1.51.4.3 2001/01/26 00:23:00 jhawk Exp $ */
+/* $NetBSD: isp_pci.c,v 1.51.4.4 2001/03/16 19:08:42 he Exp $ */
 /*
  * This driver, which is contained in NetBSD in the files:
  *
  *     sys/dev/ic/isp.c
- *     sys/dev/ic/ic/isp.c
- *     sys/dev/ic/ic/isp_inline.h
- *     sys/dev/ic/ic/isp_netbsd.c
- *     sys/dev/ic/ic/isp_netbsd.h
- *     sys/dev/ic/ic/isp_target.c
- *     sys/dev/ic/ic/isp_target.h
- *     sys/dev/ic/ic/isp_tpublic.h
- *     sys/dev/ic/ic/ispmbox.h
- *     sys/dev/ic/ic/ispreg.h
- *     sys/dev/ic/ic/ispvar.h
+ *     sys/dev/ic/isp_inline.h
+ *     sys/dev/ic/isp_netbsd.c
+ *     sys/dev/ic/isp_netbsd.h
+ *     sys/dev/ic/isp_target.c
+ *     sys/dev/ic/isp_target.h
+ *     sys/dev/ic/isp_tpublic.h
+ *     sys/dev/ic/ispmbox.h
+ *     sys/dev/ic/ispreg.h
+ *     sys/dev/ic/ispvar.h
  *     sys/microcode/isp/asm_sbus.h
  *     sys/microcode/isp/asm_1040.h
  *     sys/microcode/isp/asm_1080.h
@@ -30,21 +29,19 @@
  */
 /*
  * PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
- * Matthew Jacob (mjacob%nas.nasa.gov@localhost)
  */
 /*
  * Copyright (C) 1997, 1998, 1999 National Aeronautics & Space Administration
  * All rights reserved.
  *
+ * Additional Copyright (C) 2000, 2001 by Matthew Jacob
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
+ * 2. The name of the author may not be used to endorse or promote products
  *    derived from this software without specific prior written permission
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
@@ -64,20 +61,19 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcidevs.h>
 
-static u_int16_t isp_pci_rd_reg __P((struct ispsoftc *, int));
-static void isp_pci_wr_reg __P((struct ispsoftc *, int, u_int16_t));
+static u_int16_t isp_pci_rd_reg(struct ispsoftc *, int);
+static void isp_pci_wr_reg(struct ispsoftc *, int, u_int16_t);
 #if !(defined(ISP_DISABLE_1080_SUPPORT) && defined(ISP_DISABLE_12160_SUPPORT))
-static u_int16_t isp_pci_rd_reg_1080 __P((struct ispsoftc *, int));
-static void isp_pci_wr_reg_1080 __P((struct ispsoftc *, int, u_int16_t));
+static u_int16_t isp_pci_rd_reg_1080(struct ispsoftc *, int);
+static void isp_pci_wr_reg_1080(struct ispsoftc *, int, u_int16_t);
 #endif
-static int isp_pci_mbxdma __P((struct ispsoftc *));
-static int isp_pci_dmasetup __P((struct ispsoftc *, struct scsipi_xfer *,
-       ispreq_t *, u_int16_t *, u_int16_t));
-static void isp_pci_dmateardown __P((struct ispsoftc *, struct scsipi_xfer *,
-       u_int32_t));
-static void isp_pci_reset1 __P((struct ispsoftc *));
-static void isp_pci_dumpregs __P((struct ispsoftc *, const char *));
-static int isp_pci_intr __P((void *));
+static int isp_pci_mbxdma(struct ispsoftc *);
+static int isp_pci_dmasetup(struct ispsoftc *, XS_T *, ispreq_t *,
+    u_int16_t *, u_int16_t);
+static void isp_pci_dmateardown(struct ispsoftc *, XS_T *, u_int16_t);
+static void isp_pci_reset1(struct ispsoftc *);
+static void isp_pci_dumpregs(struct ispsoftc *, const char *);
+static int isp_pci_intr(void *);
 
 #if    defined(ISP_DISABLE_1020_SUPPORT)
 #define        ISP_1040_RISC_CODE      NULL
@@ -247,8 +243,8 @@
 #define        PCI_DFLT_LNSZ   0x10
 
 
-static int isp_pci_probe __P((struct device *, struct cfdata *, void *));
-static void isp_pci_attach __P((struct device *, struct device *, void *));
+static int isp_pci_probe(struct device *, struct cfdata *, void *);
+static void isp_pci_attach(struct device *, struct device *, void *);
 
 struct isp_pcisoftc {
        struct ispsoftc         pci_isp;
@@ -270,15 +266,12 @@
 };
 
 #ifdef DEBUG
-static char *vstring = 
+const char vstring[] = 
     "Qlogic ISP Driver, NetBSD (pci) Platform Version %d.%d Core Version %d.%d";
 #endif
 
 static int
-isp_pci_probe(parent, match, aux)
-       struct device *parent;
-       struct cfdata *match;
-       void *aux;
+isp_pci_probe(struct device *parent, struct cfdata *match, void *aux)
 {
        struct pci_attach_args *pa = aux;
        switch (pa->pa_id) {
@@ -311,14 +304,12 @@
 
 
 static void
-isp_pci_attach(parent, self, aux)
-       struct device *parent, *self;
-       void *aux;
+isp_pci_attach(struct device *parent, struct device *self, void *aux)
 {
 #ifdef DEBUG
        static char oneshot = 1;
 #endif
-       static char *nomem = "%s: no mem for sdparam table\n";
+       static const char nomem[] = "%s: no mem for sdparam table\n";
        u_int32_t data, rev, linesz = PCI_DFLT_LNSZ;
        struct pci_attach_args *pa = aux;
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) self;
@@ -545,6 +536,7 @@
        }
 
        isp->isp_confopts = self->dv_cfdata->cf_flags;
+       isp->isp_role = ISP_DEFAULT_ROLES;
        ISP_LOCK(isp);
        isp->isp_osinfo.no_mbox_ints = 1;
        isp_reset(isp);
@@ -575,9 +567,7 @@
 }
 
 static u_int16_t
-isp_pci_rd_reg(isp, regoff)
-       struct ispsoftc *isp;
-       int regoff;
+isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
 {
        u_int16_t rv;
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@@ -602,10 +592,7 @@
 }
 
 static void
-isp_pci_wr_reg(isp, regoff, val)
-       struct ispsoftc *isp;
-       int regoff;
-       u_int16_t val;
+isp_pci_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
 {
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
        int offset, oldconf = 0;
@@ -629,9 +616,7 @@
 
 #if !(defined(ISP_DISABLE_1080_SUPPORT) && defined(ISP_DISABLE_12160_SUPPORT))
 static u_int16_t
-isp_pci_rd_reg_1080(isp, regoff)
-       struct ispsoftc *isp;
-       int regoff;
+isp_pci_rd_reg_1080(struct ispsoftc *isp, int regoff)
 {
        u_int16_t rv, oc = 0;
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@@ -673,10 +658,7 @@
 }
 
 static void
-isp_pci_wr_reg_1080(isp, regoff, val)
-       struct ispsoftc *isp;
-       int regoff;
-       u_int16_t val;
+isp_pci_wr_reg_1080(struct ispsoftc *isp, int regoff, u_int16_t val)
 {
        u_int16_t oc = 0;
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@@ -718,8 +700,7 @@
 #endif
 
 static int
-isp_pci_mbxdma(isp)
-       struct ispsoftc *isp;
+isp_pci_mbxdma(struct ispsoftc *isp)
 {
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
        bus_dma_tag_t dmat = pcs->pci_dmat;
@@ -832,12 +813,8 @@
 }
 
 static int
-isp_pci_dmasetup(isp, xs, rq, iptrp, optr)
-       struct ispsoftc *isp;
-       struct scsipi_xfer *xs;
-       ispreq_t *rq;
-       u_int16_t *iptrp;
-       u_int16_t optr;
+isp_pci_dmasetup(struct ispsoftc *isp, struct scsipi_xfer *xs, ispreq_t *rq,
+    u_int16_t *iptrp, u_int16_t optr)
 {
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
        bus_dmamap_t dmap;
@@ -911,9 +888,9 @@
                            dmap->dm_segs[seg].ds_addr;
 #endif
                }
-               isp_prt(isp, ISP_LOGDEBUG2, "seg0.[%d]={0x%x,%d}",
-                   rq->req_seg_count, dmap->dm_segs[seg].ds_addr,
-                   dmap->dm_segs[seg].ds_len);
+               isp_prt(isp, ISP_LOGDEBUG2, "seg0.[%d]={0x%lx,%lu}",
+                   rq->req_seg_count, (long) dmap->dm_segs[seg].ds_addr,
+                   (unsigned long) dmap->dm_segs[seg].ds_len);
        }
 
        if (seg == segcnt)
@@ -946,10 +923,10 @@
                        crq->req_dataseg[ovseg].ds_base =
                            dmap->dm_segs[seg].ds_addr;
 #endif
-                       isp_prt(isp, ISP_LOGDEBUG2, "seg%d.[%d]={0x%x,%d}",
+                       isp_prt(isp, ISP_LOGDEBUG2, "seg%d.[%d]={0x%lx,%lu}",
                            rq->req_header.rqs_entry_count - 1,
-                           rq->req_seg_count, dmap->dm_segs[seg].ds_addr,
-                           dmap->dm_segs[seg].ds_len);
+                           rq->req_seg_count, (long)dmap->dm_segs[seg].ds_addr,
+                           (unsigned long) dmap->dm_segs[seg].ds_len);
                }
        } while (seg < segcnt);
 
@@ -967,8 +944,7 @@
 }
 
 static int
-isp_pci_intr(arg)
-       void *arg;
+isp_pci_intr(void *arg)
 {
        int rv;
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)arg;
@@ -981,10 +957,7 @@
 }
 
 static void
-isp_pci_dmateardown(isp, xs, handle)
-       struct ispsoftc *isp;
-       struct scsipi_xfer *xs;
-       u_int32_t handle;
+isp_pci_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle)
 {
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
        bus_dmamap_t dmap = pcs->pci_xfer_dmap[isp_handle_index(handle)];
@@ -995,17 +968,14 @@
 }
 
 static void
-isp_pci_reset1(isp)
-       struct ispsoftc *isp;
+isp_pci_reset1(struct ispsoftc *isp)
 {
        /* Make sure the BIOS is disabled */
        isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS);
 }
 
 static void
-isp_pci_dumpregs(isp, msg)
-       struct ispsoftc *isp;
-       const char *msg;
+isp_pci_dumpregs(struct ispsoftc *isp, const char *msg)
 {
        struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
        if (msg)



Home | Main Index | Thread Index | Old Index