@@ -1,4 +1,4 @@
-/* $NetBSD: midway.c,v 1.86 2009/03/14 15:36:17 dsl Exp $ */
+/* $NetBSD: midway.c,v 1.87 2009/03/15 15:52:12 cegger Exp $ */
/* (sync'd to midway.c 1.68) */
/*
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.86 2009/03/14 15:36:17 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.87 2009/03/15 15:52:12 cegger Exp $");
#include "opt_natm.h"
@@ -495,11 +495,7 @@
* that reads from the card.
*/
-STATIC INLINE u_int32_t en_read(sc, r)
-
-struct en_softc *sc;
-u_int32_t r;
-
+STATIC INLINE u_int32_t en_read(struct en_softc *sc, uint32_t r)
{
#ifdef EN_DEBUG_RANGE
@@ -515,11 +511,7 @@
* writes to the card.
*/
-STATIC INLINE void en_write(sc, r, v)
-
-struct en_softc *sc;
-u_int32_t r, v;
-
+STATIC INLINE void en_write(struct en_softc *sc, uint32_t r, uint32_t v)
{
#ifdef EN_DEBUG_RANGE
if (r > MID_MAXOFF || (r % 4))
@@ -533,10 +525,7 @@
* en_k2sz: convert KBytes to a size parameter (a log2)
*/
-STATIC INLINE int en_k2sz(k)
-
-int k;
-
+STATIC INLINE int en_k2sz(int k)
{
switch(k) {
case 1: return(0);
@@ -558,10 +547,7 @@
* en_b2sz: convert a DMA burst code to its byte size
*/
-STATIC INLINE int en_b2sz(b)
-
-int b;
-
+STATIC INLINE int en_b2sz(int b)
{
switch (b) {
case MIDDMA_WORD: return(1*4);
@@ -583,10 +569,7 @@
* en_sz2b: convert a burst size (bytes) to DMA burst code
*/
-STATIC INLINE int en_sz2b(sz)
-
-int sz;
-
+STATIC INLINE int en_sz2b(int sz)
{
switch (sz) {
case 1*4: return(MIDDMA_WORD);
@@ -604,12 +587,7 @@
* en_dqneed: calculate number of DTQ/DRQ's needed for a buffer
*/
-STATIC INLINE int en_dqneed(sc, data, len, tx)
-
-struct en_softc *sc;
-void *data;
-u_int len, tx;
-
+STATIC INLINE int en_dqneed(struct en_softc *sc, void *data, u_int len, u_int tx)
{
int result, needalign, sz;
@@ -670,11 +648,7 @@
* after this call the sum of all the m_len's in the chain will be totlen.
*/
-STATIC INLINE struct mbuf *en_mget(sc, totlen, drqneed)
-
-struct en_softc *sc;
-u_int totlen, *drqneed;
-
+STATIC INLINE struct mbuf *en_mget(struct en_softc *sc, u_int totlen, u_int *drqneed)
{
struct mbuf *m;
struct mbuf *top, **mp;
@@ -725,10 +699,7 @@
* autoconfig stuff
*/
-void en_attach(sc)
-
-struct en_softc *sc;
-
+void en_attach(struct en_softc *sc)
{
struct ifnet *ifp = &sc->enif;
int sz;
@@ -934,10 +905,7 @@
* p166: bestburstlen=64, alburst=0
*/
-STATIC void en_dmaprobe(sc)
-
-struct en_softc *sc;
-
+STATIC void en_dmaprobe(struct en_softc *sc)
{
u_int32_t srcbuf[64], dstbuf[64];
u_int8_t *sp, *dp;
@@ -1009,12 +977,7 @@
*/
int
-en_dmaprobe_doit(sc, sp, dp, wmtry)
-
-struct en_softc *sc;
-u_int8_t *sp, *dp;
-int wmtry;
-
+en_dmaprobe_doit(struct en_softc *sc, uint8_t *sp, uint8_t *dp, int wmtry)
{
int lcv, retval = 4, cnt, count;
u_int32_t reg, bcode, midvloc;
@@ -1145,12 +1108,7 @@
* txspeed[vci].
*/
-STATIC int en_ioctl(ifp, cmd, data)
-
-struct ifnet *ifp;
-EN_IOCTL_CMDT cmd;
-void *data;
-
+STATIC int en_ioctl(struct ifnet *ifp, EN_IOCTL_CMDT cmd, void *data)
{
#ifdef MISSING_IF_SOFTC
struct en_softc *sc = (struct en_softc *)device_lookup_private(&en_cd, ifp->if_unit);
@@ -1347,12 +1305,7 @@
* en_rxctl: turn on and off VCs for recv.
*/
-STATIC int en_rxctl(sc, pi, on)
-
-struct en_softc *sc;
-struct atm_pseudoioctl *pi;
-int on;
-
+STATIC int en_rxctl(struct en_softc *sc, struct atm_pseudoioctl *pi, int on)
{
u_int s, vci, flags, slot;
u_int32_t oldmode, newmode;
@@ -1445,10 +1398,7 @@
* must en_init to recover.
*/
-void en_reset(sc)
-
-struct en_softc *sc;
-
+void en_reset(struct en_softc *sc)
{
struct mbuf *m;
int lcv, slot;
@@ -1520,10 +1470,7 @@
* en_init: init board and sync the card with the data in the softc.
*/
-STATIC void en_init(sc)
-
-struct en_softc *sc;
-
+STATIC void en_init(struct en_softc *sc)
{
int vc, slot;
u_int32_t loc;
@@ -1641,11 +1588,7 @@
* en_loadvc: load a vc tab entry from a slot
*/
-STATIC void en_loadvc(sc, vc)
-
-struct en_softc *sc;
-int vc;
-
+STATIC void en_loadvc(struct en_softc *sc, int vc)
{
int slot;
u_int32_t reg = EN_READ(sc, MID_VC(vc));
@@ -1674,10 +1617,7 @@
* if there is one. note that atm_output() has already splnet()'d us.
*/
-STATIC void en_start(ifp)
-
-struct ifnet *ifp;
-
+STATIC void en_start(struct ifnet *ifp)
{
#ifdef MISSING_IF_SOFTC
struct en_softc *sc = (struct en_softc *)device_lookup_private(&en_cd, ifp->if_unit);
@@ -1868,11 +1808,7 @@
#ifndef __FreeBSD__
-STATIC int en_mfix(sc, mm, prev)
-
-struct en_softc *sc;
-struct mbuf **mm, *prev;
-
+STATIC int en_mfix(struct en_softc *sc, struct mbuf **mm, struct mbuf *prev)
{
struct mbuf *m, *new;
u_char *d, *cp;
@@ -2076,11 +2012,7 @@
* en_txdma: start transmit DMA, if possible
*/
-STATIC void en_txdma(sc, chan)
-
-struct en_softc *sc;
-int chan;
-
+STATIC void en_txdma(struct en_softc *sc, int chan)
{
struct mbuf *tmp;
struct atm_pseudohdr *ap;
@@ -2307,12 +2239,7 @@
* en_txlaunch: launch an mbuf into the DMA pool!
*/
-STATIC void en_txlaunch(sc, chan, l)
-
-struct en_softc *sc;
-int chan;
-struct en_launch *l;
-
+STATIC void en_txlaunch(struct en_softc *sc, int chan, struct en_launch *l)
{
struct mbuf *tmp;
u_int32_t cur = sc->txslot[chan].cur,
@@ -2664,10 +2591,7 @@
* interrupt handler
*/
-EN_INTR_TYPE en_intr(arg)
-
-void *arg;
-
+EN_INTR_TYPE en_intr(void *arg)
{
struct en_softc *sc = (struct en_softc *) arg;
struct mbuf *m;
@@ -2970,10 +2894,7 @@
*
*/
-STATIC void en_service(sc)
-
-struct en_softc *sc;
-
+STATIC void en_service(struct en_softc *sc)
{
struct mbuf *m, *tmp;
u_int32_t cur, dstart, rbd, pdu, *sav, dma, bcode, count, *data, *datastop;
@@ -3403,10 +3324,7 @@
#define END_BITS "\20\7SWSL\6DRQ\5DTQ\4RX\3TX\2MREGS\1STATS"
-int en_dump(unit, level)
-
-int unit, level;
-
+int en_dump(int unit, int level)
{
struct en_softc *sc;
int lcv, cnt, slot;
@@ -3573,10 +3491,7 @@
* en_dumpmem: dump the memory
*/
-int en_dumpmem(unit, addr, len)
-
-int unit, addr, len;
-
+int en_dumpmem(int unit, int addr, int len)
{
struct en_softc *sc;
u_int32_t reg;
@@ -3612,9 +3527,7 @@
* a round-robin fashion when en_start is called from tx complete
* interrupts.
*/
-static void rrp_add(sc, ifp)
- struct en_softc *sc;
- struct ifnet *ifp;
+static void rrp_add(struct en_softc *sc, struct ifnet *ifp)
{
struct rrp *head, *p, *new;
@@ -3655,9 +3568,7 @@
}
#if 0 /* not used */
-static void rrp_delete(sc, ifp)
- struct en_softc *sc;
- struct ifnet *ifp;
+static void rrp_delete(struct en_softc *sc, struct ifnet *ifp)
{
struct rrp *head, *p, *prev;
@@ -3747,8 +3658,7 @@
by Werner Almesberger, EPFL LRC */
static const int pre_div[] = { 4,16,128,2048 };
-static int en_pcr2txspeed(pcr)
- int pcr;
+static int en_pcr2txspeed(int pcr)
{
int pre, res, div;
@@ -3777,8 +3687,7 @@
return ((pre << 6) + res);
}
-static int en_txspeed2pcr(txspeed)
- int txspeed;
+static int en_txspeed2pcr(int txspeed)
{
int pre, res, pcr;
@@ -3794,11 +3703,7 @@
* since it assumes a transmit channel is already assigned by en_rxctl
* to the vc.
*/
-static int en_txctl(sc, vci, joint_vci, pcr)
- struct en_softc *sc;
- int vci;
- int joint_vci;
- int pcr;
+static int en_txctl(struct en_softc *sc, int vci, int joint_vci, int pcr)
{
int txspeed, txchan, s;
@@ -3856,9 +3761,7 @@
return (0);
}
-static int en_pvctx(sc, pvcreq)
- struct en_softc *sc;
- struct pvctxreq *pvcreq;
+static int en_pvctx(struct en_softc *sc, struct pvctxreq *pvcreq)
{
struct ifnet *ifp;
struct atm_pseudoioctl api;
@@ -3963,9 +3866,7 @@
return error;
}
-static int en_pvctxget(sc, pvcreq)
- struct en_softc *sc;
- struct pvctxreq *pvcreq;
+static int en_pvctxget(struct en_softc *sc, struct pvctxreq *pvcreq)
{
struct pvcsif *pvcsif;
struct ifnet *ifp;