Use ANSI function decls and more use of static.

This commit is contained in:
thorpej 2004-08-24 00:53:28 +00:00
parent 45bd8be9fa
commit 8b2ffcedfc
19 changed files with 512 additions and 700 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: aac.c,v 1.11 2004/03/20 21:16:55 christos Exp $ */
/* $NetBSD: aac.c,v 1.12 2004/08/24 00:53:28 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.11 2004/03/20 21:16:55 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.12 2004/08/24 00:53:28 thorpej Exp $");
#include "locators.h"
@ -96,25 +96,25 @@ __KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.11 2004/03/20 21:16:55 christos Exp $");
#include <dev/ic/aacvar.h>
#include <dev/ic/aac_tables.h>
int aac_check_firmware(struct aac_softc *);
void aac_describe_controller(struct aac_softc *);
int aac_dequeue_fib(struct aac_softc *, int, u_int32_t *,
struct aac_fib **);
int aac_enqueue_fib(struct aac_softc *, int, struct aac_fib *);
void aac_host_command(struct aac_softc *);
void aac_host_response(struct aac_softc *);
int aac_init(struct aac_softc *);
int aac_print(void *, const char *);
void aac_shutdown(void *);
void aac_startup(struct aac_softc *);
int aac_sync_command(struct aac_softc *, u_int32_t, u_int32_t,
u_int32_t, u_int32_t, u_int32_t, u_int32_t *);
int aac_sync_fib(struct aac_softc *, u_int32_t, u_int32_t, void *,
u_int16_t, void *, u_int16_t *);
int aac_submatch(struct device *, struct cfdata *, void *);
static int aac_check_firmware(struct aac_softc *);
static void aac_describe_controller(struct aac_softc *);
static int aac_dequeue_fib(struct aac_softc *, int, u_int32_t *,
struct aac_fib **);
static int aac_enqueue_fib(struct aac_softc *, int, struct aac_fib *);
static void aac_host_command(struct aac_softc *);
static void aac_host_response(struct aac_softc *);
static int aac_init(struct aac_softc *);
static int aac_print(void *, const char *);
static void aac_shutdown(void *);
static void aac_startup(struct aac_softc *);
static int aac_sync_command(struct aac_softc *, u_int32_t, u_int32_t,
u_int32_t, u_int32_t, u_int32_t, u_int32_t *);
static int aac_sync_fib(struct aac_softc *, u_int32_t, u_int32_t, void *,
u_int16_t, void *, u_int16_t *);
static int aac_submatch(struct device *, struct cfdata *, void *);
#ifdef AAC_DEBUG
void aac_print_fib(struct aac_softc *, struct aac_fib *, char *);
static void aac_print_fib(struct aac_softc *, struct aac_fib *, char *);
#endif
/*
@ -141,7 +141,7 @@ static struct {
int aac_debug = AAC_DEBUG;
#endif
void *aac_sdh;
static void *aac_sdh;
extern struct cfdriver aac_cd;
@ -285,7 +285,7 @@ aac_attach(struct aac_softc *sc)
/*
* Print autoconfiguration message for a sub-device.
*/
int
static int
aac_print(void *aux, const char *pnp)
{
struct aac_attach_args *aaca;
@ -301,7 +301,7 @@ aac_print(void *aux, const char *pnp)
/*
* Match a sub-device.
*/
int
static int
aac_submatch(struct device *parent, struct cfdata *cf, void *aux)
{
struct aac_attach_args *aaca;
@ -331,7 +331,7 @@ aac_describe_code(const struct aac_code_lookup *table, u_int32_t code)
return (table[i + 1].string);
}
void
static void
aac_describe_controller(struct aac_softc *sc)
{
u_int8_t buf[AAC_FIB_DATASIZE];
@ -373,7 +373,7 @@ aac_describe_controller(struct aac_softc *sc)
* Retrieve the firmware version numbers. Dell PERC2/QC cards with firmware
* version 1.x are not compatible with this driver.
*/
int
static int
aac_check_firmware(struct aac_softc *sc)
{
u_int32_t major, minor;
@ -400,7 +400,7 @@ aac_check_firmware(struct aac_softc *sc)
return (0);
}
int
static int
aac_init(struct aac_softc *sc)
{
int nsegs, i, rv, state, norm, high;
@ -619,7 +619,7 @@ aac_init(struct aac_softc *sc)
/*
* Probe for containers, create disks.
*/
void
static void
aac_startup(struct aac_softc *sc)
{
struct aac_mntinfo mi;
@ -670,7 +670,7 @@ aac_startup(struct aac_softc *sc)
}
}
void
static void
aac_shutdown(void *cookie)
{
struct aac_softc *sc;
@ -783,7 +783,7 @@ aac_intr(void *cookie)
/*
* Handle notification of one or more FIBs coming from the controller.
*/
void
static void
aac_host_command(struct aac_softc *sc)
{
struct aac_fib *fib;
@ -824,7 +824,7 @@ aac_host_command(struct aac_softc *sc)
/*
* Handle notification of one or more FIBs completed by the controller
*/
void
static void
aac_host_response(struct aac_softc *sc)
{
struct aac_ccb *ac;
@ -875,7 +875,7 @@ aac_host_response(struct aac_softc *sc)
/*
* Send a synchronous command to the controller and wait for a result.
*/
int
static int
aac_sync_command(struct aac_softc *sc, u_int32_t command, u_int32_t arg0,
u_int32_t arg1, u_int32_t arg2, u_int32_t arg3, u_int32_t *sp)
{
@ -921,7 +921,7 @@ aac_sync_command(struct aac_softc *sc, u_int32_t command, u_int32_t arg0,
/*
* Send a synchronous FIB to the controller and wait for a result.
*/
int
static int
aac_sync_fib(struct aac_softc *sc, u_int32_t command, u_int32_t xferstate,
void *data, u_int16_t datasize, void *result,
u_int16_t *resultsize)
@ -1163,7 +1163,7 @@ aac_ccb_poll(struct aac_softc *sc, struct aac_ccb *ac, int timo)
* controller in the case where we may be inserting several entries in rapid
* succession, but implementing this usefully is difficult.
*/
int
static int
aac_enqueue_fib(struct aac_softc *sc, int queue, struct aac_fib *fib)
{
u_int32_t fib_size, fib_addr, pi, ci;
@ -1211,7 +1211,7 @@ aac_enqueue_fib(struct aac_softc *sc, int queue, struct aac_fib *fib)
* Atomically remove one entry from the nominated queue, returns 0 on success
* or ENOENT if the queue is empty.
*/
int
static int
aac_dequeue_fib(struct aac_softc *sc, int queue, u_int32_t *fib_size,
struct aac_fib **fib_addr)
{
@ -1263,7 +1263,7 @@ aac_dequeue_fib(struct aac_softc *sc, int queue, u_int32_t *fib_size,
/*
* Print a FIB
*/
void
static void
aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, char *caller)
{
struct aac_blockread *br;
@ -1346,4 +1346,4 @@ aac_print_fib(struct aac_softc *sc, struct aac_fib *fib, char *caller)
break;
}
}
#endif
#endif /* AAC_DEBUG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: aacvar.h,v 1.2 2003/11/02 11:07:44 wiz Exp $ */
/* $NetBSD: aacvar.h,v 1.3 2004/08/24 00:53:28 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -92,8 +92,6 @@ struct aac_code_lookup {
};
extern const struct aac_code_lookup aac_command_status_table[];
extern const struct aac_code_lookup aac_cpu_variant[];
extern const struct aac_code_lookup aac_battery_platform[];
extern const struct aac_code_lookup aac_container_types[];
struct aac_softc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ac97.c,v 1.59 2004/08/20 14:36:13 kent Exp $ */
/* $NetBSD: ac97.c,v 1.60 2004/08/24 00:53:28 thorpej Exp $ */
/* $OpenBSD: ac97.c,v 1.8 2000/07/19 09:01:35 csapuntz Exp $ */
/*
@ -63,7 +63,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.59 2004/08/20 14:36:13 kent Exp $");
__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.60 2004/08/24 00:53:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -79,26 +79,27 @@ __KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.59 2004/08/20 14:36:13 kent Exp $");
struct ac97_softc;
struct ac97_source_info;
int ac97_mixer_get_port(struct ac97_codec_if *, mixer_ctrl_t *);
int ac97_mixer_set_port(struct ac97_codec_if *, mixer_ctrl_t *);
int ac97_query_devinfo(struct ac97_codec_if *, mixer_devinfo_t *);
int ac97_get_portnum_by_name(struct ac97_codec_if *, const char *,
const char *, const char *);
void ac97_restore_shadow(struct ac97_codec_if *);
int ac97_set_rate(struct ac97_codec_if *, int, u_long *);
void ac97_set_clock(struct ac97_codec_if *, unsigned int);
u_int16_t ac97_get_extcaps(struct ac97_codec_if *);
int ac97_add_port(struct ac97_softc *, const struct ac97_source_info *);
int ac97_str_equal(const char *, const char *);
int ac97_check_capability(struct ac97_softc *, int);
void ac97_setup_source_info(struct ac97_softc *);
void ac97_read(struct ac97_softc *, u_int8_t, u_int16_t *);
void ac97_setup_defaults(struct ac97_softc *);
int ac97_write(struct ac97_softc *, u_int8_t, u_int16_t);
static int ac97_mixer_get_port(struct ac97_codec_if *, mixer_ctrl_t *);
static int ac97_mixer_set_port(struct ac97_codec_if *, mixer_ctrl_t *);
static int ac97_query_devinfo(struct ac97_codec_if *, mixer_devinfo_t *);
static int ac97_get_portnum_by_name(struct ac97_codec_if *, const char *,
const char *, const char *);
static void ac97_restore_shadow(struct ac97_codec_if *);
static int ac97_set_rate(struct ac97_codec_if *, int, u_long *);
static void ac97_set_clock(struct ac97_codec_if *, unsigned int);
static u_int16_t ac97_get_extcaps(struct ac97_codec_if *);
static int ac97_add_port(struct ac97_softc *,
const struct ac97_source_info *);
static int ac97_str_equal(const char *, const char *);
static int ac97_check_capability(struct ac97_softc *, int);
static void ac97_setup_source_info(struct ac97_softc *);
static void ac97_read(struct ac97_softc *, u_int8_t, u_int16_t *);
static void ac97_setup_defaults(struct ac97_softc *);
static int ac97_write(struct ac97_softc *, u_int8_t, u_int16_t);
static void ac97_ad198x_init(struct ac97_softc *);
static void ac97_alc650_init(struct ac97_softc *);
static void ac97_vt1616_init(struct ac97_softc *);
static void ac97_ad198x_init(struct ac97_softc *);
static void ac97_alc650_init(struct ac97_softc *);
static void ac97_vt1616_init(struct ac97_softc *);
#define Ac97Ntone "tone"
#define Ac97Nphone "phone"
@ -138,7 +139,7 @@ ac97_volume_mono = { { AudioNvolume }, 1 };
#define WRAP(a) &a, sizeof(a)
const struct ac97_source_info {
static const struct ac97_source_info {
const char *class;
const char *device;
const char *qualifier;
@ -305,7 +306,7 @@ const struct ac97_source_info {
},
/* Missing features: Simulated Stereo, POP, Loopback mode */
} ;
};
#define SOURCE_INFO_SIZE (sizeof(source_info)/sizeof(source_info[0]))
@ -332,7 +333,7 @@ struct ac97_softc {
u_int16_t shadow_reg[128];
};
struct ac97_codec_if_vtbl ac97civ = {
static struct ac97_codec_if_vtbl ac97civ = {
ac97_mixer_get_port,
ac97_mixer_set_port,
ac97_query_devinfo,
@ -685,7 +686,7 @@ int ac97debug = 0;
#define DPRINTFN(n,x)
#endif
void
static void
ac97_read(struct ac97_softc *as, u_int8_t reg, u_int16_t *val)
{
if (as->host_flags & AC97_HOST_DONT_READ &&
@ -700,14 +701,14 @@ ac97_read(struct ac97_softc *as, u_int8_t reg, u_int16_t *val)
}
}
int
static int
ac97_write(struct ac97_softc *as, u_int8_t reg, u_int16_t val)
{
as->shadow_reg[reg >> 1] = val;
return as->host_if->write(as->host_if->arg, reg, val);
}
void
static void
ac97_setup_defaults(struct ac97_softc *as)
{
int idx;
@ -721,7 +722,7 @@ ac97_setup_defaults(struct ac97_softc *as)
}
}
void
static void
ac97_restore_shadow(struct ac97_codec_if *self)
{
struct ac97_softc *as;
@ -758,13 +759,13 @@ ac97_restore_shadow(struct ac97_codec_if *self)
}
}
int
static int
ac97_str_equal(const char *a, const char *b)
{
return (a == b) || (a && b && (!strcmp(a, b)));
}
int
static int
ac97_check_capability(struct ac97_softc *as, int check)
{
switch (check) {
@ -792,7 +793,7 @@ ac97_check_capability(struct ac97_softc *as, int check)
}
}
void
static void
ac97_setup_source_info(struct ac97_softc *as)
{
int idx, ouridx;
@ -1102,7 +1103,7 @@ ac97_attach(struct ac97_host_if *host_if)
}
int
static int
ac97_query_devinfo(struct ac97_codec_if *codec_if, mixer_devinfo_t *dip)
{
struct ac97_softc *as;
@ -1143,7 +1144,7 @@ ac97_query_devinfo(struct ac97_codec_if *codec_if, mixer_devinfo_t *dip)
int
static int
ac97_mixer_set_port(struct ac97_codec_if *codec_if, mixer_ctrl_t *cp)
{
struct ac97_softc *as;
@ -1243,7 +1244,7 @@ ac97_mixer_set_port(struct ac97_codec_if *codec_if, mixer_ctrl_t *cp)
return 0;
}
int
static int
ac97_get_portnum_by_name(struct ac97_codec_if *codec_if, const char *class,
const char *device, const char *qualifier)
{
@ -1262,7 +1263,7 @@ ac97_get_portnum_by_name(struct ac97_codec_if *codec_if, const char *class,
return -1;
}
int
static int
ac97_mixer_get_port(struct ac97_codec_if *codec_if, mixer_ctrl_t *cp)
{
struct ac97_softc *as;
@ -1338,7 +1339,7 @@ ac97_mixer_get_port(struct ac97_codec_if *codec_if, mixer_ctrl_t *cp)
}
int
static int
ac97_set_rate(struct ac97_codec_if *codec_if, int target, u_long *rate)
{
struct ac97_softc *as;
@ -1437,7 +1438,7 @@ ac97_set_rate(struct ac97_codec_if *codec_if, int target, u_long *rate)
return 0;
}
void
static void
ac97_set_clock(struct ac97_codec_if *codec_if, unsigned int clock)
{
struct ac97_softc *as;
@ -1446,7 +1447,7 @@ ac97_set_clock(struct ac97_codec_if *codec_if, unsigned int clock)
as->ac97_clock = clock;
}
u_int16_t
static u_int16_t
ac97_get_extcaps(struct ac97_codec_if *codec_if)
{
struct ac97_softc *as;
@ -1455,7 +1456,7 @@ ac97_get_extcaps(struct ac97_codec_if *codec_if)
return as->ext_id;
}
int
static int
ac97_add_port(struct ac97_softc *as, const struct ac97_source_info *src)
{
struct ac97_source_info *si;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ad1848.c,v 1.17 2003/02/21 17:14:06 tsutsui Exp $ */
/* $NetBSD: ad1848.c,v 1.18 2004/08/24 00:53:28 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.17 2003/02/21 17:14:06 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.18 2004/08/24 00:53:28 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -188,16 +188,8 @@ static const int ad1848_init_values[] = {
};
__inline int ad_read __P((struct ad1848_softc *, int));
__inline void ad_write __P((struct ad1848_softc *, int, int));
static void ad_set_MCE __P((struct ad1848_softc *, int));
static void wait_for_calibration __P((struct ad1848_softc *));
int
ad1848_to_vol(cp, vol)
mixer_ctrl_t *cp;
struct ad1848_volume *vol;
ad1848_to_vol(mixer_ctrl_t *cp, struct ad1848_volume *vol)
{
if (cp->un.value.num_channels == 1) {
vol->left =
@ -213,9 +205,7 @@ ad1848_to_vol(cp, vol)
}
int
ad1848_from_vol(cp, vol)
mixer_ctrl_t *cp;
struct ad1848_volume *vol;
ad1848_from_vol(mixer_ctrl_t *cp, struct ad1848_volume *vol)
{
if (cp->un.value.num_channels == 1) {
cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] = vol->left;
@ -231,9 +221,7 @@ ad1848_from_vol(cp, vol)
__inline int
ad_read(sc, reg)
struct ad1848_softc *sc;
int reg;
ad_read(struct ad1848_softc *sc, int reg)
{
int x;
@ -244,10 +232,7 @@ ad_read(sc, reg)
}
__inline void
ad_write(sc, reg, data)
struct ad1848_softc *sc;
int reg;
int data;
ad_write(struct ad1848_softc *sc, int reg, int data)
{
ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit);
ADWRITE(sc, AD1848_IDATA, data & 0xff);
@ -260,9 +245,7 @@ ad_write(sc, reg, data)
*/
__inline int
ad_xread(sc, reg)
struct ad1848_softc *sc;
int reg;
ad_xread(struct ad1848_softc *sc, int reg)
{
int x;
@ -274,9 +257,7 @@ ad_xread(sc, reg)
}
__inline void
ad_xwrite(sc, reg, val)
struct ad1848_softc *sc;
int reg, val;
ad_xwrite(struct ad1848_softc *sc, int reg, int val)
{
ADWRITE(sc, AD1848_IADDR, CS_XREG | sc->MCE_bit);
ADWRITE(sc, AD1848_IDATA, (reg | ALT_F3_XRAE) & 0xff);
@ -284,9 +265,7 @@ ad_xwrite(sc, reg, val)
}
static void
ad_set_MCE(sc, state)
struct ad1848_softc *sc;
int state;
ad_set_MCE(struct ad1848_softc *sc, int state)
{
if (state)
sc->MCE_bit = MODE_CHANGE_ENABLE;
@ -296,8 +275,7 @@ ad_set_MCE(sc, state)
}
static void
wait_for_calibration(sc)
struct ad1848_softc *sc;
wait_for_calibration(struct ad1848_softc *sc)
{
int timeout;
@ -359,8 +337,7 @@ wait_for_calibration(sc)
#ifdef AUDIO_DEBUG
void
ad1848_dump_regs(sc)
struct ad1848_softc *sc;
ad1848_dump_regs(struct ad1848_softc *sc)
{
int i;
u_char r;
@ -379,7 +356,7 @@ ad1848_dump_regs(sc)
}
printf("\n");
}
#endif
#endif /* AUDIO_DEBUG */
/*
@ -387,8 +364,7 @@ ad1848_dump_regs(sc)
* pseudo-device driver .
*/
void
ad1848_attach(sc)
struct ad1848_softc *sc;
ad1848_attach(struct ad1848_softc *sc)
{
int i;
static struct ad1848_volume vol_mid = {220, 220};
@ -448,7 +424,7 @@ ad1848_attach(sc)
/*
* Various routines to interface to higher level audio driver
*/
const struct ad1848_mixerinfo {
static const struct ad1848_mixerinfo {
int left_reg;
int right_reg;
int atten_bits;
@ -476,10 +452,7 @@ const struct ad1848_mixerinfo {
*/
void
ad1848_mute_channel(sc, device, mute)
struct ad1848_softc *sc;
int device;
int mute;
ad1848_mute_channel(struct ad1848_softc *sc, int device, int mute)
{
u_char reg;
@ -525,10 +498,8 @@ ad1848_mute_channel(sc, device, mute)
int
ad1848_set_channel_gain(sc, device, gp)
struct ad1848_softc *sc;
int device;
struct ad1848_volume *gp;
ad1848_set_channel_gain(struct ad1848_softc *sc, int device,
struct ad1848_volume *gp)
{
const struct ad1848_mixerinfo *info = &mixer_channel_info[device];
u_char reg;
@ -561,28 +532,22 @@ ad1848_set_channel_gain(sc, device, gp)
int
ad1848_get_device_gain(sc, device, gp)
struct ad1848_softc *sc;
int device;
struct ad1848_volume *gp;
ad1848_get_device_gain(struct ad1848_softc *sc, int device,
struct ad1848_volume *gp)
{
*gp = sc->gains[device];
return(0);
}
int
ad1848_get_rec_gain(sc, gp)
struct ad1848_softc *sc;
struct ad1848_volume *gp;
ad1848_get_rec_gain(struct ad1848_softc *sc, struct ad1848_volume *gp)
{
*gp = sc->rec_gain;
return(0);
}
int
ad1848_set_rec_gain(sc, gp)
struct ad1848_softc *sc;
struct ad1848_volume *gp;
ad1848_set_rec_gain(struct ad1848_softc *sc, struct ad1848_volume *gp)
{
u_char reg, gain;
@ -605,9 +570,7 @@ ad1848_set_rec_gain(sc, gp)
void
ad1848_mute_wave_output(sc, mute, set)
struct ad1848_softc *sc;
int mute, set;
ad1848_mute_wave_output(struct ad1848_softc *sc, int mute, int set)
{
int m;
@ -630,9 +593,7 @@ ad1848_mute_wave_output(sc, mute, set)
}
int
ad1848_set_mic_gain(sc, gp)
struct ad1848_softc *sc;
struct ad1848_volume *gp;
ad1848_set_mic_gain(struct ad1848_softc *sc, struct ad1848_volume *gp)
{
u_char reg;
@ -654,9 +615,7 @@ ad1848_set_mic_gain(sc, gp)
}
int
ad1848_get_mic_gain(sc, gp)
struct ad1848_softc *sc;
struct ad1848_volume *gp;
ad1848_get_mic_gain(struct ad1848_softc *sc, struct ad1848_volume *gp)
{
if (sc->mic_gain_on)
gp->left = gp->right = AUDIO_MAX_GAIN;
@ -667,13 +626,7 @@ ad1848_get_mic_gain(sc, gp)
static ad1848_devmap_t *
ad1848_mixer_find_dev __P((ad1848_devmap_t *, int, mixer_ctrl_t *));
static ad1848_devmap_t *
ad1848_mixer_find_dev(map, cnt, cp)
ad1848_devmap_t *map;
int cnt;
mixer_ctrl_t *cp;
ad1848_mixer_find_dev(ad1848_devmap_t *map, int cnt, mixer_ctrl_t *cp)
{
int i;
@ -686,11 +639,8 @@ ad1848_mixer_find_dev(map, cnt, cp)
}
int
ad1848_mixer_get_port(ac, map, cnt, cp)
struct ad1848_softc *ac;
struct ad1848_devmap *map;
int cnt;
mixer_ctrl_t *cp;
ad1848_mixer_get_port(struct ad1848_softc *ac, struct ad1848_devmap *map,
int cnt, mixer_ctrl_t *cp)
{
ad1848_devmap_t *entry;
struct ad1848_volume vol;
@ -761,11 +711,8 @@ ad1848_mixer_get_port(ac, map, cnt, cp)
}
int
ad1848_mixer_set_port(ac, map, cnt, cp)
struct ad1848_softc *ac;
struct ad1848_devmap *map;
int cnt;
mixer_ctrl_t *cp;
ad1848_mixer_set_port(struct ad1848_softc *ac, struct ad1848_devmap *map,
int cnt, mixer_ctrl_t *cp)
{
ad1848_devmap_t *entry;
struct ad1848_volume vol;
@ -832,9 +779,7 @@ ad1848_mixer_set_port(ac, map, cnt, cp)
int
ad1848_query_encoding(addr, fp)
void *addr;
struct audio_encoding *fp;
ad1848_query_encoding(void *addr, struct audio_encoding *fp)
{
struct ad1848_softc *sc = addr;
@ -911,15 +856,13 @@ ad1848_query_encoding(addr, fp)
}
int
ad1848_set_params(addr, setmode, usemode, p, r)
void *addr;
int setmode, usemode;
struct audio_params *p, *r;
ad1848_set_params(void *addr, int setmode, int usemode, struct audio_params *p,
struct audio_params *r)
{
struct ad1848_softc *sc = addr;
int error, bits, enc;
void (*pswcode) __P((void *, u_char *buf, int cnt));
void (*rswcode) __P((void *, u_char *buf, int cnt));
void (*pswcode)(void *, u_char *buf, int cnt);
void (*rswcode)(void *, u_char *buf, int cnt);
DPRINTF(("ad1848_set_params: %d %d %d %ld\n",
p->encoding, p->precision, p->channels, p->sample_rate));
@ -1018,9 +961,7 @@ ad1848_set_params(addr, setmode, usemode, p, r)
}
int
ad1848_set_rec_port(sc, port)
struct ad1848_softc *sc;
int port;
ad1848_set_rec_port(struct ad1848_softc *sc, int port)
{
u_char inp, reg;
@ -1051,16 +992,13 @@ ad1848_set_rec_port(sc, port)
}
int
ad1848_get_rec_port(sc)
struct ad1848_softc *sc;
ad1848_get_rec_port(struct ad1848_softc *sc)
{
return (sc->rec_port);
}
int
ad1848_round_blocksize(addr, blk)
void *addr;
int blk;
ad1848_round_blocksize(void *addr, int blk)
{
/* Round to a multiple of the biggest sample size. */
@ -1068,9 +1006,7 @@ ad1848_round_blocksize(addr, blk)
}
int
ad1848_open(addr, flags)
void *addr;
int flags;
ad1848_open(void *addr, int flags)
{
struct ad1848_softc *sc = addr;
u_char reg;
@ -1100,8 +1036,7 @@ ad1848_open(addr, flags)
* Close function is called at splaudio().
*/
void
ad1848_close(addr)
void *addr;
ad1848_close(void *addr)
{
struct ad1848_softc *sc = addr;
u_char reg;
@ -1125,8 +1060,7 @@ ad1848_close(addr)
* Lower-level routines
*/
int
ad1848_commit_settings(addr)
void *addr;
ad1848_commit_settings(void *addr)
{
struct ad1848_softc *sc = addr;
int timeout;
@ -1207,8 +1141,7 @@ ad1848_commit_settings(addr)
}
void
ad1848_reset(sc)
struct ad1848_softc *sc;
ad1848_reset(struct ad1848_softc *sc)
{
u_char r;
@ -1232,9 +1165,7 @@ ad1848_reset(sc)
}
int
ad1848_set_speed(sc, argp)
struct ad1848_softc *sc;
u_long *argp;
ad1848_set_speed(struct ad1848_softc *sc, u_long *argp)
{
/*
* The sampling speed is encoded in the least significant nible of I8.
@ -1308,8 +1239,7 @@ ad1848_set_speed(sc, argp)
* Halt I/O
*/
int
ad1848_halt_output(addr)
void *addr;
ad1848_halt_output(void *addr)
{
struct ad1848_softc *sc = addr;
u_char reg;
@ -1323,8 +1253,7 @@ ad1848_halt_output(addr)
}
int
ad1848_halt_input(addr)
void *addr;
ad1848_halt_input(void *addr)
{
struct ad1848_softc *sc = addr;
u_char reg;

View File

@ -1,4 +1,4 @@
/* $NetBSD: aha.c,v 1.43 2003/11/02 11:07:44 wiz Exp $ */
/* $NetBSD: aha.c,v 1.44 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -53,16 +53,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aha.c,v 1.43 2003/11/02 11:07:44 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: aha.c,v 1.44 2004/08/24 00:53:29 thorpej Exp $");
#include "opt_ddb.h"
#undef AHADIAG
#ifdef DDB
#define integrate
#else
#define integrate static inline
#endif
#include <sys/param.h>
#include <sys/systm.h>
@ -98,26 +93,25 @@ __KERNEL_RCSID(0, "$NetBSD: aha.c,v 1.43 2003/11/02 11:07:44 wiz Exp $");
int aha_debug = 1;
#endif /* AHADEBUG */
int aha_cmd __P((bus_space_tag_t, bus_space_handle_t, struct aha_softc *, int,
u_char *, int, u_char *));
integrate void aha_finish_ccbs __P((struct aha_softc *));
integrate void aha_reset_ccb __P((struct aha_softc *, struct aha_ccb *));
void aha_free_ccb __P((struct aha_softc *, struct aha_ccb *));
integrate int aha_init_ccb __P((struct aha_softc *, struct aha_ccb *));
struct aha_ccb *aha_get_ccb __P((struct aha_softc *));
struct aha_ccb *aha_ccb_phys_kv __P((struct aha_softc *, u_long));
void aha_queue_ccb __P((struct aha_softc *, struct aha_ccb *));
void aha_collect_mbo __P((struct aha_softc *));
void aha_start_ccbs __P((struct aha_softc *));
void aha_done __P((struct aha_softc *, struct aha_ccb *));
int aha_init __P((struct aha_softc *));
void aha_inquire_setup_information __P((struct aha_softc *));
void ahaminphys __P((struct buf *));
void aha_scsipi_request __P((struct scsipi_channel *,
scsipi_adapter_req_t, void *));
int aha_poll __P((struct aha_softc *, struct scsipi_xfer *, int));
void aha_timeout __P((void *arg));
int aha_create_ccbs __P((struct aha_softc *, struct aha_ccb *, int));
static int aha_cmd(bus_space_tag_t, bus_space_handle_t,
struct aha_softc *, int, u_char *, int, u_char *);
static void aha_finish_ccbs(struct aha_softc *);
static void aha_free_ccb(struct aha_softc *, struct aha_ccb *);
static int aha_init_ccb(struct aha_softc *, struct aha_ccb *);
static struct aha_ccb *aha_get_ccb(struct aha_softc *);
static struct aha_ccb *aha_ccb_phys_kv(struct aha_softc *, u_long);
static void aha_queue_ccb(struct aha_softc *, struct aha_ccb *);
static void aha_collect_mbo(struct aha_softc *);
static void aha_start_ccbs(struct aha_softc *);
static void aha_done(struct aha_softc *, struct aha_ccb *);
static int aha_init(struct aha_softc *);
static void aha_inquire_setup_information(struct aha_softc *);
static void ahaminphys(struct buf *);
static void aha_scsipi_request(struct scsipi_channel *,
scsipi_adapter_req_t, void *);
static int aha_poll(struct aha_softc *, struct scsipi_xfer *, int);
static void aha_timeout(void *arg);
static int aha_create_ccbs(struct aha_softc *, struct aha_ccb *, int);
#define AHA_RESET_TIMEOUT 2000 /* time to wait for reset (mSec) */
#define AHA_ABORT_TIMEOUT 2000 /* time to wait for abort (mSec) */
@ -136,13 +130,9 @@ int aha_create_ccbs __P((struct aha_softc *, struct aha_ccb *, int));
* scsi command, which is read in via the DMA; one of the adapter commands
* tells it to read in a scsi command.
*/
int
aha_cmd(iot, ioh, sc, icnt, ibuf, ocnt, obuf)
bus_space_tag_t iot;
bus_space_handle_t ioh;
struct aha_softc *sc;
int icnt, ocnt;
u_char *ibuf, *obuf;
static int
aha_cmd(bus_space_tag_t iot, bus_space_handle_t ioh, struct aha_softc *sc,
int icnt, u_char *ibuf, int ocnt, u_char *obuf)
{
const char *name;
int i;
@ -299,9 +289,8 @@ aha_attach(sc, apd)
config_found(&sc->sc_dev, &sc->sc_channel, scsiprint);
}
integrate void
aha_finish_ccbs(sc)
struct aha_softc *sc;
static void
aha_finish_ccbs(struct aha_softc *sc)
{
struct aha_mbx_in *wmbi;
struct aha_ccb *ccb;
@ -452,10 +441,8 @@ aha_intr(arg)
return (1);
}
integrate void
aha_reset_ccb(sc, ccb)
struct aha_softc *sc;
struct aha_ccb *ccb;
static __inline void
aha_reset_ccb(struct aha_softc *sc, struct aha_ccb *ccb)
{
ccb->flags = 0;
@ -464,10 +451,8 @@ aha_reset_ccb(sc, ccb)
/*
* A ccb is put onto the free list.
*/
void
aha_free_ccb(sc, ccb)
struct aha_softc *sc;
struct aha_ccb *ccb;
static void
aha_free_ccb(struct aha_softc *sc, struct aha_ccb *ccb)
{
int s;
@ -477,10 +462,8 @@ aha_free_ccb(sc, ccb)
splx(s);
}
integrate int
aha_init_ccb(sc, ccb)
struct aha_softc *sc;
struct aha_ccb *ccb;
static int
aha_init_ccb(struct aha_softc *sc, struct aha_ccb *ccb)
{
bus_dma_tag_t dmat = sc->sc_dmat;
int hashnum, error;
@ -513,11 +496,8 @@ aha_init_ccb(sc, ccb)
* Create a set of ccbs and add them to the free list. Called once
* by aha_init(). We return the number of CCBs successfully created.
*/
int
aha_create_ccbs(sc, ccbstore, count)
struct aha_softc *sc;
struct aha_ccb *ccbstore;
int count;
static int
aha_create_ccbs(struct aha_softc *sc, struct aha_ccb *ccbstore, int count)
{
struct aha_ccb *ccb;
int i, error;
@ -543,8 +523,7 @@ aha_create_ccbs(sc, ccbstore, count)
* the hash table too otherwise either return an error or sleep.
*/
struct aha_ccb *
aha_get_ccb(sc)
struct aha_softc *sc;
aha_get_ccb(struct aha_softc *sc)
{
struct aha_ccb *ccb;
int s;
@ -562,10 +541,8 @@ aha_get_ccb(sc)
/*
* Given a physical address, find the ccb that it corresponds to.
*/
struct aha_ccb *
aha_ccb_phys_kv(sc, ccb_phys)
struct aha_softc *sc;
u_long ccb_phys;
static struct aha_ccb *
aha_ccb_phys_kv(struct aha_softc *sc, u_long ccb_phys)
{
int hashnum = CCB_HASH(ccb_phys);
struct aha_ccb *ccb = sc->sc_ccbhash[hashnum];
@ -581,10 +558,8 @@ aha_ccb_phys_kv(sc, ccb_phys)
/*
* Queue a CCB to be sent to the controller, and send it if possible.
*/
void
aha_queue_ccb(sc, ccb)
struct aha_softc *sc;
struct aha_ccb *ccb;
static void
aha_queue_ccb(struct aha_softc *sc, struct aha_ccb *ccb)
{
TAILQ_INSERT_TAIL(&sc->sc_waiting_ccb, ccb, chain);
@ -594,9 +569,8 @@ aha_queue_ccb(sc, ccb)
/*
* Garbage collect mailboxes that are no longer in use.
*/
void
aha_collect_mbo(sc)
struct aha_softc *sc;
static void
aha_collect_mbo(struct aha_softc *sc)
{
struct aha_mbx_out *wmbo; /* Mail Box Out pointer */
#ifdef AHADIAG
@ -627,9 +601,8 @@ aha_collect_mbo(sc)
/*
* Send as many CCBs as we have empty mailboxes for.
*/
void
aha_start_ccbs(sc)
struct aha_softc *sc;
static void
aha_start_ccbs(struct aha_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -689,10 +662,8 @@ aha_start_ccbs(sc)
* adaptor, now we look to see how the operation
* went. Wake up the owner if waiting
*/
void
aha_done(sc, ccb)
struct aha_softc *sc;
struct aha_ccb *ccb;
static void
aha_done(struct aha_softc *sc, struct aha_ccb *ccb)
{
bus_dma_tag_t dmat = sc->sc_dmat;
struct scsipi_sense_data *s1, *s2;
@ -867,9 +838,8 @@ aha_find(iot, ioh, sc)
/*
* Start the board, ready for normal operation
*/
int
aha_init(sc)
struct aha_softc *sc;
static int
aha_init(struct aha_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -1039,9 +1009,8 @@ aha_init(sc)
return (0);
}
void
aha_inquire_setup_information(sc)
struct aha_softc *sc;
static void
aha_inquire_setup_information(struct aha_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -1129,9 +1098,8 @@ noinquire:
sc->sc_model, sc->sc_firmware);
}
void
ahaminphys(bp)
struct buf *bp;
static void
ahaminphys(struct buf *bp)
{
if (bp->b_bcount > AHA_MAXXFER)
@ -1144,11 +1112,9 @@ ahaminphys(bp)
* the unit, target and lu.
*/
void
aha_scsipi_request(chan, req, arg)
struct scsipi_channel *chan;
scsipi_adapter_req_t req;
void *arg;
static void
aha_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
void *arg)
{
struct scsipi_xfer *xs;
struct scsipi_periph *periph;
@ -1324,11 +1290,8 @@ out_bad:
/*
* Poll a particular unit, looking for a particular xs
*/
int
aha_poll(sc, xs, count)
struct aha_softc *sc;
struct scsipi_xfer *xs;
int count;
static int
aha_poll(struct aha_softc *sc, struct scsipi_xfer *xs, int count)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -1349,9 +1312,8 @@ aha_poll(sc, xs, count)
return (1);
}
void
aha_timeout(arg)
void *arg;
static void
aha_timeout(void *arg)
{
struct aha_ccb *ccb = arg;
struct scsipi_xfer *xs = ccb->xs;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahavar.h,v 1.11 2001/04/25 17:53:30 bouyer Exp $ */
/* $NetBSD: ahavar.h,v 1.12 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,6 +37,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_IC_AHAVAR_H_
#define _DEV_IC_AHAVAR_H_
#include <sys/queue.h>
/*
@ -116,7 +119,9 @@ struct aha_probe_data {
int sc_scsi_dev; /* adapters scsi id */
};
int aha_find __P((bus_space_tag_t, bus_space_handle_t,
struct aha_probe_data *));
void aha_attach __P((struct aha_softc *, struct aha_probe_data *));
int aha_intr __P((void *));
int aha_find(bus_space_tag_t, bus_space_handle_t,
struct aha_probe_data *);
void aha_attach(struct aha_softc *, struct aha_probe_data *);
int aha_intr(void *);
#endif /* _DEV_IC_AHAVAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: aic6360.c,v 1.81 2004/08/07 20:05:25 mycroft Exp $ */
/* $NetBSD: aic6360.c,v 1.82 2004/08/24 00:53:29 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@ -58,14 +58,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aic6360.c,v 1.81 2004/08/07 20:05:25 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: aic6360.c,v 1.82 2004/08/24 00:53:29 thorpej Exp $");
#include "opt_ddb.h"
#ifdef DDB
#define integrate
#else
#define integrate static inline
#endif
/*
* A few customizable items:
@ -154,34 +149,32 @@ __KERNEL_RCSID(0, "$NetBSD: aic6360.c,v 1.81 2004/08/07 20:05:25 mycroft Exp $")
int aic_debug = 0x00; /* AIC_SHOWSTART|AIC_SHOWMISC|AIC_SHOWTRACE; */
#endif
void aic_minphys(struct buf *);
void aic_done(struct aic_softc *, struct aic_acb *);
void aic_dequeue(struct aic_softc *, struct aic_acb *);
void aic_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t,
void *);
int aic_poll(struct aic_softc *, struct scsipi_xfer *, int);
integrate void aic_sched_msgout(struct aic_softc *, u_char);
integrate void aic_setsync(struct aic_softc *, struct aic_tinfo *);
void aic_select(struct aic_softc *, struct aic_acb *);
void aic_timeout(void *);
void aic_sched(struct aic_softc *);
void aic_scsi_reset(struct aic_softc *);
void aic_reset(struct aic_softc *);
void aic_free_acb(struct aic_softc *, struct aic_acb *);
struct aic_acb* aic_get_acb(struct aic_softc *);
int aic_reselect(struct aic_softc *, int);
void aic_sense(struct aic_softc *, struct aic_acb *);
void aic_msgin(struct aic_softc *);
void aic_abort(struct aic_softc *, struct aic_acb *);
void aic_msgout(struct aic_softc *);
int aic_dataout_pio(struct aic_softc *, u_char *, int);
int aic_datain_pio(struct aic_softc *, u_char *, int);
void aic_update_xfer_mode(struct aic_softc *, int);
static void aic_minphys(struct buf *);
static void aic_done(struct aic_softc *, struct aic_acb *);
static void aic_dequeue(struct aic_softc *, struct aic_acb *);
static void aic_scsipi_request(struct scsipi_channel *,
scsipi_adapter_req_t, void *);
static int aic_poll(struct aic_softc *, struct scsipi_xfer *, int);
static void aic_select(struct aic_softc *, struct aic_acb *);
static void aic_timeout(void *);
static void aic_sched(struct aic_softc *);
static void aic_scsi_reset(struct aic_softc *);
static void aic_reset(struct aic_softc *);
static void aic_free_acb(struct aic_softc *, struct aic_acb *);
static struct aic_acb* aic_get_acb(struct aic_softc *);
static int aic_reselect(struct aic_softc *, int);
static void aic_sense(struct aic_softc *, struct aic_acb *);
static void aic_msgin(struct aic_softc *);
static void aic_abort(struct aic_softc *, struct aic_acb *);
static void aic_msgout(struct aic_softc *);
static int aic_dataout_pio(struct aic_softc *, u_char *, int);
static int aic_datain_pio(struct aic_softc *, u_char *, int);
static void aic_update_xfer_mode(struct aic_softc *, int);
#if AIC_DEBUG
void aic_print_acb(struct aic_acb *);
static void aic_print_acb(struct aic_acb *);
void aic_dump_driver(struct aic_softc *);
void aic_dump6360(struct aic_softc *);
void aic_show_scsi_cmd(struct aic_acb *);
static void aic_show_scsi_cmd(struct aic_acb *);
void aic_print_active_acb(void);
#endif
@ -342,7 +335,7 @@ aic_detach(struct device *self, int flags)
* aic_isa_probe should have succeeded, i.e. the iobase address in aic_softc
* must be valid.
*/
void
static void
aic_reset(struct aic_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
@ -388,7 +381,7 @@ aic_reset(struct aic_softc *sc)
}
/* Pull the SCSI RST line for 500 us */
void
static void
aic_scsi_reset(struct aic_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
@ -456,7 +449,7 @@ aic_init(struct aic_softc *sc, int bus_reset)
bus_space_write_1(sc->sc_iot, sc->sc_ioh, DMACNTRL0, INTEN);
}
void
static void
aic_free_acb(struct aic_softc *sc, struct aic_acb *acb)
{
int s;
@ -467,7 +460,7 @@ aic_free_acb(struct aic_softc *sc, struct aic_acb *acb)
splx(s);
}
struct aic_acb *
static struct aic_acb *
aic_get_acb(struct aic_softc *sc)
{
struct aic_acb *acb;
@ -507,7 +500,7 @@ aic_get_acb(struct aic_softc *sc)
/*
* Perform a request from the SCSIPI midlayer.
*/
void
static void
aic_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
void *arg)
{
@ -620,7 +613,7 @@ aic_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
}
}
void
static void
aic_update_xfer_mode(struct aic_softc *sc, int target)
{
struct scsipi_xfer_mode xm;
@ -651,7 +644,7 @@ aic_update_xfer_mode(struct aic_softc *sc, int target)
/*
* Adjust transfer size in buffer structure
*/
void
static void
aic_minphys(struct buf *bp)
{
@ -664,7 +657,7 @@ aic_minphys(struct buf *bp)
/*
* Used when interrupt driven I/O isn't allowed, e.g. during boot.
*/
int
static int
aic_poll(struct aic_softc *sc, struct scsipi_xfer *xs, int count)
{
bus_space_tag_t iot = sc->sc_iot;
@ -690,7 +683,7 @@ aic_poll(struct aic_softc *sc, struct scsipi_xfer *xs, int count)
* LOW LEVEL SCSI UTILITIES
*/
integrate void
static __inline void
aic_sched_msgout(struct aic_softc *sc, u_char m)
{
bus_space_tag_t iot = sc->sc_iot;
@ -707,7 +700,7 @@ aic_sched_msgout(struct aic_softc *sc, u_char m)
#if !AIC_USE_SYNCHRONOUS
/* ARGSUSED */
#endif
integrate void
static __inline void
aic_setsync(struct aic_softc *sc, struct aic_tinfo *ti)
{
#if AIC_USE_SYNCHRONOUS
@ -726,7 +719,7 @@ aic_setsync(struct aic_softc *sc, struct aic_tinfo *ti)
* Start a selection. This is used by aic_sched() to select an idle target,
* and by aic_done() to immediately reselect a target to get sense information.
*/
void
static void
aic_select(struct aic_softc *sc, struct aic_acb *acb)
{
struct scsipi_periph *periph = acb->xs->xs_periph;
@ -748,7 +741,7 @@ aic_select(struct aic_softc *sc, struct aic_acb *acb)
sc->sc_state = AIC_SELECTING;
}
int
static int
aic_reselect(struct aic_softc *sc, int message)
{
u_char selid, target, lun;
@ -826,7 +819,7 @@ abort:
* may save us an unnecessary interrupt just to get things going. Should only
* be called when state == AIC_IDLE and at bio pl.
*/
void
static void
aic_sched(struct aic_softc *sc)
{
struct aic_acb *acb;
@ -866,7 +859,7 @@ aic_sched(struct aic_softc *sc)
bus_space_write_1(iot, ioh, SCSISEQ, ENRESELI);
}
void
static void
aic_sense(struct aic_softc *sc, struct aic_acb *acb)
{
struct scsipi_xfer *xs = acb->xs;
@ -900,7 +893,7 @@ aic_sense(struct aic_softc *sc, struct aic_acb *acb)
/*
* POST PROCESSING OF SCSI_CMD (usually current)
*/
void
static void
aic_done(struct aic_softc *sc, struct aic_acb *acb)
{
struct scsipi_xfer *xs = acb->xs;
@ -961,7 +954,7 @@ aic_done(struct aic_softc *sc, struct aic_acb *acb)
scsipi_done(xs);
}
void
static void
aic_dequeue(struct aic_softc *sc, struct aic_acb *acb)
{
@ -981,7 +974,7 @@ aic_dequeue(struct aic_softc *sc, struct aic_acb *acb)
* The SCSI bus is already in the MSGI phase and there is a message byte
* on the bus, along with an asserted REQ signal.
*/
void
static void
aic_msgin(struct aic_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
@ -1258,7 +1251,7 @@ out:
/*
* Send the highest priority, scheduled message.
*/
void
static void
aic_msgout(struct aic_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
@ -1451,7 +1444,7 @@ out:
* This new revision has been optimized (I tried) to make the common case fast,
* and the rarer cases (as a result) somewhat more comlex
*/
int
static int
aic_dataout_pio(struct aic_softc *sc, u_char *p, int n)
{
bus_space_tag_t iot = sc->sc_iot;
@ -1594,7 +1587,7 @@ phasechange:
* transferred. This, is OK for fast targets, but not so smart for slow
* targets which don't disconnect or for huge transfers.
*/
int
static int
aic_datain_pio(struct aic_softc *sc, u_char *p, int n)
{
bus_space_tag_t iot = sc->sc_iot;
@ -2084,7 +2077,7 @@ out:
return 1;
}
void
static void
aic_abort(struct aic_softc *sc, struct aic_acb *acb)
{
@ -2107,7 +2100,7 @@ aic_abort(struct aic_softc *sc, struct aic_acb *acb)
}
}
void
static void
aic_timeout(void *arg)
{
struct aic_acb *acb = arg;
@ -2142,7 +2135,7 @@ aic_timeout(void *arg)
* directly called from the driver or from the kernel debugger.
*/
void
static void
aic_show_scsi_cmd(struct aic_acb *acb)
{
u_char *b = (u_char *)&acb->scsipi_cmd;
@ -2161,7 +2154,7 @@ aic_show_scsi_cmd(struct aic_acb *acb)
printf("RESET\n");
}
void
static void
aic_print_acb(struct aic_acb *acb)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: aic6360var.h,v 1.9 2001/04/30 03:45:35 lukem Exp $ */
/* $NetBSD: aic6360var.h,v 1.10 2004/08/24 00:53:29 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Charles M. Hannum. All rights reserved.
@ -44,6 +44,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_IC_AIC6360VAR_H_
#define _DEV_IC_AIC6360VAR_H_
/*
* Acknowledgements: Many of the algorithms used in this driver are
* inspired by the work of Julian Elischer (julian@tfs.com) and
@ -214,10 +217,12 @@ extern int aic_debug; /* AIC_SHOWSTART|AIC_SHOWMISC|AIC_SHOWTRACE; */
#define AIC_ISA_IOSIZE 0x20 /* XXX */
void aicattach __P((struct aic_softc *));
int aic_activate __P((struct device *, enum devact));
int aic_detach __P((struct device *, int));
int aicintr __P((void *));
int aic_find __P((bus_space_tag_t, bus_space_handle_t));
void aic_isa_attach __P((struct device *, struct device *, void *));
void aic_init __P((struct aic_softc *, int));
void aicattach(struct aic_softc *);
int aic_activate(struct device *, enum devact);
int aic_detach(struct device *, int);
int aicintr(void *);
int aic_find(bus_space_tag_t, bus_space_handle_t);
void aic_isa_attach(struct device *, struct device *, void *);
void aic_init(struct aic_softc *, int);
#endif /* _DEV_IC_AIC6360VAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: aic6915.c,v 1.10 2003/10/25 18:35:42 christos Exp $ */
/* $NetBSD: aic6915.c,v 1.11 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.10 2003/10/25 18:35:42 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.11 2004/08/24 00:53:29 thorpej Exp $");
#include "bpfilter.h"
@ -76,33 +76,33 @@ __KERNEL_RCSID(0, "$NetBSD: aic6915.c,v 1.10 2003/10/25 18:35:42 christos Exp $"
#include <dev/ic/aic6915reg.h>
#include <dev/ic/aic6915var.h>
void sf_start(struct ifnet *);
void sf_watchdog(struct ifnet *);
int sf_ioctl(struct ifnet *, u_long, caddr_t);
int sf_init(struct ifnet *);
void sf_stop(struct ifnet *, int);
static void sf_start(struct ifnet *);
static void sf_watchdog(struct ifnet *);
static int sf_ioctl(struct ifnet *, u_long, caddr_t);
static int sf_init(struct ifnet *);
static void sf_stop(struct ifnet *, int);
void sf_shutdown(void *);
static void sf_shutdown(void *);
void sf_txintr(struct sf_softc *);
void sf_rxintr(struct sf_softc *);
void sf_stats_update(struct sf_softc *);
static void sf_txintr(struct sf_softc *);
static void sf_rxintr(struct sf_softc *);
static void sf_stats_update(struct sf_softc *);
void sf_reset(struct sf_softc *);
void sf_macreset(struct sf_softc *);
void sf_rxdrain(struct sf_softc *);
int sf_add_rxbuf(struct sf_softc *, int);
uint8_t sf_read_eeprom(struct sf_softc *, int);
void sf_set_filter(struct sf_softc *);
static void sf_reset(struct sf_softc *);
static void sf_macreset(struct sf_softc *);
static void sf_rxdrain(struct sf_softc *);
static int sf_add_rxbuf(struct sf_softc *, int);
static uint8_t sf_read_eeprom(struct sf_softc *, int);
static void sf_set_filter(struct sf_softc *);
int sf_mii_read(struct device *, int, int);
void sf_mii_write(struct device *, int, int, int);
void sf_mii_statchg(struct device *);
static int sf_mii_read(struct device *, int, int);
static void sf_mii_write(struct device *, int, int, int);
static void sf_mii_statchg(struct device *);
void sf_tick(void *);
static void sf_tick(void *);
int sf_mediachange(struct ifnet *);
void sf_mediastatus(struct ifnet *, struct ifmediareq *);
static int sf_mediachange(struct ifnet *);
static void sf_mediastatus(struct ifnet *, struct ifmediareq *);
#define sf_funcreg_read(sc, reg) \
bus_space_read_4((sc)->sc_st, (sc)->sc_sh_func, (reg))
@ -339,7 +339,7 @@ sf_attach(struct sf_softc *sc)
*
* Shutdown hook -- make sure the interface is stopped at reboot.
*/
void
static void
sf_shutdown(void *arg)
{
struct sf_softc *sc = arg;
@ -352,7 +352,7 @@ sf_shutdown(void *arg)
*
* Start packet transmission on the interface.
*/
void
static void
sf_start(struct ifnet *ifp)
{
struct sf_softc *sc = ifp->if_softc;
@ -504,7 +504,7 @@ sf_start(struct ifnet *ifp)
*
* Watchdog timer handler.
*/
void
static void
sf_watchdog(struct ifnet *ifp)
{
struct sf_softc *sc = ifp->if_softc;
@ -523,7 +523,7 @@ sf_watchdog(struct ifnet *ifp)
*
* Handle control requests from the operator.
*/
int
static int
sf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct sf_softc *sc = ifp->if_softc;
@ -635,7 +635,7 @@ sf_intr(void *arg)
*
* Helper -- handle transmit completion interrupts.
*/
void
static void
sf_txintr(struct sf_softc *sc)
{
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
@ -703,7 +703,7 @@ sf_txintr(struct sf_softc *sc)
*
* Helper -- handle receive interrupts.
*/
void
static void
sf_rxintr(struct sf_softc *sc)
{
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
@ -837,7 +837,7 @@ sf_rxintr(struct sf_softc *sc)
*
* One second timer, used to tick the MII and update stats.
*/
void
static void
sf_tick(void *arg)
{
struct sf_softc *sc = arg;
@ -856,7 +856,7 @@ sf_tick(void *arg)
*
* Read the statitistics counters.
*/
void
static void
sf_stats_update(struct sf_softc *sc)
{
struct sf_stats stats;
@ -893,7 +893,7 @@ sf_stats_update(struct sf_softc *sc)
*
* Perform a soft reset on the Starfire.
*/
void
static void
sf_reset(struct sf_softc *sc)
{
int i;
@ -923,7 +923,7 @@ sf_reset(struct sf_softc *sc)
*
* Reset the MAC portion of the Starfire.
*/
void
static void
sf_macreset(struct sf_softc *sc)
{
@ -937,7 +937,7 @@ sf_macreset(struct sf_softc *sc)
*
* Initialize the interface. Must be called at splnet().
*/
int
static int
sf_init(struct ifnet *ifp)
{
struct sf_softc *sc = ifp->if_softc;
@ -1129,7 +1129,7 @@ sf_init(struct ifnet *ifp)
*
* Drain the receive queue.
*/
void
static void
sf_rxdrain(struct sf_softc *sc)
{
struct sf_descsoft *ds;
@ -1150,7 +1150,7 @@ sf_rxdrain(struct sf_softc *sc)
*
* Stop transmission on the interface.
*/
void
static void
sf_stop(struct ifnet *ifp, int disable)
{
struct sf_softc *sc = ifp->if_softc;
@ -1196,7 +1196,7 @@ sf_stop(struct ifnet *ifp, int disable)
*
* Read from the Starfire EEPROM.
*/
uint8_t
static uint8_t
sf_read_eeprom(struct sf_softc *sc, int offset)
{
uint32_t reg;
@ -1211,7 +1211,7 @@ sf_read_eeprom(struct sf_softc *sc, int offset)
*
* Add a receive buffer to the indicated descriptor.
*/
int
static int
sf_add_rxbuf(struct sf_softc *sc, int idx)
{
struct sf_descsoft *ds = &sc->sc_rxsoft[idx];
@ -1282,7 +1282,7 @@ sf_set_filter_hash(struct sf_softc *sc, uint8_t *enaddr)
*
* Set the Starfire receive filter.
*/
void
static void
sf_set_filter(struct sf_softc *sc)
{
struct ethercom *ec = &sc->sc_ethercom;
@ -1372,7 +1372,7 @@ sf_set_filter(struct sf_softc *sc)
*
* Read from the MII.
*/
int
static int
sf_mii_read(struct device *self, int phy, int reg)
{
struct sf_softc *sc = (void *) self;
@ -1400,7 +1400,7 @@ sf_mii_read(struct device *self, int phy, int reg)
*
* Write to the MII.
*/
void
static void
sf_mii_write(struct device *self, int phy, int reg, int val)
{
struct sf_softc *sc = (void *) self;
@ -1423,7 +1423,7 @@ sf_mii_write(struct device *self, int phy, int reg, int val)
*
* Callback from the PHY when the media changes.
*/
void
static void
sf_mii_statchg(struct device *self)
{
struct sf_softc *sc = (void *) self;
@ -1448,7 +1448,7 @@ sf_mii_statchg(struct device *self)
*
* Callback from ifmedia to request current media status.
*/
void
static void
sf_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
{
struct sf_softc *sc = ifp->if_softc;
@ -1463,7 +1463,7 @@ sf_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
*
* Callback from ifmedia to request new media setting.
*/
int
static int
sf_mediachange(struct ifnet *ifp)
{
struct sf_softc *sc = ifp->if_softc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7990.c,v 1.65 2003/08/07 16:30:58 agc Exp $ */
/* $NetBSD: am7990.c,v 1.66 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -72,7 +72,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.65 2003/08/07 16:30:58 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.66 2004/08/24 00:53:29 thorpej Exp $");
#include "bpfilter.h"
#include "rnd.h"
@ -105,34 +105,22 @@ __KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.65 2003/08/07 16:30:58 agc Exp $");
#include <dev/ic/am7990reg.h>
#include <dev/ic/am7990var.h>
void am7990_meminit __P((struct lance_softc *));
void am7990_start __P((struct ifnet *));
static void am7990_meminit(struct lance_softc *);
static void am7990_start(struct ifnet *);
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
#endif
#ifdef DDB
#define integrate
#define hide
#else
#define integrate static __inline
#define hide static
#endif
integrate void am7990_rint __P((struct lance_softc *));
integrate void am7990_tint __P((struct lance_softc *));
#ifdef LEDEBUG
void am7990_recv_print __P((struct lance_softc *, int));
void am7990_xmit_print __P((struct lance_softc *, int));
static void am7990_recv_print(struct lance_softc *, int);
static void am7990_xmit_print(struct lance_softc *, int);
#endif
#define ifp (&sc->sc_ethercom.ec_if)
void
am7990_config(sc)
struct am7990_softc *sc;
am7990_config(struct am7990_softc *sc)
{
int mem, i;
@ -161,9 +149,8 @@ am7990_config(sc)
/*
* Set up the initialization block and the descriptor rings.
*/
void
am7990_meminit(sc)
struct lance_softc *sc;
static void
am7990_meminit(struct lance_softc *sc)
{
u_long a;
int bix;
@ -235,9 +222,8 @@ am7990_meminit(sc)
}
}
integrate void
am7990_rint(sc)
struct lance_softc *sc;
static void
am7990_rint(struct lance_softc *sc)
{
int bix;
int rp;
@ -310,9 +296,8 @@ am7990_rint(sc)
sc->sc_last_rd = bix;
}
integrate void
am7990_tint(sc)
struct lance_softc *sc;
static void
am7990_tint(struct lance_softc *sc)
{
int bix;
struct letmd tmd;
@ -396,8 +381,7 @@ am7990_tint(sc)
* Controller interrupt.
*/
int
am7990_intr(arg)
void *arg;
am7990_intr(void *arg)
{
struct lance_softc *sc = arg;
u_int16_t isr;
@ -490,9 +474,8 @@ am7990_intr(arg)
* interface before starting the output.
* Called only at splnet or interrupt level.
*/
void
am7990_start(ifp)
struct ifnet *ifp;
static void
am7990_start(struct ifnet *ifp)
{
struct lance_softc *sc = ifp->if_softc;
int bix;
@ -571,10 +554,8 @@ am7990_start(ifp)
}
#ifdef LEDEBUG
void
am7990_recv_print(sc, no)
struct lance_softc *sc;
int no;
static void
am7990_recv_print(struct lance_softc *sc, int no)
{
struct lermd rmd;
u_int16_t len;
@ -598,10 +579,8 @@ am7990_recv_print(sc, no)
}
}
void
am7990_xmit_print(sc, no)
struct lance_softc *sc;
int no;
static void
am7990_xmit_print(struct lance_softc *sc, int no)
{
struct letmd tmd;
u_int16_t len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: am79900.c,v 1.13 2004/03/24 18:22:47 thorpej Exp $ */
/* $NetBSD: am79900.c,v 1.14 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -110,7 +110,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.13 2004/03/24 18:22:47 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.14 2004/08/24 00:53:29 thorpej Exp $");
#include "bpfilter.h"
#include "rnd.h"
@ -143,34 +143,22 @@ __KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.13 2004/03/24 18:22:47 thorpej Exp $")
#include <dev/ic/am79900reg.h>
#include <dev/ic/am79900var.h>
void am79900_meminit __P((struct lance_softc *));
void am79900_start __P((struct ifnet *));
static void am79900_meminit(struct lance_softc *);
static void am79900_start(struct ifnet *);
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
#endif
#ifdef DDB
#define integrate
#define hide
#else
#define integrate static __inline
#define hide static
#endif
integrate void am79900_rint __P((struct lance_softc *));
integrate void am79900_tint __P((struct lance_softc *));
#ifdef LEDEBUG
void am79900_recv_print __P((struct lance_softc *, int));
void am79900_xmit_print __P((struct lance_softc *, int));
static void am79900_recv_print(struct lance_softc *, int);
static void am79900_xmit_print(struct lance_softc *, int);
#endif
#define ifp (&sc->sc_ethercom.ec_if)
void
am79900_config(sc)
struct am79900_softc *sc;
am79900_config(struct am79900_softc *sc)
{
int mem, i;
@ -198,9 +186,8 @@ am79900_config(sc)
/*
* Set up the initialization block and the descriptor rings.
*/
void
am79900_meminit(sc)
struct lance_softc *sc;
static void
am79900_meminit(struct lance_softc *sc)
{
u_long a;
int bix;
@ -271,9 +258,8 @@ am79900_meminit(sc)
}
}
integrate void
am79900_rint(sc)
struct lance_softc *sc;
static __inline void
am79900_rint(struct lance_softc *sc)
{
int bix;
int rp;
@ -344,9 +330,8 @@ am79900_rint(sc)
sc->sc_last_rd = bix;
}
integrate void
am79900_tint(sc)
struct lance_softc *sc;
static __inline void
am79900_tint(struct lance_softc *sc)
{
int bix;
struct letmd tmd;
@ -427,8 +412,7 @@ am79900_tint(sc)
* Controller interrupt.
*/
int
am79900_intr(arg)
void *arg;
am79900_intr(void *arg)
{
struct lance_softc *sc = arg;
u_int16_t isr;
@ -511,9 +495,8 @@ am79900_intr(arg)
* interface before starting the output.
* Called only at splnet or interrupt level.
*/
void
am79900_start(ifp)
struct ifnet *ifp;
static void
am79900_start(struct ifnet *ifp)
{
struct lance_softc *sc = ifp->if_softc;
int bix;
@ -592,10 +575,8 @@ am79900_start(ifp)
}
#ifdef LEDEBUG
void
am79900_recv_print(sc, no)
struct lance_softc *sc;
int no;
static void
am79900_recv_print(struct lance_softc *sc, int no)
{
struct lermd rmd;
u_int16_t len;
@ -618,10 +599,8 @@ am79900_recv_print(sc, no)
}
}
void
am79900_xmit_print(sc, no)
struct lance_softc *sc;
int no;
static void
am79900_xmit_print(struct lance_softc *sc, int no)
{
struct letmd tmd;
u_int16_t len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: am79900var.h,v 1.2 1998/08/15 10:51:18 mycroft Exp $ */
/* $NetBSD: am79900var.h,v 1.3 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -37,6 +37,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_IC_AM79900VAR_H_
#define _DEV_IC_AM79900VAR_H_
/*
* Ethernet software status per device.
*
@ -50,5 +53,7 @@ struct am79900_softc {
struct lance_softc lsc;
};
void am79900_config __P((struct am79900_softc *));
int am79900_intr __P((void *));
void am79900_config(struct am79900_softc *);
int am79900_intr(void *);
#endif /* _DEV_IC_AM79900VAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7990var.h,v 1.21 1998/08/15 10:51:17 mycroft Exp $ */
/* $NetBSD: am7990var.h,v 1.22 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -37,6 +37,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_IC_AM7990VAR_H_
#define _DEV_IC_AM7990VAR_H_
/*
* Ethernet software status per device.
*
@ -50,5 +53,7 @@ struct am7990_softc {
struct lance_softc lsc;
};
void am7990_config __P((struct am7990_softc *));
int am7990_intr __P((void *));
void am7990_config(struct am7990_softc *);
int am7990_intr(void *);
#endif /* _DEV_IC_AM7990VAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: an.c,v 1.31 2004/08/10 00:57:20 dyoung Exp $ */
/* $NetBSD: an.c,v 1.32 2004/08/24 00:53:29 thorpej Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.31 2004/08/10 00:57:20 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.32 2004/08/24 00:53:29 thorpej Exp $");
#include "bpfilter.h"
@ -83,37 +83,38 @@ __KERNEL_RCSID(0, "$NetBSD: an.c,v 1.31 2004/08/10 00:57:20 dyoung Exp $");
#include <dev/ic/anreg.h>
#include <dev/ic/anvar.h>
static int an_reset(struct an_softc *);
static void an_wait(struct an_softc *);
static int an_init(struct ifnet *);
static void an_stop(struct ifnet *, int);
static void an_start(struct ifnet *);
static void an_watchdog(struct ifnet *);
static int an_ioctl(struct ifnet *, u_long, caddr_t);
static int an_media_change(struct ifnet *);
static void an_media_status(struct ifnet *, struct ifmediareq *);
static int an_reset(struct an_softc *);
static void an_wait(struct an_softc *);
static int an_init(struct ifnet *);
static void an_stop(struct ifnet *, int);
static void an_start(struct ifnet *);
static void an_watchdog(struct ifnet *);
static int an_ioctl(struct ifnet *, u_long, caddr_t);
static int an_media_change(struct ifnet *);
static void an_media_status(struct ifnet *, struct ifmediareq *);
static int an_set_nwkey(struct an_softc *, struct ieee80211_nwkey *);
static int an_set_nwkey_wep(struct an_softc *, struct ieee80211_nwkey *);
static int an_set_nwkey_eap(struct an_softc *, struct ieee80211_nwkey *);
static int an_get_nwkey(struct an_softc *, struct ieee80211_nwkey *);
static int an_write_wepkey(struct an_softc *, int, struct an_wepkey *, int);
static int an_set_nwkey(struct an_softc *, struct ieee80211_nwkey *);
static int an_set_nwkey_wep(struct an_softc *, struct ieee80211_nwkey *);
static int an_set_nwkey_eap(struct an_softc *, struct ieee80211_nwkey *);
static int an_get_nwkey(struct an_softc *, struct ieee80211_nwkey *);
static int an_write_wepkey(struct an_softc *, int, struct an_wepkey *,
int);
static void an_rx_intr(struct an_softc *);
static void an_tx_intr(struct an_softc *, int);
static void an_linkstat_intr(struct an_softc *);
static void an_rx_intr(struct an_softc *);
static void an_tx_intr(struct an_softc *, int);
static void an_linkstat_intr(struct an_softc *);
static int an_cmd(struct an_softc *, int, int);
static int an_seek_bap(struct an_softc *, int, int);
static int an_read_bap(struct an_softc *, int, int, void *, int);
static int an_write_bap(struct an_softc *, int, int, void *, int);
static int an_mwrite_bap(struct an_softc *, int, int, struct mbuf *, int);
static int an_read_rid(struct an_softc *, int, void *, int *);
static int an_write_rid(struct an_softc *, int, void *, int);
static int an_cmd(struct an_softc *, int, int);
static int an_seek_bap(struct an_softc *, int, int);
static int an_read_bap(struct an_softc *, int, int, void *, int);
static int an_write_bap(struct an_softc *, int, int, void *, int);
static int an_mwrite_bap(struct an_softc *, int, int, struct mbuf *, int);
static int an_read_rid(struct an_softc *, int, void *, int *);
static int an_write_rid(struct an_softc *, int, void *, int);
static int an_alloc_fid(struct an_softc *, int, int *);
static int an_alloc_fid(struct an_softc *, int, int *);
static int an_newstate(struct ieee80211com *, enum ieee80211_state, int);
static int an_newstate(struct ieee80211com *, enum ieee80211_state, int);
#ifdef AN_DEBUG
int an_debug = 0;
@ -569,7 +570,7 @@ an_init(struct ifnet *ifp)
return 0;
}
void
static void
an_stop(struct ifnet *ifp, int disable)
{
struct an_softc *sc = ifp->if_softc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: atppc.c,v 1.16 2004/04/21 17:38:48 drochner Exp $ */
/* $NetBSD: atppc.c,v 1.17 2004/08/24 00:53:29 thorpej Exp $ */
/*
* Copyright (c) 2001 Alcove - Nicolas Souchu
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atppc.c,v 1.16 2004/04/21 17:38:48 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: atppc.c,v 1.17 2004/08/24 00:53:29 thorpej Exp $");
#include "opt_atppc.h"
@ -80,13 +80,6 @@ static int (*chipset_detect[])(struct atppc_softc *) = {
/* Prototypes for functions. */
/* Soft configuration attach */
void atppc_sc_attach(struct atppc_softc *);
int atppc_sc_detach(struct atppc_softc *, int);
/* Interrupt handler for atppc device */
int atppcintr(void *);
/* Print function for config_found_sm() */
static int atppc_print(void *, const char *);
@ -251,7 +244,8 @@ atppc_sc_attach(struct atppc_softc *lsc)
}
/* Soft configuration detach */
int atppc_sc_detach(struct atppc_softc *lsc, int flag)
int
atppc_sc_detach(struct atppc_softc *lsc, int flag)
{
struct device *dev = (struct device *)lsc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ax88190.c,v 1.3 2002/10/22 00:01:55 fair Exp $ */
/* $NetBSD: ax88190.c,v 1.4 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.3 2002/10/22 00:01:55 fair Exp $");
__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.4 2004/08/24 00:53:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -65,17 +65,17 @@ __KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.3 2002/10/22 00:01:55 fair Exp $");
#include <dev/ic/ax88190reg.h>
#include <dev/ic/ax88190var.h>
int ax88190_mii_readreg(struct device *, int, int);
void ax88190_mii_writereg(struct device *, int, int, int);
void ax88190_mii_statchg(struct device *);
static int ax88190_mii_readreg(struct device *, int, int);
static void ax88190_mii_writereg(struct device *, int, int, int);
static void ax88190_mii_statchg(struct device *);
/*
* MII bit-bang glue.
*/
u_int32_t ax88190_mii_bitbang_read(struct device *);
void ax88190_mii_bitbang_write(struct device *, u_int32_t);
static u_int32_t ax88190_mii_bitbang_read(struct device *);
static void ax88190_mii_bitbang_write(struct device *, u_int32_t);
const struct mii_bitbang_ops ax88190_mii_bitbang_ops = {
static const struct mii_bitbang_ops ax88190_mii_bitbang_ops = {
ax88190_mii_bitbang_read,
ax88190_mii_bitbang_write,
{
@ -148,7 +148,7 @@ ax88190_stop_card(struct dp8390_softc *sc)
mii_down(&sc->sc_mii);
}
u_int32_t
static u_int32_t
ax88190_mii_bitbang_read(self)
struct device *self;
{
@ -157,7 +157,7 @@ ax88190_mii_bitbang_read(self)
return (bus_space_read_1(sc->sc_asict, sc->sc_asich, AX88190_MEMR));
}
void
static void
ax88190_mii_bitbang_write(self, val)
struct device *self;
u_int32_t val;
@ -167,7 +167,7 @@ ax88190_mii_bitbang_write(self, val)
bus_space_write_1(sc->sc_asict, sc->sc_asich, AX88190_MEMR, val);
}
int
static int
ax88190_mii_readreg(self, phy, reg)
struct device *self;
int phy, reg;
@ -176,7 +176,7 @@ ax88190_mii_readreg(self, phy, reg)
return (mii_bitbang_readreg(self, &ax88190_mii_bitbang_ops, phy, reg));
}
void
static void
ax88190_mii_writereg(self, phy, reg, val)
struct device *self;
int phy, reg, val;
@ -185,7 +185,7 @@ ax88190_mii_writereg(self, phy, reg, val)
mii_bitbang_writereg(self, &ax88190_mii_bitbang_ops, phy, reg, val);
}
void
static void
ax88190_mii_statchg(self)
struct device *self;
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: bha.c,v 1.58 2004/04/22 00:17:11 itojun Exp $ */
/* $NetBSD: bha.c,v 1.59 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bha.c,v 1.58 2004/04/22 00:17:11 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: bha.c,v 1.59 2004/08/24 00:53:29 thorpej Exp $");
#include "opt_ddb.h"
@ -91,34 +91,34 @@ __KERNEL_RCSID(0, "$NetBSD: bha.c,v 1.58 2004/04/22 00:17:11 itojun Exp $");
int bha_debug = 0;
#endif /* BHADEBUG */
static int bha_cmd __P((bus_space_tag_t, bus_space_handle_t, char *, int,
u_char *, int, u_char *));
static int bha_cmd(bus_space_tag_t, bus_space_handle_t, const char *, int,
u_char *, int, u_char *);
static void bha_scsipi_request __P((struct scsipi_channel *,
scsipi_adapter_req_t, void *));
static void bha_minphys __P((struct buf *));
static void bha_scsipi_request(struct scsipi_channel *,
scsipi_adapter_req_t, void *);
static void bha_minphys(struct buf *);
static void bha_get_xfer_mode __P((struct bha_softc *,
struct scsipi_xfer_mode *));
static void bha_get_xfer_mode(struct bha_softc *,
struct scsipi_xfer_mode *);
static void bha_done __P((struct bha_softc *, struct bha_ccb *));
int bha_poll __P((struct bha_softc *, struct scsipi_xfer *, int));
static void bha_timeout __P((void *arg));
static void bha_done(struct bha_softc *, struct bha_ccb *);
static int bha_poll(struct bha_softc *, struct scsipi_xfer *, int);
static void bha_timeout(void *arg);
static int bha_init __P((struct bha_softc *));
static int bha_init(struct bha_softc *);
static int bha_create_mailbox __P((struct bha_softc *));
static void bha_collect_mbo __P((struct bha_softc *));
static int bha_create_mailbox(struct bha_softc *);
static void bha_collect_mbo(struct bha_softc *);
static void bha_queue_ccb __P((struct bha_softc *, struct bha_ccb *));
static void bha_start_ccbs __P((struct bha_softc *));
static void bha_finish_ccbs __P((struct bha_softc *));
static void bha_queue_ccb(struct bha_softc *, struct bha_ccb *);
static void bha_start_ccbs(struct bha_softc *);
static void bha_finish_ccbs(struct bha_softc *);
struct bha_ccb *bha_ccb_phys_kv __P((struct bha_softc *, bus_addr_t));
void bha_create_ccbs __P((struct bha_softc *, int));
int bha_init_ccb __P((struct bha_softc *, struct bha_ccb *));
struct bha_ccb *bha_get_ccb __P((struct bha_softc *));
void bha_free_ccb __P((struct bha_softc *, struct bha_ccb *));
static struct bha_ccb *bha_ccb_phys_kv(struct bha_softc *, bus_addr_t);
static void bha_create_ccbs(struct bha_softc *, int);
static int bha_init_ccb(struct bha_softc *, struct bha_ccb *);
static struct bha_ccb *bha_get_ccb(struct bha_softc *);
static void bha_free_ccb(struct bha_softc *, struct bha_ccb *);
#define BHA_RESET_TIMEOUT 2000 /* time to wait for reset (mSec) */
#define BHA_ABORT_TIMEOUT 2000 /* time to wait for abort (mSec) */
@ -126,17 +126,10 @@ void bha_free_ccb __P((struct bha_softc *, struct bha_ccb *));
/*
* Number of CCBs in an allocation group; must be computed at run-time.
*/
int bha_ccbs_per_group;
static int bha_ccbs_per_group;
__inline struct bha_mbx_out *bha_nextmbo __P((struct bha_softc *,
struct bha_mbx_out *));
__inline struct bha_mbx_in *bha_nextmbi __P((struct bha_softc *,
struct bha_mbx_in *));
__inline struct bha_mbx_out *
bha_nextmbo(sc, mbo)
struct bha_softc *sc;
struct bha_mbx_out *mbo;
static __inline struct bha_mbx_out *
bha_nextmbo(struct bha_softc *sc, struct bha_mbx_out *mbo)
{
if (mbo == &sc->sc_mbo[sc->sc_mbox_count - 1])
@ -144,10 +137,8 @@ bha_nextmbo(sc, mbo)
return (mbo + 1);
}
__inline struct bha_mbx_in *
bha_nextmbi(sc, mbi)
struct bha_softc *sc;
struct bha_mbx_in *mbi;
static __inline struct bha_mbx_in *
bha_nextmbi(struct bha_softc *sc, struct bha_mbx_in *mbi)
{
if (mbi == &sc->sc_mbi[sc->sc_mbox_count - 1])
return (&sc->sc_mbi[0]);
@ -160,8 +151,7 @@ bha_nextmbi(sc, mbi)
* Finish attaching a Buslogic controller, and configure children.
*/
void
bha_attach(sc)
struct bha_softc *sc;
bha_attach(struct bha_softc *sc)
{
struct scsipi_adapter *adapt = &sc->sc_adapter;
struct scsipi_channel *chan = &sc->sc_channel;
@ -231,8 +221,7 @@ bha_attach(sc)
* Interrupt service routine.
*/
int
bha_intr(arg)
void *arg;
bha_intr(void *arg)
{
struct bha_softc *sc = arg;
bus_space_tag_t iot = sc->sc_iot;
@ -285,11 +274,9 @@ bha_intr(arg)
*
* Perform a request for the SCSIPI layer.
*/
void
bha_scsipi_request(chan, req, arg)
struct scsipi_channel *chan;
scsipi_adapter_req_t req;
void *arg;
static void
bha_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
void *arg)
{
struct scsipi_adapter *adapt = chan->chan_adapter;
struct bha_softc *sc = (void *)adapt->adapt_dev;
@ -476,8 +463,7 @@ bha_scsipi_request(chan, req, arg)
* Limit a transfer to our maximum transfer size.
*/
void
bha_minphys(bp)
struct buf *bp;
bha_minphys(struct buf *bp)
{
if (bp->b_bcount > BHA_MAXXFER)
@ -497,10 +483,8 @@ bha_minphys(bp)
*
* NOTE: we must be called at splbio().
*/
void
bha_get_xfer_mode(sc, xm)
struct bha_softc *sc;
struct scsipi_xfer_mode *xm;
static void
bha_get_xfer_mode(struct bha_softc *sc, struct scsipi_xfer_mode *xm)
{
struct bha_setup hwsetup;
struct bha_period hwperiod;
@ -603,10 +587,8 @@ bha_get_xfer_mode(sc, xm)
* A CCB has completed execution. Pass the status back to the
* upper layer.
*/
void
bha_done(sc, ccb)
struct bha_softc *sc;
struct bha_ccb *ccb;
static void
bha_done(struct bha_softc *sc, struct bha_ccb *ccb)
{
bus_dma_tag_t dmat = sc->sc_dmat;
struct scsipi_xfer *xs = ccb->xs;
@ -682,11 +664,8 @@ bha_done(sc, ccb)
*
* Poll for completion of the specified job.
*/
int
bha_poll(sc, xs, count)
struct bha_softc *sc;
struct scsipi_xfer *xs;
int count;
static int
bha_poll(struct bha_softc *sc, struct scsipi_xfer *xs, int count)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -713,9 +692,8 @@ bha_poll(sc, xs, count)
*
* CCB timeout handler.
*/
void
bha_timeout(arg)
void *arg;
static void
bha_timeout(void *arg)
{
struct bha_ccb *ccb = arg;
struct scsipi_xfer *xs = ccb->xs;
@ -770,13 +748,9 @@ bha_timeout(arg)
*
* Send a command to the Buglogic controller.
*/
int
bha_cmd(iot, ioh, name, icnt, ibuf, ocnt, obuf)
bus_space_tag_t iot;
bus_space_handle_t ioh;
char *name;
int icnt, ocnt;
u_char *ibuf, *obuf;
static int
bha_cmd(bus_space_tag_t iot, bus_space_handle_t ioh, const char *name, int icnt,
u_char *ibuf, int ocnt, u_char *obuf)
{
int i;
int wait;
@ -899,9 +873,7 @@ bad:
* Find the board.
*/
int
bha_find(iot, ioh)
bus_space_tag_t iot;
bus_space_handle_t ioh;
bha_find(bus_space_tag_t iot, bus_space_handle_t ioh)
{
int i;
u_char sts;
@ -1087,8 +1059,7 @@ bha_probe_inquiry(bus_space_tag_t iot, bus_space_handle_t ioh,
* to ensure they're not autoconfigured a second time as an ISA bha.
*/
int
bha_disable_isacompat(sc)
struct bha_softc *sc;
bha_disable_isacompat(struct bha_softc *sc)
{
struct bha_isadisable isa_disable;
@ -1107,8 +1078,7 @@ bha_disable_isacompat(sc)
* return the initial number of CCBs, 0 if we failed.
*/
int
bha_info(sc)
struct bha_softc *sc;
bha_info(struct bha_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -1382,9 +1352,8 @@ bha_info(sc)
*
* Initialize the board.
*/
int
bha_init(sc)
struct bha_softc *sc;
static int
bha_init(struct bha_softc *sc)
{
char *name = sc->sc_dev.dv_xname;
struct bha_toggle toggle;
@ -1445,10 +1414,8 @@ bha_init(sc)
*
* Queue a CCB to be sent to the controller, and send it if possible.
*/
void
bha_queue_ccb(sc, ccb)
struct bha_softc *sc;
struct bha_ccb *ccb;
static void
bha_queue_ccb(struct bha_softc *sc, struct bha_ccb *ccb)
{
TAILQ_INSERT_TAIL(&sc->sc_waiting_ccb, ccb, chain);
@ -1460,9 +1427,8 @@ bha_queue_ccb(sc, ccb)
*
* Send as many CCBs as we have empty mailboxes for.
*/
void
bha_start_ccbs(sc)
struct bha_softc *sc;
static void
bha_start_ccbs(struct bha_softc *sc)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@ -1538,9 +1504,8 @@ bha_start_ccbs(sc)
*
* Finalize the execution of CCBs in our incoming mailbox.
*/
void
bha_finish_ccbs(sc)
struct bha_softc *sc;
static void
bha_finish_ccbs(struct bha_softc *sc)
{
struct bha_mbx_in *mbi;
struct bha_ccb *ccb;
@ -1659,9 +1624,8 @@ bha_finish_ccbs(sc)
* mailbox_out[mailbox_size]
* mailbox_in[mailbox_size]
*/
int
bha_create_mailbox(sc)
struct bha_softc *sc;
static int
bha_create_mailbox(struct bha_softc *sc)
{
bus_dma_segment_t seg;
size_t size;
@ -1724,9 +1688,8 @@ bha_create_mailbox(sc)
*
* Garbage collect mailboxes that are no longer in use.
*/
void
bha_collect_mbo(sc)
struct bha_softc *sc;
static void
bha_collect_mbo(struct bha_softc *sc)
{
struct bha_mbx_out *mbo;
#ifdef BHADIAG
@ -1757,11 +1720,8 @@ bha_collect_mbo(sc)
* CCB management functions
*****************************************************************************/
__inline void bha_reset_ccb __P((struct bha_ccb *));
__inline void
bha_reset_ccb(ccb)
struct bha_ccb *ccb;
static __inline void
bha_reset_ccb(struct bha_ccb *ccb)
{
ccb->flags = 0;
@ -1779,10 +1739,8 @@ bha_reset_ccb(ccb)
* XXX AB_QUIET/AB_SILENT lossage here; this is called during
* boot as well as at run-time.
*/
void
bha_create_ccbs(sc, count)
struct bha_softc *sc;
int count;
static void
bha_create_ccbs(struct bha_softc *sc, int count)
{
struct bha_ccb_group *bcg;
struct bha_ccb *ccb;
@ -1904,10 +1862,8 @@ bha_create_ccbs(sc, count)
*
* Initialize a CCB; helper function for bha_create_ccbs().
*/
int
bha_init_ccb(sc, ccb)
struct bha_softc *sc;
struct bha_ccb *ccb;
static int
bha_init_ccb(struct bha_softc *sc, struct bha_ccb *ccb)
{
struct bha_ccb_group *bcg = BHA_CCB_GROUP(ccb);
int hashnum, error;
@ -1951,9 +1907,8 @@ bha_init_ccb(sc, ccb)
* Get a CCB for the SCSI operation. If there are none left,
* wait until one becomes available, if we can.
*/
struct bha_ccb *
bha_get_ccb(sc)
struct bha_softc *sc;
static struct bha_ccb *
bha_get_ccb(struct bha_softc *sc)
{
struct bha_ccb *ccb;
int s;
@ -1973,10 +1928,8 @@ bha_get_ccb(sc)
*
* Put a CCB back onto the free list.
*/
void
bha_free_ccb(sc, ccb)
struct bha_softc *sc;
struct bha_ccb *ccb;
static void
bha_free_ccb(struct bha_softc *sc, struct bha_ccb *ccb)
{
int s;
@ -1991,10 +1944,8 @@ bha_free_ccb(sc, ccb)
*
* Given a CCB DMA address, locate the CCB in kernel virtual space.
*/
struct bha_ccb *
bha_ccb_phys_kv(sc, ccb_phys)
struct bha_softc *sc;
bus_addr_t ccb_phys;
static struct bha_ccb *
bha_ccb_phys_kv(struct bha_softc *sc, bus_addr_t ccb_phys)
{
int hashnum = CCB_HASH(ccb_phys);
struct bha_ccb *ccb = sc->sc_ccbhash[hashnum];

View File

@ -1,4 +1,4 @@
/* $NetBSD: bhavar.h,v 1.21 2001/05/03 20:34:54 ross Exp $ */
/* $NetBSD: bhavar.h,v 1.22 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -37,6 +37,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_IC_BHAVAR_H_
#define _DEV_IC_BHAVAR_H_
#include <sys/queue.h>
/* XXX adjust hash for large numbers of CCBs */
@ -150,13 +153,15 @@ struct bha_probe_data {
int sc_irq, sc_drq;
};
int bha_find __P((bus_space_tag_t, bus_space_handle_t));
int bha_inquire_config __P((bus_space_tag_t, bus_space_handle_t,
struct bha_probe_data *));
void bha_attach __P((struct bha_softc *));
int bha_info __P((struct bha_softc *));
int bha_intr __P((void *));
int bha_find(bus_space_tag_t, bus_space_handle_t);
int bha_inquire_config(bus_space_tag_t, bus_space_handle_t,
struct bha_probe_data *);
void bha_attach(struct bha_softc *);
int bha_info(struct bha_softc *);
int bha_intr(void *);
int bha_disable_isacompat __P((struct bha_softc *));
int bha_probe_inquiry __P((bus_space_tag_t, bus_space_handle_t,
struct bha_probe_data *));
int bha_disable_isacompat(struct bha_softc *);
int bha_probe_inquiry(bus_space_tag_t, bus_space_handle_t,
struct bha_probe_data *);
#endif /* _DEV_IC_BHAVAR_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cac.c,v 1.26 2003/12/05 10:23:00 pk Exp $ */
/* $NetBSD: cac.c,v 1.27 2004/08/24 00:53:29 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.26 2003/12/05 10:23:00 pk Exp $");
__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.27 2004/08/24 00:53:29 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -62,20 +62,20 @@ __KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.26 2003/12/05 10:23:00 pk Exp $");
#include <dev/ic/cacreg.h>
#include <dev/ic/cacvar.h>
struct cac_ccb *cac_ccb_alloc(struct cac_softc *, int);
void cac_ccb_done(struct cac_softc *, struct cac_ccb *);
void cac_ccb_free(struct cac_softc *, struct cac_ccb *);
int cac_ccb_poll(struct cac_softc *, struct cac_ccb *, int);
int cac_ccb_start(struct cac_softc *, struct cac_ccb *);
int cac_print(void *, const char *);
void cac_shutdown(void *);
int cac_submatch(struct device *, struct cfdata *, void *);
static struct cac_ccb *cac_ccb_alloc(struct cac_softc *, int);
static void cac_ccb_done(struct cac_softc *, struct cac_ccb *);
static void cac_ccb_free(struct cac_softc *, struct cac_ccb *);
static int cac_ccb_poll(struct cac_softc *, struct cac_ccb *, int);
static int cac_ccb_start(struct cac_softc *, struct cac_ccb *);
static int cac_print(void *, const char *);
static void cac_shutdown(void *);
static int cac_submatch(struct device *, struct cfdata *, void *);
struct cac_ccb *cac_l0_completed(struct cac_softc *);
int cac_l0_fifo_full(struct cac_softc *);
void cac_l0_intr_enable(struct cac_softc *, int);
int cac_l0_intr_pending(struct cac_softc *);
void cac_l0_submit(struct cac_softc *, struct cac_ccb *);
static struct cac_ccb *cac_l0_completed(struct cac_softc *);
static int cac_l0_fifo_full(struct cac_softc *);
static void cac_l0_intr_enable(struct cac_softc *, int);
static int cac_l0_intr_pending(struct cac_softc *);
static void cac_l0_submit(struct cac_softc *, struct cac_ccb *);
static void *cac_sdh; /* shutdown hook */
@ -193,7 +193,7 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
/*
* Shut down all `cac' controllers.
*/
void
static void
cac_shutdown(void *cookie)
{
extern struct cfdriver cac_cd;
@ -214,7 +214,7 @@ cac_shutdown(void *cookie)
/*
* Print autoconfiguration message for a sub-device.
*/
int
static int
cac_print(void *aux, const char *pnp)
{
struct cac_attach_args *caca;
@ -230,7 +230,7 @@ cac_print(void *aux, const char *pnp)
/*
* Match a sub-device.
*/
int
static int
cac_submatch(struct device *parent, struct cfdata *cf, void *aux)
{
struct cac_attach_args *caca;
@ -356,7 +356,7 @@ cac_cmd(struct cac_softc *sc, int command, void *data, int datasize,
/*
* Wait for the specified CCB to complete. Must be called at splbio.
*/
int
static int
cac_ccb_poll(struct cac_softc *sc, struct cac_ccb *wantccb, int timo)
{
struct cac_ccb *ccb;
@ -385,7 +385,7 @@ cac_ccb_poll(struct cac_softc *sc, struct cac_ccb *wantccb, int timo)
* Enqueue the specified command (if any) and attempt to start all enqueued
* commands. Must be called at splbio.
*/
int
static int
cac_ccb_start(struct cac_softc *sc, struct cac_ccb *ccb)
{
@ -408,7 +408,7 @@ cac_ccb_start(struct cac_softc *sc, struct cac_ccb *ccb)
/*
* Process a finished CCB.
*/
void
static void
cac_ccb_done(struct cac_softc *sc, struct cac_ccb *ccb)
{
struct device *dv;
@ -452,7 +452,7 @@ cac_ccb_done(struct cac_softc *sc, struct cac_ccb *ccb)
/*
* Allocate a CCB.
*/
struct cac_ccb *
static struct cac_ccb *
cac_ccb_alloc(struct cac_softc *sc, int nosleep)
{
struct cac_ccb *ccb;
@ -479,7 +479,7 @@ cac_ccb_alloc(struct cac_softc *sc, int nosleep)
/*
* Put a CCB onto the freelist.
*/
void
static void
cac_ccb_free(struct cac_softc *sc, struct cac_ccb *ccb)
{
int s;
@ -496,14 +496,14 @@ cac_ccb_free(struct cac_softc *sc, struct cac_ccb *ccb)
* Board specific linkage shared between multiple bus types.
*/
int
static int
cac_l0_fifo_full(struct cac_softc *sc)
{
return (cac_inl(sc, CAC_REG_CMD_FIFO) == 0);
}
void
static void
cac_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
{
@ -512,7 +512,7 @@ cac_l0_submit(struct cac_softc *sc, struct cac_ccb *ccb)
cac_outl(sc, CAC_REG_CMD_FIFO, ccb->ccb_paddr);
}
struct cac_ccb *
static struct cac_ccb *
cac_l0_completed(struct cac_softc *sc)
{
struct cac_ccb *ccb;
@ -534,14 +534,14 @@ cac_l0_completed(struct cac_softc *sc)
return (ccb);
}
int
static int
cac_l0_intr_pending(struct cac_softc *sc)
{
return (cac_inl(sc, CAC_REG_INTR_PENDING) & CAC_INTR_ENABLE);
}
void
static void
cac_l0_intr_enable(struct cac_softc *sc, int state)
{