summaryrefslogtreecommitdiffstats
path: root/sys/dev/isa/if_ex.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2017-01-22 10:17:37 +0000
committerdlg <dlg@openbsd.org>2017-01-22 10:17:37 +0000
commit88a08f2af426247cf5e32d11f8df17f5717812a1 (patch)
tree55b694cef98ba8f92034f91f4eed28aafa059f2a /sys/dev/isa/if_ex.c
parentsync (diff)
downloadwireguard-openbsd-88a08f2af426247cf5e32d11f8df17f5717812a1.tar.xz
wireguard-openbsd-88a08f2af426247cf5e32d11f8df17f5717812a1.zip
move counting if_opackets next to counting if_obytes in if_enqueue.
this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
Diffstat (limited to 'sys/dev/isa/if_ex.c')
-rw-r--r--sys/dev/isa/if_ex.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/isa/if_ex.c b/sys/dev/isa/if_ex.c
index e9893586243..43bdb0457e5 100644
--- a/sys/dev/isa/if_ex.c
+++ b/sys/dev/isa/if_ex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ex.c,v 1.44 2016/04/13 10:49:26 mpi Exp $ */
+/* $OpenBSD: if_ex.c,v 1.45 2017/01/22 10:17:38 dlg Exp $ */
/*
* Copyright (c) 1997, Donald A. Schmidt
* Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
@@ -515,7 +515,6 @@ ex_start(struct ifnet *ifp)
BPF_DIRECTION_OUT);
#endif
ifp->if_timer = 2;
- ifp->if_opackets++;
m_freem(opkt);
} else {
ifq_deq_rollback(&ifp->if_snd, opkt);
@@ -621,9 +620,7 @@ ex_tx_intr(struct ex_softc *sc)
break;
tx_status = CSR_READ_2(sc, IO_PORT_REG);
sc->tx_head = CSR_READ_2(sc, IO_PORT_REG);
- if (tx_status & TX_OK_bit)
- ifp->if_opackets++;
- else
+ if (!ISSET(tx_status, TX_OK_bit))
ifp->if_oerrors++;
ifp->if_collisions += tx_status & No_Collisions_bits;
}