Adopt <net/if_stats.h>.
This commit is contained in:
parent
c47207d4c0
commit
7ea25e2de8
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ipw.c,v 1.72 2019/02/03 03:19:27 mrg Exp $ */
|
||||
/* $NetBSD: if_ipw.c,v 1.73 2020/01/30 06:03:34 thorpej Exp $ */
|
||||
/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */
|
||||
|
||||
/*-
|
||||
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.72 2019/02/03 03:19:27 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.73 2020/01/30 06:03:34 thorpej Exp $");
|
||||
|
||||
/*-
|
||||
* Intel(R) PRO/Wireless 2100 MiniPCI driver
|
||||
|
@ -1035,7 +1035,7 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status,
|
|||
MGETHDR(mnew, M_DONTWAIT, MT_DATA);
|
||||
if (mnew == NULL) {
|
||||
aprint_error_dev(sc->sc_dev, "could not allocate rx mbuf\n");
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1043,7 +1043,7 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status,
|
|||
if (!(mnew->m_flags & M_EXT)) {
|
||||
aprint_error_dev(sc->sc_dev, "could not allocate rx mbuf cluster\n");
|
||||
m_freem(mnew);
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status,
|
|||
panic("%s: unable to remap rx buf",
|
||||
device_xname(sc->sc_dev));
|
||||
}
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1237,7 +1237,7 @@ ipw_tx_intr(struct ipw_softc *sc)
|
|||
sbd = &sc->stbd_list[i];
|
||||
|
||||
if (sbd->type == IPW_SBD_TYPE_DATA)
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
|
||||
ipw_release_sbd(sc, sbd);
|
||||
sc->txfree++;
|
||||
|
@ -1559,7 +1559,7 @@ ipw_start(struct ifnet *ifp)
|
|||
|
||||
if (ipw_tx_start(ifp, m0, ni) != 0) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1579,7 +1579,7 @@ ipw_watchdog(struct ifnet *ifp)
|
|||
if (sc->sc_tx_timer > 0) {
|
||||
if (--sc->sc_tx_timer == 0) {
|
||||
aprint_error_dev(sc->sc_dev, "device timeout\n");
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
ipw_stop(ifp, 1);
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_iwi.c,v 1.112 2019/11/10 21:16:36 chs Exp $ */
|
||||
/* $NetBSD: if_iwi.c,v 1.113 2020/01/30 06:03:34 thorpej Exp $ */
|
||||
/* $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -19,7 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.112 2019/11/10 21:16:36 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.113 2020/01/30 06:03:34 thorpej Exp $");
|
||||
|
||||
/*-
|
||||
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
|
||||
|
@ -1156,7 +1156,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i,
|
|||
if (le16toh(frame->len) < sizeof (struct ieee80211_frame) ||
|
||||
le16toh(frame->len) > MCLBYTES) {
|
||||
DPRINTF(("%s: bad frame length\n", device_xname(sc->sc_dev)));
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i,
|
|||
* end of the ring to the front instead of dropping.
|
||||
*/
|
||||
if ((m_new = iwi_alloc_rx_buf(sc)) == NULL) {
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1183,7 +1183,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i,
|
|||
aprint_error_dev(sc->sc_dev,
|
||||
"could not load rx buf DMA map\n");
|
||||
m_freem(m_new);
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
error = bus_dmamap_load_mbuf(sc->sc_dmat, data->map,
|
||||
data->m, BUS_DMA_READ | BUS_DMA_NOWAIT);
|
||||
if (error)
|
||||
|
@ -1455,7 +1455,7 @@ iwi_tx_intr(struct iwi_softc *sc, struct iwi_tx_ring *txq)
|
|||
|
||||
DPRINTFN(15, ("tx done idx=%u\n", txq->next));
|
||||
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
|
||||
txq->queued--;
|
||||
txq->next = (txq->next + 1) % txq->count;
|
||||
|
@ -1629,7 +1629,7 @@ iwi_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni,
|
|||
if (in->in_station == -1) { /* h/w table is full */
|
||||
m_freem(m0);
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
return 0;
|
||||
}
|
||||
iwi_write_ibssnode(sc, in);
|
||||
|
@ -1782,7 +1782,7 @@ iwi_start(struct ifnet *ifp)
|
|||
|
||||
if (m0->m_len < sizeof (struct ether_header) &&
|
||||
(m0 = m_pullup(m0, sizeof (struct ether_header))) == NULL) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1790,7 +1790,7 @@ iwi_start(struct ifnet *ifp)
|
|||
ni = ieee80211_find_txnode(ic, eh->ether_dhost);
|
||||
if (ni == NULL) {
|
||||
m_freem(m0);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1798,7 +1798,7 @@ iwi_start(struct ifnet *ifp)
|
|||
if (ieee80211_classify(ic, m0, ni) != 0) {
|
||||
m_freem(m0);
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1820,7 +1820,7 @@ iwi_start(struct ifnet *ifp)
|
|||
m0 = ieee80211_encap(ic, m0, ni);
|
||||
if (m0 == NULL) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1828,7 +1828,7 @@ iwi_start(struct ifnet *ifp)
|
|||
|
||||
if (iwi_tx_start(ifp, m0, ni, ac) != 0) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1848,7 +1848,7 @@ iwi_watchdog(struct ifnet *ifp)
|
|||
if (sc->sc_tx_timer > 0) {
|
||||
if (--sc->sc_tx_timer == 0) {
|
||||
aprint_error_dev(sc->sc_dev, "device timeout\n");
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
iwi_stop(ifp, 1);
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_iwm.c,v 1.83 2018/06/26 06:48:01 msaitoh Exp $ */
|
||||
/* $NetBSD: if_iwm.c,v 1.84 2020/01/30 06:03:34 thorpej Exp $ */
|
||||
/* OpenBSD: if_iwm.c,v 1.148 2016/11/19 21:07:08 stsp Exp */
|
||||
#define IEEE80211_NO_HT
|
||||
/*
|
||||
|
@ -106,7 +106,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.83 2018/06/26 06:48:01 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.84 2020/01/30 06:03:34 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
|
@ -4031,9 +4031,9 @@ iwm_rx_tx_cmd_single(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
|
|||
|
||||
if (status != IWM_TX_STATUS_SUCCESS &&
|
||||
status != IWM_TX_STATUS_DIRECT_DONE)
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
else
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -6824,7 +6824,7 @@ iwm_start(struct ifnet *ifp)
|
|||
|
||||
if (m->m_len < sizeof (*eh) &&
|
||||
(m = m_pullup(m, sizeof (*eh))) == NULL) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -6832,7 +6832,7 @@ iwm_start(struct ifnet *ifp)
|
|||
ni = ieee80211_find_txnode(ic, eh->ether_dhost);
|
||||
if (ni == NULL) {
|
||||
m_freem(m);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -6840,7 +6840,7 @@ iwm_start(struct ifnet *ifp)
|
|||
if (ieee80211_classify(ic, m, ni) != 0) {
|
||||
m_freem(m);
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -6852,7 +6852,7 @@ iwm_start(struct ifnet *ifp)
|
|||
|
||||
if ((m = ieee80211_encap(ic, m, ni)) == NULL) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -6861,7 +6861,7 @@ iwm_start(struct ifnet *ifp)
|
|||
|
||||
if (iwm_tx(sc, m, ni, ac) != 0) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -6910,7 +6910,7 @@ iwm_watchdog(struct ifnet *ifp)
|
|||
#endif
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
iwm_stop(ifp, 1);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
return;
|
||||
}
|
||||
ifp->if_timer = 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_iwn.c,v 1.92 2019/10/10 22:34:42 bad Exp $ */
|
||||
/* $NetBSD: if_iwn.c,v 1.93 2020/01/30 06:03:34 thorpej Exp $ */
|
||||
/* $OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $ */
|
||||
|
||||
/*-
|
||||
|
@ -22,7 +22,7 @@
|
|||
* adapters.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.92 2019/10/10 22:34:42 bad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.93 2020/01/30 06:03:34 thorpej Exp $");
|
||||
|
||||
#define IWN_USE_RBUF /* Use local storage for RX */
|
||||
#undef IWN_HWCRYPTO /* XXX does not even compile yet */
|
||||
|
@ -2075,21 +2075,21 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
|
|||
/* Discard frames with a bad FCS early. */
|
||||
if ((flags & IWN_RX_NOERROR) != IWN_RX_NOERROR) {
|
||||
DPRINTFN(2, ("RX flags error %x\n", flags));
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
/* Discard frames that are too short. */
|
||||
if (len < sizeof (*wh)) {
|
||||
DPRINTF(("frame too short: %d\n", len));
|
||||
ic->ic_stats.is_rx_tooshort++;
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
m1 = MCLGETIalt(sc, M_DONTWAIT, NULL, IWN_RBUF_SIZE);
|
||||
if (m1 == NULL) {
|
||||
ic->ic_stats.is_rx_nobuf++;
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
bus_dmamap_unload(sc->sc_dmat, data->map);
|
||||
|
@ -2113,7 +2113,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
|
|||
bus_dmamap_sync(sc->sc_dmat, ring->desc_dma.map,
|
||||
ring->cur * sizeof (uint32_t), sizeof (uint32_t),
|
||||
BUS_DMASYNC_PREWRITE);
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2400,9 +2400,9 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt,
|
|||
wn->amn.amn_retrycnt++;
|
||||
|
||||
if (status != 1 && status != 2)
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
else
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
|
||||
/* Unmap and free mbuf. */
|
||||
bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize,
|
||||
|
@ -3212,21 +3212,21 @@ iwn_start(struct ifnet *ifp)
|
|||
break;
|
||||
if (m->m_len < sizeof (*eh) &&
|
||||
(m = m_pullup(m, sizeof (*eh))) == NULL) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
eh = mtod(m, struct ether_header *);
|
||||
ni = ieee80211_find_txnode(ic, eh->ether_dhost);
|
||||
if (ni == NULL) {
|
||||
m_freem(m);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
/* classify mbuf so we can find which tx ring to use */
|
||||
if (ieee80211_classify(ic, m, ni) != 0) {
|
||||
m_freem(m);
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -3239,7 +3239,7 @@ iwn_start(struct ifnet *ifp)
|
|||
|
||||
if ((m = ieee80211_encap(ic, m, ni)) == NULL) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
sendit:
|
||||
|
@ -3250,7 +3250,7 @@ sendit:
|
|||
|
||||
if (iwn_tx(sc, m, ni, ac) != 0) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -3275,7 +3275,7 @@ iwn_watchdog(struct ifnet *ifp)
|
|||
"device timeout\n");
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
iwn_stop(ifp, 1);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
return;
|
||||
}
|
||||
ifp->if_timer = 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_rtwn.c,v 1.18 2018/12/09 11:14:02 jdolecek Exp $ */
|
||||
/* $NetBSD: if_rtwn.c,v 1.19 2020/01/30 06:03:34 thorpej Exp $ */
|
||||
/* $OpenBSD: if_rtwn.c,v 1.5 2015/06/14 08:02:47 stsp Exp $ */
|
||||
#define IEEE80211_NO_HT
|
||||
/*-
|
||||
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_rtwn.c,v 1.18 2018/12/09 11:14:02 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_rtwn.c,v 1.19 2020/01/30 06:03:34 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sockio.h>
|
||||
|
@ -1689,7 +1689,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct r92c_rx_desc_pci *rx_desc,
|
|||
* This should not happen since we setup our Rx filter
|
||||
* to not receive these frames.
|
||||
*/
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1700,11 +1700,11 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct r92c_rx_desc_pci *rx_desc,
|
|||
*/
|
||||
if (__predict_false(pktlen < (int)sizeof(struct ieee80211_frame_ack))) {
|
||||
ic->ic_stats.is_rx_tooshort++;
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
if (__predict_false(pktlen > MCLBYTES)) {
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1729,14 +1729,14 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct r92c_rx_desc_pci *rx_desc,
|
|||
MGETHDR(m1, M_DONTWAIT, MT_DATA);
|
||||
if (__predict_false(m1 == NULL)) {
|
||||
ic->ic_stats.is_rx_nobuf++;
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
MCLGET(m1, M_DONTWAIT);
|
||||
if (__predict_false(!(m1->m_flags & M_EXT))) {
|
||||
m_freem(m1);
|
||||
ic->ic_stats.is_rx_nobuf++;
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1761,7 +1761,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct r92c_rx_desc_pci *rx_desc,
|
|||
rtwn_setup_rx_desc(sc, rx_desc,
|
||||
rx_data->map->dm_segs[0].ds_addr, MCLBYTES, desc_idx);
|
||||
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2059,7 +2059,7 @@ rtwn_tx_done(struct rtwn_softc *sc, int qid)
|
|||
ieee80211_free_node(tx_data->ni);
|
||||
tx_data->ni = NULL;
|
||||
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
sc->sc_tx_timer = 0;
|
||||
tx_ring->queued--;
|
||||
}
|
||||
|
@ -2106,14 +2106,14 @@ rtwn_start(struct ifnet *ifp)
|
|||
|
||||
if (m->m_len < (int)sizeof(*eh) &&
|
||||
(m = m_pullup(m, sizeof(*eh))) == NULL) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
eh = mtod(m, struct ether_header *);
|
||||
ni = ieee80211_find_txnode(ic, eh->ether_dhost);
|
||||
if (ni == NULL) {
|
||||
m_freem(m);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2121,7 +2121,7 @@ rtwn_start(struct ifnet *ifp)
|
|||
|
||||
if ((m = ieee80211_encap(ic, m, ni)) == NULL) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
sendit:
|
||||
|
@ -2129,7 +2129,7 @@ sendit:
|
|||
|
||||
if (rtwn_tx(sc, m, ni) != 0) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2154,7 +2154,7 @@ rtwn_watchdog(struct ifnet *ifp)
|
|||
if (--sc->sc_tx_timer == 0) {
|
||||
aprint_error_dev(sc->sc_dev, "device timeout\n");
|
||||
softint_schedule(sc->init_task);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
return;
|
||||
}
|
||||
ifp->if_timer = 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_sk.c,v 1.103 2019/12/27 07:02:26 msaitoh Exp $ */
|
||||
/* $NetBSD: if_sk.c,v 1.104 2020/01/30 06:03:34 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
|
@ -115,7 +115,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.103 2019/12/27 07:02:26 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.104 2020/01/30 06:03:34 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -2011,7 +2011,7 @@ sk_watchdog(struct ifnet *ifp)
|
|||
if (sc_if->sk_cdata.sk_tx_cnt != 0) {
|
||||
aprint_error_dev(sc_if->sk_dev, "watchdog timeout\n");
|
||||
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
|
||||
sk_init(ifp);
|
||||
}
|
||||
|
@ -2086,7 +2086,7 @@ sk_rxeof(struct sk_if_softc *sc_if)
|
|||
SK_INC(i, SK_RX_RING_CNT);
|
||||
|
||||
if (rxstat & XM_RXSTAT_ERRFRAME) {
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
sk_newbuf(sc_if, cur, m, dmamap);
|
||||
continue;
|
||||
}
|
||||
|
@ -2106,7 +2106,7 @@ sk_rxeof(struct sk_if_softc *sc_if)
|
|||
if (m0 == NULL) {
|
||||
aprint_error_dev(sc_if->sk_dev, "no receive "
|
||||
"buffers available -- packet dropped!\n");
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
continue;
|
||||
}
|
||||
m_adj(m0, ETHER_ALIGN);
|
||||
|
@ -2152,7 +2152,7 @@ sk_txeof(struct sk_if_softc *sc_if)
|
|||
break;
|
||||
}
|
||||
if (sk_ctl & SK_TXCTL_LASTFRAG)
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
if (sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf != NULL) {
|
||||
entry = sc_if->sk_cdata.sk_tx_map[idx];
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_txp.c,v 1.62 2019/12/06 07:12:39 maxv Exp $ */
|
||||
/* $NetBSD: if_txp.c,v 1.63 2020/01/30 06:10:26 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.62 2019/12/06 07:12:39 maxv Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_txp.c,v 1.63 2020/01/30 06:10:26 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
|
@ -684,7 +684,7 @@ txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r,
|
|||
if (rxd->rx_flags & RX_FLAGS_ERROR) {
|
||||
printf("%s: error 0x%x\n", device_xname(sc->sc_dev),
|
||||
le32toh(rxd->rx_stat));
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
goto next;
|
||||
}
|
||||
|
||||
|
@ -883,7 +883,7 @@ txp_tx_reclaim(struct txp_softc *sc, struct txp_tx_ring *r,
|
|||
m_freem(m);
|
||||
txd->tx_addrlo = 0;
|
||||
txd->tx_addrhi = 0;
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
}
|
||||
}
|
||||
ifp->if_flags &= ~IFF_OACTIVE;
|
||||
|
@ -1362,13 +1362,16 @@ txp_tick(void *vsc)
|
|||
goto out;
|
||||
ext = (struct txp_ext_desc *)(rsp + 1);
|
||||
|
||||
ifp->if_ierrors += ext[3].ext_2 + ext[3].ext_3 + ext[3].ext_4 +
|
||||
ext[4].ext_1 + ext[4].ext_4;
|
||||
ifp->if_oerrors += ext[0].ext_1 + ext[1].ext_1 + ext[1].ext_4 +
|
||||
ext[2].ext_1;
|
||||
ifp->if_collisions += ext[0].ext_2 + ext[0].ext_3 + ext[1].ext_2 +
|
||||
ext[1].ext_3;
|
||||
ifp->if_opackets += rsp->rsp_par2;
|
||||
net_stat_ref_t nsr = IF_STAT_GETREF(ifp);
|
||||
if_statadd_ref(nsr, if_ierrors,
|
||||
ext[3].ext_2 + ext[3].ext_3 + ext[3].ext_4 +
|
||||
ext[4].ext_1 + ext[4].ext_4);
|
||||
if_statadd_ref(nsr, if_oerrors,
|
||||
ext[0].ext_1 + ext[1].ext_1 + ext[1].ext_4 + ext[2].ext_1);
|
||||
if_statadd_ref(nsr, if_collisions,
|
||||
ext[0].ext_2 + ext[0].ext_3 + ext[1].ext_2 + ext[1].ext_3);
|
||||
if_statadd_ref(nsr, if_opackets, rsp->rsp_par2);
|
||||
IF_STAT_PUTREF(ifp);
|
||||
|
||||
out:
|
||||
if (rsp != NULL)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_wpi.c,v 1.87 2019/11/10 21:16:36 chs Exp $ */
|
||||
/* $NetBSD: if_wpi.c,v 1.88 2020/01/30 06:10:26 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006, 2007
|
||||
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.87 2019/11/10 21:16:36 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.88 2020/01/30 06:10:26 thorpej Exp $");
|
||||
|
||||
/*
|
||||
* Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
|
||||
|
@ -1495,7 +1495,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc,
|
|||
|
||||
if (stat->len > WPI_STAT_MAXLEN) {
|
||||
aprint_error_dev(sc->sc_dev, "invalid rx statistic header\n");
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1514,7 +1514,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc,
|
|||
if ((le32toh(tail->flags) & WPI_RX_NOERROR) != WPI_RX_NOERROR) {
|
||||
DPRINTF(("rx tail flags error %x\n",
|
||||
le32toh(tail->flags)));
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1523,14 +1523,14 @@ wpi_rx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc,
|
|||
|
||||
MGETHDR(mnew, M_DONTWAIT, MT_DATA);
|
||||
if (mnew == NULL) {
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
rbuf = wpi_alloc_rbuf(sc);
|
||||
if (rbuf == NULL) {
|
||||
m_freem(mnew);
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1548,7 +1548,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc,
|
|||
device_printf(sc->sc_dev,
|
||||
"couldn't load rx mbuf: %d\n", error);
|
||||
m_freem(mnew);
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
|
||||
error = bus_dmamap_load(sc->sc_dmat, data->map,
|
||||
mtod(data->m, void *), WPI_RBUF_SIZE, NULL,
|
||||
|
@ -1655,9 +1655,9 @@ wpi_tx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc)
|
|||
}
|
||||
|
||||
if ((le32toh(stat->status) & 0xff) != 1)
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
else
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
|
||||
bus_dmamap_unload(sc->sc_dmat, data->map);
|
||||
m_freem(data->m);
|
||||
|
@ -2122,12 +2122,12 @@ wpi_start(struct ifnet *ifp)
|
|||
|
||||
/* management frames go into ring 0 */
|
||||
if (sc->txq[0].queued > sc->txq[0].count - 8) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
bpf_mtap3(ic->ic_rawbpf, m0, BPF_D_OUT);
|
||||
if (wpi_tx_data(sc, m0, ni, 0) != 0) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -2139,14 +2139,14 @@ wpi_start(struct ifnet *ifp)
|
|||
|
||||
if (m0->m_len < sizeof (*eh) &&
|
||||
(m0 = m_pullup(m0, sizeof (*eh))) == NULL) {
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
eh = mtod(m0, struct ether_header *);
|
||||
ni = ieee80211_find_txnode(ic, eh->ether_dhost);
|
||||
if (ni == NULL) {
|
||||
m_freem(m0);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2154,7 +2154,7 @@ wpi_start(struct ifnet *ifp)
|
|||
if (ieee80211_classify(ic, m0, ni) != 0) {
|
||||
m_freem(m0);
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2172,13 +2172,13 @@ wpi_start(struct ifnet *ifp)
|
|||
m0 = ieee80211_encap(ic, m0, ni);
|
||||
if (m0 == NULL) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
continue;
|
||||
}
|
||||
bpf_mtap3(ic->ic_rawbpf, m0, BPF_D_OUT);
|
||||
if (wpi_tx_data(sc, m0, ni, ac) != 0) {
|
||||
ieee80211_free_node(ni);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2200,7 +2200,7 @@ wpi_watchdog(struct ifnet *ifp)
|
|||
aprint_error_dev(sc->sc_dev, "device timeout\n");
|
||||
ifp->if_flags &= ~IFF_UP;
|
||||
wpi_stop(ifp, 1);
|
||||
ifp->if_oerrors++;
|
||||
if_statinc(ifp, if_oerrors);
|
||||
return;
|
||||
}
|
||||
ifp->if_timer = 1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_xge.c,v 1.32 2019/05/29 10:07:29 msaitoh Exp $ */
|
||||
/* $NetBSD: if_xge.c,v 1.33 2020/01/30 06:10:26 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004, SUNET, Swedish University Computer Network.
|
||||
|
@ -43,7 +43,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.32 2019/05/29 10:07:29 msaitoh Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_xge.c,v 1.33 2020/01/30 06:10:26 thorpej Exp $");
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -741,7 +741,7 @@ xge_intr(void *pv)
|
|||
}
|
||||
bus_dmamap_unload(sc->sc_dmat, dmp);
|
||||
m_freem(sc->sc_txb[i]);
|
||||
ifp->if_opackets++;
|
||||
if_statinc(ifp, if_opackets);
|
||||
sc->sc_lasttx = i;
|
||||
}
|
||||
if (i == sc->sc_nexttx) {
|
||||
|
@ -803,7 +803,7 @@ xge_intr(void *pv)
|
|||
#endif
|
||||
XGE_RXSYNC(sc->sc_nextrx,
|
||||
BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
|
||||
ifp->if_ierrors++;
|
||||
if_statinc(ifp, if_ierrors);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue