ath9k: simplify ath_tx_form_aggr
The check for ATH_AMPDU_SUBFRAME_DEFAULT is unnecessary, since it's set to half the maximum BlockAck Window size, which is already the maximum value that h_baw could possibly have. Also remove unnecessary variables. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
18fcf1c6a6
commit
a1cd94d345
|
@ -137,7 +137,6 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
|
||||||
#define ATH_AGGR_ENCRYPTDELIM 10
|
#define ATH_AGGR_ENCRYPTDELIM 10
|
||||||
/* minimum h/w qdepth to be sustained to maximize aggregation */
|
/* minimum h/w qdepth to be sustained to maximize aggregation */
|
||||||
#define ATH_AGGR_MIN_QDEPTH 2
|
#define ATH_AGGR_MIN_QDEPTH 2
|
||||||
#define ATH_AMPDU_SUBFRAME_DEFAULT 32
|
|
||||||
|
|
||||||
#define IEEE80211_SEQ_SEQ_SHIFT 4
|
#define IEEE80211_SEQ_SEQ_SHIFT 4
|
||||||
#define IEEE80211_SEQ_MAX 4096
|
#define IEEE80211_SEQ_MAX 4096
|
||||||
|
|
|
@ -906,7 +906,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
|
||||||
{
|
{
|
||||||
#define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
|
#define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
|
||||||
struct ath_buf *bf, *bf_first = NULL, *bf_prev = NULL;
|
struct ath_buf *bf, *bf_first = NULL, *bf_prev = NULL;
|
||||||
int rl = 0, nframes = 0, ndelim, prev_al = 0;
|
int nframes = 0, ndelim;
|
||||||
u16 aggr_limit = 0, al = 0, bpad = 0,
|
u16 aggr_limit = 0, al = 0, bpad = 0,
|
||||||
al_delta, h_baw = tid->baw_size / 2;
|
al_delta, h_baw = tid->baw_size / 2;
|
||||||
enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
|
enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
|
||||||
|
@ -925,32 +925,23 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc,
|
||||||
skb = bf->bf_mpdu;
|
skb = bf->bf_mpdu;
|
||||||
fi = get_frame_info(skb);
|
fi = get_frame_info(skb);
|
||||||
|
|
||||||
if (!bf_first)
|
if (!bf_first) {
|
||||||
bf_first = bf;
|
bf_first = bf;
|
||||||
|
|
||||||
if (!rl) {
|
|
||||||
ath_set_rates(tid->an->vif, tid->an->sta, bf);
|
ath_set_rates(tid->an->vif, tid->an->sta, bf);
|
||||||
aggr_limit = ath_lookup_rate(sc, bf, tid);
|
aggr_limit = ath_lookup_rate(sc, bf, tid);
|
||||||
rl = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do not exceed aggregation limit */
|
/* do not exceed aggregation limit */
|
||||||
al_delta = ATH_AGGR_DELIM_SZ + fi->framelen;
|
al_delta = ATH_AGGR_DELIM_SZ + fi->framelen;
|
||||||
|
if (nframes) {
|
||||||
if (nframes &&
|
if (aggr_limit < al + bpad + al_delta ||
|
||||||
((aggr_limit < (al + bpad + al_delta + prev_al)) ||
|
ath_lookup_legacy(bf) || nframes >= h_baw) {
|
||||||
ath_lookup_legacy(bf))) {
|
|
||||||
status = ATH_AGGR_LIMITED;
|
status = ATH_AGGR_LIMITED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
|
tx_info = IEEE80211_SKB_CB(bf->bf_mpdu);
|
||||||
if (nframes && (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE))
|
if (tx_info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
|
||||||
break;
|
|
||||||
|
|
||||||
/* do not exceed subframe limit */
|
|
||||||
if (nframes >= min((int)h_baw, ATH_AMPDU_SUBFRAME_DEFAULT)) {
|
|
||||||
status = ATH_AGGR_LIMITED;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue