Lines Matching refs:queue

51 void fixed_pkt_queue_free(fixed_pkt_queue_t *queue, fixed_pkt_queue_free_cb free_cb)  in fixed_pkt_queue_free()  argument
53 if (queue == NULL) { in fixed_pkt_queue_free()
57 fixed_pkt_queue_unregister_dequeue(queue); in fixed_pkt_queue_free()
59 pkt_queue_destroy(queue->pkt_list, (pkt_queue_free_cb)free_cb); in fixed_pkt_queue_free()
60 queue->pkt_list = NULL; in fixed_pkt_queue_free()
62 if (queue->enqueue_sem) { in fixed_pkt_queue_free()
63 osi_sem_free(&queue->enqueue_sem); in fixed_pkt_queue_free()
65 if (queue->dequeue_sem) { in fixed_pkt_queue_free()
66 osi_sem_free(&queue->dequeue_sem); in fixed_pkt_queue_free()
68 osi_free(queue); in fixed_pkt_queue_free()
71 bool fixed_pkt_queue_is_empty(fixed_pkt_queue_t *queue) in fixed_pkt_queue_is_empty() argument
73 if (queue == NULL) { in fixed_pkt_queue_is_empty()
77 return pkt_queue_is_empty(queue->pkt_list); in fixed_pkt_queue_is_empty()
80 size_t fixed_pkt_queue_length(fixed_pkt_queue_t *queue) in fixed_pkt_queue_length() argument
82 if (queue == NULL) { in fixed_pkt_queue_length()
85 return pkt_queue_length(queue->pkt_list); in fixed_pkt_queue_length()
88 size_t fixed_pkt_queue_capacity(fixed_pkt_queue_t *queue) in fixed_pkt_queue_capacity() argument
90 assert(queue != NULL); in fixed_pkt_queue_capacity()
92 return queue->capacity; in fixed_pkt_queue_capacity()
95 bool fixed_pkt_queue_enqueue(fixed_pkt_queue_t *queue, pkt_linked_item_t *linked_pkt, uint32_t time… in fixed_pkt_queue_enqueue() argument
99 assert(queue != NULL); in fixed_pkt_queue_enqueue()
102 if (osi_sem_take(&queue->enqueue_sem, timeout) != 0) { in fixed_pkt_queue_enqueue()
106 ret = pkt_queue_enqueue(queue->pkt_list, linked_pkt); in fixed_pkt_queue_enqueue()
109 osi_sem_give(&queue->dequeue_sem); in fixed_pkt_queue_enqueue()
114 pkt_linked_item_t *fixed_pkt_queue_dequeue(fixed_pkt_queue_t *queue, uint32_t timeout) in fixed_pkt_queue_dequeue() argument
118 assert(queue != NULL); in fixed_pkt_queue_dequeue()
120 if (osi_sem_take(&queue->dequeue_sem, timeout) != 0) { in fixed_pkt_queue_dequeue()
123 ret = pkt_queue_dequeue(queue->pkt_list); in fixed_pkt_queue_dequeue()
125 osi_sem_give(&queue->enqueue_sem); in fixed_pkt_queue_dequeue()
130 pkt_linked_item_t *fixed_pkt_queue_try_peek_first(fixed_pkt_queue_t *queue) in fixed_pkt_queue_try_peek_first() argument
132 if (queue == NULL) { in fixed_pkt_queue_try_peek_first()
136 return pkt_queue_try_peek_first(queue->pkt_list); in fixed_pkt_queue_try_peek_first()
139 void fixed_pkt_queue_register_dequeue(fixed_pkt_queue_t *queue, fixed_pkt_queue_cb ready_cb) in fixed_pkt_queue_register_dequeue() argument
141 assert(queue != NULL); in fixed_pkt_queue_register_dequeue()
144 queue->dequeue_ready = ready_cb; in fixed_pkt_queue_register_dequeue()
147 void fixed_pkt_queue_unregister_dequeue(fixed_pkt_queue_t *queue) in fixed_pkt_queue_unregister_dequeue() argument
149 assert(queue != NULL); in fixed_pkt_queue_unregister_dequeue()
151 queue->dequeue_ready = NULL; in fixed_pkt_queue_unregister_dequeue()
154 void fixed_pkt_queue_process(fixed_pkt_queue_t *queue) in fixed_pkt_queue_process() argument
156 assert(queue != NULL); in fixed_pkt_queue_process()
158 if (queue->dequeue_ready) { in fixed_pkt_queue_process()
159 queue->dequeue_ready(queue); in fixed_pkt_queue_process()