UHR fixes/updates
Johannes Berg
maintainercover UHR fixes/updates
Clearly we all missed the DUO parameters in the parsing.
Also update to D1.5, which will likely break tests without the corresponding hostap changes.
johannes
Johannes Berg
maintainerPATCH 1/2 wifi: skip DUO params when looking for NPCA
From: Johannes Berg <[email protected]>
If DUO parameters are present, they need to be skipped. This was missed during the D1.3 -> D1.4 transition and causes frames to be mis-parsed for NPCA when DUO is also enabled.
Signed-off-by Johannes Berg <[email protected]>
--- include/linux/ieee80211-uhr.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/linux/ieee80211-uhr.h +6 -0
@@ -341,6 +341,9 @@ ieee80211_uhr_npca_info(const struct ieee80211_uhr_operation *oper)if (!(oper->params &cpu_to_le16 (IEEE80211_UHR_OPER_PARAMS_NPCA_ENA )))return NULL ; +if (oper->params &cpu_to_le16 (IEEE80211_UHR_OPER_PARAMS_DUO_PRES )) + pos +=1 ; +if (oper->params &cpu_to_le16 (IEEE80211_UHR_OPER_PARAMS_DPS_PRES )) pos +=sizeof (struct ieee80211_uhr_dps_info );
@@ -372,6 +375,9 @@ ieee80211_uhr_oper_dbe_info(const struct ieee80211_uhr_operation *oper)if (!(oper->params &cpu_to_le16 (IEEE80211_UHR_OPER_PARAMS_DBE_ENA )))return NULL ; +if (oper->params &cpu_to_le16 (IEEE80211_UHR_OPER_PARAMS_DUO_PRES )) + pos +=1 ; +if (oper->params &cpu_to_le16 (IEEE80211_UHR_OPER_PARAMS_DPS_PRES )) pos +=sizeof (struct ieee80211_uhr_dps_info );
Signature · 1 line
2.55.0
Johannes Berg
maintainerPATCH 2/2 wifi: update UHR to Draft_P802.11bn D1.5
In reply to Johannes BergFrom: Johannes Berg <[email protected]>
Update various definitions and in particular NPCA
parsing to D1.5.
Signed-off-by Johannes Berg <[email protected]>
--- include/linux/ieee80211-eht.h | 18 ++++++- include/linux/ieee80211-uhr.h | 95 +++++++++++++++++++---------------- net/wireless/chan.c | 11 ++-- 3 files changed, 75 insertions(+), 49 deletions(-)
include/linux/ieee80211-eht.h +17 -1
@@ -482,6 +482,7 @@ struct ieee80211_multi_link_elem {#define IEEE80211_MLC_BASIC_PRES_MLD_ID 0x0200#define IEEE80211_MLC_BASIC_PRES_EXT_MLD_CAPA_OP 0x0400#define IEEE80211_MLC_BASIC_PRES_ENH_CRIT_UPD 0x0800 +#define IEEE80211_MLC_BASIC_PRES_AGE_OF_BSS_LOAD 0x1000#define IEEE80211_MED_SYNC_DELAY_DURATION 0x00ff#define IEEE80211_MED_SYNC_DELAY_SYNC_OFDM_ED_THRESH 0x0f00
@@ -550,6 +551,8 @@ struct ieee80211_mle_basic_common_info { } __packed;#define IEEE80211_MLC_PREQ_PRES_MLD_ID 0x0010 +#define IEEE80211_MLC_PREQ_PRES_MLD_MAC_ADDR 0x0020 +#define IEEE80211_MLC_PREQ_PRES_NEIGH_AP_MLD_MAC_ADDR 0x0040struct ieee80211_mle_preq_common_info {u8 len;
@@ -560,6 +563,7 @@ struct ieee80211_mle_preq_common_info {#define IEEE80211_MLC_RECONF_PRES_EML_CAPA 0x0020#define IEEE80211_MLC_RECONF_PRES_MLD_CAPA_OP 0x0040#define IEEE80211_MLC_RECONF_PRES_EXT_MLD_CAPA_OP 0x0080 +#define IEEE80211_MLC_RECONF_PRES_TARGET_AP_MLD_ADDR 0x0100/* no fixed fields in RECONF */
@@ -766,7 +770,7 @@ static inline u16 ieee80211_mle_get_mld_capa_op(const u8 *data)#define IEEE80211_EHT_ML_EXT_MLD_CAPA_NSTR_UPDATE 0x0020#define IEEE80211_EHT_ML_EXT_MLD_CAPA_EMLSR_ENA_ON_ONE_LINK 0x0040#define IEEE80211_EHT_ML_EXT_MLD_CAPA_BTM_MLD_RECO_MULTI_AP 0x0080 -/* defined by UHR Draft P802.11bn_D1.3 Figure 9-1147 */ +/* defined by UHR Draft P802.11bn_D1.5 Figure 9-1168 */ #define IEEE80211_UHR_ML_EXT_MLD_CAPA_ML_PM 0x0100/**
@@ -928,11 +932,17 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len) common +=2 ;if (control &IEEE80211_MLC_BASIC_PRES_ENH_CRIT_UPD ) common +=1 ; +if (control &IEEE80211_MLC_BASIC_PRES_AGE_OF_BSS_LOAD ) + common +=1 ;break ;case IEEE80211_ML_CONTROL_TYPE_PREQ : common +=sizeof (struct ieee80211_mle_preq_common_info );if (control &IEEE80211_MLC_PREQ_PRES_MLD_ID ) common +=1 ; +if (control &IEEE80211_MLC_PREQ_PRES_MLD_MAC_ADDR ) + common +=ETH_ALEN ; +if (control &IEEE80211_MLC_PREQ_PRES_NEIGH_AP_MLD_MAC_ADDR ) + common +=ETH_ALEN ;break ;case IEEE80211_ML_CONTROL_TYPE_RECONF : common +=1 ;
@@ -944,6 +954,8 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len) common +=2 ;if (control &IEEE80211_MLC_RECONF_PRES_EXT_MLD_CAPA_OP ) common +=2 ; +if (control &IEEE80211_MLC_RECONF_PRES_TARGET_AP_MLD_ADDR ) + common +=ETH_ALEN ;break ;case IEEE80211_ML_CONTROL_TYPE_TDLS : common +=sizeof (struct ieee80211_mle_tdls_common_info );
@@ -1003,6 +1015,7 @@ enum ieee80211_mle_subelems {#define IEEE80211_MLE_STA_CONTROL_BSS_PARAM_CHANGE_CNT_PRESENT 0x0800#define IEEE80211_MLE_STA_CONTROL_ENH_CRIT_UPD_PRESENT 0x1000#define IEEE80211_MLE_STA_CONTROL_AP_CONDUCTED_TX_PWR_PRESENT 0x2000 +#define IEEE80211_MLE_STA_CONTROL_AGE_OF_BSS_LOAD_PRESENT 0x4000struct ieee80211_mle_per_sta_profile {__le16 control;
@@ -1054,6 +1067,9 @@ static inline bool ieee80211_mle_basic_sta_prof_size_ok(const u8 *data,if (control &IEEE80211_MLE_STA_CONTROL_AP_CONDUCTED_TX_PWR_PRESENT ) info_len +=1 ; +if (control &IEEE80211_MLE_STA_CONTROL_AGE_OF_BSS_LOAD_PRESENT ) + info_len +=1 ; +return prof->sta_info_len >= info_len && fixed + prof->sta_info_len -1 <= len; }
include/linux/ieee80211-uhr.h +53 -42
177 lines not on this page · raw message
net/wireless/chan.c +5 -6
@@ -568,8 +568,8 @@ int cfg80211_chandef_add_npca(struct wiphy *wiphy, const struct ieee80211_uhr_npca_info *npca) {struct cfg80211_chan_def new_chandef = *chandef; -u32 width, npca_freq; -u8 offs; +u32 npca_freq; +u8 chan;if (chandef->npca_chan || chandef->npca_punctured)return -EINVAL ;
@@ -589,11 +589,10 @@ int cfg80211_chandef_add_npca(struct wiphy *wiphy,return -EINVAL ; } - offs =le32_get_bits (npca->params, -IEEE80211_UHR_NPCA_PARAMS_PRIMARY_CHAN_OFFS ); + chan =le32_get_bits (npca->params, +IEEE80211_UHR_NPCA_PARAMS_PRIMARY_CHAN ); - width =cfg80211_chandef_get_width (chandef); - npca_freq = chandef->center_freq1 - width /2 +10 +20 * offs; + npca_freq =ieee80211_channel_to_frequency (chan, chandef->chan->band); new_chandef.npca_chan =ieee80211_get_channel (wiphy, npca_freq);if (!new_chandef.npca_chan)return -EINVAL ;
Signature · 1 line
2.55.0