Lines Matching refs:idx

75 	BUG_ON(rates[0].idx < 0);  in tx_policy_build()
80 if (rates[i].idx < 0) { in tx_policy_build()
84 if (rates[i].idx > rates[i - 1].idx) { in tx_policy_build()
94 if (rates[j].idx == rates[i].idx) { in tx_policy_build()
96 } else if (rates[j].idx > rates[i].idx) { in tx_policy_build()
128 rates[0].idx > 4 && rates[0].count > 2 && in tx_policy_build()
129 rates[1].idx < 2) { in tx_policy_build()
130 int mid_rate = (rates[0].idx + 4) >> 1; in tx_policy_build()
140 rates[2].idx = 4; in tx_policy_build()
145 rates[1].idx = mid_rate; in tx_policy_build()
165 rates[1].idx = 4; in tx_policy_build()
193 rates[0].idx, rates[0].count, in tx_policy_build()
194 rates[1].idx, rates[1].count, in tx_policy_build()
195 rates[2].idx, rates[2].count, in tx_policy_build()
196 rates[3].idx, rates[3].count); in tx_policy_build()
255 int idx, locked; in tx_policy_clean() local
263 for (idx = 0; idx < TX_POLICY_CACHE_SIZE; idx++) { in tx_policy_clean()
264 entry = &cache->cache[idx]; in tx_policy_clean()
303 int idx; in tx_policy_get() local
314 idx = tx_policy_find(cache, &wanted); in tx_policy_get()
315 if (idx >= 0) { in tx_policy_get()
316 pr_debug("[TX policy] Used TX policy: %d\n", idx); in tx_policy_get()
327 idx = entry - cache->cache; in tx_policy_get()
328 pr_debug("[TX policy] New TX policy: %d\n", idx); in tx_policy_get()
331 tx_policy_use(cache, &cache->cache[idx]); in tx_policy_get()
337 return idx; in tx_policy_get()
340 static void tx_policy_put(struct cw1200_common *priv, int idx) in tx_policy_put() argument
347 usage = tx_policy_release(cache, &cache->cache[idx]); in tx_policy_put()
431 if (rate->idx < 0) in cw1200_get_tx_rate()
434 return &priv->mcs_rates[rate->idx]; in cw1200_get_tx_rate()
436 bitrates[rate->idx]; in cw1200_get_tx_rate()
950 tx->status.rates[i].idx = -1; in cw1200_tx_confirm_cb()
1234 int idx; in cw1200_alloc_key() local
1236 idx = ffs(~priv->key_map) - 1; in cw1200_alloc_key()
1237 if (idx < 0 || idx > WSM_KEY_MAX_INDEX) in cw1200_alloc_key()
1240 priv->key_map |= BIT(idx); in cw1200_alloc_key()
1241 priv->keys[idx].index = idx; in cw1200_alloc_key()
1242 return idx; in cw1200_alloc_key()
1245 void cw1200_free_key(struct cw1200_common *priv, int idx) in cw1200_free_key() argument
1247 BUG_ON(!(priv->key_map & BIT(idx))); in cw1200_free_key()
1248 memset(&priv->keys[idx], 0, sizeof(priv->keys[idx])); in cw1200_free_key()
1249 priv->key_map &= ~BIT(idx); in cw1200_free_key()
1260 int idx, ret = 0; in cw1200_upload_keys() local
1261 for (idx = 0; idx <= WSM_KEY_MAX_INDEX; ++idx) in cw1200_upload_keys()
1262 if (priv->key_map & BIT(idx)) { in cw1200_upload_keys()
1263 ret = wsm_add_key(priv, &priv->keys[idx]); in cw1200_upload_keys()