Lines Matching full:rates

67 	struct ieee80211_tx_rate *rates, size_t count)  in tx_policy_build()  argument
72 BUG_ON(rates[0].idx < 0); in tx_policy_build()
75 /* Sort rates in descending order. */ in tx_policy_build()
77 if (rates[i].idx < 0) { in tx_policy_build()
81 if (rates[i].idx > rates[i - 1].idx) { in tx_policy_build()
82 struct ieee80211_tx_rate tmp = rates[i - 1]; in tx_policy_build()
83 rates[i - 1] = rates[i]; in tx_policy_build()
84 rates[i] = tmp; in tx_policy_build()
89 total = rates[0].count; in tx_policy_build()
91 if (rates[j].idx == rates[i].idx) { in tx_policy_build()
92 rates[i].count += rates[j].count; in tx_policy_build()
93 } else if (rates[j].idx > rates[i].idx) { in tx_policy_build()
98 rates[i] = rates[j]; in tx_policy_build()
100 total += rates[j].count; in tx_policy_build()
112 if (rates[i].count > limit - left) in tx_policy_build()
113 rates[i].count = limit - left; in tx_policy_build()
114 limit -= rates[i].count; in tx_policy_build()
121 * As a workaround, additional g-rates are injected to the in tx_policy_build()
124 if (count == 2 && !(rates[0].flags & IEEE80211_TX_RC_MCS) && in tx_policy_build()
125 rates[0].idx > 4 && rates[0].count > 2 && in tx_policy_build()
126 rates[1].idx < 2) { in tx_policy_build()
127 int mid_rate = (rates[0].idx + 4) >> 1; in tx_policy_build()
130 rates[0].count -= 2; in tx_policy_build()
134 rates[3] = rates[1]; in tx_policy_build()
137 rates[2].idx = 4; in tx_policy_build()
138 rates[2].count = 1; in tx_policy_build()
139 rates[2].flags = rates[1].flags; in tx_policy_build()
142 rates[1].idx = mid_rate; in tx_policy_build()
143 rates[1].count = 1; in tx_policy_build()
150 if (rates[0].count >= 3) { in tx_policy_build()
151 --rates[0].count; in tx_policy_build()
152 ++rates[2].count; in tx_policy_build()
155 /* Adjust amount of rates defined */ in tx_policy_build()
159 rates[2] = rates[1]; in tx_policy_build()
162 rates[1].idx = 4; in tx_policy_build()
163 rates[1].count = 2; in tx_policy_build()
165 /* Adjust amount of rates defined */ in tx_policy_build()
170 policy->defined = cw1200_get_tx_rate(priv, &rates[0])->hw_value + 1; in tx_policy_build()
175 rateid = cw1200_get_tx_rate(priv, &rates[i])->hw_value; in tx_policy_build()
179 retries = rates[i].count; in tx_policy_build()
181 rates[i].count = 0x0f; in tx_policy_build()
190 rates[0].idx, rates[0].count, in tx_policy_build()
191 rates[1].idx, rates[1].count, in tx_policy_build()
192 rates[2].idx, rates[2].count, in tx_policy_build()
193 rates[3].idx, rates[3].count); in tx_policy_build()
297 struct ieee80211_tx_rate *rates, in tx_policy_get() argument
304 tx_policy_build(priv, &wanted, rates, count); in tx_policy_get()
413 u32 cw1200_rate_mask_to_wsm(struct cw1200_common *priv, u32 rates) in cw1200_rate_mask_to_wsm() argument
418 if (rates & BIT(i)) in cw1200_rate_mask_to_wsm()
419 ret |= BIT(priv->rates[i].hw_value); in cw1200_rate_mask_to_wsm()
645 t->tx_info->control.rates, IEEE80211_TX_MAX_RATES, in cw1200_tx_h_rate_policy()
653 &t->tx_info->control.rates[0]); in cw1200_tx_h_rate_policy()
933 if (tx->status.rates[i].count >= tx_count) { in cw1200_tx_confirm_cb()
934 tx->status.rates[i].count = tx_count; in cw1200_tx_confirm_cb()
937 tx_count -= tx->status.rates[i].count; in cw1200_tx_confirm_cb()
938 if (tx->status.rates[i].flags & IEEE80211_TX_RC_MCS) in cw1200_tx_confirm_cb()
939 tx->status.rates[i].flags |= ht_flags; in cw1200_tx_confirm_cb()
943 tx->status.rates[i].count = 0; in cw1200_tx_confirm_cb()
944 tx->status.rates[i].idx = -1; in cw1200_tx_confirm_cb()