summaryrefslogtreecommitdiff
path: root/sys/dev/snc
diff options
context:
space:
mode:
authorYoshihiro Takahashi <nyan@FreeBSD.org>2012-11-10 14:58:06 +0000
committerYoshihiro Takahashi <nyan@FreeBSD.org>2012-11-10 14:58:06 +0000
commit7a1cea226cd5e1ddd57555a87465010557b89630 (patch)
tree7fe0a3d57f503d604b175ef8b6e3d7bec4e5c305 /sys/dev/snc
parent2de04c22e5bca0fe7b55a62d5fa35e442fdf2085 (diff)
Notes
Diffstat (limited to 'sys/dev/snc')
-rw-r--r--sys/dev/snc/dp83932.c89
-rw-r--r--sys/dev/snc/dp83932subr.c100
-rw-r--r--sys/dev/snc/if_snc.c26
-rw-r--r--sys/dev/snc/if_snc_cbus.c9
4 files changed, 63 insertions, 161 deletions
diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c
index f86ad7ebfe1d..17b67cd418f7 100644
--- a/sys/dev/snc/dp83932.c
+++ b/sys/dev/snc/dp83932.c
@@ -142,10 +142,8 @@ int sncdebug = 0;
int
-sncconfig(sc, media, nmedia, defmedia, myea)
- struct snc_softc *sc;
- int *media, nmedia, defmedia;
- u_int8_t *myea;
+sncconfig(struct snc_softc *sc, int *media, int nmedia, int defmedia,
+ u_int8_t *myea)
{
struct ifnet *ifp;
int i;
@@ -195,8 +193,7 @@ sncconfig(sc, media, nmedia, defmedia, myea)
}
void
-sncshutdown(arg)
- void *arg;
+sncshutdown(void *arg)
{
struct snc_softc *sc = arg;
@@ -208,8 +205,7 @@ sncshutdown(arg)
* Media change callback.
*/
int
-snc_mediachange(ifp)
- struct ifnet *ifp;
+snc_mediachange(struct ifnet *ifp)
{
struct snc_softc *sc = ifp->if_softc;
int error;
@@ -227,9 +223,7 @@ snc_mediachange(ifp)
* Media status callback.
*/
void
-snc_mediastatus(ifp, ifmr)
- struct ifnet *ifp;
- struct ifmediareq *ifmr;
+snc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
{
struct snc_softc *sc = ifp->if_softc;
@@ -248,10 +242,7 @@ snc_mediastatus(ifp, ifmr)
static int
-sncioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
+sncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct ifreq *ifr;
struct snc_softc *sc = ifp->if_softc;
@@ -317,8 +308,7 @@ sncioctl(ifp, cmd, data)
* Encapsulate a packet of type family for the local net.
*/
static void
-sncstart(ifp)
- struct ifnet *ifp;
+sncstart(struct ifnet *ifp)
{
struct snc_softc *sc = ifp->if_softc;
@@ -328,8 +318,7 @@ sncstart(ifp)
}
static void
-sncstart_locked(ifp)
- struct ifnet *ifp;
+sncstart_locked(struct ifnet *ifp)
{
struct snc_softc *sc = ifp->if_softc;
struct mbuf *m;
@@ -390,16 +379,14 @@ outloop:
* hardware/software errors.
*/
static void
-sncreset(sc)
- struct snc_softc *sc;
+sncreset(struct snc_softc *sc)
{
sncstop(sc);
sncinit_locked(sc);
}
static void
-sncinit(xsc)
- void *xsc;
+sncinit(void *xsc)
{
struct snc_softc *sc = xsc;
@@ -476,8 +463,7 @@ sncinit_locked(struct snc_softc *sc)
* part way through.
*/
static int
-sncstop(sc)
- struct snc_softc *sc;
+sncstop(struct snc_softc *sc)
{
struct mtd *mtd;
@@ -536,10 +522,7 @@ sncwatchdog(void *arg)
* stuff packet into sonic
*/
static u_int
-sonicput(sc, m0, mtd_next)
- struct snc_softc *sc;
- struct mbuf *m0;
- int mtd_next;
+sonicput(struct snc_softc *sc, struct mbuf *m0, int mtd_next)
{
struct mtd *mtdp;
struct mbuf *m;
@@ -629,8 +612,7 @@ sonicput(sc, m0, mtd_next)
* CAM support
*/
static void
-caminitialise(sc)
- struct snc_softc *sc;
+caminitialise(struct snc_softc *sc)
{
u_int32_t v_cda = sc->v_cda;
int i;
@@ -653,10 +635,7 @@ caminitialise(sc)
}
static void
-camentry(sc, entry, ea)
- int entry;
- u_char *ea;
- struct snc_softc *sc;
+camentry(struct snc_softc *sc, int entry, u_char *ea)
{
u_int32_t v_cda = sc->v_cda;
int camoffset = entry * CDA_CAMDESC;
@@ -670,8 +649,7 @@ camentry(sc, entry, ea)
}
static void
-camprogram(sc)
- struct snc_softc *sc;
+camprogram(struct snc_softc *sc)
{
struct ifmultiaddr *ifma;
struct ifnet *ifp;
@@ -732,8 +710,7 @@ camprogram(sc)
#ifdef SNCDEBUG
static void
-camdump(sc)
- struct snc_softc *sc;
+camdump(struct snc_softc *sc)
{
int i;
@@ -758,8 +735,7 @@ camdump(sc)
#endif
static void
-initialise_tda(sc)
- struct snc_softc *sc;
+initialise_tda(struct snc_softc *sc)
{
struct mtd *mtd;
int i;
@@ -780,8 +756,7 @@ initialise_tda(sc)
}
static void
-initialise_rda(sc)
- struct snc_softc *sc;
+initialise_rda(struct snc_softc *sc)
{
int i;
u_int32_t vv_rda = 0;
@@ -809,8 +784,7 @@ initialise_rda(sc)
}
static void
-initialise_rra(sc)
- struct snc_softc *sc;
+initialise_rra(struct snc_softc *sc)
{
int i;
u_int v;
@@ -842,8 +816,7 @@ initialise_rra(sc)
}
void
-sncintr(arg)
- void *arg;
+sncintr(void *arg)
{
struct snc_softc *sc = (struct snc_softc *)arg;
int isr;
@@ -912,8 +885,7 @@ sncintr(arg)
* Transmit interrupt routine
*/
static void
-sonictxint(sc)
- struct snc_softc *sc;
+sonictxint(struct snc_softc *sc)
{
struct mtd *mtd;
u_int32_t txp;
@@ -990,8 +962,7 @@ sonictxint(sc)
* Receive interrupt routine
*/
static void
-sonicrxint(sc)
- struct snc_softc *sc;
+sonicrxint(struct snc_softc *sc)
{
u_int32_t rda;
int orra;
@@ -1084,10 +1055,7 @@ sonicrxint(sc)
* appropriate protocol handler
*/
static int
-sonic_read(sc, pkt, len)
- struct snc_softc *sc;
- u_int32_t pkt;
- int len;
+sonic_read(struct snc_softc *sc, u_int32_t pkt, int len)
{
struct ifnet *ifp = sc->sc_ifp;
struct ether_header *et;
@@ -1131,10 +1099,7 @@ sonic_read(sc, pkt, len)
* munge the received packet into an mbuf chain
*/
static struct mbuf *
-sonic_get(sc, pkt, datalen)
- struct snc_softc *sc;
- u_int32_t pkt;
- int datalen;
+sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen)
{
struct mbuf *m, *top, **mp;
int len;
@@ -1194,8 +1159,7 @@ sonic_get(sc, pkt, datalen)
* Enable power on the interface.
*/
int
-snc_enable(sc)
- struct snc_softc *sc;
+snc_enable(struct snc_softc *sc)
{
#ifdef SNCDEBUG
@@ -1217,8 +1181,7 @@ snc_enable(sc)
* Disable power on the interface.
*/
void
-snc_disable(sc)
- struct snc_softc *sc;
+snc_disable(struct snc_softc *sc)
{
#ifdef SNCDEBUG
diff --git a/sys/dev/snc/dp83932subr.c b/sys/dev/snc/dp83932subr.c
index 35c94a820907..a34c554aa5e1 100644
--- a/sys/dev/snc/dp83932subr.c
+++ b/sys/dev/snc/dp83932subr.c
@@ -73,9 +73,7 @@ static __inline u_int16_t snc_nec16_select_bank
* to accept packets.
*/
int
-sncsetup(sc, lladdr)
- struct snc_softc *sc;
- u_int8_t *lladdr;
+sncsetup(struct snc_softc *sc, u_int8_t *lladdr)
{
u_int32_t p, pp;
int i;
@@ -172,8 +170,7 @@ sncsetup(sc, lladdr)
* check if a specified irq is acceptable.
*/
u_int8_t
-snc_nec16_validate_irq(irq)
- int irq;
+snc_nec16_validate_irq(int irq)
{
const u_int8_t encoded_irq[16] = {
-1, -1, -1, 0, -1, 1, 2, -1, -1, 3, 4, -1, 5, 6, -1, -1
@@ -186,9 +183,7 @@ snc_nec16_validate_irq(irq)
* specify irq to board.
*/
int
-snc_nec16_register_irq(sc, irq)
- struct snc_softc *sc;
- int irq;
+snc_nec16_register_irq(struct snc_softc *sc, int irq)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@@ -212,8 +207,7 @@ snc_nec16_register_irq(sc, irq)
* check if a specified memory base address is acceptable.
*/
int
-snc_nec16_validate_mem(maddr)
- int maddr;
+snc_nec16_validate_mem(int maddr)
{
/* Check on Normal mode with max range, only */
@@ -230,9 +224,7 @@ snc_nec16_validate_mem(maddr)
* specify memory base address to board and map to first bank.
*/
int
-snc_nec16_register_mem(sc, maddr)
- struct snc_softc *sc;
- int maddr;
+snc_nec16_register_mem(struct snc_softc *sc, int maddr)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@@ -260,11 +252,8 @@ snc_nec16_register_mem(sc, maddr)
}
int
-snc_nec16_check_memory(iot, ioh, memt, memh)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
- bus_space_tag_t memt;
- bus_space_handle_t memh;
+snc_nec16_check_memory(bus_space_tag_t iot, bus_space_handle_t ioh,
+ bus_space_tag_t memt, bus_space_handle_t memh)
{
u_int16_t val;
int i, j;
@@ -341,14 +330,9 @@ snc_nec16_check_memory(iot, ioh, memt, memh)
}
int
-snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
- bus_space_tag_t memt;
- bus_space_handle_t memh;
- int irq;
- int maddr;
- u_int8_t type;
+snc_nec16_detectsubr(bus_space_tag_t iot, bus_space_handle_t ioh,
+ bus_space_tag_t memt, bus_space_handle_t memh, int irq, int maddr,
+ u_int8_t type)
{
u_int16_t cr;
u_int8_t ident;
@@ -413,8 +397,7 @@ snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type)
#define SNC_NEC_SERIES_PNP_CBUS2 0x3d
u_int8_t *
-snc_nec16_detect_type(myea)
- u_int8_t *myea;
+snc_nec16_detect_type(u_int8_t *myea)
{
u_int32_t vendor = (myea[0] << 16) | (myea[1] << 8) | myea[2];
u_int8_t series = myea[3];
@@ -459,10 +442,8 @@ snc_nec16_detect_type(myea)
}
int
-snc_nec16_get_enaddr(iot, ioh, myea)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
- u_int8_t *myea;
+snc_nec16_get_enaddr(bus_space_tag_t iot, bus_space_handle_t ioh,
+ u_int8_t *myea)
{
u_int8_t eeprom[SNEC_EEPROM_SIZE];
u_int8_t rom_sum, sum = 0x00;
@@ -493,9 +474,7 @@ snc_nec16_get_enaddr(iot, ioh, myea)
* read from NEC/SONIC NIC register.
*/
u_int16_t
-snc_nec16_nic_get(sc, reg)
- struct snc_softc *sc;
- u_int8_t reg;
+snc_nec16_nic_get(struct snc_softc *sc, u_int8_t reg)
{
u_int16_t val;
@@ -510,10 +489,7 @@ snc_nec16_nic_get(sc, reg)
* write to NEC/SONIC NIC register.
*/
void
-snc_nec16_nic_put(sc, reg, val)
- struct snc_softc *sc;
- u_int8_t reg;
- u_int16_t val;
+snc_nec16_nic_put(struct snc_softc *sc, u_int8_t reg, u_int16_t val)
{
/* select SONIC register */
@@ -527,10 +503,7 @@ snc_nec16_nic_put(sc, reg, val)
* where exists specified (internal buffer memory) offset.
*/
static __inline u_int16_t
-snc_nec16_select_bank(sc, base, offset)
- struct snc_softc *sc;
- u_int32_t base;
- u_int32_t offset;
+snc_nec16_select_bank(struct snc_softc *sc, u_int32_t base, u_int32_t offset)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
@@ -565,11 +538,8 @@ snc_nec16_select_bank(sc, base, offset)
* write to SONIC descriptors.
*/
void
-snc_nec16_writetodesc(sc, base, offset, val)
- struct snc_softc *sc;
- u_int32_t base;
- u_int32_t offset;
- u_int16_t val;
+snc_nec16_writetodesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset,
+ u_int16_t val)
{
bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh;
@@ -584,10 +554,7 @@ snc_nec16_writetodesc(sc, base, offset, val)
* read from SONIC descriptors.
*/
u_int16_t
-snc_nec16_readfromdesc(sc, base, offset)
- struct snc_softc *sc;
- u_int32_t base;
- u_int32_t offset;
+snc_nec16_readfromdesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset)
{
bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh;
@@ -602,11 +569,8 @@ snc_nec16_readfromdesc(sc, base, offset)
* read from SONIC data buffer.
*/
void
-snc_nec16_copyfrombuf(sc, dst, offset, size)
- struct snc_softc *sc;
- void *dst;
- u_int32_t offset;
- size_t size;
+snc_nec16_copyfrombuf(struct snc_softc *sc, void *dst, u_int32_t offset,
+ size_t size)
{
bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh;
@@ -644,11 +608,8 @@ snc_nec16_copyfrombuf(sc, dst, offset, size)
* write to SONIC data buffer.
*/
void
-snc_nec16_copytobuf(sc, src, offset, size)
- struct snc_softc *sc;
- void *src;
- u_int32_t offset;
- size_t size;
+snc_nec16_copytobuf(struct snc_softc *sc, void *src, u_int32_t offset,
+ size_t size)
{
bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh;
@@ -688,10 +649,7 @@ snc_nec16_copytobuf(sc, src, offset, size)
* write (fill) 0 to SONIC data buffer.
*/
void
-snc_nec16_zerobuf(sc, offset, size)
- struct snc_softc *sc;
- u_int32_t offset;
- size_t size;
+snc_nec16_zerobuf(struct snc_softc *sc, u_int32_t offset, size_t size)
{
bus_space_tag_t memt = sc->sc_memt;
bus_space_handle_t memh = sc->sc_memh;
@@ -735,10 +693,8 @@ snc_nec16_zerobuf(sc, offset, size)
#define SNEC_EEP_DELAY 1000
void
-snc_nec16_read_eeprom(iot, ioh, data)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
- u_int8_t *data;
+snc_nec16_read_eeprom(bus_space_tag_t iot, bus_space_handle_t ioh,
+ u_int8_t *data)
{
u_int8_t n, val, bit;
@@ -851,9 +807,7 @@ snc_nec16_read_eeprom(iot, ioh, data)
#ifdef SNCDEBUG
void
-snc_nec16_dump_reg(iot, ioh)
- bus_space_tag_t iot;
- bus_space_handle_t ioh;
+snc_nec16_dump_reg(bus_space_tag_t iot, bus_space_handle_t ioh)
{
u_int8_t n;
u_int16_t val;
diff --git a/sys/dev/snc/if_snc.c b/sys/dev/snc/if_snc.c
index 02ac7eb764fb..914a406f635c 100644
--- a/sys/dev/snc/if_snc.c
+++ b/sys/dev/snc/if_snc.c
@@ -66,9 +66,7 @@ devclass_t snc_devclass;
* Allocate a port resource with the given resource id.
*/
int
-snc_alloc_port(dev, rid)
- device_t dev;
- int rid;
+snc_alloc_port(device_t dev, int rid)
{
struct snc_softc *sc = device_get_softc(dev);
struct resource *res;
@@ -91,9 +89,7 @@ snc_alloc_port(dev, rid)
* Allocate a memory resource with the given resource id.
*/
int
-snc_alloc_memory(dev, rid)
- device_t dev;
- int rid;
+snc_alloc_memory(device_t dev, int rid)
{
struct snc_softc *sc = device_get_softc(dev);
struct resource *res;
@@ -116,10 +112,7 @@ snc_alloc_memory(dev, rid)
* Allocate an irq resource with the given resource id.
*/
int
-snc_alloc_irq(dev, rid, flags)
- device_t dev;
- int rid;
- int flags;
+snc_alloc_irq(device_t dev, int rid, int flags)
{
struct snc_softc *sc = device_get_softc(dev);
struct resource *res;
@@ -139,8 +132,7 @@ snc_alloc_irq(dev, rid, flags)
* Release all resources
*/
void
-snc_release_resources(dev)
- device_t dev;
+snc_release_resources(device_t dev)
{
struct snc_softc *sc = device_get_softc(dev);
@@ -170,9 +162,7 @@ snc_release_resources(dev)
****************************************************************/
int
-snc_probe(dev, type)
- device_t dev;
- int type;
+snc_probe(device_t dev, int type)
{
struct snc_softc *sc = device_get_softc(dev);
@@ -188,8 +178,7 @@ snc_probe(dev, type)
****************************************************************/
int
-snc_attach(dev)
- device_t dev;
+snc_attach(device_t dev)
{
struct snc_softc *sc = device_get_softc(dev);
u_int8_t myea[ETHER_ADDR_LEN];
@@ -253,8 +242,7 @@ snc_attach(dev)
****************************************************************/
int
-snc_shutdown(dev)
- device_t dev;
+snc_shutdown(device_t dev)
{
struct snc_softc *sc = device_get_softc(dev);
diff --git a/sys/dev/snc/if_snc_cbus.c b/sys/dev/snc/if_snc_cbus.c
index e859b7ad8d75..c3c7946a4b65 100644
--- a/sys/dev/snc/if_snc_cbus.c
+++ b/sys/dev/snc/if_snc_cbus.c
@@ -68,8 +68,7 @@ static struct isa_pnp_id snc_ids[] = {
};
static void
-snc_isapnp_reconfig(dev)
- device_t dev;
+snc_isapnp_reconfig(device_t dev)
{
struct isa_device *idev = DEVTOISA(dev);
struct isa_config config;
@@ -111,8 +110,7 @@ snc_isapnp_reconfig(dev)
}
static int
-snc_isa_probe(dev)
- device_t dev;
+snc_isa_probe(device_t dev)
{
struct snc_softc *sc = device_get_softc(dev);
int type;
@@ -177,8 +175,7 @@ snc_isa_probe(dev)
}
static int
-snc_isa_attach(dev)
- device_t dev;
+snc_isa_attach(device_t dev)
{
struct snc_softc *sc = device_get_softc(dev);