Lines Matching full:queue

80     UHCIQueue *queue;  member
126 UHCIQueue *queue; in uhci_queue_new() local
128 queue = g_new0(UHCIQueue, 1); in uhci_queue_new()
129 queue->uhci = s; in uhci_queue_new()
130 queue->qh_addr = qh_addr; in uhci_queue_new()
131 queue->token = uhci_queue_token(td); in uhci_queue_new()
132 queue->ep = ep; in uhci_queue_new()
133 QTAILQ_INIT(&queue->asyncs); in uhci_queue_new()
134 QTAILQ_INSERT_HEAD(&s->queues, queue, next); in uhci_queue_new()
135 queue->valid = QH_VALID; in uhci_queue_new()
136 trace_usb_uhci_queue_add(queue->token); in uhci_queue_new()
137 return queue; in uhci_queue_new()
140 static void uhci_queue_free(UHCIQueue *queue, const char *reason) in uhci_queue_free() argument
142 UHCIState *s = queue->uhci; in uhci_queue_free()
145 while (!QTAILQ_EMPTY(&queue->asyncs)) { in uhci_queue_free()
146 async = QTAILQ_FIRST(&queue->asyncs); in uhci_queue_free()
149 usb_device_ep_stopped(queue->ep->dev, queue->ep); in uhci_queue_free()
151 trace_usb_uhci_queue_del(queue->token, reason); in uhci_queue_free()
152 QTAILQ_REMOVE(&s->queues, queue, next); in uhci_queue_free()
153 g_free(queue); in uhci_queue_free()
159 UHCIQueue *queue; in uhci_queue_find() local
161 QTAILQ_FOREACH(queue, &s->queues, next) { in uhci_queue_find()
162 if (queue->token == token) { in uhci_queue_find()
163 return queue; in uhci_queue_find()
169 static bool uhci_queue_verify(UHCIQueue *queue, uint32_t qh_addr, UHCI_TD *td, in uhci_queue_verify() argument
172 UHCIAsync *first = QTAILQ_FIRST(&queue->asyncs); in uhci_queue_verify()
173 uint32_t queue_token_addr = (queue->token >> 8) & 0x7f; in uhci_queue_verify()
175 return queue->qh_addr == qh_addr && in uhci_queue_verify()
176 queue->token == uhci_queue_token(td) && in uhci_queue_verify()
177 queue_token_addr == queue->ep->dev->addr && in uhci_queue_verify()
182 static UHCIAsync *uhci_async_alloc(UHCIQueue *queue, uint32_t td_addr) in uhci_async_alloc() argument
186 async->queue = queue; in uhci_async_alloc()
189 trace_usb_uhci_packet_add(async->queue->token, async->td_addr); in uhci_async_alloc()
196 trace_usb_uhci_packet_del(async->queue->token, async->td_addr); in uhci_async_free()
206 UHCIQueue *queue = async->queue; in uhci_async_link() local
207 QTAILQ_INSERT_TAIL(&queue->asyncs, async, next); in uhci_async_link()
208 trace_usb_uhci_packet_link_async(async->queue->token, async->td_addr); in uhci_async_link()
213 UHCIQueue *queue = async->queue; in uhci_async_unlink() local
214 QTAILQ_REMOVE(&queue->asyncs, async, next); in uhci_async_unlink()
215 trace_usb_uhci_packet_unlink_async(async->queue->token, async->td_addr); in uhci_async_unlink()
221 trace_usb_uhci_packet_cancel(async->queue->token, async->td_addr, in uhci_async_cancel()
235 UHCIQueue *queue; in uhci_async_validate_begin() local
237 QTAILQ_FOREACH(queue, &s->queues, next) { in uhci_async_validate_begin()
238 queue->valid--; in uhci_async_validate_begin()
247 UHCIQueue *queue, *n; in uhci_async_validate_end() local
249 QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) { in uhci_async_validate_end()
250 if (!queue->valid) { in uhci_async_validate_end()
251 uhci_queue_free(queue, "validate-end"); in uhci_async_validate_end()
258 UHCIQueue *queue, *n; in uhci_async_cancel_device() local
260 QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) { in uhci_async_cancel_device()
261 if (queue->ep->dev == dev) { in uhci_async_cancel_device()
262 uhci_queue_free(queue, "cancel-device"); in uhci_async_cancel_device()
269 UHCIQueue *queue, *nq; in uhci_async_cancel_all() local
271 QTAILQ_FOREACH_SAFE(queue, &s->queues, next, nq) { in uhci_async_cancel_all()
272 uhci_queue_free(queue, "cancel-all"); in uhci_async_cancel_all()
278 UHCIQueue *queue; in uhci_async_find_td() local
281 QTAILQ_FOREACH(queue, &s->queues, next) { in uhci_async_find_td()
282 QTAILQ_FOREACH(async, &queue->asyncs, next) { in uhci_async_find_td()
719 trace_usb_uhci_packet_complete_shortxfer(async->queue->token, in uhci_complete_td()
726 trace_usb_uhci_packet_complete_success(async->queue->token, in uhci_complete_td()
743 if (uhci_queue_verify(async->queue, qh_addr, td, td_addr, queuing)) { in uhci_handle_td()
744 assert(q == NULL || q == async->queue); in uhci_handle_td()
745 q = async->queue; in uhci_handle_td()
747 uhci_queue_free(async->queue, "guest re-used pending td"); in uhci_handle_td()
767 /* Guest marked a pending td non-active, cancel the queue */ in uhci_handle_td()
768 uhci_queue_free(async->queue, "pending td non-active"); in uhci_handle_td()
801 * we are busy filling the queue, we are not prepared in uhci_handle_td()
809 UHCIAsync *last = QTAILQ_LAST(&async->queue->asyncs); in uhci_handle_td()
812 * may have added more tds to the queue. Note we re-read the td in uhci_handle_td()
816 uhci_queue_fill(async->queue, &last_td); in uhci_handle_td()
889 UHCIState *s = async->queue->uhci; in uhci_async_complete()