Skip to contentSkip to conversation

mac80211: fix RX STBC override byte order

PATCH In review Johannes Berg 2 participants 2 messages Apr 9, 2019 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH v2 1/1 mac80211: fix RX STBC override byte order

From: Johannes Berg <[email protected]>

The original patch neglected to take byte order conversions into account, fix that.

Fixes d9bb410888ce ("mac80211: allow overriding HT STBC capabilities")
---
 net/mac80211/ht.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/mac80211/ht.c +3 -2
index e03c46ac8e4d..c62101857b9b 100644
@@ -112,8 +112,9 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
 			     IEEE80211_HT_CAP_TX_STBC);
 
 	/* Allow user to configure RX STBC bits */
-	if (ht_capa_mask->cap_info & IEEE80211_HT_CAP_RX_STBC)
-		ht_cap->cap |= ht_capa->cap_info & IEEE80211_HT_CAP_RX_STBC;
+	if (ht_capa_mask->cap_info & cpu_to_le16(IEEE80211_HT_CAP_RX_STBC))
+		ht_cap->cap |= le16_to_cpu(ht_capa->cap_info) &
+					IEEE80211_HT_CAP_RX_STBC;
 
 	/* Allow user to decrease AMPDU factor */
 	if (ht_capa_mask->ampdu_params_info &
Signature · 1 line
2.17.2
Reviewed-by on v2 1/1
#1 lore raw
Quoted 15 lines

The original patch neglected to take byte order conversions into account, fix that.

Fixes d9bb410888ce ("mac80211: allow overriding HT STBC capabilities")
---
 net/mac80211/ht.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
net/mac80211/ht.c +0 -0
index e03c46ac8e4d..c62101857b9b 100644
@@ -112,8 +112,9 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
                             IEEE80211_HT_CAP_TX_STBC);

net/mac80211/ht.c void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, · line 120

Quoted 10 lines
net/mac80211/ht.c +3 -2
 
        /* Allow user to configure RX STBC bits */
-       if (ht_capa_mask->cap_info & IEEE80211_HT_CAP_RX_STBC)
-               ht_cap->cap |= ht_capa->cap_info & IEEE80211_HT_CAP_RX_STBC;
+       if (ht_capa_mask->cap_info & cpu_to_le16(IEEE80211_HT_CAP_RX_STBC))
+               ht_cap->cap |= le16_to_cpu(ht_capa->cap_info) &
+                                       IEEE80211_HT_CAP_RX_STBC;
 
        /* Allow user to decrease AMPDU factor */
        if (ht_capa_mask->ampdu_params_info &

Thanks for fixing this!

Regards,
Sergey