Mechanically convert to if_inc_counter().
This commit is contained in:
parent
006b95da09
commit
e1ed7fe8b1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271805
@ -1509,9 +1509,9 @@ sis_rxeof(struct sis_softc *sc)
|
||||
ETHER_CRC_LEN))
|
||||
rxstat &= ~SIS_RXSTAT_GIANT;
|
||||
if (SIS_RXSTAT_ERROR(rxstat) != 0) {
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
if (rxstat & SIS_RXSTAT_COLL)
|
||||
ifp->if_collisions++;
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||
sis_discard_rxbuf(rxd);
|
||||
continue;
|
||||
}
|
||||
@ -1519,7 +1519,7 @@ sis_rxeof(struct sis_softc *sc)
|
||||
/* Add a new receive buffer to the ring. */
|
||||
m = rxd->rx_m;
|
||||
if (sis_newbuf(sc, rxd) != 0) {
|
||||
ifp->if_iqdrops++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
|
||||
sis_discard_rxbuf(rxd);
|
||||
continue;
|
||||
}
|
||||
@ -1535,7 +1535,7 @@ sis_rxeof(struct sis_softc *sc)
|
||||
*/
|
||||
sis_fixup_rx(m);
|
||||
#endif
|
||||
ifp->if_ipackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
SIS_UNLOCK(sc);
|
||||
@ -1593,15 +1593,15 @@ sis_txeof(struct sis_softc *sc)
|
||||
m_freem(txd->tx_m);
|
||||
txd->tx_m = NULL;
|
||||
if ((txstat & SIS_CMDSTS_PKT_OK) != 0) {
|
||||
ifp->if_opackets++;
|
||||
ifp->if_collisions +=
|
||||
(txstat & SIS_TXSTAT_COLLCNT) >> 16;
|
||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
|
||||
(txstat & SIS_TXSTAT_COLLCNT) >> 16);
|
||||
} else {
|
||||
ifp->if_oerrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||
if (txstat & SIS_TXSTAT_EXCESSCOLLS)
|
||||
ifp->if_collisions++;
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||
if (txstat & SIS_TXSTAT_OUTOFWINCOLL)
|
||||
ifp->if_collisions++;
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||
}
|
||||
}
|
||||
sc->sis_tx_cnt--;
|
||||
@ -1664,7 +1664,7 @@ sis_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
|
||||
status = CSR_READ_4(sc, SIS_ISR);
|
||||
|
||||
if (status & (SIS_ISR_RX_ERR|SIS_ISR_RX_OFLOW))
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
|
||||
if (status & (SIS_ISR_RX_IDLE))
|
||||
SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
|
||||
@ -1722,7 +1722,7 @@ sis_intr(void *arg)
|
||||
sis_rxeof(sc);
|
||||
|
||||
if (status & SIS_ISR_RX_OFLOW)
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
|
||||
if (status & (SIS_ISR_RX_IDLE))
|
||||
SIS_SETBIT(sc, SIS_CSR, SIS_CSR_RX_ENABLE);
|
||||
@ -2197,7 +2197,7 @@ sis_watchdog(struct sis_softc *sc)
|
||||
return;
|
||||
|
||||
device_printf(sc->sis_dev, "watchdog timeout\n");
|
||||
sc->sis_ifp->if_oerrors++;
|
||||
if_inc_counter(sc->sis_ifp, IFCOUNTER_OERRORS, 1);
|
||||
|
||||
sc->sis_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
|
||||
sis_initl(sc);
|
||||
|
Loading…
Reference in New Issue
Block a user