diff options
author | glebius <glebius@FreeBSD.org> | 2014-09-19 03:51:26 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-09-19 03:51:26 +0000 |
commit | b3b337a80e78f4cc2d0c75f98e4685bee9c749c9 (patch) | |
tree | 6899fa7510de1719ea0a76790446b61cd2d300fe /sys/dev/cp | |
parent | 094cca2b36ac9809749d6a0b76bcd37556939c00 (diff) | |
download | FreeBSD-src-b3b337a80e78f4cc2d0c75f98e4685bee9c749c9.zip FreeBSD-src-b3b337a80e78f4cc2d0c75f98e4685bee9c749c9.tar.gz |
Mechanically convert to if_inc_counter().
Diffstat (limited to 'sys/dev/cp')
-rw-r--r-- | sys/dev/cp/if_cp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index 4c728fc..59f06a9 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -867,7 +867,7 @@ static void cp_transmit (cp_chan_t *c, void *attachment, int len) d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_opackets; + if_inc_counter(d->ifp, IFCOUNTER_OPACKETS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cp_start (d); @@ -888,7 +888,7 @@ static void cp_receive (cp_chan_t *c, unsigned char *data, int len) if (! m) { CP_DEBUG (d, ("no memory for packet\n")); #ifndef NETGRAPH - ++d->ifp->if_iqdrops; + if_inc_counter(d->ifp, IFCOUNTER_IQDROPS, 1); #endif return; } @@ -898,7 +898,7 @@ static void cp_receive (cp_chan_t *c, unsigned char *data, int len) m->m_pkthdr.rcvif = 0; NG_SEND_DATA_ONLY (error, d->hook, m); #else - ++d->ifp->if_ipackets; + if_inc_counter(d->ifp, IFCOUNTER_IPACKETS, 1); m->m_pkthdr.rcvif = d->ifp; /* Check if there's a BPF listener on this interface. * If so, hand off the raw packet to bpf. */ @@ -915,33 +915,33 @@ static void cp_error (cp_chan_t *c, int data) case CP_FRAME: CP_DEBUG (d, ("frame error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_CRC: CP_DEBUG (d, ("crc error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_OVERRUN: CP_DEBUG (d, ("overrun error\n")); #ifndef NETGRAPH - ++d->ifp->if_collisions; - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_COLLISIONS, 1); + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_OVERFLOW: CP_DEBUG (d, ("overflow error\n")); #ifndef NETGRAPH - ++d->ifp->if_ierrors; + if_inc_counter(d->ifp, IFCOUNTER_IERRORS, 1); #endif break; case CP_UNDERRUN: CP_DEBUG (d, ("underrun error\n")); d->timeout = 0; #ifndef NETGRAPH - ++d->ifp->if_oerrors; + if_inc_counter(d->ifp, IFCOUNTER_OERRORS, 1); d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; #endif cp_start (d); |