Lines Matching full:combined

28 static void usb_combined_packet_add(USBCombinedPacket *combined, USBPacket *p)  in usb_combined_packet_add()  argument
30 qemu_iovec_concat(&combined->iov, &p->iov, 0, p->iov.size); in usb_combined_packet_add()
31 QTAILQ_INSERT_TAIL(&combined->packets, p, combined_entry); in usb_combined_packet_add()
32 p->combined = combined; in usb_combined_packet_add()
35 /* Note will free combined when the last packet gets removed */
36 static void usb_combined_packet_remove(USBCombinedPacket *combined, in usb_combined_packet_remove() argument
39 assert(p->combined == combined); in usb_combined_packet_remove()
40 p->combined = NULL; in usb_combined_packet_remove()
41 QTAILQ_REMOVE(&combined->packets, p, combined_entry); in usb_combined_packet_remove()
42 if (QTAILQ_EMPTY(&combined->packets)) { in usb_combined_packet_remove()
43 qemu_iovec_destroy(&combined->iov); in usb_combined_packet_remove()
44 g_free(combined); in usb_combined_packet_remove()
48 /* Also handles completion of non combined packets for pipelined input eps */
51 USBCombinedPacket *combined = p->combined; in usb_combined_input_packet_complete() local
57 if (combined == NULL) { in usb_combined_input_packet_complete()
62 assert(combined->first == p && p == QTAILQ_FIRST(&combined->packets)); in usb_combined_input_packet_complete()
64 status = combined->first->status; in usb_combined_input_packet_complete()
65 actual_length = combined->first->actual_length; in usb_combined_input_packet_complete()
66 short_not_ok = QTAILQ_LAST(&combined->packets)->short_not_ok; in usb_combined_input_packet_complete()
68 QTAILQ_FOREACH_SAFE(p, &combined->packets, combined_entry, next) { in usb_combined_input_packet_complete()
85 /* Note will free combined when the last packet gets removed! */ in usb_combined_input_packet_complete()
86 usb_combined_packet_remove(combined, p); in usb_combined_input_packet_complete()
92 /* Note will free combined on the last packet! */ in usb_combined_input_packet_complete()
96 /* Do not use combined here, it has been freed! */ in usb_combined_input_packet_complete()
102 /* May only be called for combined packets! */
105 USBCombinedPacket *combined = p->combined; in usb_combined_packet_cancel() local
106 assert(combined != NULL); in usb_combined_packet_cancel()
107 USBPacket *first = p->combined->first; in usb_combined_packet_cancel()
109 /* Note will free combined on the last packet! */ in usb_combined_packet_cancel()
110 usb_combined_packet_remove(combined, p); in usb_combined_packet_cancel()
147 * If the previous (combined) packet has the short_not_ok flag set in usb_ep_combine_input_packets()
156 if (first->combined == NULL) { in usb_ep_combine_input_packets()
157 USBCombinedPacket *combined = g_new0(USBCombinedPacket, 1); in usb_ep_combine_input_packets() local
159 combined->first = first; in usb_ep_combine_input_packets()
160 QTAILQ_INIT(&combined->packets); in usb_ep_combine_input_packets()
161 qemu_iovec_init(&combined->iov, 2); in usb_ep_combine_input_packets()
162 usb_combined_packet_add(combined, first); in usb_ep_combine_input_packets()
164 usb_combined_packet_add(first->combined, p); in usb_ep_combine_input_packets()
169 /* Is this packet the last one of a (combined) transfer? */ in usb_ep_combine_input_packets()
170 totalsize = (p->combined) ? p->combined->iov.size : p->iov.size; in usb_ep_combine_input_packets()
175 /* Next package may grow combined package over 1MiB */ in usb_ep_combine_input_packets()
179 if (first->combined) { in usb_ep_combine_input_packets()
180 QTAILQ_FOREACH(u, &first->combined->packets, combined_entry) { in usb_ep_combine_input_packets()