- Use ANSI function decls and make use of static.
This commit is contained in:
parent
3e1286d67c
commit
41e5f04cfd
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ahb.c,v 1.39 2003/11/02 09:57:58 wiz Exp $ */
|
||||
/* $NetBSD: ahb.c,v 1.40 2004/08/23 06:03:19 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -53,16 +53,11 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.39 2003/11/02 09:57:58 wiz Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahb.c,v 1.40 2004/08/23 06:03:19 thorpej Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#undef AHBDEBUG
|
||||
#ifdef DDB
|
||||
#define integrate
|
||||
#else
|
||||
#define integrate static inline
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -130,27 +125,27 @@ struct ahb_probe_data {
|
|||
int sc_scsi_dev;
|
||||
};
|
||||
|
||||
void ahb_send_mbox __P((struct ahb_softc *, int, struct ahb_ecb *));
|
||||
void ahb_send_immed __P((struct ahb_softc *, u_int32_t, struct ahb_ecb *));
|
||||
int ahbintr __P((void *));
|
||||
void ahb_free_ecb __P((struct ahb_softc *, struct ahb_ecb *));
|
||||
struct ahb_ecb *ahb_get_ecb __P((struct ahb_softc *));
|
||||
struct ahb_ecb *ahb_ecb_phys_kv __P((struct ahb_softc *, physaddr));
|
||||
void ahb_done __P((struct ahb_softc *, struct ahb_ecb *));
|
||||
int ahb_find __P((bus_space_tag_t, bus_space_handle_t, struct ahb_probe_data *));
|
||||
int ahb_init __P((struct ahb_softc *));
|
||||
void ahbminphys __P((struct buf *));
|
||||
void ahb_scsipi_request __P((struct scsipi_channel *,
|
||||
scsipi_adapter_req_t, void *));
|
||||
int ahb_poll __P((struct ahb_softc *, struct scsipi_xfer *, int));
|
||||
void ahb_timeout __P((void *));
|
||||
int ahb_create_ecbs __P((struct ahb_softc *, struct ahb_ecb *, int));
|
||||
static void ahb_send_mbox(struct ahb_softc *, int, struct ahb_ecb *);
|
||||
static void ahb_send_immed(struct ahb_softc *, u_int32_t, struct ahb_ecb *);
|
||||
static int ahbintr(void *);
|
||||
static void ahb_free_ecb(struct ahb_softc *, struct ahb_ecb *);
|
||||
static struct ahb_ecb *ahb_get_ecb(struct ahb_softc *);
|
||||
static struct ahb_ecb *ahb_ecb_phys_kv(struct ahb_softc *, physaddr);
|
||||
static void ahb_done(struct ahb_softc *, struct ahb_ecb *);
|
||||
static int ahb_find(bus_space_tag_t, bus_space_handle_t,
|
||||
struct ahb_probe_data *);
|
||||
static int ahb_init(struct ahb_softc *);
|
||||
static void ahbminphys(struct buf *);
|
||||
static void ahb_scsipi_request(struct scsipi_channel *,
|
||||
scsipi_adapter_req_t, void *);
|
||||
static int ahb_poll(struct ahb_softc *, struct scsipi_xfer *, int);
|
||||
static void ahb_timeout(void *);
|
||||
static int ahb_create_ecbs(struct ahb_softc *, struct ahb_ecb *, int);
|
||||
|
||||
integrate void ahb_reset_ecb __P((struct ahb_softc *, struct ahb_ecb *));
|
||||
integrate int ahb_init_ecb __P((struct ahb_softc *, struct ahb_ecb *));
|
||||
static int ahb_init_ecb(struct ahb_softc *, struct ahb_ecb *);
|
||||
|
||||
int ahbmatch __P((struct device *, struct cfdata *, void *));
|
||||
void ahbattach __P((struct device *, struct device *, void *));
|
||||
static int ahbmatch(struct device *, struct cfdata *, void *);
|
||||
static void ahbattach(struct device *, struct device *, void *);
|
||||
|
||||
CFATTACH_DECL(ahb, sizeof(struct ahb_softc),
|
||||
ahbmatch, ahbattach, NULL, NULL);
|
||||
|
@ -162,11 +157,8 @@ CFATTACH_DECL(ahb, sizeof(struct ahb_softc),
|
|||
* If we find one, note it's address (slot) and call
|
||||
* the actual probe routine to check it out.
|
||||
*/
|
||||
int
|
||||
ahbmatch(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
static int
|
||||
ahbmatch(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
bus_space_tag_t iot = ea->ea_iot;
|
||||
|
@ -195,10 +187,8 @@ ahbmatch(parent, match, aux)
|
|||
/*
|
||||
* Attach all the sub-devices we can find
|
||||
*/
|
||||
void
|
||||
ahbattach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
static void
|
||||
ahbattach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
struct ahb_softc *sc = (void *)self;
|
||||
|
@ -292,11 +282,8 @@ ahbattach(parent, self, aux)
|
|||
/*
|
||||
* Function to send a command out through a mailbox
|
||||
*/
|
||||
void
|
||||
ahb_send_mbox(sc, opcode, ecb)
|
||||
struct ahb_softc *sc;
|
||||
int opcode;
|
||||
struct ahb_ecb *ecb;
|
||||
static void
|
||||
ahb_send_mbox(struct ahb_softc *sc, int opcode, struct ahb_ecb *ecb)
|
||||
{
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
|
@ -330,11 +317,8 @@ ahb_send_mbox(sc, opcode, ecb)
|
|||
/*
|
||||
* Function to send an immediate type command to the adapter
|
||||
*/
|
||||
void
|
||||
ahb_send_immed(sc, cmd, ecb)
|
||||
struct ahb_softc *sc;
|
||||
u_int32_t cmd;
|
||||
struct ahb_ecb *ecb;
|
||||
static void
|
||||
ahb_send_immed(struct ahb_softc *sc, u_int32_t cmd, struct ahb_ecb *ecb)
|
||||
{
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
|
@ -364,9 +348,8 @@ ahb_send_immed(sc, cmd, ecb)
|
|||
/*
|
||||
* Catch an interrupt from the adaptor
|
||||
*/
|
||||
int
|
||||
ahbintr(arg)
|
||||
void *arg;
|
||||
static int
|
||||
ahbintr(void *arg)
|
||||
{
|
||||
struct ahb_softc *sc = arg;
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
|
@ -436,10 +419,8 @@ ahbintr(arg)
|
|||
}
|
||||
}
|
||||
|
||||
integrate void
|
||||
ahb_reset_ecb(sc, ecb)
|
||||
struct ahb_softc *sc;
|
||||
struct ahb_ecb *ecb;
|
||||
static __inline void
|
||||
ahb_reset_ecb(struct ahb_softc *sc, struct ahb_ecb *ecb)
|
||||
{
|
||||
|
||||
ecb->flags = 0;
|
||||
|
@ -449,10 +430,8 @@ ahb_reset_ecb(sc, ecb)
|
|||
* A ecb (and hence a mbx-out is put onto the
|
||||
* free list.
|
||||
*/
|
||||
void
|
||||
ahb_free_ecb(sc, ecb)
|
||||
struct ahb_softc *sc;
|
||||
struct ahb_ecb *ecb;
|
||||
static void
|
||||
ahb_free_ecb(struct ahb_softc *sc, struct ahb_ecb *ecb)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
@ -465,10 +444,8 @@ ahb_free_ecb(sc, ecb)
|
|||
/*
|
||||
* Create a set of ecbs and add them to the free list.
|
||||
*/
|
||||
integrate int
|
||||
ahb_init_ecb(sc, ecb)
|
||||
struct ahb_softc *sc;
|
||||
struct ahb_ecb *ecb;
|
||||
static int
|
||||
ahb_init_ecb(struct ahb_softc *sc, struct ahb_ecb *ecb)
|
||||
{
|
||||
bus_dma_tag_t dmat = sc->sc_dmat;
|
||||
int hashnum, error;
|
||||
|
@ -497,11 +474,8 @@ ahb_init_ecb(sc, ecb)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
ahb_create_ecbs(sc, ecbstore, count)
|
||||
struct ahb_softc *sc;
|
||||
struct ahb_ecb *ecbstore;
|
||||
int count;
|
||||
static int
|
||||
ahb_create_ecbs(struct ahb_softc *sc, struct ahb_ecb *ecbstore, int count)
|
||||
{
|
||||
struct ahb_ecb *ecb;
|
||||
int i, error;
|
||||
|
@ -526,9 +500,8 @@ ahb_create_ecbs(sc, ecbstore, count)
|
|||
* If there are none, see if we can allocate a new one. If so, put it in the
|
||||
* hash table too otherwise either return an error or sleep.
|
||||
*/
|
||||
struct ahb_ecb *
|
||||
ahb_get_ecb(sc)
|
||||
struct ahb_softc *sc;
|
||||
static struct ahb_ecb *
|
||||
ahb_get_ecb(struct ahb_softc *sc)
|
||||
{
|
||||
struct ahb_ecb *ecb;
|
||||
int s;
|
||||
|
@ -546,10 +519,8 @@ ahb_get_ecb(sc)
|
|||
/*
|
||||
* given a physical address, find the ecb that it corresponds to.
|
||||
*/
|
||||
struct ahb_ecb *
|
||||
ahb_ecb_phys_kv(sc, ecb_phys)
|
||||
struct ahb_softc *sc;
|
||||
physaddr ecb_phys;
|
||||
static struct ahb_ecb *
|
||||
ahb_ecb_phys_kv(struct ahb_softc *sc, physaddr ecb_phys)
|
||||
{
|
||||
int hashnum = ECB_HASH(ecb_phys);
|
||||
struct ahb_ecb *ecb = sc->sc_ecbhash[hashnum];
|
||||
|
@ -566,10 +537,8 @@ ahb_ecb_phys_kv(sc, ecb_phys)
|
|||
* We have a ecb which has been processed by the adaptor, now we look to see
|
||||
* how the operation went.
|
||||
*/
|
||||
void
|
||||
ahb_done(sc, ecb)
|
||||
struct ahb_softc *sc;
|
||||
struct ahb_ecb *ecb;
|
||||
static void
|
||||
ahb_done(struct ahb_softc *sc, struct ahb_ecb *ecb)
|
||||
{
|
||||
bus_dma_tag_t dmat = sc->sc_dmat;
|
||||
struct scsipi_sense_data *s1, *s2;
|
||||
|
@ -644,11 +613,8 @@ done:
|
|||
/*
|
||||
* Start the board, ready for normal operation
|
||||
*/
|
||||
int
|
||||
ahb_find(iot, ioh, sc)
|
||||
bus_space_tag_t iot;
|
||||
bus_space_handle_t ioh;
|
||||
struct ahb_probe_data *sc;
|
||||
static int
|
||||
ahb_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct ahb_probe_data *sc)
|
||||
{
|
||||
u_char intdef;
|
||||
int i, irq, busid;
|
||||
|
@ -735,9 +701,8 @@ ahb_find(iot, ioh, sc)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ahb_init(sc)
|
||||
struct ahb_softc *sc;
|
||||
static int
|
||||
ahb_init(struct ahb_softc *sc)
|
||||
{
|
||||
bus_dma_segment_t seg;
|
||||
int i, error, rseg;
|
||||
|
@ -797,9 +762,8 @@ ahb_init(sc)
|
|||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
ahbminphys(bp)
|
||||
struct buf *bp;
|
||||
static void
|
||||
ahbminphys(struct buf *bp)
|
||||
{
|
||||
|
||||
if (bp->b_bcount > AHB_MAXXFER)
|
||||
|
@ -811,11 +775,9 @@ ahbminphys(bp)
|
|||
* start a scsi operation given the command and the data address. Also needs
|
||||
* the unit, target and lu.
|
||||
*/
|
||||
void
|
||||
ahb_scsipi_request(chan, req, arg)
|
||||
struct scsipi_channel *chan;
|
||||
scsipi_adapter_req_t req;
|
||||
void *arg;
|
||||
static void
|
||||
ahb_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
|
||||
void *arg)
|
||||
{
|
||||
struct scsipi_xfer *xs;
|
||||
struct scsipi_periph *periph;
|
||||
|
@ -994,11 +956,8 @@ ahb_scsipi_request(chan, req, arg)
|
|||
/*
|
||||
* Function to poll for command completion when in poll mode
|
||||
*/
|
||||
int
|
||||
ahb_poll(sc, xs, count)
|
||||
struct ahb_softc *sc;
|
||||
struct scsipi_xfer *xs;
|
||||
int count;
|
||||
static int
|
||||
ahb_poll(struct ahb_softc *sc, struct scsipi_xfer *xs, int count)
|
||||
{ /* in msec */
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
|
@ -1018,9 +977,8 @@ ahb_poll(sc, xs, count)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
ahb_timeout(arg)
|
||||
void *arg;
|
||||
static void
|
||||
ahb_timeout(void *arg)
|
||||
{
|
||||
struct ahb_ecb *ecb = arg;
|
||||
struct scsipi_xfer *xs = ecb->xs;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ahc_eisa.c,v 1.28 2003/04/22 14:33:01 tsutsui Exp $ */
|
||||
/* $NetBSD: ahc_eisa.c,v 1.29 2004/08/23 06:03:19 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Product specific probe and attach routines for:
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahc_eisa.c,v 1.28 2003/04/22 14:33:01 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ahc_eisa.c,v 1.29 2004/08/23 06:03:19 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -56,8 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: ahc_eisa.c,v 1.28 2003/04/22 14:33:01 tsutsui Exp $"
|
|||
#include <dev/ic/aic77xxreg.h>
|
||||
#include <dev/ic/aic77xxvar.h>
|
||||
|
||||
int ahc_eisa_match __P((struct device *, struct cfdata *, void *));
|
||||
void ahc_eisa_attach __P((struct device *, struct device *, void *));
|
||||
static int ahc_eisa_match(struct device *, struct cfdata *, void *);
|
||||
static void ahc_eisa_attach(struct device *, struct device *, void *);
|
||||
|
||||
|
||||
CFATTACH_DECL(ahc_eisa, sizeof(struct ahc_softc),
|
||||
|
@ -68,11 +68,8 @@ CFATTACH_DECL(ahc_eisa, sizeof(struct ahc_softc),
|
|||
* If we find one, note it's address (slot) and call
|
||||
* the actual probe routine to check it out.
|
||||
*/
|
||||
int
|
||||
ahc_eisa_match(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
static int
|
||||
ahc_eisa_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
bus_space_tag_t iot = ea->ea_iot;
|
||||
|
@ -95,10 +92,8 @@ ahc_eisa_match(parent, match, aux)
|
|||
return (irq >= 0);
|
||||
}
|
||||
|
||||
void
|
||||
ahc_eisa_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
static void
|
||||
ahc_eisa_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct ahc_softc *ahc = (void *)self;
|
||||
struct eisa_attach_args *ea = aux;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bha_eisa.c,v 1.23 2002/10/02 16:33:46 thorpej Exp $ */
|
||||
/* $NetBSD: bha_eisa.c,v 1.24 2004/08/23 06:03:19 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: bha_eisa.c,v 1.23 2002/10/02 16:33:46 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bha_eisa.c,v 1.24 2004/08/23 06:03:19 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -61,18 +61,15 @@ __KERNEL_RCSID(0, "$NetBSD: bha_eisa.c,v 1.23 2002/10/02 16:33:46 thorpej Exp $"
|
|||
|
||||
#define BHA_EISA_IOCONF 0x0c
|
||||
|
||||
int bha_eisa_address __P((bus_space_tag_t, bus_space_handle_t, int *));
|
||||
int bha_eisa_match __P((struct device *, struct cfdata *, void *));
|
||||
void bha_eisa_attach __P((struct device *, struct device *, void *));
|
||||
static int bha_eisa_address(bus_space_tag_t, bus_space_handle_t, int *);
|
||||
static int bha_eisa_match(struct device *, struct cfdata *, void *);
|
||||
static void bha_eisa_attach(struct device *, struct device *, void *);
|
||||
|
||||
CFATTACH_DECL(bha_eisa, sizeof(struct bha_softc),
|
||||
bha_eisa_match, bha_eisa_attach, NULL, NULL);
|
||||
|
||||
int
|
||||
bha_eisa_address(iot, ioh, portp)
|
||||
bus_space_tag_t iot;
|
||||
bus_space_handle_t ioh;
|
||||
int *portp;
|
||||
static int
|
||||
bha_eisa_address(bus_space_tag_t iot, bus_space_handle_t ioh, int *portp)
|
||||
{
|
||||
int port;
|
||||
|
||||
|
@ -108,11 +105,8 @@ bha_eisa_address(iot, ioh, portp)
|
|||
* If we find one, note it's address (slot) and call
|
||||
* the actual probe routine to check it out.
|
||||
*/
|
||||
int
|
||||
bha_eisa_match(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
static int
|
||||
bha_eisa_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
bus_space_tag_t iot = ea->ea_iot;
|
||||
|
@ -147,10 +141,8 @@ bha_eisa_match(parent, match, aux)
|
|||
/*
|
||||
* Attach all the sub-devices we can find
|
||||
*/
|
||||
void
|
||||
bha_eisa_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
static void
|
||||
bha_eisa_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
struct bha_softc *sc = (void *)self;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cac_eisa.c,v 1.8 2002/10/02 16:33:46 thorpej Exp $ */
|
||||
/* $NetBSD: cac_eisa.c,v 1.9 2004/08/23 06:03:19 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -68,7 +68,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: cac_eisa.c,v 1.8 2002/10/02 16:33:46 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: cac_eisa.c,v 1.9 2004/08/23 06:03:19 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -87,14 +87,14 @@ __KERNEL_RCSID(0, "$NetBSD: cac_eisa.c,v 1.8 2002/10/02 16:33:46 thorpej Exp $")
|
|||
#define CAC_EISA_IOSIZE 0x0017
|
||||
#define CAC_EISA_IOCONF 0x38
|
||||
|
||||
void cac_eisa_attach(struct device *, struct device *, void *);
|
||||
int cac_eisa_match(struct device *, struct cfdata *, void *);
|
||||
static void cac_eisa_attach(struct device *, struct device *, void *);
|
||||
static int cac_eisa_match(struct device *, struct cfdata *, void *);
|
||||
|
||||
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 *);
|
||||
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 *);
|
||||
|
||||
CFATTACH_DECL(cac_eisa, sizeof(struct cac_softc),
|
||||
cac_eisa_match, cac_eisa_attach, NULL, NULL);
|
||||
|
@ -119,7 +119,7 @@ struct cac_eisa_type {
|
|||
{ "CPQ4030", "SMART-2/E", &cac_l0 },
|
||||
};
|
||||
|
||||
int
|
||||
static int
|
||||
cac_eisa_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea;
|
||||
|
@ -134,7 +134,7 @@ cac_eisa_match(struct device *parent, struct cfdata *match, void *aux)
|
|||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
cac_eisa_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea;
|
||||
|
@ -213,7 +213,7 @@ cac_eisa_attach(struct device *parent, struct device *self, void *aux)
|
|||
* Linkage specific to EISA boards.
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
cac_eisa_l0_fifo_full(struct cac_softc *sc)
|
||||
{
|
||||
|
||||
|
@ -221,7 +221,7 @@ cac_eisa_l0_fifo_full(struct cac_softc *sc)
|
|||
CAC_EISA_CHANNEL_CLEAR) == 0);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
cac_eisa_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
|
||||
{
|
||||
u_int16_t size;
|
||||
|
@ -242,7 +242,7 @@ cac_eisa_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
|
|||
cac_outb(sc, CAC_EISAREG_LOCAL_DOORBELL, CAC_EISA_CHANNEL_BUSY);
|
||||
}
|
||||
|
||||
struct cac_ccb *
|
||||
static struct cac_ccb *
|
||||
cac_eisa_l0_completed(struct cac_softc *sc)
|
||||
{
|
||||
struct cac_ccb *ccb;
|
||||
|
@ -271,7 +271,7 @@ cac_eisa_l0_completed(struct cac_softc *sc)
|
|||
return (ccb);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
cac_eisa_l0_intr_pending(struct cac_softc *sc)
|
||||
{
|
||||
|
||||
|
@ -279,7 +279,7 @@ cac_eisa_l0_intr_pending(struct cac_softc *sc)
|
|||
CAC_EISA_CHANNEL_BUSY);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
cac_eisa_l0_intr_enable(struct cac_softc *sc, int state)
|
||||
{
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: uha_eisa.c,v 1.21 2002/10/02 16:33:48 thorpej Exp $ */
|
||||
/* $NetBSD: uha_eisa.c,v 1.22 2004/08/23 06:03:19 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: uha_eisa.c,v 1.21 2002/10/02 16:33:48 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: uha_eisa.c,v 1.22 2004/08/23 06:03:19 thorpej Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
|
@ -64,8 +64,8 @@ __KERNEL_RCSID(0, "$NetBSD: uha_eisa.c,v 1.21 2002/10/02 16:33:48 thorpej Exp $"
|
|||
#define UHA_EISA_SLOT_OFFSET 0xc80
|
||||
#define UHA_EISA_IOSIZE 0x020
|
||||
|
||||
int uha_eisa_match __P((struct device *, struct cfdata *, void *));
|
||||
void uha_eisa_attach __P((struct device *, struct device *, void *));
|
||||
static int uha_eisa_match(struct device *, struct cfdata *, void *);
|
||||
static void uha_eisa_attach(struct device *, struct device *, void *);
|
||||
|
||||
CFATTACH_DECL(uha_eisa, sizeof(struct uha_softc),
|
||||
uha_eisa_match, uha_eisa_attach, NULL, NULL);
|
||||
|
@ -74,23 +74,20 @@ CFATTACH_DECL(uha_eisa, sizeof(struct uha_softc),
|
|||
#define Debugger() panic("should call debugger here (uha_eisa.c)")
|
||||
#endif /* ! DDB */
|
||||
|
||||
int u24_find __P((bus_space_tag_t, bus_space_handle_t,
|
||||
struct uha_probe_data *));
|
||||
void u24_start_mbox __P((struct uha_softc *, struct uha_mscp *));
|
||||
int u24_poll __P((struct uha_softc *, struct scsipi_xfer *, int));
|
||||
int u24_intr __P((void *));
|
||||
void u24_init __P((struct uha_softc *));
|
||||
static int u24_find(bus_space_tag_t, bus_space_handle_t,
|
||||
struct uha_probe_data *);
|
||||
static void u24_start_mbox(struct uha_softc *, struct uha_mscp *);
|
||||
static int u24_poll(struct uha_softc *, struct scsipi_xfer *, int);
|
||||
static int u24_intr(void *);
|
||||
static void u24_init(struct uha_softc *);
|
||||
|
||||
/*
|
||||
* Check the slots looking for a board we recognise
|
||||
* If we find one, note it's address (slot) and call
|
||||
* the actual probe routine to check it out.
|
||||
*/
|
||||
int
|
||||
uha_eisa_match(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
static int
|
||||
uha_eisa_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
bus_space_tag_t iot = ea->ea_iot;
|
||||
|
@ -115,10 +112,8 @@ uha_eisa_match(parent, match, aux)
|
|||
/*
|
||||
* Attach all the sub-devices we can find
|
||||
*/
|
||||
void
|
||||
uha_eisa_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
static void
|
||||
uha_eisa_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct eisa_attach_args *ea = aux;
|
||||
struct uha_softc *sc = (void *)self;
|
||||
|
@ -174,11 +169,8 @@ uha_eisa_attach(parent, self, aux)
|
|||
uha_attach(sc, &upd);
|
||||
}
|
||||
|
||||
int
|
||||
u24_find(iot, ioh, sc)
|
||||
bus_space_tag_t iot;
|
||||
bus_space_handle_t ioh;
|
||||
struct uha_probe_data *sc;
|
||||
static int
|
||||
u24_find(bus_space_tag_t iot, bus_space_handle_t ioh, struct uha_probe_data *sc)
|
||||
{
|
||||
u_int8_t config0, config1, config2;
|
||||
int irq, drq;
|
||||
|
@ -234,10 +226,8 @@ u24_find(iot, ioh, sc)
|
|||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
u24_start_mbox(sc, mscp)
|
||||
struct uha_softc *sc;
|
||||
struct uha_mscp *mscp;
|
||||
static void
|
||||
u24_start_mbox(struct uha_softc *sc, struct uha_mscp *mscp)
|
||||
{
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
|
@ -267,11 +257,8 @@ u24_start_mbox(sc, mscp)
|
|||
mstohz(mscp->timeout), uha_timeout, mscp);
|
||||
}
|
||||
|
||||
int
|
||||
u24_poll(sc, xs, count)
|
||||
struct uha_softc *sc;
|
||||
struct scsipi_xfer *xs;
|
||||
int count;
|
||||
static int
|
||||
u24_poll(struct uha_softc *sc, struct scsipi_xfer *xs, int count)
|
||||
{
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
|
@ -291,9 +278,8 @@ u24_poll(sc, xs, count)
|
|||
return (1);
|
||||
}
|
||||
|
||||
int
|
||||
u24_intr(arg)
|
||||
void *arg;
|
||||
static int
|
||||
u24_intr(void *arg)
|
||||
{
|
||||
struct uha_softc *sc = arg;
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
|
@ -340,9 +326,8 @@ u24_intr(arg)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
u24_init(sc)
|
||||
struct uha_softc *sc;
|
||||
static void
|
||||
u24_init(struct uha_softc *sc)
|
||||
{
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
|
|
Loading…
Reference in New Issue