mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
Mechanically convert to if_inc_counter().
This commit is contained in:
parent
eed9bc6a5b
commit
dde47b5589
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271827
@ -1121,7 +1121,7 @@ my_rxeof(struct my_softc * sc)
|
||||
sc->my_cdata.my_rx_head = cur_rx->my_nextdesc;
|
||||
|
||||
if (rxstat & MY_ES) { /* error summary: give up this rx pkt */
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
cur_rx->my_ptr->my_status = MY_OWNByNIC;
|
||||
continue;
|
||||
}
|
||||
@ -1134,7 +1134,7 @@ my_rxeof(struct my_softc * sc)
|
||||
total_len, 0, ifp, NULL);
|
||||
cur_rx->my_ptr->my_status = MY_OWNByNIC;
|
||||
if (m == NULL) {
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@ -1147,14 +1147,14 @@ my_rxeof(struct my_softc * sc)
|
||||
* little else we can do in this situation.
|
||||
*/
|
||||
if (my_newbuf(sc, cur_rx) == ENOBUFS) {
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
cur_rx->my_ptr->my_status = MY_OWNByNIC;
|
||||
continue;
|
||||
}
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len;
|
||||
}
|
||||
ifp->if_ipackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
|
||||
eh = mtod(m, struct ether_header *);
|
||||
#if NBPFILTER > 0
|
||||
/*
|
||||
@ -1212,16 +1212,16 @@ my_txeof(struct my_softc * sc)
|
||||
break;
|
||||
if (!(CSR_READ_4(sc, MY_TCRRCR) & MY_Enhanced)) {
|
||||
if (txstat & MY_TXERR) {
|
||||
ifp->if_oerrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||
if (txstat & MY_EC) /* excessive collision */
|
||||
ifp->if_collisions++;
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||
if (txstat & MY_LC) /* late collision */
|
||||
ifp->if_collisions++;
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1);
|
||||
}
|
||||
ifp->if_collisions += (txstat & MY_NCRMASK) >>
|
||||
MY_NCRShift;
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
|
||||
(txstat & MY_NCRMASK) >> MY_NCRShift);
|
||||
}
|
||||
ifp->if_opackets++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
|
||||
m_freem(cur_tx->my_mbuf);
|
||||
cur_tx->my_mbuf = NULL;
|
||||
if (sc->my_cdata.my_tx_head == sc->my_cdata.my_tx_tail) {
|
||||
@ -1232,7 +1232,7 @@ my_txeof(struct my_softc * sc)
|
||||
sc->my_cdata.my_tx_head = cur_tx->my_nextdesc;
|
||||
}
|
||||
if (CSR_READ_4(sc, MY_TCRRCR) & MY_Enhanced) {
|
||||
ifp->if_collisions += (CSR_READ_4(sc, MY_TSR) & MY_NCRMask);
|
||||
if_inc_counter(ifp, IFCOUNTER_COLLISIONS, (CSR_READ_4(sc, MY_TSR) & MY_NCRMask));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1293,7 +1293,7 @@ my_intr(void *arg)
|
||||
|
||||
if ((status & MY_RBU) || (status & MY_RxErr)) {
|
||||
/* rx buffer unavailable or rx error */
|
||||
ifp->if_ierrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
|
||||
#ifdef foo
|
||||
my_stop(sc);
|
||||
my_reset(sc);
|
||||
@ -1701,7 +1701,7 @@ my_watchdog(void *arg)
|
||||
return;
|
||||
|
||||
ifp = sc->my_ifp;
|
||||
ifp->if_oerrors++;
|
||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
|
||||
if_printf(ifp, "watchdog timeout\n");
|
||||
if (!(my_phy_readreg(sc, PHY_BMSR) & PHY_BMSR_LINKSTAT))
|
||||
if_printf(ifp, "no carrier - transceiver cable problem?\n");
|
||||
|
Loading…
Reference in New Issue
Block a user