Lines Matching refs:queue
140 static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave);
147 spin_lock(&eql->queue.lock);
148 head = &eql->queue.all_slaves;
157 eql_kill_one_slave(&eql->queue, slave);
161 spin_unlock(&eql->queue.lock);
186 spin_lock_init(&eql->queue.lock);
187 INIT_LIST_HEAD(&eql->queue.all_slaves);
188 eql->queue.master_dev = dev;
213 BUG_ON(!list_empty(&eql->queue.all_slaves));
223 static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave)
226 queue->num_slaves--;
232 static void eql_kill_slave_queue(slave_queue_t *queue)
236 spin_lock_bh(&queue->lock);
238 head = &queue->all_slaves;
242 eql_kill_one_slave(queue, s);
245 spin_unlock_bh(&queue->lock);
259 eql_kill_slave_queue(&eql->queue);
297 /* queue->lock must be held */
298 static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
307 head = &queue->all_slaves;
327 eql_kill_one_slave(queue, slave);
338 spin_lock(&eql->queue.lock);
340 slave = __eql_schedule_slaves(&eql->queue);
354 spin_unlock(&eql->queue.lock);
363 /* queue->lock must be held */
364 static slave_t *__eql_find_slave_dev(slave_queue_t *queue, struct net_device *dev)
368 head = &queue->all_slaves;
379 static inline int eql_is_full(slave_queue_t *queue)
381 equalizer_t *eql = netdev_priv(queue->master_dev);
383 if (queue->num_slaves >= eql->max_slaves)
388 /* queue->lock must be held */
389 static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
391 if (!eql_is_full(queue)) {
394 duplicate_slave = __eql_find_slave_dev(queue, slave->dev);
396 eql_kill_one_slave(queue, duplicate_slave);
398 list_add(&slave->list, &queue->all_slaves);
399 queue->num_slaves++;
437 spin_lock_bh(&eql->queue.lock);
438 ret = __eql_insert_slave(&eql->queue, s);
443 spin_unlock_bh(&eql->queue.lock);
467 spin_lock_bh(&eql->queue.lock);
470 slave_t *slave = __eql_find_slave_dev(&eql->queue,
474 eql_kill_one_slave(&eql->queue, slave);
480 spin_unlock_bh(&eql->queue.lock);
503 spin_lock_bh(&eql->queue.lock);
505 slave = __eql_find_slave_dev(&eql->queue, slave_dev);
511 spin_unlock_bh(&eql->queue.lock);
539 spin_lock_bh(&eql->queue.lock);
541 slave = __eql_find_slave_dev(&eql->queue, slave_dev);
549 spin_unlock_bh(&eql->queue.lock);