Deleted Added
full compact
113c113
< __FBSDID("$FreeBSD: head/sys/dev/le/am79900.c 155881 2006-02-21 20:20:43Z marius $");
---
> __FBSDID("$FreeBSD: head/sys/dev/le/am79900.c 158663 2006-05-16 21:04:01Z marius $");
130a131,132
> #include <machine/bus.h>
>
257a260
> struct mbuf *m;
260a264,266
> #if defined(__i386__) && !defined(PC98)
> struct ether_header *eh;
> #endif
273,274c279,282
< if (rmd1 & LE_R1_ERR) {
< if (rmd1 & LE_R1_ENP) {
---
> m = NULL;
> if ((rmd1 & (LE_R1_ERR | LE_R1_STP | LE_R1_ENP)) !=
> (LE_R1_STP | LE_R1_ENP)){
> if (rmd1 & LE_R1_ERR) {
276,283c284,295
< if ((rmd1 & LE_R1_OFLO) == 0) {
< if (rmd1 & LE_R1_FRAM)
< if_printf(ifp,
< "framing error\n");
< if (rmd1 & LE_R1_CRC)
< if_printf(ifp,
< "crc mismatch\n");
< }
---
> if (rmd1 & LE_R1_ENP) {
> if ((rmd1 & LE_R1_OFLO) == 0) {
> if (rmd1 & LE_R1_FRAM)
> if_printf(ifp,
> "framing error\n");
> if (rmd1 & LE_R1_CRC)
> if_printf(ifp,
> "crc mismatch\n");
> }
> } else
> if (rmd1 & LE_R1_OFLO)
> if_printf(ifp, "overflow\n");
285,295c297,302
< } else {
< if (rmd1 & LE_R1_OFLO)
< if_printf(ifp, "overflow\n");
< }
< if (rmd1 & LE_R1_BUFF)
< if_printf(ifp, "receive buffer error\n");
< ifp->if_ierrors++;
< } else if ((rmd1 & (LE_R1_STP | LE_R1_ENP)) !=
< (LE_R1_STP | LE_R1_ENP)) {
< if_printf(ifp, "dropping chained buffer\n");
< ifp->if_ierrors++;
---
> if (rmd1 & LE_R1_BUFF)
> if_printf(ifp,
> "receive buffer error\n");
> } else if ((rmd1 & (LE_R1_STP | LE_R1_ENP)) !=
> (LE_R1_STP | LE_R1_ENP))
> if_printf(ifp, "dropping chained buffer\n");
299c306
< am79900_recv_print(sc, sc->sc_last_rd);
---
> am79900_recv_print(sc, bix);
301c308,309
< lance_read(sc, LE_RBUFADDR(sc, bix),
---
> /* Pull the packet off the interface. */
> m = lance_get(sc, LE_RBUFADDR(sc, bix),
311,318d318
< #ifdef LEDEBUG
< if (sc->sc_flags & LE_DEBUG)
< if_printf(ifp, "sc->sc_last_rd = %x, rmd: "
< "adr %08x, flags/blen %08x\n",
< sc->sc_last_rd, LE_LE32TOH(rmd.rmd0),
< LE_LE32TOH(rmd.rmd1));
< #endif
<
320a321,343
>
> if (m != NULL) {
> ifp->if_ipackets++;
>
> #if defined(__i386__) && !defined(PC98)
> /*
> * The VMware LANCE does not present IFF_SIMPLEX
> * behavior on multicast packets. Thus drop the
> * packet if it is from ourselves.
> */
> eh = mtod(m, struct ether_header *);
> if (!ether_cmp(eh->ether_shost, sc->sc_enaddr)) {
> m_freem(m);
> continue;
> }
> #endif
>
> /* Pass the packet up. */
> LE_UNLOCK(sc);
> (*ifp->if_input)(ifp, m);
> LE_LOCK(sc);
> } else
> ifp->if_ierrors++;
342a366,367
> tmd1 = LE_LE32TOH(tmd.tmd1);
>
347c372
< LE_LE32TOH(tmd.tmd0), LE_LE32TOH(tmd.tmd1));
---
> LE_LE32TOH(tmd.tmd0), tmd1);
350d374
< tmd1 = LE_LE32TOH(tmd.tmd1);
356d379
< tmd2 = LE_LE32TOH(tmd.tmd2);
357a381
> tmd2 = LE_LE32TOH(tmd.tmd2);
437,441c461,465
< * could completely miss some interrupt events as the the NIC
< * can change these flags while we're in this handler. We turn
< * of interrupts while processing them so we don't get another
< * one while we still process the previous one in ifp->if_input()
< * with the driver lock dropped.
---
> * could completely miss some interrupt events as the NIC can
> * change these flags while we're in this handler. We turn off
> * interrupts so we don't get another RX interrupt while still
> * processing the previous one in ifp->if_input() with the
> * driver lock dropped.
575c599
< am79900_xmit_print(sc, sc->sc_last_td);
---
> am79900_xmit_print(sc, bix);