diff options
author | glebius <glebius@FreeBSD.org> | 2014-09-18 20:33:25 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-09-18 20:33:25 +0000 |
commit | 545843dfa991805f9fbee7aa4323352c8ee516ea (patch) | |
tree | 1240e69a36ff43e59ce237d54e905c71030ba163 /sys/dev | |
parent | 684180d1f9ab3a1b02e9804660de801eac32dac3 (diff) | |
download | FreeBSD-src-545843dfa991805f9fbee7aa4323352c8ee516ea.zip FreeBSD-src-545843dfa991805f9fbee7aa4323352c8ee516ea.tar.gz |
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/smc/if_smc.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/smc/if_smc.c b/sys/dev/smc/if_smc.c index 0ce595f..fd29ead 100644 --- a/sys/dev/smc/if_smc.c +++ b/sys/dev/smc/if_smc.c @@ -512,7 +512,7 @@ smc_start_locked(struct ifnet *ifp) len += (len & 1); if (len > ETHER_MAX_LEN - ETHER_CRC_LEN) { if_printf(ifp, "large packet discarded\n"); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); return; /* XXX readcheck? */ } @@ -598,7 +598,7 @@ smc_task_tx(void *context, int pending) */ if (packet & ARR_FAILED) { IFQ_DRV_PREPEND(&ifp->if_snd, m); - ++ifp->if_oerrors; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; smc_start_locked(ifp); SMC_UNLOCK(sc); @@ -655,7 +655,7 @@ smc_task_tx(void *context, int pending) /* * Finish up. */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; SMC_UNLOCK(sc); BPF_MTAP(ifp, m0); @@ -721,7 +721,7 @@ smc_task_rx(void *context, int pending) if (status & (RX_TOOSHORT | RX_TOOLNG | RX_BADCRC | RX_ALGNERR)) { smc_mmu_wait(sc); smc_write_2(sc, MMUCR, MMUCR_CMD_RELEASE); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); m_freem(m); break; } @@ -777,7 +777,7 @@ smc_task_rx(void *context, int pending) m = mhead; mhead = mhead->m_next; m->m_next = NULL; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } } @@ -892,7 +892,7 @@ smc_task_intr(void *context, int pending) */ if (status & RX_OVRN_INT) { smc_write_1(sc, ACK, RX_OVRN_INT); - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); } /* @@ -909,10 +909,9 @@ smc_task_intr(void *context, int pending) smc_select_bank(sc, 0); counter = smc_read_2(sc, ECR); smc_select_bank(sc, 2); - ifp->if_collisions += - (counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT; - ifp->if_collisions += - (counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT; + if_inc_counter(ifp, IFNET_COLLISIONS, + ((counter & ECR_SNGLCOL_MASK) >> ECR_SNGLCOL_SHIFT) + + ((counter & ECR_MULCOL_MASK) >> ECR_MULCOL_SHIFT)); /* * See if there are any packets to transmit. |