Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_output.c
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | #endif /* IEEE80211_SUPPORT_SUPERG */ | ||||
* Unlock at this point - no need to hold it across | * Unlock at this point - no need to hold it across | ||||
* ieee80211_free_node() (ie, the comlock) | * ieee80211_free_node() (ie, the comlock) | ||||
*/ | */ | ||||
IEEE80211_TX_UNLOCK(ic); | IEEE80211_TX_UNLOCK(ic); | ||||
if (error != 0) { | if (error != 0) { | ||||
/* NB: IFQ_HANDOFF reclaims mbuf */ | /* NB: IFQ_HANDOFF reclaims mbuf */ | ||||
ieee80211_free_node(ni); | ieee80211_free_node(ni); | ||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); | if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); | ||||
} else { | |||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); | |||||
if_inc_counter(ifp, IFCOUNTER_OMCASTS, mcast); | |||||
if_inc_counter(ifp, IFCOUNTER_OBYTES, len); | |||||
} | } | ||||
ic->ic_lastdata = ticks; | ic->ic_lastdata = ticks; | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | |||||
* if_transmit() requires that the mbuf be consumed by this call | * if_transmit() requires that the mbuf be consumed by this call | ||||
* regardless of the return condition. | * regardless of the return condition. | ||||
*/ | */ | ||||
int | int | ||||
ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) | ieee80211_vap_transmit(struct ifnet *ifp, struct mbuf *m) | ||||
{ | { | ||||
struct ieee80211vap *vap = ifp->if_softc; | struct ieee80211vap *vap = ifp->if_softc; | ||||
struct ieee80211com *ic = vap->iv_ic; | struct ieee80211com *ic = vap->iv_ic; | ||||
struct ifnet *parent = ic->ic_ifp; | |||||
/* NB: parent must be up and running */ | |||||
if (!IFNET_IS_UP_RUNNING(parent)) { | |||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, | |||||
"%s: ignore queue, parent %s not up+running\n", | |||||
__func__, parent->if_xname); | |||||
m_freem(m); | |||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); | |||||
return (ENETDOWN); | |||||
} | |||||
/* | /* | ||||
* No data frames go out unless we're running. | * No data frames go out unless we're running. | ||||
* Note in particular this covers CAC and CSA | * Note in particular this covers CAC and CSA | ||||
* states (though maybe we should check muting | * states (though maybe we should check muting | ||||
* for CSA). | * for CSA). | ||||
*/ | */ | ||||
if (vap->iv_state != IEEE80211_S_RUN && | if (vap->iv_state != IEEE80211_S_RUN && | ||||
vap->iv_state != IEEE80211_S_SLEEP) { | vap->iv_state != IEEE80211_S_SLEEP) { | ||||
▲ Show 20 Lines • Show All 2,979 Lines • ▼ Show 20 Lines | |||||
* This frees the mbuf and if the mbuf has a node reference, | * This frees the mbuf and if the mbuf has a node reference, | ||||
* the node reference will be freed. | * the node reference will be freed. | ||||
*/ | */ | ||||
void | void | ||||
ieee80211_tx_complete(struct ieee80211_node *ni, struct mbuf *m, int status) | ieee80211_tx_complete(struct ieee80211_node *ni, struct mbuf *m, int status) | ||||
{ | { | ||||
if (ni != NULL) { | if (ni != NULL) { | ||||
struct ifnet *ifp = ni->ni_vap->iv_ifp; | |||||
if (status == 0) { | |||||
if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); | |||||
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); | |||||
if (m->m_flags & M_MCAST) | |||||
if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); | |||||
} else | |||||
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); | |||||
if (m->m_flags & M_TXCB) | if (m->m_flags & M_TXCB) | ||||
ieee80211_process_callback(ni, m, status); | ieee80211_process_callback(ni, m, status); | ||||
ieee80211_free_node(ni); | ieee80211_free_node(ni); | ||||
} | } | ||||
m_freem(m); | m_freem(m); | ||||
} | } |