diff options
-rw-r--r-- | sys/dev/ic/ral.c | 15 | ||||
-rw-r--r-- | sys/dev/pci/if_ipw.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_ral.c | 8 |
4 files changed, 34 insertions, 7 deletions
diff --git a/sys/dev/ic/ral.c b/sys/dev/ic/ral.c index ddc41b79441..4d30603e21b 100644 --- a/sys/dev/ic/ral.c +++ b/sys/dev/ic/ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ral.c,v 1.37 2005/03/19 09:49:35 damien Exp $ */ +/* $OpenBSD: ral.c,v 1.38 2005/03/23 14:14:24 damien Exp $ */ /*- * Copyright (c) 2005 @@ -1065,11 +1065,13 @@ ral_tx_intr(struct ral_softc *sc) ieee80211_rssadapt_raise_rate(ic, &rn->rssadapt, &data->id); } + ifp->if_opackets++; break; case RAL_TX_SUCCESS_RETRY: DPRINTFN(9, ("data frame sent after %u retries\n", (letoh32(desc->flags) >> 5) & 0x7)); + ifp->if_opackets++; break; case RAL_TX_FAIL_RETRY: @@ -1079,6 +1081,7 @@ ral_tx_intr(struct ral_softc *sc) ieee80211_rssadapt_lower_rate(ic, data->ni, &rn->rssadapt, &data->id); } + ifp->if_oerrors++; break; case RAL_TX_FAIL_INVALID: @@ -1086,6 +1089,7 @@ ral_tx_intr(struct ral_softc *sc) default: printf("%s: sending data frame failed 0x%08x\n", sc->sc_dev.dv_xname, letoh32(desc->flags)); + ifp->if_oerrors++; } bus_dmamap_sync(sc->sc_dmat, data->map, 0, @@ -1214,12 +1218,16 @@ ral_decryption_intr(struct ral_softc *sc) (letoh32(desc->flags) & RAL_RX_CIPHER_BUSY)) break; - if (data->drop) + if (data->drop) { + ifp->if_ierrors++; goto skip; + } if ((letoh32(desc->flags) & RAL_RX_CIPHER_MASK) != 0 && - (letoh32(desc->flags) & RAL_RX_ICV_ERROR)) + (letoh32(desc->flags) & RAL_RX_ICV_ERROR)) { + ifp->if_ierrors++; goto skip; + } bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize, BUS_DMASYNC_POSTREAD); @@ -2014,6 +2022,7 @@ ral_watchdog(struct ifnet *ifp) if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); ral_init(ifp); + ifp->if_oerrors++; return; } ifp->if_timer = 1; diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 3c7e41c5be8..bd01849af3b 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.44 2005/03/17 20:08:13 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.45 2005/03/23 14:14:30 damien Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -1021,12 +1021,18 @@ void ipw_tx_intr(struct ipw_softc *sc) { struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ipw_soft_bd *sbd; u_int32_t r, i; r = CSR_READ_4(sc, IPW_CSR_TX_READ_INDEX); for (i = (sc->txold + 1) % IPW_NTBD; i != r; i = (i + 1) % IPW_NTBD) { - ipw_release_sbd(sc, &sc->stbd_list[i]); + sbd = &sc->stbd_list[i]; + + if (sbd->type == IPW_SBD_TYPE_DATA) + ifp->if_opackets++; + + ipw_release_sbd(sc, sbd); sc->txfree++; } @@ -1334,6 +1340,7 @@ ipw_start(struct ifnet *ifp) if (ipw_tx_start(ifp, m, ni) != 0) { if (ni != NULL) ieee80211_release_node(ic, ni); + ifp->if_oerrors++; break; } @@ -1354,6 +1361,7 @@ ipw_watchdog(struct ifnet *ifp) if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); ipw_stop(ifp, 1); + ifp->if_oerrors++; return; } ifp->if_timer = 1; diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 7cd75a0e5ce..3c183b0a160 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.31 2005/03/17 20:08:13 damien Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.32 2005/03/23 14:14:30 damien Exp $ */ /*- * Copyright (c) 2004, 2005 @@ -739,6 +739,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_buf *buf, int i, if (letoh16(frame->len) < sizeof (struct ieee80211_frame_min) || letoh16(frame->len) > MCLBYTES) { printf("%s: bad frame length\n", sc->sc_dev.dv_xname); + ifp->if_ierrors++; return; } @@ -976,6 +977,7 @@ iwi_tx_intr(struct iwi_softc *sc) ieee80211_release_node(ic, buf->ni); buf->ni = NULL; + ifp->if_opackets++; sc->tx_queued--; /* kill watchdog timer */ @@ -1224,6 +1226,7 @@ iwi_start(struct ifnet *ifp) if (iwi_tx_start(ifp, m0, ni) != 0) { if (ni != NULL) ieee80211_release_node(ic, ni); + ifp->if_oerrors++; break; } @@ -1244,6 +1247,7 @@ iwi_watchdog(struct ifnet *ifp) if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", sc->sc_dev.dv_xname); iwi_stop(ifp, 1); + ifp->if_oerrors++; return; } ifp->if_timer = 1; diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index 23d912205ba..da25537e450 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.16 2005/03/23 13:07:35 dlg Exp $ */ +/* $OpenBSD: if_ral.c,v 1.17 2005/03/23 14:14:31 damien Exp $ */ /*- * Copyright (c) 2005 @@ -788,6 +788,8 @@ ural_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) if (status == USBD_STALLED) usbd_clear_endpoint_stall(sc->sc_rx_pipeh); + + ifp->if_oerrors++; return; } @@ -799,6 +801,7 @@ ural_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) data->ni = NULL; sc->tx_queued--; + ifp->if_opackets++; DPRINTFN(10, ("tx done\n")); @@ -835,6 +838,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) if (len < RAL_RX_DESC_SIZE) { printf("%s: xfer too short %d\n", USBDEVNAME(sc->sc_dev), len); + ifp->if_ierrors++; goto skip; } @@ -848,6 +852,7 @@ ural_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) * those frames when we filled RAL_TXRX_CSR2. */ DPRINTFN(5, ("PHY or CRC error\n")); + ifp->if_ierrors++; goto skip; } @@ -1364,6 +1369,7 @@ ural_watchdog(struct ifnet *ifp) if (--sc->sc_tx_timer == 0) { printf("%s: device timeout\n", USBDEVNAME(sc->sc_dev)); /*ural_init(ifp); XXX needs a process context! */ + ifp->if_oerrors++; return; } ifp->if_timer = 1; |