diff options
author | adrian <adrian@FreeBSD.org> | 2013-02-27 00:49:32 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-02-27 00:49:32 +0000 |
commit | 215eaab94f57ae7481fdd68b199e418d98aa6b6a (patch) | |
tree | f2d40c9afdce1e0ab7345ee82a3d22daf585c0b1 /sys/dev | |
parent | 256df5868727e3e8cfea69e423b68f1d5e04589e (diff) | |
download | FreeBSD-src-215eaab94f57ae7481fdd68b199e418d98aa6b6a.zip FreeBSD-src-215eaab94f57ae7481fdd68b199e418d98aa6b6a.tar.gz |
Enable STBC for the given rate series if it's negotiated:
* If both ends have negotiated (at least) one stream;
* Only if it's a single stream rate (MCS0-7);
* Only if there's more than one TX chain enabled.
Tested:
* AR9280 STA mode -> Atheros AP; tested both MCS2 (STBC) and MCS12 (no STBC.)
Verified using athalq to inspect the TX descriptors.
TODO:
* Test AR5416 - no STBC should be enabled;
* Test AR9280 with one TX chain enabled - no STBC should be enabled.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ath/if_ath_tx_ht.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index c0e72ac..d382f8f 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -536,16 +536,29 @@ ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni, series[i].RateFlags |= HAL_RATESERIES_HALFGI; /* - * XXX TODO: STBC if it's possible + * Setup rate and TX power cap for this series. */ + series[i].Rate = rt->info[rc[i].rix].rateCode; + series[i].RateIndex = rc[i].rix; + series[i].tx_power_cap = 0x3f; /* XXX for now */ + /* - * XXX TODO: LDPC if it's possible + * If we have STBC TX enabled and the receiver + * can receive (at least) 1 stream STBC, AND it's + * MCS 0-7, AND we have at least two chains enabled, + * enable STBC. */ + if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC && + ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM && + (sc->sc_cur_txchainmask > 1) && + HT_RC_2_STREAMS(series[i].Rate) == 1) { + series[i].RateFlags |= HAL_RATESERIES_STBC; + } - series[i].Rate = rt->info[rc[i].rix].rateCode; - series[i].RateIndex = rc[i].rix; - series[i].tx_power_cap = 0x3f; /* XXX for now */ + /* + * XXX TODO: LDPC if it's possible + */ /* * PktDuration doesn't include slot, ACK, RTS, etc timing - |