Lines Matching full:rates
47 struct ieee80211_tx_rate *rates) in wfx_tx_policy_build() argument
53 WARN(rates[0].idx < 0, "invalid rate policy"); in wfx_tx_policy_build()
56 if (rates[i].idx < 0) in wfx_tx_policy_build()
58 WARN_ON(rates[i].count > 15); in wfx_tx_policy_build()
59 rateid = wfx_get_hw_rate(wdev, &rates[i]); in wfx_tx_policy_build()
60 /* Pack two values in each byte of policy->rates */ in wfx_tx_policy_build()
61 count = rates[i].count; in wfx_tx_policy_build()
64 policy->rates[rateid / 2] |= count; in wfx_tx_policy_build()
70 return !memcmp(a->rates, b->rates, sizeof(a->rates)); in wfx_tx_policy_is_equal()
101 static int wfx_tx_policy_get(struct wfx_vif *wvif, struct ieee80211_tx_rate *rates, bool *renew) in wfx_tx_policy_get() argument
108 wfx_tx_policy_build(wvif, &wanted, rates); in wfx_tx_policy_get()
123 memcpy(entry->rates, wanted.rates, sizeof(entry->rates)); in wfx_tx_policy_get()
159 is_used = memzcmp(policies[i].rates, sizeof(policies[i].rates)); in wfx_tx_policy_upload()
165 memcpy(tmp_rates, policies[i].rates, sizeof(tmp_rates)); in wfx_tx_policy_upload()
227 static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) in wfx_tx_fixup_rates() argument
232 /* Firmware is not able to mix rates with different flags */ in wfx_tx_fixup_rates()
234 if (rates[0].flags & IEEE80211_TX_RC_SHORT_GI) in wfx_tx_fixup_rates()
235 rates[i].flags |= IEEE80211_TX_RC_SHORT_GI; in wfx_tx_fixup_rates()
236 if (!(rates[0].flags & IEEE80211_TX_RC_SHORT_GI)) in wfx_tx_fixup_rates()
237 rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; in wfx_tx_fixup_rates()
238 if (!(rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)) in wfx_tx_fixup_rates()
239 rates[i].flags &= ~IEEE80211_TX_RC_USE_RTS_CTS; in wfx_tx_fixup_rates()
242 /* Sort rates and remove duplicates */ in wfx_tx_fixup_rates()
246 if (rates[i + 1].idx == rates[i].idx && in wfx_tx_fixup_rates()
247 rates[i].idx != -1) { in wfx_tx_fixup_rates()
248 rates[i].count += rates[i + 1].count; in wfx_tx_fixup_rates()
249 if (rates[i].count > 15) in wfx_tx_fixup_rates()
250 rates[i].count = 15; in wfx_tx_fixup_rates()
251 rates[i + 1].idx = -1; in wfx_tx_fixup_rates()
252 rates[i + 1].count = 0; in wfx_tx_fixup_rates()
256 if (rates[i + 1].idx > rates[i].idx) { in wfx_tx_fixup_rates()
257 swap(rates[i + 1], rates[i]); in wfx_tx_fixup_rates()
264 if (rates[i].idx == 0) in wfx_tx_fixup_rates()
266 if (rates[i].idx == -1) { in wfx_tx_fixup_rates()
267 rates[i].idx = 0; in wfx_tx_fixup_rates()
268 rates[i].count = 8; /* == hw->max_rate_tries */ in wfx_tx_fixup_rates()
269 rates[i].flags = rates[i - 1].flags & IEEE80211_TX_RC_MCS; in wfx_tx_fixup_rates()
275 rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; in wfx_tx_fixup_rates()
446 rate = &tx_info->status.rates[i]; in wfx_tx_fill_rates()
455 dev_dbg(wdev->dev, "inconsistent tx_info rates: %d != %d\n", in wfx_tx_fill_rates()