Clean up licence a bit. ANSIfy.

This commit is contained in:
mjacob 2001-03-14 05:47:56 +00:00
parent c67c3d855d
commit ecdaf852b2
1 changed files with 30 additions and 60 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: isp_pci.c,v 1.67 2001/03/07 23:07:16 thorpej Exp $ */ /* $NetBSD: isp_pci.c,v 1.68 2001/03/14 05:47:56 mjacob Exp $ */
/* /*
* This driver, which is contained in NetBSD in the files: * This driver, which is contained in NetBSD in the files:
* *
@ -29,21 +29,19 @@
*/ */
/* /*
* PCI specific probe and attach routines for Qlogic ISP SCSI adapters. * PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
* Matthew Jacob (mjacob@nas.nasa.gov)
*/ */
/* /*
* Copyright (C) 1997, 1998, 1999 National Aeronautics & Space Administration * Copyright (C) 1997, 1998, 1999 National Aeronautics & Space Administration
* All rights reserved. * All rights reserved.
* *
* Additional Copyright (C) 2000, 2001 by Matthew Jacob
*
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * 2. The name of the author may not be used to endorse or promote products
* 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
* derived from this software without specific prior written permission * derived from this software without specific prior written permission
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
@ -65,20 +63,19 @@
#include <uvm/uvm_extern.h> #include <uvm/uvm_extern.h>
#include <sys/reboot.h> #include <sys/reboot.h>
static u_int16_t isp_pci_rd_reg __P((struct ispsoftc *, int)); static u_int16_t isp_pci_rd_reg(struct ispsoftc *, int);
static void isp_pci_wr_reg __P((struct ispsoftc *, int, u_int16_t)); static void isp_pci_wr_reg(struct ispsoftc *, int, u_int16_t);
#if !(defined(ISP_DISABLE_1080_SUPPORT) && defined(ISP_DISABLE_12160_SUPPORT)) #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 u_int16_t isp_pci_rd_reg_1080(struct ispsoftc *, int);
static void isp_pci_wr_reg_1080 __P((struct ispsoftc *, int, u_int16_t)); static void isp_pci_wr_reg_1080(struct ispsoftc *, int, u_int16_t);
#endif #endif
static int isp_pci_mbxdma __P((struct ispsoftc *)); static int isp_pci_mbxdma(struct ispsoftc *);
static int isp_pci_dmasetup __P((struct ispsoftc *, struct scsipi_xfer *, static int isp_pci_dmasetup(struct ispsoftc *, XS_T *, ispreq_t *,
ispreq_t *, u_int16_t *, u_int16_t)); u_int16_t *, u_int16_t);
static void isp_pci_dmateardown __P((struct ispsoftc *, struct scsipi_xfer *, static void isp_pci_dmateardown(struct ispsoftc *, XS_T *, u_int16_t);
u_int32_t)); static void isp_pci_reset1(struct ispsoftc *);
static void isp_pci_reset1 __P((struct ispsoftc *)); static void isp_pci_dumpregs(struct ispsoftc *, const char *);
static void isp_pci_dumpregs __P((struct ispsoftc *, const char *)); static int isp_pci_intr(void *);
static int isp_pci_intr __P((void *));
#if defined(ISP_DISABLE_1020_SUPPORT) #if defined(ISP_DISABLE_1020_SUPPORT)
#define ISP_1040_RISC_CODE NULL #define ISP_1040_RISC_CODE NULL
@ -248,8 +245,8 @@ static struct ispmdvec mdvec_2200 = {
#define PCI_DFLT_LNSZ 0x10 #define PCI_DFLT_LNSZ 0x10
static int isp_pci_probe __P((struct device *, struct cfdata *, void *)); static int isp_pci_probe(struct device *, struct cfdata *, void *);
static void isp_pci_attach __P((struct device *, struct device *, void *)); static void isp_pci_attach(struct device *, struct device *, void *);
struct isp_pcisoftc { struct isp_pcisoftc {
struct ispsoftc pci_isp; struct ispsoftc pci_isp;
@ -276,10 +273,7 @@ const char vstring[] =
#endif #endif
static int static int
isp_pci_probe(parent, match, aux) isp_pci_probe(struct device *parent, struct cfdata *match, void *aux)
struct device *parent;
struct cfdata *match;
void *aux;
{ {
struct pci_attach_args *pa = aux; struct pci_attach_args *pa = aux;
switch (pa->pa_id) { switch (pa->pa_id) {
@ -312,9 +306,7 @@ isp_pci_probe(parent, match, aux)
static void static void
isp_pci_attach(parent, self, aux) isp_pci_attach(struct device *parent, struct device *self, void *aux)
struct device *parent, *self;
void *aux;
{ {
#ifdef DEBUG #ifdef DEBUG
static char oneshot = 1; static char oneshot = 1;
@ -577,9 +569,7 @@ isp_pci_attach(parent, self, aux)
} }
static u_int16_t static u_int16_t
isp_pci_rd_reg(isp, regoff) isp_pci_rd_reg(struct ispsoftc *isp, int regoff)
struct ispsoftc *isp;
int regoff;
{ {
u_int16_t rv; u_int16_t rv;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@ -604,10 +594,7 @@ isp_pci_rd_reg(isp, regoff)
} }
static void static void
isp_pci_wr_reg(isp, regoff, val) isp_pci_wr_reg(struct ispsoftc *isp, int regoff, u_int16_t val)
struct ispsoftc *isp;
int regoff;
u_int16_t val;
{ {
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
int offset, oldconf = 0; int offset, oldconf = 0;
@ -631,9 +618,7 @@ isp_pci_wr_reg(isp, regoff, val)
#if !(defined(ISP_DISABLE_1080_SUPPORT) && defined(ISP_DISABLE_12160_SUPPORT)) #if !(defined(ISP_DISABLE_1080_SUPPORT) && defined(ISP_DISABLE_12160_SUPPORT))
static u_int16_t static u_int16_t
isp_pci_rd_reg_1080(isp, regoff) isp_pci_rd_reg_1080(struct ispsoftc *isp, int regoff)
struct ispsoftc *isp;
int regoff;
{ {
u_int16_t rv, oc = 0; u_int16_t rv, oc = 0;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@ -675,10 +660,7 @@ isp_pci_rd_reg_1080(isp, regoff)
} }
static void static void
isp_pci_wr_reg_1080(isp, regoff, val) isp_pci_wr_reg_1080(struct ispsoftc *isp, int regoff, u_int16_t val)
struct ispsoftc *isp;
int regoff;
u_int16_t val;
{ {
u_int16_t oc = 0; u_int16_t oc = 0;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *) isp;
@ -720,8 +702,7 @@ isp_pci_wr_reg_1080(isp, regoff, val)
#endif #endif
static int static int
isp_pci_mbxdma(isp) isp_pci_mbxdma(struct ispsoftc *isp)
struct ispsoftc *isp;
{ {
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
bus_dma_tag_t dmat = pcs->pci_dmat; bus_dma_tag_t dmat = pcs->pci_dmat;
@ -837,12 +818,8 @@ dmafail:
} }
static int static int
isp_pci_dmasetup(isp, xs, rq, iptrp, optr) isp_pci_dmasetup(struct ispsoftc *isp, struct scsipi_xfer *xs, ispreq_t *rq,
struct ispsoftc *isp; u_int16_t *iptrp, u_int16_t optr)
struct scsipi_xfer *xs;
ispreq_t *rq;
u_int16_t *iptrp;
u_int16_t optr;
{ {
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
bus_dmamap_t dmap; bus_dmamap_t dmap;
@ -972,8 +949,7 @@ mbxsync:
} }
static int static int
isp_pci_intr(arg) isp_pci_intr(void *arg)
void *arg;
{ {
int rv; int rv;
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)arg; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)arg;
@ -986,10 +962,7 @@ isp_pci_intr(arg)
} }
static void static void
isp_pci_dmateardown(isp, xs, handle) isp_pci_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle)
struct ispsoftc *isp;
struct scsipi_xfer *xs;
u_int32_t handle;
{ {
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
bus_dmamap_t dmap = pcs->pci_xfer_dmap[isp_handle_index(handle)]; bus_dmamap_t dmap = pcs->pci_xfer_dmap[isp_handle_index(handle)];
@ -1000,17 +973,14 @@ isp_pci_dmateardown(isp, xs, handle)
} }
static void static void
isp_pci_reset1(isp) isp_pci_reset1(struct ispsoftc *isp)
struct ispsoftc *isp;
{ {
/* Make sure the BIOS is disabled */ /* Make sure the BIOS is disabled */
isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS); isp_pci_wr_reg(isp, HCCR, PCI_HCCR_CMD_BIOS);
} }
static void static void
isp_pci_dumpregs(isp, msg) isp_pci_dumpregs(struct ispsoftc *isp, const char *msg)
struct ispsoftc *isp;
const char *msg;
{ {
struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp;
if (msg) if (msg)