Deleted Added
full compact
75c75
< __FBSDID("$FreeBSD: head/sys/dev/le/am7990.c 155881 2006-02-21 20:20:43Z marius $");
---
> __FBSDID("$FreeBSD: head/sys/dev/le/am7990.c 158663 2006-05-16 21:04:01Z marius $");
92a93,94
> #include <machine/bus.h>
>
217a220
> struct mbuf *m;
219a223,227
> #if defined(LANCE_REVC_BUG)
> struct ether_header *eh;
> /* Make sure this is short-aligned, for ether_cmp(). */
> static uint16_t bcast_enaddr[3] = { ~0, ~0, ~0 };
> #endif
231,232c239,242
< if (rmd.rmd1_bits & LE_R1_ERR) {
< if (rmd.rmd1_bits & LE_R1_ENP) {
---
> m = NULL;
> if ((rmd.rmd1_bits & (LE_R1_ERR | LE_R1_STP | LE_R1_ENP)) !=
> (LE_R1_STP | LE_R1_ENP)) {
> if (rmd.rmd1_bits & LE_R1_ERR) {
234,241c244,255
< if ((rmd.rmd1_bits & LE_R1_OFLO) == 0) {
< if (rmd.rmd1_bits & LE_R1_FRAM)
< if_printf(ifp,
< "framing error\n");
< if (rmd.rmd1_bits & LE_R1_CRC)
< if_printf(ifp,
< "crc mismatch\n");
< }
---
> if (rmd.rmd1_bits & LE_R1_ENP) {
> if ((rmd.rmd1_bits & LE_R1_OFLO) == 0) {
> if (rmd.rmd1_bits & LE_R1_FRAM)
> if_printf(ifp,
> "framing error\n");
> if (rmd.rmd1_bits & LE_R1_CRC)
> if_printf(ifp,
> "crc mismatch\n");
> }
> } else
> if (rmd.rmd1_bits & LE_R1_OFLO)
> if_printf(ifp, "overflow\n");
243,253c257,262
< } else {
< if (rmd.rmd1_bits & LE_R1_OFLO)
< if_printf(ifp, "overflow\n");
< }
< if (rmd.rmd1_bits & LE_R1_BUFF)
< if_printf(ifp, "receive buffer error\n");
< ifp->if_ierrors++;
< } else if ((rmd.rmd1_bits & (LE_R1_STP | LE_R1_ENP)) !=
< (LE_R1_STP | LE_R1_ENP)) {
< if_printf(ifp, "dropping chained buffer\n");
< ifp->if_ierrors++;
---
> if (rmd.rmd1_bits & LE_R1_BUFF)
> if_printf(ifp,
> "receive buffer error\n");
> } else if ((rmd.rmd1_bits & (LE_R1_STP | LE_R1_ENP)) !=
> (LE_R1_STP | LE_R1_ENP))
> if_printf(ifp, "dropping chained buffer\n");
257c266
< am7990_recv_print(sc, sc->sc_last_rd);
---
> am7990_recv_print(sc, bix);
259c268,269
< lance_read(sc, LE_RBUFADDR(sc, bix),
---
> /* Pull the packet off the interface. */
> m = lance_get(sc, LE_RBUFADDR(sc, bix),
268,276d277
< #ifdef LEDEBUG
< if (sc->sc_flags & LE_DEBUG)
< if_printf(ifp, "sc->sc_last_rd = %x, rmd: "
< "ladr %04x, hadr %02x, flags %02x, "
< "bcnt %04x, mcnt %04x\n",
< sc->sc_last_rd, rmd.rmd0, rmd.rmd1_hadr,
< rmd.rmd1_bits, rmd.rmd2, rmd.rmd3);
< #endif
<
278a280,306
>
> if (m != NULL) {
> ifp->if_ipackets++;
>
> #ifdef LANCE_REVC_BUG
> /*
> * The old LANCE (Rev. C) chips have a bug which
> * causes garbage to be inserted in front of the
> * received packet. The workaround is to ignore
> * packets with an invalid destination address
> * (garbage will usually not match).
> * Of course, this precludes multicast support...
> */
> eh = mtod(m, struct ether_header *);
> if (ether_cmp(eh->ether_dhost, sc->sc_enaddr) &&
> ether_cmp(eh->ether_dhost, bcast_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++;
395,399c423,427
< * 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.
532c560
< am7990_xmit_print(sc, sc->sc_last_td);
---
> am7990_xmit_print(sc, bix);