Lines Matching defs:tx_credit
87 /* require to hold tx_credit lock */
88 static int iwm_tx_credit_get(struct iwm_tx_credit *tx_credit, int id)
90 struct pool_entry *pool = &tx_credit->pools[id];
91 struct spool_entry *spool = &tx_credit->spools[pool->sid];
105 if (npages <= iwm_tx_credit_get(&iwm->tx_credit, id))
108 set_bit(id, &iwm->tx_credit.full_pools_map);
112 iwm_tx_credit_get(&iwm->tx_credit, id));
126 pool = &iwm->tx_credit.pools[id];
127 spool = &iwm->tx_credit.spools[pool->sid];
151 if (test_bit(id, &iwm->tx_credit.full_pools_map) &&
153 clear_bit(id, &iwm->tx_credit.full_pools_map);
159 iwm_tx_credit_get(&iwm->tx_credit, id));
175 pool = &iwm->tx_credit.pools[id];
176 spool = &iwm->tx_credit.spools[pool->sid];
197 spin_lock(&iwm->tx_credit.lock);
208 spin_unlock(&iwm->tx_credit.lock);
253 spin_lock(&iwm->tx_credit.lock);
255 iwm->tx_credit.pool_nr = le16_to_cpu(alive->page_grp_count);
256 iwm->tx_credit.full_pools_map = 0;
257 memset(&iwm->tx_credit.spools[0], 0, sizeof(struct spool_entry));
259 IWM_DBG_TX(iwm, DBG, "Pools number is %d\n", iwm->tx_credit.pool_nr);
261 for (i = 0; i < iwm->tx_credit.pool_nr; i++) {
264 iwm->tx_credit.pools[i].id = GET_VAL32(page_grp_state,
266 iwm->tx_credit.pools[i].sid = GET_VAL32(page_grp_state,
268 iwm->tx_credit.pools[i].min_pages = GET_VAL32(page_grp_state,
270 iwm->tx_credit.pools[i].max_pages = GET_VAL32(page_grp_state,
272 iwm->tx_credit.pools[i].alloc_pages = 0;
273 iwm->tx_credit.pools[i].total_freed_pages = 0;
275 sid = iwm->tx_credit.pools[i].sid;
276 pool_pages = iwm->tx_credit.pools[i].min_pages;
278 if (iwm->tx_credit.spools[sid].max_pages == 0) {
279 iwm->tx_credit.spools[sid].id = sid;
280 iwm->tx_credit.spools[sid].max_pages =
283 iwm->tx_credit.spools[sid].alloc_pages = 0;
286 iwm->tx_credit.spools[sid].alloc_pages += pool_pages;
291 i, iwm->tx_credit.pools[i].id,
292 iwm->tx_credit.pools[i].sid,
293 iwm->tx_credit.pools[i].min_pages,
294 iwm->tx_credit.pools[i].max_pages,
295 iwm->tx_credit.pools[i].alloc_pages,
296 iwm->tx_credit.pools[i].total_freed_pages,
297 iwm->tx_credit.spools[sid].alloc_pages);
300 spin_unlock(&iwm->tx_credit.lock);
374 while (!test_bit(pool_id, &iwm->tx_credit.full_pools_map) &&
422 IWM_DBG_TX(iwm, DBG, "not enough tx_credit for queue "
445 !test_bit(pool_id, &iwm->tx_credit.full_pools_map) &&