wifi: mac80211: clarify IEEE80211_STATUS_SUBDATA_MASK
authorJohannes Berg <johannes.berg@intel.com>
Wed, 20 Mar 2024 07:14:00 +0000 (09:14 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Mar 2024 14:39:28 +0000 (15:39 +0100)
We have 13 bits for the status_data, so restricting
type to 4 and subdata to 8 bits is confusing, even if
we don't need more bits now. Change subdata mask to
be 9 bits instead, just to make things match up.

If we actually need more types or more subdata bits
we can later also reshuffle the bits between these,
but we should probably keep them at 13 bits together.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240320091155.28ac7b665039.I1abbb13e90f016cab552492e05f5cb5b52de6463@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ht.c
net/mac80211/ieee80211_i.h

index c3330aea4da3c5d679ebd540577e0d62d7dc6faa..d7e8cf8e48b78f7d801e1bf5548eec2a7647c153 100644 (file)
@@ -580,7 +580,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
        /* we'll do more on status of this frame */
        info = IEEE80211_SKB_CB(skb);
        info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
-       /* we have 12 bits, and need 6: link_id 4, smps 2 */
+       /* we have 13 bits, and need 6: link_id 4, smps 2 */
        info->status_data = IEEE80211_STATUS_TYPE_SMPS |
                            u16_encode_bits(status_link_id << 2 | smps,
                                            IEEE80211_STATUS_SUBDATA_MASK);
index c2212363dad3b75801595542a5863b4f05d352aa..fe81ab6416207f76b1170232d4895e0c7dc7e1b9 100644 (file)
@@ -90,7 +90,7 @@ enum ieee80211_status_data {
        IEEE80211_STATUS_TYPE_INVALID   = 0,
        IEEE80211_STATUS_TYPE_SMPS      = 1,
        IEEE80211_STATUS_TYPE_NEG_TTLM  = 2,
-       IEEE80211_STATUS_SUBDATA_MASK   = 0xff0,
+       IEEE80211_STATUS_SUBDATA_MASK   = 0x1ff0,
 };
 
 static inline bool