freebsd11_network: Enable previously-disabled uses of counter(9).

Tested and verified this doesn't break anything.
This commit is contained in:
Augustin Cavalier
2018-06-30 12:39:19 -04:00
parent 7a41fb9137
commit 6a138e1704
3 changed files with 0 additions and 17 deletions
@@ -2036,10 +2036,7 @@ wpi_rx_done(struct wpi_softc *sc, struct wpi_rx_desc *desc,
fail2: m_freem(m); fail2: m_freem(m);
fail1: fail1:
return;
#ifndef __HAIKU__
counter_u64_add(ic->ic_ierrors, 1); counter_u64_add(ic->ic_ierrors, 1);
#endif
} }
static void static void
@@ -3016,18 +3016,14 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
if ((flags & IWN_RX_NOERROR) != IWN_RX_NOERROR) { if ((flags & IWN_RX_NOERROR) != IWN_RX_NOERROR) {
DPRINTF(sc, IWN_DEBUG_RECV, "%s: RX flags error %x\n", DPRINTF(sc, IWN_DEBUG_RECV, "%s: RX flags error %x\n",
__func__, flags); __func__, flags);
#ifndef __HAIKU__
counter_u64_add(ic->ic_ierrors, 1); counter_u64_add(ic->ic_ierrors, 1);
#endif
return; return;
} }
/* Discard frames that are too short. */ /* Discard frames that are too short. */
if (len < sizeof (struct ieee80211_frame_ack)) { if (len < sizeof (struct ieee80211_frame_ack)) {
DPRINTF(sc, IWN_DEBUG_RECV, "%s: frame too short: %d\n", DPRINTF(sc, IWN_DEBUG_RECV, "%s: frame too short: %d\n",
__func__, len); __func__, len);
#ifndef __HAIKU__
counter_u64_add(ic->ic_ierrors, 1); counter_u64_add(ic->ic_ierrors, 1);
#endif
return; return;
} }
@@ -3035,9 +3031,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
if (m1 == NULL) { if (m1 == NULL) {
DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n", DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n",
__func__); __func__);
#ifndef __HAIKU__
counter_u64_add(ic->ic_ierrors, 1); counter_u64_add(ic->ic_ierrors, 1);
#endif
return; return;
} }
bus_dmamap_unload(ring->data_dmat, data->map); bus_dmamap_unload(ring->data_dmat, data->map);
@@ -3062,9 +3056,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc,
ring->desc[ring->cur] = htole32(paddr >> 8); ring->desc[ring->cur] = htole32(paddr >> 8);
bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map,
BUS_DMASYNC_PREWRITE); BUS_DMASYNC_PREWRITE);
#ifndef __HAIKU__
counter_u64_add(ic->ic_ierrors, 1); counter_u64_add(ic->ic_ierrors, 1);
#endif
return; return;
} }
@@ -311,10 +311,8 @@ ieee80211_ifattach(struct ieee80211com *ic)
taskqueue_thread_enqueue, &ic->ic_tq); taskqueue_thread_enqueue, &ic->ic_tq);
taskqueue_start_threads(&ic->ic_tq, 1, PI_NET, "%s net80211 taskq", taskqueue_start_threads(&ic->ic_tq, 1, PI_NET, "%s net80211 taskq",
ic->ic_name); ic->ic_name);
#ifndef __HAIKU__
ic->ic_ierrors = counter_u64_alloc(M_WAITOK); ic->ic_ierrors = counter_u64_alloc(M_WAITOK);
ic->ic_oerrors = counter_u64_alloc(M_WAITOK); ic->ic_oerrors = counter_u64_alloc(M_WAITOK);
#endif
/* /*
* Fill in 802.11 available channel set, mark all * Fill in 802.11 available channel set, mark all
* available channels as active, and pick a default * available channels as active, and pick a default
@@ -395,10 +393,8 @@ ieee80211_ifdetach(struct ieee80211com *ic)
ieee80211_power_detach(ic); ieee80211_power_detach(ic);
ieee80211_node_detach(ic); ieee80211_node_detach(ic);
#ifndef __HAIKU__
counter_u64_free(ic->ic_ierrors); counter_u64_free(ic->ic_ierrors);
counter_u64_free(ic->ic_oerrors); counter_u64_free(ic->ic_oerrors);
#endif
taskqueue_free(ic->ic_tq); taskqueue_free(ic->ic_tq);
IEEE80211_TX_LOCK_DESTROY(ic); IEEE80211_TX_LOCK_DESTROY(ic);
@@ -457,14 +453,12 @@ ieee80211_get_counter(struct ifnet *ifp, ift_counter cnt)
rv = if_get_counter_default(ifp, cnt); rv = if_get_counter_default(ifp, cnt);
switch (cnt) { switch (cnt) {
#ifndef __HAIKU__
case IFCOUNTER_OERRORS: case IFCOUNTER_OERRORS:
rv += counter_u64_fetch(ic->ic_oerrors); rv += counter_u64_fetch(ic->ic_oerrors);
break; break;
case IFCOUNTER_IERRORS: case IFCOUNTER_IERRORS:
rv += counter_u64_fetch(ic->ic_ierrors); rv += counter_u64_fetch(ic->ic_ierrors);
break; break;
#endif
default: default:
break; break;
} }