Lines Matching refs:p

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()
37 USBPacket *p) 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()
49 void usb_combined_input_packet_complete(USBDevice *dev, USBPacket *p) in usb_combined_input_packet_complete() argument
51 USBCombinedPacket *combined = p->combined; in usb_combined_input_packet_complete()
52 USBEndpoint *ep = p->ep; in usb_combined_input_packet_complete()
58 usb_packet_complete_one(dev, p); in usb_combined_input_packet_complete()
62 assert(combined->first == p && p == QTAILQ_FIRST(&combined->packets)); in usb_combined_input_packet_complete()
68 QTAILQ_FOREACH_SAFE(p, &combined->packets, combined_entry, next) { in usb_combined_input_packet_complete()
71 if (actual_length >= p->iov.size) { in usb_combined_input_packet_complete()
72 p->actual_length = p->iov.size; in usb_combined_input_packet_complete()
75 p->actual_length = actual_length; in usb_combined_input_packet_complete()
80 p->status = status; in usb_combined_input_packet_complete()
82 p->status = USB_RET_SUCCESS; in usb_combined_input_packet_complete()
84 p->short_not_ok = short_not_ok; in usb_combined_input_packet_complete()
86 usb_combined_packet_remove(combined, p); in usb_combined_input_packet_complete()
87 usb_packet_complete_one(dev, p); in usb_combined_input_packet_complete()
88 actual_length -= p->actual_length; in usb_combined_input_packet_complete()
91 p->status = USB_RET_REMOVE_FROM_QUEUE; in usb_combined_input_packet_complete()
93 dev->port->ops->complete(dev->port, p); in usb_combined_input_packet_complete()
103 void usb_combined_packet_cancel(USBDevice *dev, USBPacket *p) in usb_combined_packet_cancel() argument
105 USBCombinedPacket *combined = p->combined; in usb_combined_packet_cancel()
107 USBPacket *first = p->combined->first; in usb_combined_packet_cancel()
110 usb_combined_packet_remove(combined, p); in usb_combined_packet_cancel()
111 if (p == first) { in usb_combined_packet_cancel()
112 usb_device_cancel_packet(dev, p); in usb_combined_packet_cancel()
124 USBPacket *p, *u, *next, *prev = NULL, *first = NULL; in usb_ep_combine_input_packets() local
131 QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) { in usb_ep_combine_input_packets()
134 p->status = USB_RET_REMOVE_FROM_QUEUE; in usb_ep_combine_input_packets()
135 port->ops->complete(port, p); in usb_ep_combine_input_packets()
140 if (p->state == USB_PACKET_ASYNC) { in usb_ep_combine_input_packets()
141 prev = p; in usb_ep_combine_input_packets()
144 usb_packet_check_state(p, USB_PACKET_QUEUED); in usb_ep_combine_input_packets()
164 usb_combined_packet_add(first->combined, p); in usb_ep_combine_input_packets()
166 first = p; in usb_ep_combine_input_packets()
170 totalsize = (p->combined) ? p->combined->iov.size : p->iov.size; in usb_ep_combine_input_packets()
171 if ((p->iov.size % ep->max_packet_size) != 0 || !p->short_not_ok || in usb_ep_combine_input_packets()
174 (totalsize == (16 * KiB - 36) && p->int_req) || in usb_ep_combine_input_packets()
187 prev = p; in usb_ep_combine_input_packets()