Added arpcom counters ipackets, opackets etc.
This commit is contained in:
parent
b8be8f1e63
commit
2103705fc5
@ -97,7 +97,7 @@ int is_probe(),is_attach(),is_watchdog();
|
||||
int is_ioctl(),is_init(),is_start();
|
||||
|
||||
static inline void is_rint(int unit);
|
||||
static inline void isread(struct is_softc*, char*, int);
|
||||
static inline void isread(struct is_softc*, unsigned char*, int);
|
||||
|
||||
struct mbuf *isget();
|
||||
|
||||
@ -206,6 +206,9 @@ int is_attach(isa_dev)
|
||||
|
||||
if_attach(ifp);
|
||||
|
||||
#if NBPFILTER > 0
|
||||
bpfattach(&is->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Search down the ifa address list looking for the AF_LINK type
|
||||
@ -232,10 +235,6 @@ entry
|
||||
}
|
||||
|
||||
printf (" ethernet address %s", ether_sprintf(is->arpcom.ac_enaddr)) ;
|
||||
|
||||
#if NBPFILTER > 0
|
||||
bpfattach(&is->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header));
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
@ -518,35 +517,43 @@ isintr(unit)
|
||||
|
||||
while((isr=isrdcsr(unit,0))&INTR) {
|
||||
if (isr&ERR) {
|
||||
if (isr&BABL)
|
||||
if (isr&BABL){
|
||||
printf("is%d:BABL\n",unit);
|
||||
if (isr&CERR)
|
||||
is->arpcom.ac_if.if_oerrors++;
|
||||
}
|
||||
if (isr&CERR) {
|
||||
printf("is%d:CERR\n",unit);
|
||||
if (isr&MISS)
|
||||
is->arpcom.ac_if.if_collisions++;
|
||||
}
|
||||
if (isr&MISS) {
|
||||
printf("is%d:MISS\n",unit);
|
||||
is->arpcom.ac_if.if_ierrors++;
|
||||
}
|
||||
if (isr&MERR)
|
||||
printf("is%d:MERR\n",unit);
|
||||
iswrcsr(unit,0,BABL|CERR|MISS|MERR|INEA);
|
||||
}
|
||||
if (!(isr&RXON)) {
|
||||
printf("!(isr&RXON)\n");
|
||||
is->arpcom.ac_if.if_ierrors++;
|
||||
is_reset(unit);
|
||||
return(1);
|
||||
}
|
||||
if (!(isr&TXON)) {
|
||||
printf("!(isr&TXON)\n");
|
||||
is->arpcom.ac_if.if_oerrors++;
|
||||
is_reset(unit);
|
||||
return(1);
|
||||
}
|
||||
|
||||
if (isr&RINT) {
|
||||
/* reset watchdog timer */
|
||||
is->arpcom.ac_if.if_timer = 0;
|
||||
/* reset watchdog timer */
|
||||
is->arpcom.ac_if.if_timer = 0;
|
||||
is_rint(unit);
|
||||
}
|
||||
if (isr&TINT) {
|
||||
/* reset watchdog timer */
|
||||
is->arpcom.ac_if.if_timer = 0;
|
||||
/* reset watchdog timer */
|
||||
is->arpcom.ac_if.if_timer = 0;
|
||||
iswrcsr(unit,0,TINT|INEA);
|
||||
istint(unit);
|
||||
}
|
||||
@ -561,6 +568,7 @@ istint(unit)
|
||||
int i,loopcount=0;
|
||||
struct mds *cdm;
|
||||
|
||||
is->arpcom.ac_if.if_opackets++;
|
||||
do {
|
||||
if ((i=is->last_td - is->no_td) < 0)
|
||||
i+=NTBUF;
|
||||
@ -630,7 +638,8 @@ static inline void is_rint(int unit)
|
||||
#if ISDEBUG >2
|
||||
recv_print(unit,is->last_rd);
|
||||
#endif
|
||||
isread(is,is->rbuf+(BUFSIZE*rmd),cdm->mcnt);
|
||||
isread(is,is->rbuf+(BUFSIZE*rmd),(int)cdm->mcnt);
|
||||
is->arpcom.ac_if.if_ipackets++;
|
||||
}
|
||||
|
||||
cdm->flags |= OWN;
|
||||
@ -648,7 +657,8 @@ static inline void is_rint(int unit)
|
||||
* Pass a packet to the higher levels.
|
||||
* We deal with the trailer protocol here.
|
||||
*/
|
||||
static inline void isread(struct is_softc *is, char *buf, int len)
|
||||
static inline void
|
||||
isread(struct is_softc *is, unsigned char *buf, int len)
|
||||
{
|
||||
register struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
|
Loading…
Reference in New Issue
Block a user