summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net80211/ieee80211_output.c')
-rw-r--r--sys/net80211/ieee80211_output.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index d828a35..5997bb9 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -132,7 +132,7 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m,
{
struct ieee80211com *ic = vap->iv_ic;
struct ifnet *ifp = vap->iv_ifp;
- int error;
+ int error, len, mcast;
if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) &&
(m->m_flags & M_PWR_SAV) == 0) {
@@ -142,7 +142,8 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m,
* the frame back when the time is right.
* XXX lose WDS vap linkage?
*/
- (void) ieee80211_pwrsave(ni, m);
+ if (ieee80211_pwrsave(ni, m) != 0)
+ ifp->if_oerrors++;
ieee80211_free_node(ni);
/*
@@ -171,6 +172,8 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m,
* interface it (might have been) received on.
*/
m->m_pkthdr.rcvif = (void *)ni;
+ mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1: 0;
+ len = m->m_pkthdr.len;
BPF_MTAP(ifp, m); /* 802.3 tx */
@@ -236,7 +239,7 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m,
/* NB: stat+msg handled in ieee80211_encap */
IEEE80211_TX_UNLOCK(ic);
ieee80211_free_node(ni);
- /* XXX better status? */
+ ifp->if_oerrors++;
return (ENOBUFS);
}
}
@@ -250,8 +253,11 @@ ieee80211_vap_pkt_send_dest(struct ieee80211vap *vap, struct mbuf *m,
if (error != 0) {
/* NB: IFQ_HANDOFF reclaims mbuf */
ieee80211_free_node(ni);
+ ifp->if_oerrors++;
} else {
ifp->if_opackets++;
+ ifp->if_omcasts += mcast;
+ ifp->if_obytes += len;
}
ic->ic_lastdata = ticks;
@@ -315,6 +321,7 @@ ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m)
eh->ether_dhost, "mcast", "%s", "on DWDS");
vap->iv_stats.is_dwds_mcast++;
m_freem(m);
+ ifp->if_oerrors++;
/* XXX better status? */
return (ENOBUFS);
}
@@ -429,9 +436,9 @@ ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m)
IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
"%s: ignore queue, parent %s not up+running\n",
__func__, parent->if_xname);
- /* XXX stat */
m_freem(m);
- return (EINVAL);
+ ifp->if_oerrors++;
+ return (ENETDOWN);
}
/*
@@ -453,7 +460,8 @@ ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m)
IEEE80211_UNLOCK(ic);
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
m_freem(m);
- return (EINVAL);
+ ifp->if_oerrors++;
+ return (ENETDOWN);
}
IEEE80211_UNLOCK(ic);
}
OpenPOWER on IntegriCloud