diff options
author | adrian <adrian@FreeBSD.org> | 2012-04-07 03:22:11 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-04-07 03:22:11 +0000 |
commit | 89f805c29a4e922e5a7d624cd548006901e33ee7 (patch) | |
tree | ca673f08e61e2454f9ac4f07ef23518a60949213 /sys/dev/ath/if_ath_tx_ht.c | |
parent | 17c1a9e4d5f967c74c9cabe8abc58f29af44b433 (diff) | |
download | FreeBSD-src-89f805c29a4e922e5a7d624cd548006901e33ee7.zip FreeBSD-src-89f805c29a4e922e5a7d624cd548006901e33ee7.tar.gz |
Enforce the RTS aggregation limit if RTS/CTS protection is enabled;
if any subframes in an aggregate have different protection from the
first frame in the formed aggregate, don't add that frame to the
aggregate.
This is likely a suboptimal method (I think we'll mostly be OK marking
frames that have seqno's with the same protection as normal data frames)
but I'll just be cautious for now.
Diffstat (limited to 'sys/dev/ath/if_ath_tx_ht.c')
-rw-r--r-- | sys/dev/ath/if_ath_tx_ht.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index 976464c..b7875a3 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -707,14 +707,6 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, */ /* - * XXX TODO: AR5416 has an 8K aggregation size limit - * when RTS is enabled, and RTS is required for dual-stream - * rates. - * - * For now, limit all aggregates for the AR5416 to be 8K. - */ - - /* * do not exceed aggregation limit */ al_delta = ATH_AGGR_DELIM_SZ + bf->bf_state.bfs_pktlen; @@ -725,6 +717,20 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, } /* + * If RTS/CTS is set on the first frame, enforce + * the RTS aggregate limit. + */ + if (bf_first->bf_state.bfs_txflags & + (HAL_TXDESC_CTSENA | HAL_TXDESC_RTSENA)) { + if (nframes && + (sc->sc_rts_aggr_limit < + (al + bpad + al_delta + prev_al))) { + status = ATH_AGGR_8K_LIMITED; + break; + } + } + + /* * Do not exceed subframe limit. */ if ((nframes + prev_frames) >= MIN((h_baw), @@ -734,7 +740,24 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, } /* - * TODO: If it's _before_ the BAW left edge, complain very loudly. + * If the current frame has an RTS/CTS configuration + * that differs from the first frame, don't include + * this in the aggregate. It's possible that the + * "right" thing to do here is enforce the aggregate + * configuration. + */ + if ((bf_first->bf_state.bfs_txflags & + (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) != + (bf->bf_state.bfs_txflags & + (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))) { + status = ATH_AGGR_NONAGGR; + break; + } + + /* + * TODO: If it's _before_ the BAW left edge, complain very + * loudly. + * * This means something (else) has slid the left edge along * before we got a chance to be TXed. */ @@ -814,11 +837,6 @@ ath_tx_form_aggr(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, bf->bf_state.bfs_addedbaw = 1; /* - * XXX TODO: If any frame in the aggregate requires RTS/CTS, - * set the first frame. - */ - - /* * XXX enforce ACK for aggregate frames (this needs to be * XXX handled more gracefully? */ |