Cosmetic: use device_t and accessors. Change to ANSI-style
prototypes. Delete some dead code.
This commit is contained in:
parent
677859c28a
commit
f71d8b8379
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mtd803.c,v 1.17 2008/01/19 22:10:17 dyoung Exp $ */
|
||||
/* $NetBSD: mtd803.c,v 1.18 2008/03/12 16:11:23 dyoung Exp $ */
|
||||
|
||||
/*-
|
||||
*
|
||||
|
@ -51,7 +51,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.17 2008/01/19 22:10:17 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mtd803.c,v 1.18 2008/03/12 16:11:23 dyoung Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
||||
|
@ -139,8 +139,7 @@ int mtd_bufirq(struct mtd_softc *);
|
|||
|
||||
|
||||
int
|
||||
mtd_config(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_config(struct mtd_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
int i;
|
||||
|
@ -203,8 +202,7 @@ mtd_config(sc)
|
|||
* Must be called at splnet()
|
||||
*/
|
||||
int
|
||||
mtd_init(ifp)
|
||||
struct ifnet *ifp;
|
||||
mtd_init(struct ifnet *ifp)
|
||||
{
|
||||
struct mtd_softc *sc = ifp->if_softc;
|
||||
|
||||
|
@ -255,8 +253,7 @@ mtd_init(ifp)
|
|||
|
||||
|
||||
int
|
||||
mtd_init_desc(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_init_desc(struct mtd_softc *sc)
|
||||
{
|
||||
int rseg, err, i;
|
||||
bus_dma_segment_t seg;
|
||||
|
@ -414,37 +411,32 @@ mtd_init_desc(sc)
|
|||
|
||||
|
||||
void
|
||||
mtd_mii_statchg(struct device *self)
|
||||
mtd_mii_statchg(device_t self)
|
||||
{
|
||||
/*struct mtd_softc *sc = (void *)self;*/
|
||||
|
||||
/* Should we do something here? :) */
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mtd_mii_readreg(struct device *self, int phy, int reg)
|
||||
mtd_mii_readreg(device_t self, int phy, int reg)
|
||||
{
|
||||
struct mtd_softc *sc = (void *)self;
|
||||
struct mtd_softc *sc = device_private(self);
|
||||
|
||||
return (MTD_READ_2(sc, MTD_PHYBASE + reg * 2));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
mtd_mii_writereg(struct device *self, int phy, int reg, int val)
|
||||
mtd_mii_writereg(device_t self, int phy, int reg, int val)
|
||||
{
|
||||
struct mtd_softc *sc = (void *)self;
|
||||
struct mtd_softc *sc = device_private(self);
|
||||
|
||||
MTD_WRITE_2(sc, MTD_PHYBASE + reg * 2, val);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mtd_put(sc, index, m)
|
||||
struct mtd_softc *sc;
|
||||
int index;
|
||||
struct mbuf *m;
|
||||
mtd_put(struct mtd_softc *sc, int index, struct mbuf *m)
|
||||
{
|
||||
int len, tlen;
|
||||
char *buf = (char *)sc->buf + MTD_NUM_RXD * MTD_RXBUF_SIZE
|
||||
|
@ -478,8 +470,7 @@ mtd_put(sc, index, m)
|
|||
|
||||
|
||||
void
|
||||
mtd_start(ifp)
|
||||
struct ifnet *ifp;
|
||||
mtd_start(struct ifnet *ifp)
|
||||
{
|
||||
struct mtd_softc *sc = ifp->if_softc;
|
||||
struct mbuf *m;
|
||||
|
@ -531,9 +522,7 @@ mtd_start(ifp)
|
|||
|
||||
|
||||
void
|
||||
mtd_stop (ifp, disable)
|
||||
struct ifnet *ifp;
|
||||
int disable;
|
||||
mtd_stop(struct ifnet *ifp, int disable)
|
||||
{
|
||||
struct mtd_softc *sc = ifp->if_softc;
|
||||
|
||||
|
@ -557,8 +546,7 @@ mtd_stop (ifp, disable)
|
|||
|
||||
|
||||
void
|
||||
mtd_watchdog(ifp)
|
||||
struct ifnet *ifp;
|
||||
mtd_watchdog(struct ifnet *ifp)
|
||||
{
|
||||
struct mtd_softc *sc = ifp->if_softc;
|
||||
int s;
|
||||
|
@ -577,10 +565,7 @@ mtd_watchdog(ifp)
|
|||
|
||||
|
||||
int
|
||||
mtd_ioctl(ifp, cmd, data)
|
||||
struct ifnet * ifp;
|
||||
u_long cmd;
|
||||
void *data;
|
||||
mtd_ioctl(struct ifnet *ifp, u_long cmd, void *data)
|
||||
{
|
||||
struct mtd_softc *sc = ifp->if_softc;
|
||||
int s, error = 0;
|
||||
|
@ -603,10 +588,7 @@ mtd_ioctl(ifp, cmd, data)
|
|||
|
||||
|
||||
struct mbuf *
|
||||
mtd_get(sc, index, totlen)
|
||||
struct mtd_softc *sc;
|
||||
int index;
|
||||
int totlen;
|
||||
mtd_get(struct mtd_softc *sc, int index, int totlen)
|
||||
{
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
struct mbuf *m, *m0, *newm;
|
||||
|
@ -661,8 +643,7 @@ mtd_get(sc, index, totlen)
|
|||
|
||||
|
||||
int
|
||||
mtd_rxirq(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_rxirq(struct mtd_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
int len;
|
||||
|
@ -731,8 +712,7 @@ mtd_rxirq(sc)
|
|||
|
||||
|
||||
int
|
||||
mtd_txirq(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_txirq(struct mtd_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
|
||||
|
@ -749,8 +729,7 @@ mtd_txirq(sc)
|
|||
|
||||
|
||||
int
|
||||
mtd_bufirq(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_bufirq(struct mtd_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
|
||||
|
@ -764,8 +743,7 @@ mtd_bufirq(sc)
|
|||
|
||||
|
||||
int
|
||||
mtd_irq_h(args)
|
||||
void *args;
|
||||
mtd_irq_h(void *args)
|
||||
{
|
||||
struct mtd_softc *sc = args;
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
|
@ -862,8 +840,7 @@ mtd_irq_h(args)
|
|||
|
||||
|
||||
void
|
||||
mtd_setmulti(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_setmulti(struct mtd_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp = &sc->ethercom.ec_if;
|
||||
u_int32_t rxtx_stat;
|
||||
|
@ -909,8 +886,7 @@ mtd_setmulti(sc)
|
|||
|
||||
|
||||
void
|
||||
mtd_reset(sc)
|
||||
struct mtd_softc *sc;
|
||||
mtd_reset(struct mtd_softc *sc)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
Loading…
Reference in New Issue