aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cp/if_cp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/cp/if_cp.c')
-rw-r--r--sys/dev/cp/if_cp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index 4c728fcf7e49..59f06a9cd232 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);