mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mac80211: minstrel: Enable STBC and LDPC for VHT Rates
If peer support reception of STBC and LDPC, enable them for better performance. Signed-off-by: Chaitanya TK <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
parent
42dca5ef24
commit
f458e832ba
2 changed files with 16 additions and 8 deletions
|
|
@ -1130,7 +1130,7 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
|
|||
struct minstrel_ht_sta_priv *msp = priv_sta;
|
||||
struct minstrel_ht_sta *mi = &msp->ht;
|
||||
struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
|
||||
u16 sta_cap = sta->ht_cap.cap;
|
||||
u16 ht_cap = sta->ht_cap.cap;
|
||||
struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap;
|
||||
struct sta_info *sinfo = container_of(sta, struct sta_info, sta);
|
||||
int use_vht;
|
||||
|
|
@ -1138,6 +1138,7 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
|
|||
int ack_dur;
|
||||
int stbc;
|
||||
int i;
|
||||
bool ldpc;
|
||||
|
||||
/* fall back to the old minstrel for legacy stations */
|
||||
if (!sta->ht_cap.ht_supported)
|
||||
|
|
@ -1175,16 +1176,22 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
|
|||
}
|
||||
mi->sample_tries = 4;
|
||||
|
||||
/* TODO tx_flags for vht - ATM the RC API is not fine-grained enough */
|
||||
if (!use_vht) {
|
||||
stbc = (sta_cap & IEEE80211_HT_CAP_RX_STBC) >>
|
||||
stbc = (ht_cap & IEEE80211_HT_CAP_RX_STBC) >>
|
||||
IEEE80211_HT_CAP_RX_STBC_SHIFT;
|
||||
mi->tx_flags |= stbc << IEEE80211_TX_CTL_STBC_SHIFT;
|
||||
|
||||
if (sta_cap & IEEE80211_HT_CAP_LDPC_CODING)
|
||||
mi->tx_flags |= IEEE80211_TX_CTL_LDPC;
|
||||
ldpc = ht_cap & IEEE80211_HT_CAP_LDPC_CODING;
|
||||
} else {
|
||||
stbc = (vht_cap->cap & IEEE80211_VHT_CAP_RXSTBC_MASK) >>
|
||||
IEEE80211_VHT_CAP_RXSTBC_SHIFT;
|
||||
|
||||
ldpc = vht_cap->cap & IEEE80211_VHT_CAP_RXLDPC;
|
||||
}
|
||||
|
||||
mi->tx_flags |= stbc << IEEE80211_TX_CTL_STBC_SHIFT;
|
||||
if (ldpc)
|
||||
mi->tx_flags |= IEEE80211_TX_CTL_LDPC;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mi->groups); i++) {
|
||||
u32 gflags = minstrel_mcs_groups[i].flags;
|
||||
int bw, nss;
|
||||
|
|
@ -1197,10 +1204,10 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
|
|||
|
||||
if (gflags & IEEE80211_TX_RC_SHORT_GI) {
|
||||
if (gflags & IEEE80211_TX_RC_40_MHZ_WIDTH) {
|
||||
if (!(sta_cap & IEEE80211_HT_CAP_SGI_40))
|
||||
if (!(ht_cap & IEEE80211_HT_CAP_SGI_40))
|
||||
continue;
|
||||
} else {
|
||||
if (!(sta_cap & IEEE80211_HT_CAP_SGI_20))
|
||||
if (!(ht_cap & IEEE80211_HT_CAP_SGI_20))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue