hoist ampdu tx aggregation setup from ieee80211_encap to ieee80211_start
where it was meant all along (the code was in encap because ampdu was implemented pre vaps)
This commit is contained in:
parent
51b5aba2d6
commit
168f582e2e
@ -251,8 +251,43 @@ ieee80211_start(struct ifnet *ifp)
|
|||||||
|
|
||||||
BPF_MTAP(ifp, m); /* 802.3 tx */
|
BPF_MTAP(ifp, m); /* 802.3 tx */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if A-MPDU tx aggregation is setup or if we
|
||||||
|
* should try to enable it. The sta must be associated
|
||||||
|
* with HT and A-MPDU enabled for use. When the policy
|
||||||
|
* routine decides we should enable A-MPDU we issue an
|
||||||
|
* ADDBA request and wait for a reply. The frame being
|
||||||
|
* encapsulated will go out w/o using A-MPDU, or possibly
|
||||||
|
* it might be collected by the driver and held/retransmit.
|
||||||
|
* The default ic_ampdu_enable routine handles staggering
|
||||||
|
* ADDBA requests in case the receiver NAK's us or we are
|
||||||
|
* otherwise unable to establish a BA stream.
|
||||||
|
*/
|
||||||
|
if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) &&
|
||||||
|
(vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_TX) &&
|
||||||
|
(m->m_flags & M_EAPOL) == 0) {
|
||||||
|
const int ac = M_WME_GETAC(m);
|
||||||
|
struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac];
|
||||||
|
|
||||||
|
ieee80211_txampdu_count_packet(tap);
|
||||||
|
if (IEEE80211_AMPDU_RUNNING(tap)) {
|
||||||
|
/*
|
||||||
|
* Operational, mark frame for aggregation.
|
||||||
|
*
|
||||||
|
* XXX do tx aggregation here
|
||||||
|
*/
|
||||||
|
m->m_flags |= M_AMPDU_MPDU;
|
||||||
|
} else if (!IEEE80211_AMPDU_REQUESTED(tap) &&
|
||||||
|
ic->ic_ampdu_enable(ni, tap)) {
|
||||||
|
/*
|
||||||
|
* Not negotiated yet, request service.
|
||||||
|
*/
|
||||||
|
ieee80211_ampdu_request(ni, tap);
|
||||||
|
/* XXX hold frame for reply? */
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef IEEE80211_SUPPORT_SUPERG
|
#ifdef IEEE80211_SUPPORT_SUPERG
|
||||||
if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) {
|
else if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) {
|
||||||
m = ieee80211_ff_check(ni, m);
|
m = ieee80211_ff_check(ni, m);
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
/* NB: any ni ref held on stageq */
|
/* NB: any ni ref held on stageq */
|
||||||
@ -1042,42 +1077,6 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni,
|
|||||||
/* map from access class/queue to 11e header priorty value */
|
/* map from access class/queue to 11e header priorty value */
|
||||||
tid = WME_AC_TO_TID(ac);
|
tid = WME_AC_TO_TID(ac);
|
||||||
qos[0] = tid & IEEE80211_QOS_TID;
|
qos[0] = tid & IEEE80211_QOS_TID;
|
||||||
/*
|
|
||||||
* Check if A-MPDU tx aggregation is setup or if we
|
|
||||||
* should try to enable it. The sta must be associated
|
|
||||||
* with HT and A-MPDU enabled for use. When the policy
|
|
||||||
* routine decides we should enable A-MPDU we issue an
|
|
||||||
* ADDBA request and wait for a reply. The frame being
|
|
||||||
* encapsulated will go out w/o using A-MPDU, or possibly
|
|
||||||
* it might be collected by the driver and held/retransmit.
|
|
||||||
* The default ic_ampdu_enable routine handles staggering
|
|
||||||
* ADDBA requests in case the receiver NAK's us or we are
|
|
||||||
* otherwise unable to establish a BA stream.
|
|
||||||
*/
|
|
||||||
if ((ni->ni_flags & IEEE80211_NODE_AMPDU_TX) &&
|
|
||||||
(vap->iv_flags_ext & IEEE80211_FEXT_AMPDU_TX)) {
|
|
||||||
struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac];
|
|
||||||
|
|
||||||
ieee80211_txampdu_count_packet(tap);
|
|
||||||
if (IEEE80211_AMPDU_RUNNING(tap)) {
|
|
||||||
/*
|
|
||||||
* Operational, mark frame for aggregation.
|
|
||||||
*
|
|
||||||
* NB: We support only immediate BA's for
|
|
||||||
* AMPDU which means we set the QoS control
|
|
||||||
* field to "normal ack" (0) to get "implicit
|
|
||||||
* block ack" behaviour.
|
|
||||||
*/
|
|
||||||
m->m_flags |= M_AMPDU_MPDU;
|
|
||||||
} else if (!IEEE80211_AMPDU_REQUESTED(tap) &&
|
|
||||||
ic->ic_ampdu_enable(ni, tap)) {
|
|
||||||
/*
|
|
||||||
* Not negotiated yet, request service.
|
|
||||||
*/
|
|
||||||
ieee80211_ampdu_request(ni, tap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* XXX works even when BA marked above */
|
|
||||||
if (ic->ic_wme.wme_wmeChanParams.cap_wmeParams[ac].wmep_noackPolicy)
|
if (ic->ic_wme.wme_wmeChanParams.cap_wmeParams[ac].wmep_noackPolicy)
|
||||||
qos[0] |= IEEE80211_QOS_ACKPOLICY_NOACK;
|
qos[0] |= IEEE80211_QOS_ACKPOLICY_NOACK;
|
||||||
qos[1] = 0;
|
qos[1] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user