Commit b0a33448 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath9k: add LDPC support

LDPC is enabled by the rate control if the its determined
that the target peer supports LDPC. We would have already
intersected the HT capabilities so if our peer supports
LDPC so do we.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ce01805a
...@@ -189,6 +189,9 @@ static void setup_ht_cap(struct ath_softc *sc, ...@@ -189,6 +189,9 @@ static void setup_ht_cap(struct ath_softc *sc,
IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_40 |
IEEE80211_HT_CAP_DSSSCCK40; IEEE80211_HT_CAP_DSSSCCK40;
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_LDPC)
ht_info->cap |= IEEE80211_HT_CAP_LDPC_CODING;
ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8;
......
...@@ -689,6 +689,15 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, ...@@ -689,6 +689,15 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
rate_table = sc->cur_rate_table; rate_table = sc->cur_rate_table;
rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe); rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe);
/*
* If we're in HT mode and both us and our peer supports LDPC.
* We don't need to check our own device's capabilities as our own
* ht capabilities would have already been intersected with our peer's.
*/
if (conf_is_ht(&sc->hw->conf) &&
(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
tx_info->flags |= IEEE80211_TX_CTL_LDPC;
if (is_probe) { if (is_probe) {
/* set one try for probe rates. For the /* set one try for probe rates. For the
* probes don't enable rts */ * probes don't enable rts */
......
...@@ -1483,8 +1483,7 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb, ...@@ -1483,8 +1483,7 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb,
INCR(tid->seq_next, IEEE80211_SEQ_MAX); INCR(tid->seq_next, IEEE80211_SEQ_MAX);
} }
static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, static int setup_tx_flags(struct sk_buff *skb, bool use_ldpc)
struct ath_txq *txq)
{ {
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
int flags = 0; int flags = 0;
...@@ -1495,6 +1494,9 @@ static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, ...@@ -1495,6 +1494,9 @@ static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb,
if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK)
flags |= ATH9K_TXDESC_NOACK; flags |= ATH9K_TXDESC_NOACK;
if (use_ldpc)
flags |= ATH9K_TXDESC_LDPC;
return flags; return flags;
} }
...@@ -1646,6 +1648,7 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf, ...@@ -1646,6 +1648,7 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
int hdrlen; int hdrlen;
__le16 fc; __le16 fc;
int padpos, padsize; int padpos, padsize;
bool use_ldpc = false;
tx_info->pad[0] = 0; tx_info->pad[0] = 0;
switch (txctl->frame_type) { switch (txctl->frame_type) {
...@@ -1672,10 +1675,13 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf, ...@@ -1672,10 +1675,13 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
bf->bf_frmlen -= padsize; bf->bf_frmlen -= padsize;
} }
if (conf_is_ht(&hw->conf)) if (conf_is_ht(&hw->conf)) {
bf->bf_state.bf_type |= BUF_HT; bf->bf_state.bf_type |= BUF_HT;
if (tx_info->flags & IEEE80211_TX_CTL_LDPC)
use_ldpc = true;
}
bf->bf_flags = setup_tx_flags(sc, skb, txctl->txq); bf->bf_flags = setup_tx_flags(skb, use_ldpc);
bf->bf_keytype = get_hw_crypto_keytype(skb); bf->bf_keytype = get_hw_crypto_keytype(skb);
if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR) { if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment