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()
93 struct cw1200_queue_stats *stats = queue->stats; in __cw1200_queue_gc() local
102 spin_lock_bh(&stats->lock); in __cw1200_queue_gc()
103 --stats->num_queued; in __cw1200_queue_gc()
104 if (!--stats->link_map_cache[item->txpriv.link_id]) in __cw1200_queue_gc()
106 spin_unlock_bh(&stats->lock); in __cw1200_queue_gc()
107 cw1200_debug_tx_ttl(stats->priv); in __cw1200_queue_gc()
114 wake_up(&stats->wait_link_id_empty); in __cw1200_queue_gc()
124 cw1200_pm_stay_awake(&stats->priv->pm_state, in __cw1200_queue_gc()
139 cw1200_queue_post_gc(queue->stats, &list); in cw1200_queue_gc()
142 int cw1200_queue_stats_init(struct cw1200_queue_stats *stats, in cw1200_queue_stats_init() argument
147 memset(stats, 0, sizeof(*stats)); in cw1200_queue_stats_init()
148 stats->map_capacity = map_capacity; in cw1200_queue_stats_init()
149 stats->skb_dtor = skb_dtor; in cw1200_queue_stats_init()
150 stats->priv = priv; in cw1200_queue_stats_init()
151 spin_lock_init(&stats->lock); in cw1200_queue_stats_init()
152 init_waitqueue_head(&stats->wait_link_id_empty); in cw1200_queue_stats_init()
154 stats->link_map_cache = kcalloc(map_capacity, sizeof(int), in cw1200_queue_stats_init()
156 if (!stats->link_map_cache) in cw1200_queue_stats_init()
163 struct cw1200_queue_stats *stats, in cw1200_queue_init() argument
171 queue->stats = stats; in cw1200_queue_init()
186 queue->link_map_cache = kcalloc(stats->map_capacity, sizeof(int), in cw1200_queue_init()
204 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_clear() local
219 spin_lock_bh(&stats->lock); in cw1200_queue_clear()
220 for (i = 0; i < stats->map_capacity; ++i) { in cw1200_queue_clear()
221 stats->num_queued -= queue->link_map_cache[i]; in cw1200_queue_clear()
222 stats->link_map_cache[i] -= queue->link_map_cache[i]; in cw1200_queue_clear()
225 spin_unlock_bh(&stats->lock); in cw1200_queue_clear()
231 wake_up(&stats->wait_link_id_empty); in cw1200_queue_clear()
232 cw1200_queue_post_gc(stats, &gc_list); in cw1200_queue_clear()
236 void cw1200_queue_stats_deinit(struct cw1200_queue_stats *stats) in cw1200_queue_stats_deinit() argument
238 kfree(stats->link_map_cache); in cw1200_queue_stats_deinit()
239 stats->link_map_cache = NULL; in cw1200_queue_stats_deinit()
259 size_t map_capacity = queue->stats->map_capacity; in cw1200_queue_get_num_queued()
283 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_put() local
285 if (txpriv->link_id >= queue->stats->map_capacity) in cw1200_queue_put()
307 spin_lock_bh(&stats->lock); in cw1200_queue_put()
308 ++stats->num_queued; in cw1200_queue_put()
309 ++stats->link_map_cache[txpriv->link_id]; in cw1200_queue_put()
310 spin_unlock_bh(&stats->lock); in cw1200_queue_put()
337 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_get() local
358 spin_lock_bh(&stats->lock); in cw1200_queue_get()
359 --stats->num_queued; in cw1200_queue_get()
360 if (!--stats->link_map_cache[item->txpriv.link_id]) in cw1200_queue_get()
362 spin_unlock_bh(&stats->lock); in cw1200_queue_get()
366 wake_up(&stats->wait_link_id_empty); in cw1200_queue_get()
375 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_requeue() local
396 spin_lock_bh(&stats->lock); in cw1200_queue_requeue()
397 ++stats->num_queued; in cw1200_queue_requeue()
398 ++stats->link_map_cache[item->txpriv.link_id]; in cw1200_queue_requeue()
399 spin_unlock_bh(&stats->lock); in cw1200_queue_requeue()
415 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_requeue_all() local
422 spin_lock_bh(&stats->lock); in cw1200_queue_requeue_all()
423 ++stats->num_queued; in cw1200_queue_requeue_all()
424 ++stats->link_map_cache[item->txpriv.link_id]; in cw1200_queue_requeue_all()
425 spin_unlock_bh(&stats->lock); in cw1200_queue_requeue_all()
444 struct cw1200_queue_stats *stats = queue->stats; in cw1200_queue_remove() local
485 stats->skb_dtor(stats->priv, gc_skb, &gc_txpriv); in cw1200_queue_remove()
555 bool cw1200_queue_stats_is_empty(struct cw1200_queue_stats *stats, in cw1200_queue_stats_is_empty() argument
560 spin_lock_bh(&stats->lock); in cw1200_queue_stats_is_empty()
562 empty = stats->num_queued == 0; in cw1200_queue_stats_is_empty()
565 for (i = 0; i < stats->map_capacity; ++i) { in cw1200_queue_stats_is_empty()
567 if (stats->link_map_cache[i]) { in cw1200_queue_stats_is_empty()
574 spin_unlock_bh(&stats->lock); in cw1200_queue_stats_is_empty()