Use ANSI function decls and make use of static.
This commit is contained in:
parent
6b027bd148
commit
d17a849385
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_pcn.c,v 1.22 2003/10/25 18:31:11 christos Exp $ */
|
||||
/* $NetBSD: if_pcn.c,v 1.23 2004/08/21 22:48:18 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Wasabi Systems, Inc.
|
||||
@ -67,7 +67,7 @@
|
||||
#include "opt_pcn.h"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.22 2003/10/25 18:31:11 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.23 2004/08/21 22:48:18 thorpej Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
#include "rnd.h"
|
||||
@ -188,14 +188,14 @@ struct pcn_rxsoft {
|
||||
/*
|
||||
* Description of Rx FIFO watermarks for various revisions.
|
||||
*/
|
||||
const char * const pcn_79c970_rcvfw[] = {
|
||||
static const char * const pcn_79c970_rcvfw[] = {
|
||||
"16 bytes",
|
||||
"64 bytes",
|
||||
"128 bytes",
|
||||
NULL,
|
||||
};
|
||||
|
||||
const char * const pcn_79c971_rcvfw[] = {
|
||||
static const char * const pcn_79c971_rcvfw[] = {
|
||||
"16 bytes",
|
||||
"64 bytes",
|
||||
"112 bytes",
|
||||
@ -205,21 +205,21 @@ const char * const pcn_79c971_rcvfw[] = {
|
||||
/*
|
||||
* Description of Tx start points for various revisions.
|
||||
*/
|
||||
const char * const pcn_79c970_xmtsp[] = {
|
||||
static const char * const pcn_79c970_xmtsp[] = {
|
||||
"8 bytes",
|
||||
"64 bytes",
|
||||
"128 bytes",
|
||||
"248 bytes",
|
||||
};
|
||||
|
||||
const char * const pcn_79c971_xmtsp[] = {
|
||||
static const char * const pcn_79c971_xmtsp[] = {
|
||||
"20 bytes",
|
||||
"64 bytes",
|
||||
"128 bytes",
|
||||
"248 bytes",
|
||||
};
|
||||
|
||||
const char * const pcn_79c971_xmtsp_sram[] = {
|
||||
static const char * const pcn_79c971_xmtsp_sram[] = {
|
||||
"44 bytes",
|
||||
"64 bytes",
|
||||
"128 bytes",
|
||||
@ -229,14 +229,14 @@ const char * const pcn_79c971_xmtsp_sram[] = {
|
||||
/*
|
||||
* Description of Tx FIFO watermarks for various revisions.
|
||||
*/
|
||||
const char * const pcn_79c970_xmtfw[] = {
|
||||
static const char * const pcn_79c970_xmtfw[] = {
|
||||
"16 bytes",
|
||||
"64 bytes",
|
||||
"128 bytes",
|
||||
NULL,
|
||||
};
|
||||
|
||||
const char * const pcn_79c971_xmtfw[] = {
|
||||
static const char * const pcn_79c971_xmtfw[] = {
|
||||
"16 bytes",
|
||||
"64 bytes",
|
||||
"108 bytes",
|
||||
@ -394,44 +394,44 @@ do { \
|
||||
PCN_CDRXSYNC((sc), (x), BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);\
|
||||
} while(/*CONSTCOND*/0)
|
||||
|
||||
void pcn_start(struct ifnet *);
|
||||
void pcn_watchdog(struct ifnet *);
|
||||
int pcn_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
int pcn_init(struct ifnet *);
|
||||
void pcn_stop(struct ifnet *, int);
|
||||
static void pcn_start(struct ifnet *);
|
||||
static void pcn_watchdog(struct ifnet *);
|
||||
static int pcn_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int pcn_init(struct ifnet *);
|
||||
static void pcn_stop(struct ifnet *, int);
|
||||
|
||||
void pcn_shutdown(void *);
|
||||
static void pcn_shutdown(void *);
|
||||
|
||||
void pcn_reset(struct pcn_softc *);
|
||||
void pcn_rxdrain(struct pcn_softc *);
|
||||
int pcn_add_rxbuf(struct pcn_softc *, int);
|
||||
void pcn_tick(void *);
|
||||
static void pcn_reset(struct pcn_softc *);
|
||||
static void pcn_rxdrain(struct pcn_softc *);
|
||||
static int pcn_add_rxbuf(struct pcn_softc *, int);
|
||||
static void pcn_tick(void *);
|
||||
|
||||
void pcn_spnd(struct pcn_softc *);
|
||||
static void pcn_spnd(struct pcn_softc *);
|
||||
|
||||
void pcn_set_filter(struct pcn_softc *);
|
||||
static void pcn_set_filter(struct pcn_softc *);
|
||||
|
||||
int pcn_intr(void *);
|
||||
void pcn_txintr(struct pcn_softc *);
|
||||
int pcn_rxintr(struct pcn_softc *);
|
||||
static int pcn_intr(void *);
|
||||
static void pcn_txintr(struct pcn_softc *);
|
||||
static int pcn_rxintr(struct pcn_softc *);
|
||||
|
||||
int pcn_mii_readreg(struct device *, int, int);
|
||||
void pcn_mii_writereg(struct device *, int, int, int);
|
||||
void pcn_mii_statchg(struct device *);
|
||||
static int pcn_mii_readreg(struct device *, int, int);
|
||||
static void pcn_mii_writereg(struct device *, int, int, int);
|
||||
static void pcn_mii_statchg(struct device *);
|
||||
|
||||
void pcn_79c970_mediainit(struct pcn_softc *);
|
||||
int pcn_79c970_mediachange(struct ifnet *);
|
||||
void pcn_79c970_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
static void pcn_79c970_mediainit(struct pcn_softc *);
|
||||
static int pcn_79c970_mediachange(struct ifnet *);
|
||||
static void pcn_79c970_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
void pcn_79c971_mediainit(struct pcn_softc *);
|
||||
int pcn_79c971_mediachange(struct ifnet *);
|
||||
void pcn_79c971_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
static void pcn_79c971_mediainit(struct pcn_softc *);
|
||||
static int pcn_79c971_mediachange(struct ifnet *);
|
||||
static void pcn_79c971_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
/*
|
||||
* Description of a PCnet-PCI variant. Used to select media access
|
||||
* method, mostly, and to print a nice description of the chip.
|
||||
*/
|
||||
const struct pcn_variant {
|
||||
static const struct pcn_variant {
|
||||
const char *pcv_desc;
|
||||
void (*pcv_mediainit)(struct pcn_softc *);
|
||||
uint16_t pcv_chipid;
|
||||
@ -467,8 +467,8 @@ const struct pcn_variant {
|
||||
|
||||
int pcn_copy_small = 0;
|
||||
|
||||
int pcn_match(struct device *, struct cfdata *, void *);
|
||||
void pcn_attach(struct device *, struct device *, void *);
|
||||
static int pcn_match(struct device *, struct cfdata *, void *);
|
||||
static void pcn_attach(struct device *, struct device *, void *);
|
||||
|
||||
CFATTACH_DECL(pcn, sizeof(struct pcn_softc),
|
||||
pcn_match, pcn_attach, NULL, NULL);
|
||||
@ -526,7 +526,7 @@ pcn_lookup_variant(uint16_t chipid)
|
||||
return (pcv);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
pcn_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = aux;
|
||||
@ -543,7 +543,7 @@ pcn_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
pcn_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct pcn_softc *sc = (struct pcn_softc *) self;
|
||||
@ -870,7 +870,7 @@ pcn_attach(struct device *parent, struct device *self, void *aux)
|
||||
*
|
||||
* Make sure the interface is stopped at reboot time.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_shutdown(void *arg)
|
||||
{
|
||||
struct pcn_softc *sc = arg;
|
||||
@ -883,7 +883,7 @@ pcn_shutdown(void *arg)
|
||||
*
|
||||
* Start packet transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_start(struct ifnet *ifp)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -1120,7 +1120,7 @@ pcn_start(struct ifnet *ifp)
|
||||
*
|
||||
* Watchdog timer handler.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_watchdog(struct ifnet *ifp)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -1149,7 +1149,7 @@ pcn_watchdog(struct ifnet *ifp)
|
||||
*
|
||||
* Handle control requests from the operator.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -1188,7 +1188,7 @@ pcn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
*
|
||||
* Interrupt service routine.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_intr(void *arg)
|
||||
{
|
||||
struct pcn_softc *sc = arg;
|
||||
@ -1272,7 +1272,7 @@ pcn_intr(void *arg)
|
||||
*
|
||||
* Suspend the chip.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_spnd(struct pcn_softc *sc)
|
||||
{
|
||||
int i;
|
||||
@ -1294,7 +1294,7 @@ pcn_spnd(struct pcn_softc *sc)
|
||||
*
|
||||
* Helper; handle transmit interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_txintr(struct pcn_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1398,7 +1398,7 @@ pcn_txintr(struct pcn_softc *sc)
|
||||
*
|
||||
* Helper; handle receive interrupts.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_rxintr(struct pcn_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1540,7 +1540,7 @@ pcn_rxintr(struct pcn_softc *sc)
|
||||
*
|
||||
* One second timer, used to tick the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_tick(void *arg)
|
||||
{
|
||||
struct pcn_softc *sc = arg;
|
||||
@ -1558,7 +1558,7 @@ pcn_tick(void *arg)
|
||||
*
|
||||
* Perform a soft reset on the PCnet-PCI.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_reset(struct pcn_softc *sc)
|
||||
{
|
||||
|
||||
@ -1591,7 +1591,7 @@ pcn_reset(struct pcn_softc *sc)
|
||||
*
|
||||
* Initialize the interface. Must be called at splnet().
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_init(struct ifnet *ifp)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -1810,7 +1810,7 @@ pcn_init(struct ifnet *ifp)
|
||||
*
|
||||
* Drain the receive queue.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_rxdrain(struct pcn_softc *sc)
|
||||
{
|
||||
struct pcn_rxsoft *rxs;
|
||||
@ -1831,7 +1831,7 @@ pcn_rxdrain(struct pcn_softc *sc)
|
||||
*
|
||||
* Stop transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -1872,7 +1872,7 @@ pcn_stop(struct ifnet *ifp, int disable)
|
||||
*
|
||||
* Add a receive buffer to the indicated descriptor.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_add_rxbuf(struct pcn_softc *sc, int idx)
|
||||
{
|
||||
struct pcn_rxsoft *rxs = &sc->sc_rxsoft[idx];
|
||||
@ -1916,7 +1916,7 @@ pcn_add_rxbuf(struct pcn_softc *sc, int idx)
|
||||
*
|
||||
* Set up the receive filter.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_set_filter(struct pcn_softc *sc)
|
||||
{
|
||||
struct ethercom *ec = &sc->sc_ethercom;
|
||||
@ -1983,7 +1983,7 @@ pcn_set_filter(struct pcn_softc *sc)
|
||||
*
|
||||
* Initialize media for the Am79c970.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_79c970_mediainit(struct pcn_softc *sc)
|
||||
{
|
||||
const char *sep = "";
|
||||
@ -2018,7 +2018,7 @@ do { \
|
||||
*
|
||||
* Get the current interface media status (Am79c970 version).
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_79c970_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -2036,7 +2036,7 @@ pcn_79c970_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
*
|
||||
* Set hardware to newly-selected media (Am79c970 version).
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_79c970_mediachange(struct ifnet *ifp)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -2079,7 +2079,7 @@ pcn_79c970_mediachange(struct ifnet *ifp)
|
||||
*
|
||||
* Initialize media for the Am79c971.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_79c971_mediainit(struct pcn_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -2119,7 +2119,7 @@ pcn_79c971_mediainit(struct pcn_softc *sc)
|
||||
*
|
||||
* Get the current interface media status (Am79c971 version).
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_79c971_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -2134,7 +2134,7 @@ pcn_79c971_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
*
|
||||
* Set hardware to newly-selected media (Am79c971 version).
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_79c971_mediachange(struct ifnet *ifp)
|
||||
{
|
||||
struct pcn_softc *sc = ifp->if_softc;
|
||||
@ -2149,7 +2149,7 @@ pcn_79c971_mediachange(struct ifnet *ifp)
|
||||
*
|
||||
* Read a PHY register on the MII.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
pcn_mii_readreg(struct device *self, int phy, int reg)
|
||||
{
|
||||
struct pcn_softc *sc = (void *) self;
|
||||
@ -2174,7 +2174,7 @@ pcn_mii_readreg(struct device *self, int phy, int reg)
|
||||
*
|
||||
* Write a PHY register on the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
struct pcn_softc *sc = (void *) self;
|
||||
@ -2188,7 +2188,7 @@ pcn_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
*
|
||||
* Callback from MII layer when media changes.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
pcn_mii_statchg(struct device *self)
|
||||
{
|
||||
struct pcn_softc *sc = (void *) self;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_sip.c,v 1.94 2004/05/15 22:33:13 thorpej Exp $ */
|
||||
/* $NetBSD: if_sip.c,v 1.95 2004/08/21 22:48:18 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
|
||||
@ -80,7 +80,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.94 2004/05/15 22:33:13 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.95 2004/08/21 22:48:18 thorpej Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
#include "rnd.h"
|
||||
@ -410,59 +410,60 @@ do { \
|
||||
|
||||
#define SIP_TIMEOUT 1000
|
||||
|
||||
void SIP_DECL(start)(struct ifnet *);
|
||||
void SIP_DECL(watchdog)(struct ifnet *);
|
||||
int SIP_DECL(ioctl)(struct ifnet *, u_long, caddr_t);
|
||||
int SIP_DECL(init)(struct ifnet *);
|
||||
void SIP_DECL(stop)(struct ifnet *, int);
|
||||
static void SIP_DECL(start)(struct ifnet *);
|
||||
static void SIP_DECL(watchdog)(struct ifnet *);
|
||||
static int SIP_DECL(ioctl)(struct ifnet *, u_long, caddr_t);
|
||||
static int SIP_DECL(init)(struct ifnet *);
|
||||
static void SIP_DECL(stop)(struct ifnet *, int);
|
||||
|
||||
void SIP_DECL(shutdown)(void *);
|
||||
static void SIP_DECL(shutdown)(void *);
|
||||
|
||||
void SIP_DECL(reset)(struct sip_softc *);
|
||||
void SIP_DECL(rxdrain)(struct sip_softc *);
|
||||
int SIP_DECL(add_rxbuf)(struct sip_softc *, int);
|
||||
void SIP_DECL(read_eeprom)(struct sip_softc *, int, int, u_int16_t *);
|
||||
void SIP_DECL(tick)(void *);
|
||||
static void SIP_DECL(reset)(struct sip_softc *);
|
||||
static void SIP_DECL(rxdrain)(struct sip_softc *);
|
||||
static int SIP_DECL(add_rxbuf)(struct sip_softc *, int);
|
||||
static void SIP_DECL(read_eeprom)(struct sip_softc *, int, int,
|
||||
u_int16_t *);
|
||||
static void SIP_DECL(tick)(void *);
|
||||
|
||||
#if !defined(DP83820)
|
||||
void SIP_DECL(sis900_set_filter)(struct sip_softc *);
|
||||
static void SIP_DECL(sis900_set_filter)(struct sip_softc *);
|
||||
#endif /* ! DP83820 */
|
||||
void SIP_DECL(dp83815_set_filter)(struct sip_softc *);
|
||||
static void SIP_DECL(dp83815_set_filter)(struct sip_softc *);
|
||||
|
||||
#if defined(DP83820)
|
||||
void SIP_DECL(dp83820_read_macaddr)(struct sip_softc *,
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
static void SIP_DECL(dp83820_read_macaddr)(struct sip_softc *,
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
#else
|
||||
static void SIP_DECL(sis900_eeprom_delay)(struct sip_softc *sc);
|
||||
void SIP_DECL(sis900_read_macaddr)(struct sip_softc *,
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
void SIP_DECL(dp83815_read_macaddr)(struct sip_softc *,
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
static void SIP_DECL(sis900_read_macaddr)(struct sip_softc *,
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
static void SIP_DECL(dp83815_read_macaddr)(struct sip_softc *,
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
#endif /* DP83820 */
|
||||
|
||||
int SIP_DECL(intr)(void *);
|
||||
void SIP_DECL(txintr)(struct sip_softc *);
|
||||
void SIP_DECL(rxintr)(struct sip_softc *);
|
||||
static int SIP_DECL(intr)(void *);
|
||||
static void SIP_DECL(txintr)(struct sip_softc *);
|
||||
static void SIP_DECL(rxintr)(struct sip_softc *);
|
||||
|
||||
#if defined(DP83820)
|
||||
int SIP_DECL(dp83820_mii_readreg)(struct device *, int, int);
|
||||
void SIP_DECL(dp83820_mii_writereg)(struct device *, int, int, int);
|
||||
void SIP_DECL(dp83820_mii_statchg)(struct device *);
|
||||
static int SIP_DECL(dp83820_mii_readreg)(struct device *, int, int);
|
||||
static void SIP_DECL(dp83820_mii_writereg)(struct device *, int, int, int);
|
||||
static void SIP_DECL(dp83820_mii_statchg)(struct device *);
|
||||
#else
|
||||
int SIP_DECL(sis900_mii_readreg)(struct device *, int, int);
|
||||
void SIP_DECL(sis900_mii_writereg)(struct device *, int, int, int);
|
||||
void SIP_DECL(sis900_mii_statchg)(struct device *);
|
||||
static int SIP_DECL(sis900_mii_readreg)(struct device *, int, int);
|
||||
static void SIP_DECL(sis900_mii_writereg)(struct device *, int, int, int);
|
||||
static void SIP_DECL(sis900_mii_statchg)(struct device *);
|
||||
|
||||
int SIP_DECL(dp83815_mii_readreg)(struct device *, int, int);
|
||||
void SIP_DECL(dp83815_mii_writereg)(struct device *, int, int, int);
|
||||
void SIP_DECL(dp83815_mii_statchg)(struct device *);
|
||||
static int SIP_DECL(dp83815_mii_readreg)(struct device *, int, int);
|
||||
static void SIP_DECL(dp83815_mii_writereg)(struct device *, int, int, int);
|
||||
static void SIP_DECL(dp83815_mii_statchg)(struct device *);
|
||||
#endif /* DP83820 */
|
||||
|
||||
int SIP_DECL(mediachange)(struct ifnet *);
|
||||
void SIP_DECL(mediastatus)(struct ifnet *, struct ifmediareq *);
|
||||
static int SIP_DECL(mediachange)(struct ifnet *);
|
||||
static void SIP_DECL(mediastatus)(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
int SIP_DECL(match)(struct device *, struct cfdata *, void *);
|
||||
void SIP_DECL(attach)(struct device *, struct device *, void *);
|
||||
static int SIP_DECL(match)(struct device *, struct cfdata *, void *);
|
||||
static void SIP_DECL(attach)(struct device *, struct device *, void *);
|
||||
|
||||
int SIP_DECL(copy_small) = 0;
|
||||
|
||||
@ -486,10 +487,10 @@ struct sip_variant {
|
||||
const struct pci_attach_args *, u_int8_t *);
|
||||
};
|
||||
|
||||
u_int32_t SIP_DECL(mii_bitbang_read)(struct device *);
|
||||
void SIP_DECL(mii_bitbang_write)(struct device *, u_int32_t);
|
||||
static u_int32_t SIP_DECL(mii_bitbang_read)(struct device *);
|
||||
static void SIP_DECL(mii_bitbang_write)(struct device *, u_int32_t);
|
||||
|
||||
const struct mii_bitbang_ops SIP_DECL(mii_bitbang_ops) = {
|
||||
static const struct mii_bitbang_ops SIP_DECL(mii_bitbang_ops) = {
|
||||
SIP_DECL(mii_bitbang_read),
|
||||
SIP_DECL(mii_bitbang_write),
|
||||
{
|
||||
@ -502,7 +503,7 @@ const struct mii_bitbang_ops SIP_DECL(mii_bitbang_ops) = {
|
||||
};
|
||||
|
||||
#if defined(DP83820)
|
||||
const struct sip_variant SIP_DECL(variant_dp83820) = {
|
||||
static const struct sip_variant SIP_DECL(variant_dp83820) = {
|
||||
SIP_DECL(dp83820_mii_readreg),
|
||||
SIP_DECL(dp83820_mii_writereg),
|
||||
SIP_DECL(dp83820_mii_statchg),
|
||||
@ -510,7 +511,7 @@ const struct sip_variant SIP_DECL(variant_dp83820) = {
|
||||
SIP_DECL(dp83820_read_macaddr),
|
||||
};
|
||||
#else
|
||||
const struct sip_variant SIP_DECL(variant_sis900) = {
|
||||
static const struct sip_variant SIP_DECL(variant_sis900) = {
|
||||
SIP_DECL(sis900_mii_readreg),
|
||||
SIP_DECL(sis900_mii_writereg),
|
||||
SIP_DECL(sis900_mii_statchg),
|
||||
@ -518,7 +519,7 @@ const struct sip_variant SIP_DECL(variant_sis900) = {
|
||||
SIP_DECL(sis900_read_macaddr),
|
||||
};
|
||||
|
||||
const struct sip_variant SIP_DECL(variant_dp83815) = {
|
||||
static const struct sip_variant SIP_DECL(variant_dp83815) = {
|
||||
SIP_DECL(dp83815_mii_readreg),
|
||||
SIP_DECL(dp83815_mii_writereg),
|
||||
SIP_DECL(dp83815_mii_statchg),
|
||||
@ -530,7 +531,7 @@ const struct sip_variant SIP_DECL(variant_dp83815) = {
|
||||
/*
|
||||
* Devices supported by this driver.
|
||||
*/
|
||||
const struct sip_product {
|
||||
static const struct sip_product {
|
||||
pci_vendor_id_t sip_vendor;
|
||||
pci_product_id_t sip_product;
|
||||
const char *sip_name;
|
||||
@ -623,7 +624,7 @@ SIP_DECL(check_64bit)(const struct pci_attach_args *pa)
|
||||
}
|
||||
#endif /* DP83820 */
|
||||
|
||||
int
|
||||
static int
|
||||
SIP_DECL(match)(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = aux;
|
||||
@ -634,7 +635,7 @@ SIP_DECL(match)(struct device *parent, struct cfdata *cf, void *aux)
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SIP_DECL(attach)(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -1133,7 +1134,7 @@ SIP_DECL(attach)(struct device *parent, struct device *self, void *aux)
|
||||
*
|
||||
* Make sure the interface is stopped at reboot time.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(shutdown)(void *arg)
|
||||
{
|
||||
struct sip_softc *sc = arg;
|
||||
@ -1146,7 +1147,7 @@ SIP_DECL(shutdown)(void *arg)
|
||||
*
|
||||
* Start packet transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(start)(struct ifnet *ifp)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
@ -1470,7 +1471,7 @@ SIP_DECL(start)(struct ifnet *ifp)
|
||||
*
|
||||
* Watchdog timer handler.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(watchdog)(struct ifnet *ifp)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
@ -1502,7 +1503,7 @@ SIP_DECL(watchdog)(struct ifnet *ifp)
|
||||
*
|
||||
* Handle control requests from the operator.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(ioctl)(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
@ -1576,7 +1577,7 @@ SIP_DECL(ioctl)(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
*
|
||||
* Interrupt service routine.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(intr)(void *arg)
|
||||
{
|
||||
struct sip_softc *sc = arg;
|
||||
@ -1717,7 +1718,7 @@ SIP_DECL(intr)(void *arg)
|
||||
*
|
||||
* Helper; handle transmit interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(txintr)(struct sip_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1792,7 +1793,7 @@ SIP_DECL(txintr)(struct sip_softc *sc)
|
||||
*
|
||||
* Helper; handle receive interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(rxintr)(struct sip_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -2021,7 +2022,7 @@ SIP_DECL(rxintr)(struct sip_softc *sc)
|
||||
*
|
||||
* Helper; handle receive interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(rxintr)(struct sip_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -2191,7 +2192,7 @@ SIP_DECL(rxintr)(struct sip_softc *sc)
|
||||
*
|
||||
* One second timer, used to tick the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(tick)(void *arg)
|
||||
{
|
||||
struct sip_softc *sc = arg;
|
||||
@ -2221,7 +2222,7 @@ SIP_DECL(tick)(void *arg)
|
||||
*
|
||||
* Perform a soft reset on the SiS 900.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(reset)(struct sip_softc *sc)
|
||||
{
|
||||
bus_space_tag_t st = sc->sc_st;
|
||||
@ -2259,7 +2260,7 @@ SIP_DECL(reset)(struct sip_softc *sc)
|
||||
*
|
||||
* Initialize the interface. Must be called at splnet().
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(init)(struct ifnet *ifp)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
@ -2559,7 +2560,7 @@ SIP_DECL(init)(struct ifnet *ifp)
|
||||
*
|
||||
* Drain the receive queue.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(rxdrain)(struct sip_softc *sc)
|
||||
{
|
||||
struct sip_rxsoft *rxs;
|
||||
@ -2580,7 +2581,7 @@ SIP_DECL(rxdrain)(struct sip_softc *sc)
|
||||
*
|
||||
* Stop transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(stop)(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
@ -2653,7 +2654,7 @@ SIP_DECL(stop)(struct ifnet *ifp, int disable)
|
||||
*
|
||||
* Read data from the serial EEPROM.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(read_eeprom)(struct sip_softc *sc, int word, int wordcnt,
|
||||
u_int16_t *data)
|
||||
{
|
||||
@ -2719,7 +2720,7 @@ SIP_DECL(read_eeprom)(struct sip_softc *sc, int word, int wordcnt,
|
||||
*
|
||||
* Add a receive buffer to the indicated descriptor.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(add_rxbuf)(struct sip_softc *sc, int idx)
|
||||
{
|
||||
struct sip_rxsoft *rxs = &sc->sc_rxsoft[idx];
|
||||
@ -2768,7 +2769,7 @@ SIP_DECL(add_rxbuf)(struct sip_softc *sc, int idx)
|
||||
*
|
||||
* Set up the receive filter.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(sis900_set_filter)(struct sip_softc *sc)
|
||||
{
|
||||
bus_space_tag_t st = sc->sc_st;
|
||||
@ -2914,7 +2915,7 @@ SIP_DECL(sis900_set_filter)(struct sip_softc *sc)
|
||||
*
|
||||
* Set up the receive filter.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83815_set_filter)(struct sip_softc *sc)
|
||||
{
|
||||
bus_space_tag_t st = sc->sc_st;
|
||||
@ -3052,7 +3053,7 @@ SIP_DECL(dp83815_set_filter)(struct sip_softc *sc)
|
||||
*
|
||||
* Read a PHY register on the MII of the DP83820.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(dp83820_mii_readreg)(struct device *self, int phy, int reg)
|
||||
{
|
||||
struct sip_softc *sc = (void *) self;
|
||||
@ -3117,7 +3118,7 @@ SIP_DECL(dp83820_mii_readreg)(struct device *self, int phy, int reg)
|
||||
*
|
||||
* Write a PHY register on the MII of the DP83820.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83820_mii_writereg)(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
struct sip_softc *sc = (void *) self;
|
||||
@ -3149,7 +3150,7 @@ SIP_DECL(dp83820_mii_writereg)(struct device *self, int phy, int reg, int val)
|
||||
*
|
||||
* Callback from MII layer when media changes.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83820_mii_statchg)(struct device *self)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3213,7 +3214,7 @@ SIP_DECL(dp83820_mii_statchg)(struct device *self)
|
||||
*
|
||||
* Read the MII serial port for the MII bit-bang module.
|
||||
*/
|
||||
u_int32_t
|
||||
static u_int32_t
|
||||
SIP_DECL(mii_bitbang_read)(struct device *self)
|
||||
{
|
||||
struct sip_softc *sc = (void *) self;
|
||||
@ -3226,7 +3227,7 @@ SIP_DECL(mii_bitbang_read)(struct device *self)
|
||||
*
|
||||
* Write the MII serial port for the MII bit-bang module.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(mii_bitbang_write)(struct device *self, u_int32_t val)
|
||||
{
|
||||
struct sip_softc *sc = (void *) self;
|
||||
@ -3240,7 +3241,7 @@ SIP_DECL(mii_bitbang_write)(struct device *self, u_int32_t val)
|
||||
*
|
||||
* Read a PHY register on the MII.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(sis900_mii_readreg)(struct device *self, int phy, int reg)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3277,7 +3278,7 @@ SIP_DECL(sis900_mii_readreg)(struct device *self, int phy, int reg)
|
||||
*
|
||||
* Write a PHY register on the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(sis900_mii_writereg)(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3311,7 +3312,7 @@ SIP_DECL(sis900_mii_writereg)(struct device *self, int phy, int reg, int val)
|
||||
*
|
||||
* Callback from MII layer when media changes.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(sis900_mii_statchg)(struct device *self)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3366,7 +3367,7 @@ SIP_DECL(sis900_mii_statchg)(struct device *self)
|
||||
*
|
||||
* Read a PHY register on the MII.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(dp83815_mii_readreg)(struct device *self, int phy, int reg)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3401,7 +3402,7 @@ SIP_DECL(dp83815_mii_readreg)(struct device *self, int phy, int reg)
|
||||
*
|
||||
* Write a PHY register to the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83815_mii_writereg)(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3421,7 +3422,7 @@ SIP_DECL(dp83815_mii_writereg)(struct device *self, int phy, int reg, int val)
|
||||
*
|
||||
* Callback from MII layer when media changes.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83815_mii_statchg)(struct device *self)
|
||||
{
|
||||
struct sip_softc *sc = (struct sip_softc *) self;
|
||||
@ -3481,7 +3482,7 @@ SIP_DECL(dp83815_mii_statchg)(struct device *self)
|
||||
#endif /* DP83820 */
|
||||
|
||||
#if defined(DP83820)
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83820_read_macaddr)(struct sip_softc *sc,
|
||||
const struct pci_attach_args *pa, u_int8_t *enaddr)
|
||||
{
|
||||
@ -3530,7 +3531,7 @@ SIP_DECL(sis900_eeprom_delay)(struct sip_softc *sc)
|
||||
bus_space_read_4(sc->sc_st, sc->sc_sh, SIP_CR);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SIP_DECL(sis900_read_macaddr)(struct sip_softc *sc,
|
||||
const struct pci_attach_args *pa, u_int8_t *enaddr)
|
||||
{
|
||||
@ -3635,7 +3636,7 @@ SIP_DECL(sis900_read_macaddr)(struct sip_softc *sc,
|
||||
static const u_int8_t bbr4[] = {0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15};
|
||||
#define bbr(v) ((bbr4[(v)&0xf] << 4) | bbr4[((v)>>4) & 0xf])
|
||||
|
||||
void
|
||||
static void
|
||||
SIP_DECL(dp83815_read_macaddr)(struct sip_softc *sc,
|
||||
const struct pci_attach_args *pa, u_int8_t *enaddr)
|
||||
{
|
||||
@ -3695,7 +3696,7 @@ SIP_DECL(dp83815_read_macaddr)(struct sip_softc *sc,
|
||||
*
|
||||
* Get the current interface media status.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
SIP_DECL(mediastatus)(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
@ -3711,7 +3712,7 @@ SIP_DECL(mediastatus)(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
*
|
||||
* Set hardware to newly-selected media.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SIP_DECL(mediachange)(struct ifnet *ifp)
|
||||
{
|
||||
struct sip_softc *sc = ifp->if_softc;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_ste.c,v 1.18 2004/07/08 18:27:14 mycroft Exp $ */
|
||||
/* $NetBSD: if_ste.c,v 1.19 2004/08/21 22:48:18 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.18 2004/07/08 18:27:14 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ste.c,v 1.19 2004/08/21 22:48:18 thorpej Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
||||
@ -204,49 +204,49 @@ do { \
|
||||
|
||||
#define STE_TIMEOUT 1000
|
||||
|
||||
void ste_start(struct ifnet *);
|
||||
void ste_watchdog(struct ifnet *);
|
||||
int ste_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
int ste_init(struct ifnet *);
|
||||
void ste_stop(struct ifnet *, int);
|
||||
static void ste_start(struct ifnet *);
|
||||
static void ste_watchdog(struct ifnet *);
|
||||
static int ste_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int ste_init(struct ifnet *);
|
||||
static void ste_stop(struct ifnet *, int);
|
||||
|
||||
void ste_shutdown(void *);
|
||||
static void ste_shutdown(void *);
|
||||
|
||||
void ste_reset(struct ste_softc *, u_int32_t);
|
||||
void ste_setthresh(struct ste_softc *);
|
||||
void ste_txrestart(struct ste_softc *, u_int8_t);
|
||||
void ste_rxdrain(struct ste_softc *);
|
||||
int ste_add_rxbuf(struct ste_softc *, int);
|
||||
void ste_read_eeprom(struct ste_softc *, int, uint16_t *);
|
||||
void ste_tick(void *);
|
||||
static void ste_reset(struct ste_softc *, u_int32_t);
|
||||
static void ste_setthresh(struct ste_softc *);
|
||||
static void ste_txrestart(struct ste_softc *, u_int8_t);
|
||||
static void ste_rxdrain(struct ste_softc *);
|
||||
static int ste_add_rxbuf(struct ste_softc *, int);
|
||||
static void ste_read_eeprom(struct ste_softc *, int, uint16_t *);
|
||||
static void ste_tick(void *);
|
||||
|
||||
void ste_stats_update(struct ste_softc *);
|
||||
static void ste_stats_update(struct ste_softc *);
|
||||
|
||||
void ste_set_filter(struct ste_softc *);
|
||||
static void ste_set_filter(struct ste_softc *);
|
||||
|
||||
int ste_intr(void *);
|
||||
void ste_txintr(struct ste_softc *);
|
||||
void ste_rxintr(struct ste_softc *);
|
||||
static int ste_intr(void *);
|
||||
static void ste_txintr(struct ste_softc *);
|
||||
static void ste_rxintr(struct ste_softc *);
|
||||
|
||||
int ste_mii_readreg(struct device *, int, int);
|
||||
void ste_mii_writereg(struct device *, int, int, int);
|
||||
void ste_mii_statchg(struct device *);
|
||||
static int ste_mii_readreg(struct device *, int, int);
|
||||
static void ste_mii_writereg(struct device *, int, int, int);
|
||||
static void ste_mii_statchg(struct device *);
|
||||
|
||||
int ste_mediachange(struct ifnet *);
|
||||
void ste_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
static int ste_mediachange(struct ifnet *);
|
||||
static void ste_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
int ste_match(struct device *, struct cfdata *, void *);
|
||||
void ste_attach(struct device *, struct device *, void *);
|
||||
static int ste_match(struct device *, struct cfdata *, void *);
|
||||
static void ste_attach(struct device *, struct device *, void *);
|
||||
|
||||
int ste_copy_small = 0;
|
||||
|
||||
CFATTACH_DECL(ste, sizeof(struct ste_softc),
|
||||
ste_match, ste_attach, NULL, NULL);
|
||||
|
||||
uint32_t ste_mii_bitbang_read(struct device *);
|
||||
void ste_mii_bitbang_write(struct device *, uint32_t);
|
||||
static uint32_t ste_mii_bitbang_read(struct device *);
|
||||
static void ste_mii_bitbang_write(struct device *, uint32_t);
|
||||
|
||||
const struct mii_bitbang_ops ste_mii_bitbang_ops = {
|
||||
static const struct mii_bitbang_ops ste_mii_bitbang_ops = {
|
||||
ste_mii_bitbang_read,
|
||||
ste_mii_bitbang_write,
|
||||
{
|
||||
@ -261,7 +261,7 @@ const struct mii_bitbang_ops ste_mii_bitbang_ops = {
|
||||
/*
|
||||
* Devices supported by this driver.
|
||||
*/
|
||||
const struct ste_product {
|
||||
static const struct ste_product {
|
||||
pci_vendor_id_t ste_vendor;
|
||||
pci_product_id_t ste_product;
|
||||
const char *ste_name;
|
||||
@ -289,7 +289,7 @@ ste_lookup(const struct pci_attach_args *pa)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ste_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = aux;
|
||||
@ -300,7 +300,7 @@ ste_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
ste_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct ste_softc *sc = (struct ste_softc *) self;
|
||||
@ -572,7 +572,7 @@ ste_attach(struct device *parent, struct device *self, void *aux)
|
||||
*
|
||||
* Make sure the interface is stopped at reboot time.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_shutdown(void *arg)
|
||||
{
|
||||
struct ste_softc *sc = arg;
|
||||
@ -601,7 +601,7 @@ ste_dmahalt_wait(struct ste_softc *sc)
|
||||
*
|
||||
* Start packet transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_start(struct ifnet *ifp)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
@ -791,7 +791,7 @@ ste_start(struct ifnet *ifp)
|
||||
*
|
||||
* Watchdog timer handler.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_watchdog(struct ifnet *ifp)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
@ -810,7 +810,7 @@ ste_watchdog(struct ifnet *ifp)
|
||||
*
|
||||
* Handle control requests from the operator.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
ste_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
@ -850,7 +850,7 @@ ste_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
*
|
||||
* Interrupt service routine.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
ste_intr(void *arg)
|
||||
{
|
||||
struct ste_softc *sc = arg;
|
||||
@ -949,7 +949,7 @@ ste_intr(void *arg)
|
||||
*
|
||||
* Helper; handle transmit interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_txintr(struct ste_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -997,7 +997,7 @@ ste_txintr(struct ste_softc *sc)
|
||||
*
|
||||
* Helper; handle receive interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_rxintr(struct ste_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1097,7 +1097,7 @@ ste_rxintr(struct ste_softc *sc)
|
||||
*
|
||||
* One second timer, used to tick the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_tick(void *arg)
|
||||
{
|
||||
struct ste_softc *sc = arg;
|
||||
@ -1116,7 +1116,7 @@ ste_tick(void *arg)
|
||||
*
|
||||
* Read the ST-201 statistics counters.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_stats_update(struct ste_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1160,7 +1160,7 @@ ste_stats_update(struct ste_softc *sc)
|
||||
*
|
||||
* Perform a soft reset on the ST-201.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_reset(struct ste_softc *sc, u_int32_t rstbits)
|
||||
{
|
||||
uint32_t ac;
|
||||
@ -1190,7 +1190,7 @@ ste_reset(struct ste_softc *sc, u_int32_t rstbits)
|
||||
*
|
||||
* set the various transmit threshold registers
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_setthresh(struct ste_softc *sc)
|
||||
{
|
||||
/* set the TX threhold */
|
||||
@ -1205,8 +1205,7 @@ ste_setthresh(struct ste_softc *sc)
|
||||
/*
|
||||
* restart TX at the given frame ID in the transmitter ring
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
ste_txrestart(struct ste_softc *sc, u_int8_t id)
|
||||
{
|
||||
u_int32_t control;
|
||||
@ -1231,7 +1230,7 @@ ste_txrestart(struct ste_softc *sc, u_int8_t id)
|
||||
*
|
||||
* Initialize the interface. Must be called at splnet().
|
||||
*/
|
||||
int
|
||||
static int
|
||||
ste_init(struct ifnet *ifp)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
@ -1379,7 +1378,7 @@ ste_init(struct ifnet *ifp)
|
||||
*
|
||||
* Drain the receive queue.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_rxdrain(struct ste_softc *sc)
|
||||
{
|
||||
struct ste_descsoft *ds;
|
||||
@ -1400,7 +1399,7 @@ ste_rxdrain(struct ste_softc *sc)
|
||||
*
|
||||
* Stop transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
@ -1474,7 +1473,7 @@ ste_eeprom_wait(struct ste_softc *sc)
|
||||
*
|
||||
* Read data from the serial EEPROM.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_read_eeprom(struct ste_softc *sc, int offset, uint16_t *data)
|
||||
{
|
||||
|
||||
@ -1495,7 +1494,7 @@ ste_read_eeprom(struct ste_softc *sc, int offset, uint16_t *data)
|
||||
*
|
||||
* Add a receive buffer to the indicated descriptor.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
ste_add_rxbuf(struct ste_softc *sc, int idx)
|
||||
{
|
||||
struct ste_descsoft *ds = &sc->sc_rxsoft[idx];
|
||||
@ -1539,7 +1538,7 @@ ste_add_rxbuf(struct ste_softc *sc, int idx)
|
||||
*
|
||||
* Set up the receive filter.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_set_filter(struct ste_softc *sc)
|
||||
{
|
||||
struct ethercom *ec = &sc->sc_ethercom;
|
||||
@ -1629,7 +1628,7 @@ ste_set_filter(struct ste_softc *sc)
|
||||
*
|
||||
* Read a PHY register on the MII of the ST-201.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
ste_mii_readreg(struct device *self, int phy, int reg)
|
||||
{
|
||||
|
||||
@ -1641,7 +1640,7 @@ ste_mii_readreg(struct device *self, int phy, int reg)
|
||||
*
|
||||
* Write a PHY register on the MII of the ST-201.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
|
||||
@ -1653,7 +1652,7 @@ ste_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
*
|
||||
* Callback from MII layer when media changes.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_mii_statchg(struct device *self)
|
||||
{
|
||||
struct ste_softc *sc = (struct ste_softc *) self;
|
||||
@ -1673,7 +1672,7 @@ ste_mii_statchg(struct device *self)
|
||||
*
|
||||
* Read the MII serial port for the MII bit-bang module.
|
||||
*/
|
||||
uint32_t
|
||||
static uint32_t
|
||||
ste_mii_bitbang_read(struct device *self)
|
||||
{
|
||||
struct ste_softc *sc = (void *) self;
|
||||
@ -1686,7 +1685,7 @@ ste_mii_bitbang_read(struct device *self)
|
||||
*
|
||||
* Write the MII serial port for the MII bit-bang module.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_mii_bitbang_write(struct device *self, uint32_t val)
|
||||
{
|
||||
struct ste_softc *sc = (void *) self;
|
||||
@ -1699,7 +1698,7 @@ ste_mii_bitbang_write(struct device *self, uint32_t val)
|
||||
*
|
||||
* Get the current interface media status.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
ste_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
@ -1714,7 +1713,7 @@ ste_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
*
|
||||
* Set hardware to newly-selected media.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
ste_mediachange(struct ifnet *ifp)
|
||||
{
|
||||
struct ste_softc *sc = ifp->if_softc;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_stge.c,v 1.19 2003/03/01 19:49:45 mjacob Exp $ */
|
||||
/* $NetBSD: if_stge.c,v 1.20 2004/08/21 22:48:18 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -42,7 +42,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.19 2003/03/01 19:49:45 mjacob Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.20 2004/08/21 22:48:18 thorpej Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
||||
@ -266,49 +266,49 @@ do { \
|
||||
|
||||
#define STGE_TIMEOUT 1000
|
||||
|
||||
void stge_start(struct ifnet *);
|
||||
void stge_watchdog(struct ifnet *);
|
||||
int stge_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
int stge_init(struct ifnet *);
|
||||
void stge_stop(struct ifnet *, int);
|
||||
static void stge_start(struct ifnet *);
|
||||
static void stge_watchdog(struct ifnet *);
|
||||
static int stge_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int stge_init(struct ifnet *);
|
||||
static void stge_stop(struct ifnet *, int);
|
||||
|
||||
void stge_shutdown(void *);
|
||||
static void stge_shutdown(void *);
|
||||
|
||||
void stge_reset(struct stge_softc *);
|
||||
void stge_rxdrain(struct stge_softc *);
|
||||
int stge_add_rxbuf(struct stge_softc *, int);
|
||||
static void stge_reset(struct stge_softc *);
|
||||
static void stge_rxdrain(struct stge_softc *);
|
||||
static int stge_add_rxbuf(struct stge_softc *, int);
|
||||
#if 0
|
||||
void stge_read_eeprom(struct stge_softc *, int, uint16_t *);
|
||||
static void stge_read_eeprom(struct stge_softc *, int, uint16_t *);
|
||||
#endif
|
||||
void stge_tick(void *);
|
||||
static void stge_tick(void *);
|
||||
|
||||
void stge_stats_update(struct stge_softc *);
|
||||
static void stge_stats_update(struct stge_softc *);
|
||||
|
||||
void stge_set_filter(struct stge_softc *);
|
||||
static void stge_set_filter(struct stge_softc *);
|
||||
|
||||
int stge_intr(void *);
|
||||
void stge_txintr(struct stge_softc *);
|
||||
void stge_rxintr(struct stge_softc *);
|
||||
static int stge_intr(void *);
|
||||
static void stge_txintr(struct stge_softc *);
|
||||
static void stge_rxintr(struct stge_softc *);
|
||||
|
||||
int stge_mii_readreg(struct device *, int, int);
|
||||
void stge_mii_writereg(struct device *, int, int, int);
|
||||
void stge_mii_statchg(struct device *);
|
||||
static int stge_mii_readreg(struct device *, int, int);
|
||||
static void stge_mii_writereg(struct device *, int, int, int);
|
||||
static void stge_mii_statchg(struct device *);
|
||||
|
||||
int stge_mediachange(struct ifnet *);
|
||||
void stge_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
static int stge_mediachange(struct ifnet *);
|
||||
static void stge_mediastatus(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
int stge_match(struct device *, struct cfdata *, void *);
|
||||
void stge_attach(struct device *, struct device *, void *);
|
||||
static int stge_match(struct device *, struct cfdata *, void *);
|
||||
static void stge_attach(struct device *, struct device *, void *);
|
||||
|
||||
int stge_copy_small = 0;
|
||||
|
||||
CFATTACH_DECL(stge, sizeof(struct stge_softc),
|
||||
stge_match, stge_attach, NULL, NULL);
|
||||
|
||||
uint32_t stge_mii_bitbang_read(struct device *);
|
||||
void stge_mii_bitbang_write(struct device *, uint32_t);
|
||||
static uint32_t stge_mii_bitbang_read(struct device *);
|
||||
static void stge_mii_bitbang_write(struct device *, uint32_t);
|
||||
|
||||
const struct mii_bitbang_ops stge_mii_bitbang_ops = {
|
||||
static const struct mii_bitbang_ops stge_mii_bitbang_ops = {
|
||||
stge_mii_bitbang_read,
|
||||
stge_mii_bitbang_write,
|
||||
{
|
||||
@ -323,7 +323,7 @@ const struct mii_bitbang_ops stge_mii_bitbang_ops = {
|
||||
/*
|
||||
* Devices supported by this driver.
|
||||
*/
|
||||
const struct stge_product {
|
||||
static const struct stge_product {
|
||||
pci_vendor_id_t stge_vendor;
|
||||
pci_product_id_t stge_product;
|
||||
const char *stge_name;
|
||||
@ -370,7 +370,7 @@ stge_lookup(const struct pci_attach_args *pa)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
stge_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = aux;
|
||||
@ -381,7 +381,7 @@ stge_match(struct device *parent, struct cfdata *cf, void *aux)
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
stge_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct stge_softc *sc = (struct stge_softc *) self;
|
||||
@ -739,7 +739,7 @@ stge_attach(struct device *parent, struct device *self, void *aux)
|
||||
*
|
||||
* Make sure the interface is stopped at reboot time.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_shutdown(void *arg)
|
||||
{
|
||||
struct stge_softc *sc = arg;
|
||||
@ -768,7 +768,7 @@ stge_dma_wait(struct stge_softc *sc)
|
||||
*
|
||||
* Start packet transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_start(struct ifnet *ifp)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
@ -989,7 +989,7 @@ stge_start(struct ifnet *ifp)
|
||||
*
|
||||
* Watchdog timer handler.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_watchdog(struct ifnet *ifp)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
@ -1014,7 +1014,7 @@ stge_watchdog(struct ifnet *ifp)
|
||||
*
|
||||
* Handle control requests from the operator.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
@ -1054,7 +1054,7 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
*
|
||||
* Interrupt service routine.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
stge_intr(void *arg)
|
||||
{
|
||||
struct stge_softc *sc = arg;
|
||||
@ -1151,7 +1151,7 @@ stge_intr(void *arg)
|
||||
*
|
||||
* Helper; handle transmit interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_txintr(struct stge_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1199,7 +1199,7 @@ stge_txintr(struct stge_softc *sc)
|
||||
*
|
||||
* Helper; handle receive interrupts.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_rxintr(struct stge_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1398,7 +1398,7 @@ stge_rxintr(struct stge_softc *sc)
|
||||
*
|
||||
* One second timer, used to tick the MII.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_tick(void *arg)
|
||||
{
|
||||
struct stge_softc *sc = arg;
|
||||
@ -1417,7 +1417,7 @@ stge_tick(void *arg)
|
||||
*
|
||||
* Read the TC9021 statistics counters.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_stats_update(struct stge_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
|
||||
@ -1452,7 +1452,7 @@ stge_stats_update(struct stge_softc *sc)
|
||||
*
|
||||
* Perform a soft reset on the TC9021.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_reset(struct stge_softc *sc)
|
||||
{
|
||||
uint32_t ac;
|
||||
@ -1490,7 +1490,7 @@ stge_reset(struct stge_softc *sc)
|
||||
*
|
||||
* Initialize the interface. Must be called at splnet().
|
||||
*/
|
||||
int
|
||||
static int
|
||||
stge_init(struct ifnet *ifp)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
@ -1685,7 +1685,7 @@ stge_init(struct ifnet *ifp)
|
||||
*
|
||||
* Drain the receive queue.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_rxdrain(struct stge_softc *sc)
|
||||
{
|
||||
struct stge_descsoft *ds;
|
||||
@ -1707,7 +1707,7 @@ stge_rxdrain(struct stge_softc *sc)
|
||||
*
|
||||
* Stop transmission on the interface.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
@ -1784,7 +1784,7 @@ stge_eeprom_wait(struct stge_softc *sc)
|
||||
*
|
||||
* Read data from the serial EEPROM.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_read_eeprom(struct stge_softc *sc, int offset, uint16_t *data)
|
||||
{
|
||||
|
||||
@ -1806,7 +1806,7 @@ stge_read_eeprom(struct stge_softc *sc, int offset, uint16_t *data)
|
||||
*
|
||||
* Add a receive buffer to the indicated descriptor.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
stge_add_rxbuf(struct stge_softc *sc, int idx)
|
||||
{
|
||||
struct stge_descsoft *ds = &sc->sc_rxsoft[idx];
|
||||
@ -1852,7 +1852,7 @@ stge_add_rxbuf(struct stge_softc *sc, int idx)
|
||||
*
|
||||
* Set up the receive filter.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_set_filter(struct stge_softc *sc)
|
||||
{
|
||||
struct ethercom *ec = &sc->sc_ethercom;
|
||||
@ -1948,7 +1948,7 @@ stge_set_filter(struct stge_softc *sc)
|
||||
*
|
||||
* Read a PHY register on the MII of the TC9021.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
stge_mii_readreg(struct device *self, int phy, int reg)
|
||||
{
|
||||
|
||||
@ -1960,7 +1960,7 @@ stge_mii_readreg(struct device *self, int phy, int reg)
|
||||
*
|
||||
* Write a PHY register on the MII of the TC9021.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
|
||||
@ -1972,7 +1972,7 @@ stge_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
*
|
||||
* Callback from MII layer when media changes.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_mii_statchg(struct device *self)
|
||||
{
|
||||
struct stge_softc *sc = (struct stge_softc *) self;
|
||||
@ -1992,7 +1992,7 @@ stge_mii_statchg(struct device *self)
|
||||
*
|
||||
* Read the MII serial port for the MII bit-bang module.
|
||||
*/
|
||||
uint32_t
|
||||
static uint32_t
|
||||
stge_mii_bitbang_read(struct device *self)
|
||||
{
|
||||
struct stge_softc *sc = (void *) self;
|
||||
@ -2005,7 +2005,7 @@ stge_mii_bitbang_read(struct device *self)
|
||||
*
|
||||
* Write the MII serial port for the MII bit-bang module.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_mii_bitbang_write(struct device *self, uint32_t val)
|
||||
{
|
||||
struct stge_softc *sc = (void *) self;
|
||||
@ -2019,7 +2019,7 @@ stge_mii_bitbang_write(struct device *self, uint32_t val)
|
||||
*
|
||||
* Get the current interface media status.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
stge_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
@ -2034,7 +2034,7 @@ stge_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
*
|
||||
* Set hardware to newly-selected media.
|
||||
*/
|
||||
int
|
||||
static int
|
||||
stge_mediachange(struct ifnet *ifp)
|
||||
{
|
||||
struct stge_softc *sc = ifp->if_softc;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_vr.c,v 1.68 2004/02/15 09:40:32 jdolecek Exp $ */
|
||||
/* $NetBSD: if_vr.c,v 1.69 2004/08/21 22:48:18 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
|
||||
@ -104,7 +104,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.68 2004/02/15 09:40:32 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.69 2004/08/21 22:48:18 thorpej Exp $");
|
||||
|
||||
#include "rnd.h"
|
||||
|
||||
@ -303,29 +303,29 @@ do { \
|
||||
|
||||
#define VR_TIMEOUT 1000
|
||||
|
||||
static int vr_add_rxbuf __P((struct vr_softc *, int));
|
||||
static int vr_add_rxbuf(struct vr_softc *, int);
|
||||
|
||||
static void vr_rxeof __P((struct vr_softc *));
|
||||
static void vr_rxeoc __P((struct vr_softc *));
|
||||
static void vr_txeof __P((struct vr_softc *));
|
||||
static int vr_intr __P((void *));
|
||||
static void vr_start __P((struct ifnet *));
|
||||
static int vr_ioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
static int vr_init __P((struct ifnet *));
|
||||
static void vr_stop __P((struct ifnet *, int));
|
||||
static void vr_rxdrain __P((struct vr_softc *));
|
||||
static void vr_watchdog __P((struct ifnet *));
|
||||
static void vr_tick __P((void *));
|
||||
static void vr_rxeof(struct vr_softc *);
|
||||
static void vr_rxeoc(struct vr_softc *);
|
||||
static void vr_txeof(struct vr_softc *);
|
||||
static int vr_intr(void *);
|
||||
static void vr_start(struct ifnet *);
|
||||
static int vr_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int vr_init(struct ifnet *);
|
||||
static void vr_stop(struct ifnet *, int);
|
||||
static void vr_rxdrain(struct vr_softc *);
|
||||
static void vr_watchdog(struct ifnet *);
|
||||
static void vr_tick(void *);
|
||||
|
||||
static int vr_ifmedia_upd __P((struct ifnet *));
|
||||
static void vr_ifmedia_sts __P((struct ifnet *, struct ifmediareq *));
|
||||
static int vr_ifmedia_upd(struct ifnet *);
|
||||
static void vr_ifmedia_sts(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
static int vr_mii_readreg __P((struct device *, int, int));
|
||||
static void vr_mii_writereg __P((struct device *, int, int, int));
|
||||
static void vr_mii_statchg __P((struct device *));
|
||||
static int vr_mii_readreg(struct device *, int, int);
|
||||
static void vr_mii_writereg(struct device *, int, int, int);
|
||||
static void vr_mii_statchg(struct device *);
|
||||
|
||||
static void vr_setmulti __P((struct vr_softc *));
|
||||
static void vr_reset __P((struct vr_softc *));
|
||||
static void vr_setmulti(struct vr_softc *);
|
||||
static void vr_reset(struct vr_softc *);
|
||||
|
||||
int vr_copy_small = 0;
|
||||
|
||||
@ -356,10 +356,10 @@ int vr_copy_small = 0;
|
||||
/*
|
||||
* MII bit-bang glue.
|
||||
*/
|
||||
u_int32_t vr_mii_bitbang_read __P((struct device *));
|
||||
void vr_mii_bitbang_write __P((struct device *, u_int32_t));
|
||||
static u_int32_t vr_mii_bitbang_read(struct device *);
|
||||
static void vr_mii_bitbang_write(struct device *, u_int32_t);
|
||||
|
||||
const struct mii_bitbang_ops vr_mii_bitbang_ops = {
|
||||
static const struct mii_bitbang_ops vr_mii_bitbang_ops = {
|
||||
vr_mii_bitbang_read,
|
||||
vr_mii_bitbang_write,
|
||||
{
|
||||
@ -371,19 +371,16 @@ const struct mii_bitbang_ops vr_mii_bitbang_ops = {
|
||||
}
|
||||
};
|
||||
|
||||
u_int32_t
|
||||
vr_mii_bitbang_read(self)
|
||||
struct device *self;
|
||||
static u_int32_t
|
||||
vr_mii_bitbang_read(struct device *self)
|
||||
{
|
||||
struct vr_softc *sc = (void *) self;
|
||||
|
||||
return (CSR_READ_1(sc, VR_MIICMD));
|
||||
}
|
||||
|
||||
void
|
||||
vr_mii_bitbang_write(self, val)
|
||||
struct device *self;
|
||||
u_int32_t val;
|
||||
static void
|
||||
vr_mii_bitbang_write(struct device *self, u_int32_t val)
|
||||
{
|
||||
struct vr_softc *sc = (void *) self;
|
||||
|
||||
@ -394,9 +391,7 @@ vr_mii_bitbang_write(self, val)
|
||||
* Read an PHY register through the MII.
|
||||
*/
|
||||
static int
|
||||
vr_mii_readreg(self, phy, reg)
|
||||
struct device *self;
|
||||
int phy, reg;
|
||||
vr_mii_readreg(struct device *self, int phy, int reg)
|
||||
{
|
||||
struct vr_softc *sc = (void *) self;
|
||||
|
||||
@ -408,9 +403,7 @@ vr_mii_readreg(self, phy, reg)
|
||||
* Write to a PHY register through the MII.
|
||||
*/
|
||||
static void
|
||||
vr_mii_writereg(self, phy, reg, val)
|
||||
struct device *self;
|
||||
int phy, reg, val;
|
||||
vr_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
{
|
||||
struct vr_softc *sc = (void *) self;
|
||||
|
||||
@ -419,8 +412,7 @@ vr_mii_writereg(self, phy, reg, val)
|
||||
}
|
||||
|
||||
static void
|
||||
vr_mii_statchg(self)
|
||||
struct device *self;
|
||||
vr_mii_statchg(struct device *self)
|
||||
{
|
||||
struct vr_softc *sc = (struct vr_softc *)self;
|
||||
|
||||
@ -447,8 +439,7 @@ vr_mii_statchg(self)
|
||||
* Program the 64-bit multicast hash filter.
|
||||
*/
|
||||
static void
|
||||
vr_setmulti(sc)
|
||||
struct vr_softc *sc;
|
||||
vr_setmulti(struct vr_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
int h = 0;
|
||||
@ -506,8 +497,7 @@ allmulti:
|
||||
}
|
||||
|
||||
static void
|
||||
vr_reset(sc)
|
||||
struct vr_softc *sc;
|
||||
vr_reset(struct vr_softc *sc)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -542,9 +532,7 @@ vr_reset(sc)
|
||||
* overflow the field and make a mess.
|
||||
*/
|
||||
static int
|
||||
vr_add_rxbuf(sc, i)
|
||||
struct vr_softc *sc;
|
||||
int i;
|
||||
vr_add_rxbuf(struct vr_softc *sc, int i)
|
||||
{
|
||||
struct vr_descsoft *ds = VR_DSRX(sc, i);
|
||||
struct mbuf *m_new;
|
||||
@ -587,8 +575,7 @@ vr_add_rxbuf(sc, i)
|
||||
* the higher level protocols.
|
||||
*/
|
||||
static void
|
||||
vr_rxeof(sc)
|
||||
struct vr_softc *sc;
|
||||
vr_rxeof(struct vr_softc *sc)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
@ -765,8 +752,7 @@ vr_rxeof(sc)
|
||||
}
|
||||
|
||||
void
|
||||
vr_rxeoc(sc)
|
||||
struct vr_softc *sc;
|
||||
vr_rxeoc(struct vr_softc *sc)
|
||||
{
|
||||
|
||||
vr_rxeof(sc);
|
||||
@ -781,8 +767,7 @@ vr_rxeoc(sc)
|
||||
* the list buffers.
|
||||
*/
|
||||
static void
|
||||
vr_txeof(sc)
|
||||
struct vr_softc *sc;
|
||||
vr_txeof(struct vr_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->vr_ec.ec_if;
|
||||
struct vr_desc *d;
|
||||
@ -837,8 +822,7 @@ vr_txeof(sc)
|
||||
}
|
||||
|
||||
static int
|
||||
vr_intr(arg)
|
||||
void *arg;
|
||||
vr_intr(void *arg)
|
||||
{
|
||||
struct vr_softc *sc;
|
||||
struct ifnet *ifp;
|
||||
@ -934,8 +918,7 @@ vr_intr(arg)
|
||||
* physical addresses.
|
||||
*/
|
||||
static void
|
||||
vr_start(ifp)
|
||||
struct ifnet *ifp;
|
||||
vr_start(struct ifnet *ifp)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
struct mbuf *m0, *m;
|
||||
@ -1107,8 +1090,7 @@ vr_start(ifp)
|
||||
* Initialize the interface. Must be called at splnet.
|
||||
*/
|
||||
static int
|
||||
vr_init(ifp)
|
||||
struct ifnet *ifp;
|
||||
vr_init(struct ifnet *ifp)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
struct vr_desc *d;
|
||||
@ -1225,8 +1207,7 @@ vr_init(ifp)
|
||||
* Set media options.
|
||||
*/
|
||||
static int
|
||||
vr_ifmedia_upd(ifp)
|
||||
struct ifnet *ifp;
|
||||
vr_ifmedia_upd(struct ifnet *ifp)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
|
||||
@ -1239,9 +1220,7 @@ vr_ifmedia_upd(ifp)
|
||||
* Report current media status.
|
||||
*/
|
||||
static void
|
||||
vr_ifmedia_sts(ifp, ifmr)
|
||||
struct ifnet *ifp;
|
||||
struct ifmediareq *ifmr;
|
||||
vr_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
|
||||
@ -1251,10 +1230,7 @@ vr_ifmedia_sts(ifp, ifmr)
|
||||
}
|
||||
|
||||
static int
|
||||
vr_ioctl(ifp, command, data)
|
||||
struct ifnet *ifp;
|
||||
u_long command;
|
||||
caddr_t data;
|
||||
vr_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
@ -1286,8 +1262,7 @@ vr_ioctl(ifp, command, data)
|
||||
}
|
||||
|
||||
static void
|
||||
vr_watchdog(ifp)
|
||||
struct ifnet *ifp;
|
||||
vr_watchdog(struct ifnet *ifp)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
|
||||
@ -1301,8 +1276,7 @@ vr_watchdog(ifp)
|
||||
* One second timer, used to tick MII.
|
||||
*/
|
||||
static void
|
||||
vr_tick(arg)
|
||||
void *arg;
|
||||
vr_tick(void *arg)
|
||||
{
|
||||
struct vr_softc *sc = arg;
|
||||
int s;
|
||||
@ -1318,8 +1292,7 @@ vr_tick(arg)
|
||||
* Drain the receive queue.
|
||||
*/
|
||||
static void
|
||||
vr_rxdrain(sc)
|
||||
struct vr_softc *sc;
|
||||
vr_rxdrain(struct vr_softc *sc)
|
||||
{
|
||||
struct vr_descsoft *ds;
|
||||
int i;
|
||||
@ -1339,9 +1312,7 @@ vr_rxdrain(sc)
|
||||
* transmit lists.
|
||||
*/
|
||||
static void
|
||||
vr_stop(ifp, disable)
|
||||
struct ifnet *ifp;
|
||||
int disable;
|
||||
vr_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct vr_softc *sc = ifp->if_softc;
|
||||
struct vr_descsoft *ds;
|
||||
@ -1384,17 +1355,15 @@ vr_stop(ifp, disable)
|
||||
ifp->if_timer = 0;
|
||||
}
|
||||
|
||||
static struct vr_type *vr_lookup __P((struct pci_attach_args *));
|
||||
static int vr_probe __P((struct device *, struct cfdata *, void *));
|
||||
static void vr_attach __P((struct device *, struct device *, void *));
|
||||
static void vr_shutdown __P((void *));
|
||||
static int vr_probe(struct device *, struct cfdata *, void *);
|
||||
static void vr_attach(struct device *, struct device *, void *);
|
||||
static void vr_shutdown(void *);
|
||||
|
||||
CFATTACH_DECL(vr, sizeof (struct vr_softc),
|
||||
vr_probe, vr_attach, NULL, NULL);
|
||||
|
||||
static struct vr_type *
|
||||
vr_lookup(pa)
|
||||
struct pci_attach_args *pa;
|
||||
vr_lookup(struct pci_attach_args *pa)
|
||||
{
|
||||
struct vr_type *vrt;
|
||||
|
||||
@ -1407,10 +1376,7 @@ vr_lookup(pa)
|
||||
}
|
||||
|
||||
static int
|
||||
vr_probe(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
vr_probe(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = (struct pci_attach_args *)aux;
|
||||
|
||||
@ -1425,8 +1391,7 @@ vr_probe(parent, match, aux)
|
||||
* get confused by errant DMAs when rebooting.
|
||||
*/
|
||||
static void
|
||||
vr_shutdown(arg)
|
||||
void *arg;
|
||||
vr_shutdown(void *arg)
|
||||
{
|
||||
struct vr_softc *sc = (struct vr_softc *)arg;
|
||||
|
||||
@ -1438,10 +1403,7 @@ vr_shutdown(arg)
|
||||
* setup and ethernet/BPF attach.
|
||||
*/
|
||||
static void
|
||||
vr_attach(parent, self, aux)
|
||||
struct device *parent;
|
||||
struct device *self;
|
||||
void *aux;
|
||||
vr_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct vr_softc *sc = (struct vr_softc *) self;
|
||||
struct pci_attach_args *pa = (struct pci_attach_args *) aux;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_wi_pci.c,v 1.34 2004/08/07 17:13:27 mycroft Exp $ */
|
||||
/* $NetBSD: if_wi_pci.c,v 1.35 2004/08/21 22:48:18 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
@ -43,7 +43,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.34 2004/08/07 17:13:27 mycroft Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.35 2004/08/21 22:48:18 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -96,20 +96,20 @@ struct wi_pci_softc {
|
||||
void *sc_powerhook; /* power hook descriptor */
|
||||
};
|
||||
|
||||
static int wi_pci_match __P((struct device *, struct cfdata *, void *));
|
||||
static void wi_pci_attach __P((struct device *, struct device *, void *));
|
||||
static int wi_pci_enable __P((struct wi_softc *));
|
||||
static void wi_pci_disable __P((struct wi_softc *));
|
||||
static void wi_pci_reset __P((struct wi_softc *));
|
||||
static void wi_pci_powerhook __P((int, void *));
|
||||
static int wi_pci_match(struct device *, struct cfdata *, void *);
|
||||
static void wi_pci_attach(struct device *, struct device *, void *);
|
||||
static int wi_pci_enable(struct wi_softc *);
|
||||
static void wi_pci_disable(struct wi_softc *);
|
||||
static void wi_pci_reset(struct wi_softc *);
|
||||
static void wi_pci_powerhook(int, void *);
|
||||
|
||||
static const struct wi_pci_product
|
||||
*wi_pci_lookup __P((struct pci_attach_args *));
|
||||
*wi_pci_lookup(struct pci_attach_args *);
|
||||
|
||||
CFATTACH_DECL(wi_pci, sizeof(struct wi_pci_softc),
|
||||
wi_pci_match, wi_pci_attach, NULL, NULL);
|
||||
|
||||
const struct wi_pci_product {
|
||||
static const struct wi_pci_product {
|
||||
pci_vendor_id_t wpp_vendor; /* vendor ID */
|
||||
pci_product_id_t wpp_product; /* product ID */
|
||||
int wpp_chip; /* uses other chip */
|
||||
@ -137,8 +137,7 @@ const struct wi_pci_product {
|
||||
};
|
||||
|
||||
static int
|
||||
wi_pci_enable(sc)
|
||||
struct wi_softc *sc;
|
||||
wi_pci_enable(struct wi_softc *sc)
|
||||
{
|
||||
struct wi_pci_softc *psc = (struct wi_pci_softc *)sc;
|
||||
|
||||
@ -159,8 +158,7 @@ wi_pci_enable(sc)
|
||||
}
|
||||
|
||||
static void
|
||||
wi_pci_disable(sc)
|
||||
struct wi_softc *sc;
|
||||
wi_pci_disable(struct wi_softc *sc)
|
||||
{
|
||||
struct wi_pci_softc *psc = (struct wi_pci_softc *)sc;
|
||||
|
||||
@ -168,8 +166,7 @@ wi_pci_disable(sc)
|
||||
}
|
||||
|
||||
static void
|
||||
wi_pci_reset(sc)
|
||||
struct wi_softc *sc;
|
||||
wi_pci_reset(struct wi_softc *sc)
|
||||
{
|
||||
int i, secs, usecs;
|
||||
|
||||
@ -202,8 +199,7 @@ wi_pci_reset(sc)
|
||||
}
|
||||
|
||||
static const struct wi_pci_product *
|
||||
wi_pci_lookup(pa)
|
||||
struct pci_attach_args *pa;
|
||||
wi_pci_lookup(struct pci_attach_args *pa)
|
||||
{
|
||||
const struct wi_pci_product *wpp;
|
||||
|
||||
@ -216,10 +212,7 @@ wi_pci_lookup(pa)
|
||||
}
|
||||
|
||||
static int
|
||||
wi_pci_match(parent, match, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *match;
|
||||
void *aux;
|
||||
wi_pci_match(struct device *parent, struct cfdata *match, void *aux)
|
||||
{
|
||||
struct pci_attach_args *pa = aux;
|
||||
|
||||
@ -229,9 +222,7 @@ wi_pci_match(parent, match, aux)
|
||||
}
|
||||
|
||||
static void
|
||||
wi_pci_attach(parent, self, aux)
|
||||
struct device *parent, *self;
|
||||
void *aux;
|
||||
wi_pci_attach(struct device *parent, struct device *self, void *aux)
|
||||
{
|
||||
struct wi_pci_softc *psc = (struct wi_pci_softc *)self;
|
||||
struct wi_softc *sc = &psc->psc_wi;
|
||||
@ -399,9 +390,7 @@ wi_pci_attach(parent, self, aux)
|
||||
}
|
||||
|
||||
static void
|
||||
wi_pci_powerhook(why, arg)
|
||||
int why;
|
||||
void *arg;
|
||||
wi_pci_powerhook(int why, void *arg)
|
||||
{
|
||||
struct wi_pci_softc *psc = arg;
|
||||
struct wi_softc *sc = &psc->psc_wi;
|
||||
|
Loading…
Reference in New Issue
Block a user