Lines Matching +full:data +full:- +full:rates
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright 2011-2020 NXP
83 /* AC rates */
181 * This function maps an index in supported rates table into
182 * the corresponding data rate.
202 rate = ac_mcs_rate_nss2[2 * (3 - bw) + gi][mcs_index]; in mwifiex_index_to_acs_data_rate()
204 rate = ac_mcs_rate_nss1[2 * (3 - bw) + gi][mcs_index]; in mwifiex_index_to_acs_data_rate()
219 rate = mcs_rate[2 * (1 - bw) + gi][index]; in mwifiex_index_to_acs_data_rate()
226 /* 11n non-HT rates */ in mwifiex_index_to_acs_data_rate()
235 /* This function maps an index in supported rates table into
236 * the corresponding data rate.
242 (priv->adapter->user_dev_mcs_support == HT_STREAM_2X2) ? 16 : 8; in mwifiex_index_to_data_rate()
245 if (priv->adapter->is_hw_11ac_capable) in mwifiex_index_to_data_rate()
281 * This function returns the current active data rates.
285 u32 mwifiex_get_active_data_rates(struct mwifiex_private *priv, u8 *rates) in mwifiex_get_active_data_rates() argument
287 if (!priv->media_connected) in mwifiex_get_active_data_rates()
288 return mwifiex_get_supported_rates(priv, rates); in mwifiex_get_active_data_rates()
290 return mwifiex_copy_rates(rates, 0, in mwifiex_get_active_data_rates()
291 priv->curr_bss_params.data_rates, in mwifiex_get_active_data_rates()
292 priv->curr_bss_params.num_of_rates); in mwifiex_get_active_data_rates()
296 * This function locates the Channel-Frequency-Power triplet based upon
311 sband = priv->wdev.wiphy->bands[NL80211_BAND_2GHZ]; in mwifiex_get_cfp()
313 sband = priv->wdev.wiphy->bands[NL80211_BAND_5GHZ]; in mwifiex_get_cfp()
316 mwifiex_dbg(priv->adapter, ERROR, in mwifiex_get_cfp()
322 for (i = 0; i < sband->n_channels; i++) { in mwifiex_get_cfp()
323 ch = &sband->channels[i]; in mwifiex_get_cfp()
325 if (ch->flags & IEEE80211_CHAN_DISABLED) in mwifiex_get_cfp()
329 if (ch->center_freq == freq) in mwifiex_get_cfp()
333 if (ch->hw_value == channel || in mwifiex_get_cfp()
338 if (i == sband->n_channels) { in mwifiex_get_cfp()
339 mwifiex_dbg(priv->adapter, WARN, in mwifiex_get_cfp()
347 priv->cfp.channel = ch->hw_value; in mwifiex_get_cfp()
348 priv->cfp.freq = ch->center_freq; in mwifiex_get_cfp()
349 priv->cfp.max_tx_power = ch->max_power; in mwifiex_get_cfp()
350 cfp = &priv->cfp; in mwifiex_get_cfp()
357 * This function checks if the data rate is set to auto.
365 for (i = 0; i < ARRAY_SIZE(priv->bitmap_rates); i++) in mwifiex_is_rate_auto()
366 if (priv->bitmap_rates[i]) in mwifiex_is_rate_auto()
375 /* This function gets the supported data rates from bitmask inside
379 u8 *rates, u8 radio_type) in mwifiex_get_rates_from_cfg80211() argument
381 struct wiphy *wiphy = priv->adapter->wiphy; in mwifiex_get_rates_from_cfg80211()
382 struct cfg80211_scan_request *request = priv->scan_request; in mwifiex_get_rates_from_cfg80211()
388 sband = wiphy->bands[NL80211_BAND_5GHZ]; in mwifiex_get_rates_from_cfg80211()
391 rate_mask = request->rates[NL80211_BAND_5GHZ]; in mwifiex_get_rates_from_cfg80211()
393 sband = wiphy->bands[NL80211_BAND_2GHZ]; in mwifiex_get_rates_from_cfg80211()
396 rate_mask = request->rates[NL80211_BAND_2GHZ]; in mwifiex_get_rates_from_cfg80211()
400 for (i = 0; i < sband->n_bitrates; i++) { in mwifiex_get_rates_from_cfg80211()
403 rates[num_rates++] = (u8)(sband->bitrates[i].bitrate / 5); in mwifiex_get_rates_from_cfg80211()
409 /* This function gets the supported data rates. The function works in
410 * both Ad-Hoc and infra mode by printing the band and returning the
411 * data rates.
413 u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates) in mwifiex_get_supported_rates() argument
416 struct mwifiex_adapter *adapter = priv->adapter; in mwifiex_get_supported_rates()
418 if (priv->bss_mode == NL80211_IFTYPE_STATION || in mwifiex_get_supported_rates()
419 priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { in mwifiex_get_supported_rates()
420 switch (adapter->config_bands) { in mwifiex_get_supported_rates()
424 adapter->config_bands); in mwifiex_get_supported_rates()
425 k = mwifiex_copy_rates(rates, k, supported_rates_b, in mwifiex_get_supported_rates()
432 adapter->config_bands); in mwifiex_get_supported_rates()
433 k = mwifiex_copy_rates(rates, k, supported_rates_g, in mwifiex_get_supported_rates()
444 adapter->config_bands); in mwifiex_get_supported_rates()
445 k = mwifiex_copy_rates(rates, k, supported_rates_bg, in mwifiex_get_supported_rates()
452 adapter->config_bands); in mwifiex_get_supported_rates()
453 k = mwifiex_copy_rates(rates, k, supported_rates_a, in mwifiex_get_supported_rates()
463 adapter->config_bands); in mwifiex_get_supported_rates()
464 k = mwifiex_copy_rates(rates, k, supported_rates_a, in mwifiex_get_supported_rates()
470 adapter->config_bands); in mwifiex_get_supported_rates()
471 k = mwifiex_copy_rates(rates, k, supported_rates_n, in mwifiex_get_supported_rates()
476 /* Ad-hoc mode */ in mwifiex_get_supported_rates()
477 switch (adapter->adhoc_start_band) { in mwifiex_get_supported_rates()
480 k = mwifiex_copy_rates(rates, k, adhoc_rates_b, in mwifiex_get_supported_rates()
486 k = mwifiex_copy_rates(rates, k, adhoc_rates_g, in mwifiex_get_supported_rates()
492 k = mwifiex_copy_rates(rates, k, adhoc_rates_bg, in mwifiex_get_supported_rates()
498 k = mwifiex_copy_rates(rates, k, adhoc_rates_a, in mwifiex_get_supported_rates()
520 rx_rate - 1 : rx_rate; in mwifiex_adjust_data_rate()
523 rate_index = MWIFIEX_MAX_AC_RX_RATES - 1; in mwifiex_adjust_data_rate()