wifi: ieee80211: fix erroneous NSTR bitmap size checks
[carl9170fw.git] / include / linux / ieee80211.h
index 8858f88c8e3c36c4289eff9ee83ade3917044114..ca76f88b4c4c2f69baad49b70e8f00264a9a5490 100644 (file)
@@ -4433,6 +4433,9 @@ static inline bool for_each_element_completed(const struct element *element,
 #define IEEE80211_RNR_TBTT_PARAMS_PROBE_ACTIVE                 0x20
 #define IEEE80211_RNR_TBTT_PARAMS_COLOC_AP                     0x40
 
+#define IEEE80211_RNR_TBTT_PARAMS_PSD_NO_LIMIT                 127
+#define IEEE80211_RNR_TBTT_PARAMS_PSD_RESERVED                 -128
+
 struct ieee80211_neighbor_ap_info {
        u8 tbtt_info_hdr;
        u8 tbtt_info_len;
@@ -4468,7 +4471,7 @@ struct ieee80211_tbtt_info_7_8_9 {
 
        /* The following element is optional, structure may not grow */
        u8 bss_params;
-       u8 psd_20;
+       s8 psd_20;
 } __packed;
 
 /* Format of the TBTT information element if it has >= 11 bytes */
@@ -4479,7 +4482,7 @@ struct ieee80211_tbtt_info_ge_11 {
 
        /* The following elements are optional, structure may grow */
        u8 bss_params;
-       u8 psd_20;
+       s8 psd_20;
        struct ieee80211_rnr_mld_params mld_params;
 } __packed;
 
@@ -4845,7 +4848,7 @@ static inline bool ieee80211_mle_basic_sta_prof_size_ok(const u8 *data,
        if (control & IEEE80211_MLE_STA_CONTROL_DTIM_INFO_PRESENT)
                info_len += 2;
        if (control & IEEE80211_MLE_STA_CONTROL_COMPLETE_PROFILE &&
-           control & IEEE80211_MLE_STA_CONTROL_NSTR_BITMAP_SIZE) {
+           control & IEEE80211_MLE_STA_CONTROL_NSTR_LINK_PAIR_PRESENT) {
                if (control & IEEE80211_MLE_STA_CONTROL_NSTR_BITMAP_SIZE)
                        info_len += 2;
                else
@@ -4884,7 +4887,7 @@ ieee80211_mle_basic_sta_prof_bss_param_ch_cnt(const struct ieee80211_mle_per_sta
        if (control & IEEE80211_MLE_STA_CONTROL_DTIM_INFO_PRESENT)
                pos += 2;
        if (control & IEEE80211_MLE_STA_CONTROL_COMPLETE_PROFILE &&
-           control & IEEE80211_MLE_STA_CONTROL_NSTR_BITMAP_SIZE) {
+           control & IEEE80211_MLE_STA_CONTROL_NSTR_LINK_PAIR_PRESENT) {
                if (control & IEEE80211_MLE_STA_CONTROL_NSTR_BITMAP_SIZE)
                        pos += 2;
                else