On Tue, 2022-05-24 at 14:33 +0300, viktor.barna@xxxxxxxxxx wrote: > > + if (sta->vht_cap.vht_supported) { > + u32 vht_exp = (sta->vht_cap.cap & > + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >> > + IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT; You can (often) simplify that kind of thing using u32_get_bits() > + he_exp = (mac_cap_info3 & IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) >> > + HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_OFFSET; or u8_get_bits(), etc. There are even le/be versions. > + struct ieee80211_he_6ghz_capa *he_6g_cap = &sta->he_6ghz_capa; > + u8 he_exp_6ghz = (le16_to_cpu(he_6g_cap->capa) & > + HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP_MASK) >> > + HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP_OFFSET; which you could use here. I know we don't use it everywhere yet, but IMHO it's ultimately nicer code, and I definitely try to use it in new code. johannes