diff options
author | dg <dg@FreeBSD.org> | 1995-12-05 02:01:59 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-12-05 02:01:59 +0000 |
commit | 8156a5707a8830d1ce5658e103e6780f22cfc8dd (patch) | |
tree | 85cbbd7c1e0b938f939f958fcf5fd93d4c5c5406 /sys/i386/isa/if_cx.c | |
parent | fd5819ba7c85b8236d4b1f4cc3340e673229a93a (diff) | |
download | FreeBSD-src-8156a5707a8830d1ce5658e103e6780f22cfc8dd.zip FreeBSD-src-8156a5707a8830d1ce5658e103e6780f22cfc8dd.tar.gz |
all:
Removed ifnet.if_init and ifnet.if_reset as they are generally unused.
Change the parameter passed to if_watchdog to be a ifnet * rather than
a unit number. All of this is an attempt to move toward not needing an
array of softc pointers (which is usually static in size) to point to
the driver softc.
if_ed.c:
Changed some of the argument passing to some functions to make a little
more sense.
if_ep.c, if_vx.c:
Killed completely bogus use of if_timer. It was being set in such a way
that the interface was being reset once per second (blech!).
Diffstat (limited to 'sys/i386/isa/if_cx.c')
-rw-r--r-- | sys/i386/isa/if_cx.c | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/sys/i386/isa/if_cx.c b/sys/i386/isa/if_cx.c index 59e25ed..1520f95 100644 --- a/sys/i386/isa/if_cx.c +++ b/sys/i386/isa/if_cx.c @@ -50,8 +50,7 @@ # define CDEV_MAJOR 42 /*XXX*/ /* replace with variable ASAP*/ # include <sys/devconf.h> # endif -# define init_func_t void(*)(int) -# define watchdog_func_t void(*)(int) +# define watchdog_func_t void(*)(struct ifnet *) # define start_func_t void(*)(struct ifnet*) #endif @@ -116,9 +115,8 @@ extern void cxswitch __P((cx_chan_t *c, cx_soft_opt_t new)); #define IFNETSZ (sizeof (struct ifnet)) int cxsioctl (struct ifnet *ifp, int cmd, caddr_t data); -void cxinit (int unit); void cxstart (struct ifnet *ifp); -void cxwatchdog (int unit); +void cxwatchdog (struct ifnet *ifp); void cxinput (cx_chan_t *c, void *buf, unsigned len); int cxrinta (cx_chan_t *c); void cxtinta (cx_chan_t *c); @@ -345,7 +343,6 @@ void cxattach (struct device *parent, struct device *self, void *aux) c->ifp->if_start = (start_func_t) cxstart; c->ifp->if_watchdog = (watchdog_func_t) cxwatchdog; /* Init routine is never called by upper level? */ - c->ifp->if_init = (init_func_t) cxinit; sppp_attach (c->ifp); if_attach (c->ifp); #if NBPFILTER > 0 @@ -531,32 +528,6 @@ void cxup (cx_chan_t *c) } /* - * Initialization of interface. - */ -void cxinit (int unit) -{ - cx_chan_t *q, *c = cxchan[unit]; - int s = splimp(); - - print (("cx%d.%d: cxinit\n", c->board->num, c->num)); - - cxdown (c); - - /* Stop all slave subchannels. */ - for (q=c->slaveq; q; q=q->slaveq) - cxdown (q); - - if (c->ifp->if_flags & IFF_RUNNING) { - cxup (c); - - /* Start all slave subchannels. */ - for (q=c->slaveq; q; q=q->slaveq) - cxup (q); - } - splx (s); -} - -/* * Fill transmitter buffer with data. */ void cxput (cx_chan_t *c, char b) @@ -702,13 +673,13 @@ void cxstart (struct ifnet *ifp) * Recover after lost transmit interrupts. * Always called on splimp(). */ -void cxwatchdog (int unit) +void cxwatchdog (struct ifnet *ifp) { - cx_chan_t *q, *c = cxchan[unit]; + cx_chan_t *q, *c = cxchan[ifp->if_unit]; - if (! (c->ifp->if_flags & IFF_RUNNING)) + if (! (ifp->if_flags & IFF_RUNNING)) return; - if (c->ifp->if_flags & IFF_DEBUG) + if (ifp->if_flags & IFF_DEBUG) printf ("cx%d.%d: device timeout\n", c->board->num, c->num); cxdown (c); @@ -719,7 +690,7 @@ void cxwatchdog (int unit) for (q=c->slaveq; q; q=q->slaveq) cxup (q); - cxstart (c->ifp); + cxstart (ifp); } /* |