Lines Matching refs:stats
28 struct cw1200_queue_stats *stats = queue->stats; in __cw1200_queue_lock() local
32 ieee80211_stop_queue(stats->priv->hw, queue->queue_id); in __cw1200_queue_lock()
38 struct cw1200_queue_stats *stats = queue->stats; in __cw1200_queue_unlock() local
43 ieee80211_wake_queue(stats->priv->hw, queue->queue_id); in __cw1200_queue_unlock()
66 static void cw1200_queue_post_gc(struct cw1200_queue_stats *stats, in cw1200_queue_post_gc() argument
73 stats->skb_dtor(stats->priv, item->skb, &item->txpriv); in cw1200_queue_post_gc()
92 struct cw1200_queue_stats *stats = queue->stats; in __cw1200_queue_gc() local
101 spin_lock_bh(&stats->lock); in __cw1200_queue_gc()
102 --stats->num_queued; in __cw1200_queue_gc()
103 if (!--stats->link_map_cache[item->txpriv.link_id]) in __cw1200_queue_gc()
105 spin_unlock_bh(&stats->lock); in __cw1200_queue_gc()
106 cw1200_debug_tx_ttl(stats->priv); in __cw1200_queue_gc()
113 wake_up(&stats->wait_link_id_empty); in __cw1200_queue_gc()
123 cw1200_pm_stay_awake(&stats->priv->pm_state, in __cw1200_queue_gc()
138 cw1200_queue_post_gc(queue->stats, &list); in cw1200_queue_gc()
141 int cw1200_queue_stats_init(struct cw1200_queue_stats *stats, in cw1200_queue_stats_init() argument
146 memset(stats, 0, sizeof(*stats)); in cw1200_queue_stats_init()
147 stats->map_capacity = map_capacity; in cw1200_queue_stats_init()
148 stats->skb_dtor = skb_dtor; in cw1200_queue_stats_init()
149 stats->priv = priv; in cw1200_queue_stats_init()
150 spin_lock_init(&stats->lock); in cw1200_queue_stats_init()
151 init_waitqueue_head(&stats->wait_link_id_empty); in cw1200_queue_stats_init()
153 stats->link_map_cache = kcalloc(map_capacity, sizeof(int), in cw1200_queue_stats_init()
155 if (!stats->link_map_cache) in cw1200_queue_stats_init()
162 struct cw1200_queue_stats *stats, in cw1200_queue_init() argument
170 queue->stats = stats; in cw1200_queue_init()
185 queue->link_map_cache = kcalloc(stats->map_capacity, sizeof(int), in cw1200_queue_init()
203 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_clear() local
218 spin_lock_bh(&stats->lock); in cw1200_queue_clear()
219 for (i = 0; i < stats->map_capacity; ++i) { in cw1200_queue_clear()
220 stats->num_queued -= queue->link_map_cache[i]; in cw1200_queue_clear()
221 stats->link_map_cache[i] -= queue->link_map_cache[i]; in cw1200_queue_clear()
224 spin_unlock_bh(&stats->lock); in cw1200_queue_clear()
230 wake_up(&stats->wait_link_id_empty); in cw1200_queue_clear()
231 cw1200_queue_post_gc(stats, &gc_list); in cw1200_queue_clear()
235 void cw1200_queue_stats_deinit(struct cw1200_queue_stats *stats) in cw1200_queue_stats_deinit() argument
237 kfree(stats->link_map_cache); in cw1200_queue_stats_deinit()
238 stats->link_map_cache = NULL; in cw1200_queue_stats_deinit()
258 size_t map_capacity = queue->stats->map_capacity; in cw1200_queue_get_num_queued()
282 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_put() local
284 if (txpriv->link_id >= queue->stats->map_capacity) in cw1200_queue_put()
306 spin_lock_bh(&stats->lock); in cw1200_queue_put()
307 ++stats->num_queued; in cw1200_queue_put()
308 ++stats->link_map_cache[txpriv->link_id]; in cw1200_queue_put()
309 spin_unlock_bh(&stats->lock); in cw1200_queue_put()
336 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_get() local
357 spin_lock_bh(&stats->lock); in cw1200_queue_get()
358 --stats->num_queued; in cw1200_queue_get()
359 if (!--stats->link_map_cache[item->txpriv.link_id]) in cw1200_queue_get()
361 spin_unlock_bh(&stats->lock); in cw1200_queue_get()
365 wake_up(&stats->wait_link_id_empty); in cw1200_queue_get()
374 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_requeue() local
395 spin_lock_bh(&stats->lock); in cw1200_queue_requeue()
396 ++stats->num_queued; in cw1200_queue_requeue()
397 ++stats->link_map_cache[item->txpriv.link_id]; in cw1200_queue_requeue()
398 spin_unlock_bh(&stats->lock); in cw1200_queue_requeue()
414 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_requeue_all() local
421 spin_lock_bh(&stats->lock); in cw1200_queue_requeue_all()
422 ++stats->num_queued; in cw1200_queue_requeue_all()
423 ++stats->link_map_cache[item->txpriv.link_id]; in cw1200_queue_requeue_all()
424 spin_unlock_bh(&stats->lock); in cw1200_queue_requeue_all()
443 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_remove() local
484 stats->skb_dtor(stats->priv, gc_skb, &gc_txpriv); in cw1200_queue_remove()
554 bool cw1200_queue_stats_is_empty(struct cw1200_queue_stats *stats, in cw1200_queue_stats_is_empty() argument
559 spin_lock_bh(&stats->lock); in cw1200_queue_stats_is_empty()
561 empty = stats->num_queued == 0; in cw1200_queue_stats_is_empty()
564 for (i = 0; i < stats->map_capacity; ++i) { in cw1200_queue_stats_is_empty()
566 if (stats->link_map_cache[i]) { in cw1200_queue_stats_is_empty()
573 spin_unlock_bh(&stats->lock); in cw1200_queue_stats_is_empty()