Lines Matching refs:rate
1089 static u32 cfg80211_calculate_bitrate_ht(struct rate_info *rate) in cfg80211_calculate_bitrate_ht() argument
1094 if (WARN_ON_ONCE(rate->mcs >= 32)) in cfg80211_calculate_bitrate_ht()
1097 modulation = rate->mcs & 7; in cfg80211_calculate_bitrate_ht()
1098 streams = (rate->mcs >> 3) + 1; in cfg80211_calculate_bitrate_ht()
1100 bitrate = (rate->bw == RATE_INFO_BW_40) ? 13500000 : 6500000; in cfg80211_calculate_bitrate_ht()
1111 if (rate->flags & RATE_INFO_FLAGS_SHORT_GI) in cfg80211_calculate_bitrate_ht()
1118 static u32 cfg80211_calculate_bitrate_dmg(struct rate_info *rate) in cfg80211_calculate_bitrate_dmg() argument
1159 if (WARN_ON_ONCE(rate->mcs >= ARRAY_SIZE(__mcs2bitrate))) in cfg80211_calculate_bitrate_dmg()
1162 return __mcs2bitrate[rate->mcs]; in cfg80211_calculate_bitrate_dmg()
1165 static u32 cfg80211_calculate_bitrate_edmg(struct rate_info *rate) in cfg80211_calculate_bitrate_edmg() argument
1193 if (WARN_ON_ONCE(rate->mcs >= ARRAY_SIZE(__mcs2bitrate))) in cfg80211_calculate_bitrate_edmg()
1196 return __mcs2bitrate[rate->mcs] * rate->n_bonded_ch; in cfg80211_calculate_bitrate_edmg()
1199 static u32 cfg80211_calculate_bitrate_vht(struct rate_info *rate) in cfg80211_calculate_bitrate_vht() argument
1251 if (rate->mcs > 9) in cfg80211_calculate_bitrate_vht()
1254 switch (rate->bw) { in cfg80211_calculate_bitrate_vht()
1272 bitrate = base[idx][rate->mcs]; in cfg80211_calculate_bitrate_vht()
1273 bitrate *= rate->nss; in cfg80211_calculate_bitrate_vht()
1275 if (rate->flags & RATE_INFO_FLAGS_SHORT_GI) in cfg80211_calculate_bitrate_vht()
1282 rate->bw, rate->mcs, rate->nss); in cfg80211_calculate_bitrate_vht()
1286 static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) in cfg80211_calculate_bitrate_he() argument
1313 if (WARN_ON_ONCE(rate->mcs > 11)) in cfg80211_calculate_bitrate_he()
1316 if (WARN_ON_ONCE(rate->he_gi > NL80211_RATE_INFO_HE_GI_3_2)) in cfg80211_calculate_bitrate_he()
1318 if (WARN_ON_ONCE(rate->he_ru_alloc > in cfg80211_calculate_bitrate_he()
1321 if (WARN_ON_ONCE(rate->nss < 1 || rate->nss > 8)) in cfg80211_calculate_bitrate_he()
1324 if (rate->bw == RATE_INFO_BW_160) in cfg80211_calculate_bitrate_he()
1325 result = rates_160M[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1326 else if (rate->bw == RATE_INFO_BW_80 || in cfg80211_calculate_bitrate_he()
1327 (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1328 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_996)) in cfg80211_calculate_bitrate_he()
1329 result = rates_969[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1330 else if (rate->bw == RATE_INFO_BW_40 || in cfg80211_calculate_bitrate_he()
1331 (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1332 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_484)) in cfg80211_calculate_bitrate_he()
1333 result = rates_484[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1334 else if (rate->bw == RATE_INFO_BW_20 || in cfg80211_calculate_bitrate_he()
1335 (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1336 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_242)) in cfg80211_calculate_bitrate_he()
1337 result = rates_242[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1338 else if (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1339 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_106) in cfg80211_calculate_bitrate_he()
1340 result = rates_106[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1341 else if (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1342 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_52) in cfg80211_calculate_bitrate_he()
1343 result = rates_52[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1344 else if (rate->bw == RATE_INFO_BW_HE_RU && in cfg80211_calculate_bitrate_he()
1345 rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_26) in cfg80211_calculate_bitrate_he()
1346 result = rates_26[rate->he_gi]; in cfg80211_calculate_bitrate_he()
1349 rate->bw, rate->he_ru_alloc); in cfg80211_calculate_bitrate_he()
1356 do_div(tmp, mcs_divisors[rate->mcs]); in cfg80211_calculate_bitrate_he()
1360 result = (result * rate->nss) / 8; in cfg80211_calculate_bitrate_he()
1361 if (rate->he_dcm) in cfg80211_calculate_bitrate_he()
1367 u32 cfg80211_calculate_bitrate(struct rate_info *rate) in cfg80211_calculate_bitrate() argument
1369 if (rate->flags & RATE_INFO_FLAGS_MCS) in cfg80211_calculate_bitrate()
1370 return cfg80211_calculate_bitrate_ht(rate); in cfg80211_calculate_bitrate()
1371 if (rate->flags & RATE_INFO_FLAGS_DMG) in cfg80211_calculate_bitrate()
1372 return cfg80211_calculate_bitrate_dmg(rate); in cfg80211_calculate_bitrate()
1373 if (rate->flags & RATE_INFO_FLAGS_EDMG) in cfg80211_calculate_bitrate()
1374 return cfg80211_calculate_bitrate_edmg(rate); in cfg80211_calculate_bitrate()
1375 if (rate->flags & RATE_INFO_FLAGS_VHT_MCS) in cfg80211_calculate_bitrate()
1376 return cfg80211_calculate_bitrate_vht(rate); in cfg80211_calculate_bitrate()
1377 if (rate->flags & RATE_INFO_FLAGS_HE_MCS) in cfg80211_calculate_bitrate()
1378 return cfg80211_calculate_bitrate_he(rate); in cfg80211_calculate_bitrate()
1380 return rate->legacy; in cfg80211_calculate_bitrate()
1931 int rate = (rates[i] & 0x7f) * 5; in ieee80211_get_ratemask() local
1935 if (sband->bitrates[j].bitrate == rate) { in ieee80211_get_ratemask()