diff options
| author | Gleb Smirnoff <glebius@FreeBSD.org> | 2014-09-18 20:06:10 +0000 |
|---|---|---|
| committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2014-09-18 20:06:10 +0000 |
| commit | 006b95da091ade4d1d54028faf68d313a09b8865 (patch) | |
| tree | 2011bebeec0d6a347adf8ff5bbdb44df3cce542b /sys/dev/tx | |
| parent | 5941b6d1200e4bb6987baea9e5d9a38980d91f48 (diff) | |
Notes
Diffstat (limited to 'sys/dev/tx')
| -rw-r--r-- | sys/dev/tx/if_tx.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index 7a965588d9084..7a12aee288d19 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -671,7 +671,7 @@ epic_ifstart_locked(struct ifnet * ifp) if (error && error != EFBIG) { m_freem(m0); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } @@ -683,7 +683,7 @@ epic_ifstart_locked(struct ifnet * ifp) m = m_defrag(m0, M_NOWAIT); if (m == NULL) { m_freem(m0); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } m_freem(m0); @@ -693,7 +693,7 @@ epic_ifstart_locked(struct ifnet * ifp) epic_dma_map_txbuf, flist, 0); if (error) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -748,7 +748,7 @@ epic_rx_done(epic_softc_t *sc) * RXE interrupt usually. */ if ((desc->status & 1) == 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); desc->status = 0x8000; continue; } @@ -763,7 +763,7 @@ epic_rx_done(epic_softc_t *sc) if (buf->mbuf == NULL) { buf->mbuf = m; desc->status = 0x8000; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } buf->mbuf->m_len = buf->mbuf->m_pkthdr.len = MCLBYTES; @@ -775,7 +775,7 @@ epic_rx_done(epic_softc_t *sc) if (error) { buf->mbuf = m; desc->status = 0x8000; - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); continue; } @@ -796,7 +796,7 @@ epic_rx_done(epic_softc_t *sc) EPIC_LOCK(sc); /* Successfuly received frame */ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); } bus_dmamap_sync(sc->rtag, sc->rmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -838,10 +838,10 @@ epic_tx_done(epic_softc_t *sc) /* Check for errors and collisions. */ if (status & 0x0001) - sc->ifp->if_opackets++; + if_inc_counter(sc->ifp, IFCOUNTER_OPACKETS, 1); else - sc->ifp->if_oerrors++; - sc->ifp->if_collisions += (status >> 8) & 0x1F; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(sc->ifp, IFCOUNTER_COLLISIONS, (status >> 8) & 0x1F); #ifdef EPIC_DIAG if ((status & 0x1001) == 0x1001) device_printf(sc->dev, @@ -881,7 +881,7 @@ epic_intr(void *arg) #endif if ((CSR_READ_4(sc, COMMAND) & COMMAND_RXQUEUED) == 0) CSR_WRITE_4(sc, COMMAND, COMMAND_RXQUEUED); - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } } @@ -911,12 +911,12 @@ epic_intr(void *arg) #ifdef EPIC_DIAG device_printf(sc->dev, "CRC/Alignment error\n"); #endif - sc->ifp->if_ierrors++; + if_inc_counter(sc->ifp, IFCOUNTER_IERRORS, 1); } if (status & INTSTAT_TXU) { epic_tx_underrun(sc); - sc->ifp->if_oerrors++; + if_inc_counter(sc->ifp, IFCOUNTER_OERRORS, 1); } } } @@ -981,7 +981,7 @@ epic_timer(void *arg) /* If not successful. */ if (sc->pending_txs > 0) { - ifp->if_oerrors += sc->pending_txs; + if_inc_counter(ifp, IFCOUNTER_OERRORS, sc->pending_txs); /* Reinitialize board. */ device_printf(sc->dev, "reinitialization\n"); |
