From cabb5e540a5850940e930e5c499b10e4b95c6390 Mon Sep 17 00:00:00 2001 From: paul <paul@FreeBSD.org> Date: Tue, 16 May 2000 02:30:53 +0000 Subject: [PATCH] Replace all references to lnc_softc with a typedef. --- sys/dev/lnc/if_lnc.c | 60 +++++++++++++++++++-------------------- sys/dev/lnc/if_lnc_isa.c | 36 +++++++++++------------ sys/dev/lnc/if_lnc_pc98.c | 6 ++-- sys/dev/lnc/if_lnc_pci.c | 6 ++-- sys/dev/lnc/if_lncvar.h | 8 +++--- 5 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index 633e8896cee2..c4c4ecad14dd 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -90,7 +90,7 @@ #include <dev/lnc/if_lncvar.h> #include <dev/lnc/if_lncreg.h> -struct lnc_softc lnc_softc[NLNC]; +lnc_softc_t lnc_softc[NLNC]; static char const * const nic_ident[] = { "Unknown", @@ -115,22 +115,22 @@ static char const * const ic_ident[] = { "PCnet-Home", }; -static void lnc_setladrf __P((struct lnc_softc *sc)); -static void lnc_stop __P((struct lnc_softc *sc)); -static void lnc_reset __P((struct lnc_softc *sc)); -static void lnc_free_mbufs __P((struct lnc_softc *sc)); -static __inline int alloc_mbuf_cluster __P((struct lnc_softc *sc, +static void lnc_setladrf __P((lnc_softc_t *sc)); +static void lnc_stop __P((lnc_softc_t *sc)); +static void lnc_reset __P((lnc_softc_t *sc)); +static void lnc_free_mbufs __P((lnc_softc_t *sc)); +static __inline int alloc_mbuf_cluster __P((lnc_softc_t *sc, struct host_ring_entry *desc)); -static __inline struct mbuf *chain_mbufs __P((struct lnc_softc *sc, +static __inline struct mbuf *chain_mbufs __P((lnc_softc_t *sc, int start_of_packet, int pkt_len)); -static __inline struct mbuf *mbuf_packet __P((struct lnc_softc *sc, +static __inline struct mbuf *mbuf_packet __P((lnc_softc_t *sc, int start_of_packet, int pkt_len)); -static __inline void lnc_rint __P((struct lnc_softc *sc)); -static __inline void lnc_tint __P((struct lnc_softc *sc)); +static __inline void lnc_rint __P((lnc_softc_t *sc)); +static __inline void lnc_tint __P((lnc_softc_t *sc)); extern int lnc_probe __P((struct isa_device *isa_dev)); -int lnc_attach_sc __P((struct lnc_softc *sc, int unit)); +int lnc_attach_sc __P((lnc_softc_t *sc, int unit)); extern int lnc_attach __P((struct isa_device *isa_dev)); static void lnc_init __P((void *)); static __inline int mbuf_to_buffer __P((struct mbuf *m, char *buffer)); @@ -139,23 +139,23 @@ static void lnc_start __P((struct ifnet *ifp)); static int lnc_ioctl __P((struct ifnet *ifp, u_long command, caddr_t data)); static void lnc_watchdog __P((struct ifnet *ifp)); #ifdef DEBUG -void lnc_dump_state __P((struct lnc_softc *sc)); +void lnc_dump_state __P((lnc_softc_t *sc)); void mbuf_dump_chain __P((struct mbuf *m)); #endif -void lncintr_sc __P((struct lnc_softc *sc)); +void lncintr_sc __P((lnc_softc_t *sc)); struct isa_driver lncdriver = {lnc_probe, lnc_attach, "lnc"}; static __inline void -write_bcr(struct lnc_softc *sc, u_short port, u_short val) +write_bcr(lnc_softc_t *sc, u_short port, u_short val) { outw(sc->rap, port); outw(sc->bdp, val); } static __inline u_short -read_bcr(struct lnc_softc *sc, u_short port) +read_bcr(lnc_softc_t *sc, u_short port) { outw(sc->rap, port); return (inw(sc->bdp)); @@ -183,7 +183,7 @@ ether_crc(const u_char *ether_addr) * Set up the logical address filter for multicast packets */ static __inline void -lnc_setladrf(struct lnc_softc *sc) +lnc_setladrf(lnc_softc_t *sc) { struct ifnet *ifp = &sc->arpcom.ac_if; struct ifmultiaddr *ifma; @@ -216,19 +216,19 @@ lnc_setladrf(struct lnc_softc *sc) } static void -lnc_stop(struct lnc_softc *sc) +lnc_stop(lnc_softc_t *sc) { write_csr(sc, CSR0, STOP); } static void -lnc_reset(struct lnc_softc *sc) +lnc_reset(lnc_softc_t *sc) { lnc_init(sc); } static void -lnc_free_mbufs(struct lnc_softc *sc) +lnc_free_mbufs(lnc_softc_t *sc) { int i; @@ -250,7 +250,7 @@ lnc_free_mbufs(struct lnc_softc *sc) } static __inline int -alloc_mbuf_cluster(struct lnc_softc *sc, struct host_ring_entry *desc) +alloc_mbuf_cluster(lnc_softc_t *sc, struct host_ring_entry *desc) { register struct mds *md = desc->md; struct mbuf *m=0; @@ -283,7 +283,7 @@ alloc_mbuf_cluster(struct lnc_softc *sc, struct host_ring_entry *desc) } static __inline struct mbuf * -chain_mbufs(struct lnc_softc *sc, int start_of_packet, int pkt_len) +chain_mbufs(lnc_softc_t *sc, int start_of_packet, int pkt_len) { struct mbuf *head, *m; struct host_ring_entry *desc; @@ -317,7 +317,7 @@ chain_mbufs(struct lnc_softc *sc, int start_of_packet, int pkt_len) } static __inline struct mbuf * -mbuf_packet(struct lnc_softc *sc, int start_of_packet, int pkt_len) +mbuf_packet(lnc_softc_t *sc, int start_of_packet, int pkt_len) { struct host_ring_entry *start; @@ -392,7 +392,7 @@ mbuf_packet(struct lnc_softc *sc, int start_of_packet, int pkt_len) static __inline void -lnc_rint(struct lnc_softc *sc) +lnc_rint(lnc_softc_t *sc) { struct host_ring_entry *next, *start; int start_of_packet; @@ -567,7 +567,7 @@ lnc_rint(struct lnc_softc *sc) } static __inline void -lnc_tint(struct lnc_softc *sc) +lnc_tint(lnc_softc_t *sc) { struct host_ring_entry *next, *start; int start_of_packet; @@ -807,7 +807,7 @@ lnc_tint(struct lnc_softc *sc) } int -lnc_attach_sc(struct lnc_softc *sc, int unit) +lnc_attach_sc(lnc_softc_t *sc, int unit) { int lnc_mem_size; @@ -911,7 +911,7 @@ static void lnc_init(xsc) void *xsc; { - struct lnc_softc *sc = xsc; + lnc_softc_t *sc = xsc; int s, i; char *lnc_mem; @@ -1106,7 +1106,7 @@ lnc_init(xsc) */ void -lncintr_sc(struct lnc_softc *sc) +lncintr_sc(lnc_softc_t *sc) { int unit = sc->arpcom.ac_if.if_unit; u_short csr0; @@ -1217,7 +1217,7 @@ static void lnc_start(struct ifnet *ifp) { - struct lnc_softc *sc = ifp->if_softc; + lnc_softc_t *sc = ifp->if_softc; struct host_ring_entry *desc; int tmp; int end_of_packet; @@ -1373,7 +1373,7 @@ static int lnc_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { - struct lnc_softc *sc = ifp->if_softc; + lnc_softc_t *sc = ifp->if_softc; int s, error = 0; s = splimp(); @@ -1451,7 +1451,7 @@ lnc_watchdog(struct ifnet *ifp) #ifdef DEBUG void -lnc_dump_state(struct lnc_softc *sc) +lnc_dump_state(lnc_softc_t *sc) { int i; diff --git a/sys/dev/lnc/if_lnc_isa.c b/sys/dev/lnc/if_lnc_isa.c index 0bef8b5bac7c..f3fb26189c44 100644 --- a/sys/dev/lnc/if_lnc_isa.c +++ b/sys/dev/lnc/if_lnc_isa.c @@ -46,23 +46,23 @@ #include <dev/lnc/if_lncvar.h> #include <dev/lnc/if_lncreg.h> -int ne2100_probe __P((struct lnc_softc *, unsigned)); -int bicc_probe __P((struct lnc_softc *, unsigned)); -int depca_probe __P((struct lnc_softc *, unsigned)); -int lance_probe __P((struct lnc_softc *)); -int pcnet_probe __P((struct lnc_softc *)); +int ne2100_probe __P((lnc_softc_t *, unsigned)); +int bicc_probe __P((lnc_softc_t *, unsigned)); +int depca_probe __P((lnc_softc_t *, unsigned)); +int lance_probe __P((lnc_softc_t *)); +int pcnet_probe __P((lnc_softc_t *)); int lnc_probe __P((struct isa_device *)); int lnc_attach __P((struct isa_device *)); -static int dec_macaddr_extract __P((u_char[], struct lnc_softc *)); +static int dec_macaddr_extract __P((u_char[], lnc_softc_t *)); static ointhand2_t lncintr; -extern struct lnc_softc lnc_softc[]; -extern int lnc_attach_sc __P((struct lnc_softc *, int)); -extern void lncintr_sc __P((struct lnc_softc *)); +extern lnc_softc_t lnc_softc[]; +extern int lnc_attach_sc __P((lnc_softc_t *, int)); +extern void lncintr_sc __P((lnc_softc_t *)); int -ne2100_probe(struct lnc_softc *sc, unsigned iobase) +ne2100_probe(lnc_softc_t *sc, unsigned iobase) { int i; @@ -88,7 +88,7 @@ ne2100_probe(struct lnc_softc *sc, unsigned iobase) } int -bicc_probe(struct lnc_softc *sc, unsigned iobase) +bicc_probe(lnc_softc_t *sc, unsigned iobase) { int i; @@ -129,7 +129,7 @@ bicc_probe(struct lnc_softc *sc, unsigned iobase) * signature so keep searching for the signature first. */ static int -dec_macaddr_extract(u_char ring[], struct lnc_softc * sc) +dec_macaddr_extract(u_char ring[], lnc_softc_t * sc) { const unsigned char signature[] = {0xff, 0x00, 0x55, 0xaa, 0xff, 0x00, 0x55, 0xaa}; @@ -155,7 +155,7 @@ dec_macaddr_extract(u_char ring[], struct lnc_softc * sc) } int -depca_probe(struct lnc_softc *sc, unsigned iobase) +depca_probe(lnc_softc_t *sc, unsigned iobase) { int i; unsigned char maddr_ring[DEPCA_ADDR_ROM_SIZE]; @@ -178,7 +178,7 @@ depca_probe(struct lnc_softc *sc, unsigned iobase) } int -lance_probe(struct lnc_softc *sc) +lance_probe(lnc_softc_t *sc) { write_csr(sc, CSR0, STOP); @@ -198,7 +198,7 @@ lance_probe(struct lnc_softc *sc) } int -pcnet_probe(struct lnc_softc *sc) +pcnet_probe(lnc_softc_t *sc) { u_long chip_id; int type; @@ -247,7 +247,7 @@ lnc_probe(struct isa_device * isa_dev) { int nports; int unit = isa_dev->id_unit; - struct lnc_softc *sc = &lnc_softc[unit]; + lnc_softc_t *sc = &lnc_softc[unit]; unsigned iobase = isa_dev->id_iobase; #ifdef DIAGNOSTIC @@ -272,7 +272,7 @@ int lnc_attach(struct isa_device * isa_dev) { int unit = isa_dev->id_unit; - struct lnc_softc *sc = &lnc_softc[unit]; + lnc_softc_t *sc = &lnc_softc[unit]; int result; isa_dev->id_ointr = lncintr; @@ -296,6 +296,6 @@ lnc_attach(struct isa_device * isa_dev) static void lncintr(int unit) { - struct lnc_softc *sc = &lnc_softc[unit]; + lnc_softc_t *sc = &lnc_softc[unit]; lncintr_sc (sc); } diff --git a/sys/dev/lnc/if_lnc_pc98.c b/sys/dev/lnc/if_lnc_pc98.c index 459561993282..c476e9e5117d 100644 --- a/sys/dev/lnc/if_lnc_pc98.c +++ b/sys/dev/lnc/if_lnc_pc98.c @@ -52,8 +52,8 @@ #include <dev/lnc/if_lncvar.h> #include <dev/lnc/if_lncreg.h> -int pcnet_probe __P((struct lnc_softc *sc)); -static int cnet98s_probe __P((struct lnc_softc *sc, unsigned iobase)); +int pcnet_probe __P((lnc_softc_t *sc)); +static int cnet98s_probe __P((lnc_softc_t *sc, unsigned iobase)); /* C-NET(98)S port addresses */ #define CNET98S_RDP 0x400 /* Register Data Port */ @@ -85,7 +85,7 @@ static int cnet98s_probe __P((struct lnc_softc *sc, unsigned iobase)); #define LED_COLE 0x0001 /* Collision */ static int -cnet98s_probe(struct lnc_softc *sc, unsigned iobase) +cnet98s_probe(lnc_softc_t *sc, unsigned iobase) { int i; ushort tmp; diff --git a/sys/dev/lnc/if_lnc_pci.c b/sys/dev/lnc/if_lnc_pci.c index e459377ad17f..2c492641301f 100644 --- a/sys/dev/lnc/if_lnc_pci.c +++ b/sys/dev/lnc/if_lnc_pci.c @@ -47,8 +47,8 @@ #define PCI_DEVICE_ID_PCNet_PCI 0x20001022 #define PCI_DEVICE_ID_PCHome_PCI 0x20011022 -extern int pcnet_probe __P((struct lnc_softc *sc)); -extern int lnc_attach_sc __P((struct lnc_softc *sc, int unit)); +extern int pcnet_probe __P((lnc_softc_t *sc)); +extern int lnc_attach_sc __P((lnc_softc_t *sc, int unit)); static const char* lnc_pci_probe __P((pcici_t tag, pcidi_t type)); static void lnc_pci_attach __P((pcici_t config_id, int unit)); @@ -88,7 +88,7 @@ lnc_pci_attach(config_id, unit) pcici_t config_id; int unit; { - struct lnc_softc *sc; + lnc_softc_t *sc; unsigned iobase; unsigned data; /* scratch to make this device a bus master*/ int i; diff --git a/sys/dev/lnc/if_lncvar.h b/sys/dev/lnc/if_lncvar.h index 5a4de234a04c..ac1687b132e8 100644 --- a/sys/dev/lnc/if_lncvar.h +++ b/sys/dev/lnc/if_lncvar.h @@ -185,7 +185,7 @@ struct host_ring_entry { #define LNCSTATS(X) #endif -struct lnc_softc { +typedef struct lnc_softc { struct arpcom arpcom; /* see ../../net/if_arp.h */ struct nic_info nic; /* NIC specific info */ int nrdre; @@ -207,7 +207,7 @@ struct lnc_softc { int lnc_debug; #endif LNCSTATS_STRUCT -}; +} lnc_softc_t; #define NDESC(len2) (1 << len2) @@ -223,14 +223,14 @@ struct lnc_softc { #define TRANS_NEXT (sc->trans_ring->base + sc->trans_next) static __inline void -write_csr(struct lnc_softc *sc, u_short port, u_short val) +write_csr(lnc_softc_t *sc, u_short port, u_short val) { outw(sc->rap, port); outw(sc->rdp, val); } static __inline u_short -read_csr(struct lnc_softc *sc, u_short port) +read_csr(lnc_softc_t *sc, u_short port) { outw(sc->rap, port); return (inw(sc->rdp));