core.c (6a98d1c0f9e4f6a95d6ecd730ae6fdc70d15c73f) core.c (8550a02d1239415342959f6a32d178bc05c557cc)
1/*
2 * QEMU USB emulation
3 *
4 * Copyright (c) 2005 Fabrice Bellard
5 *
6 * 2008 Generic packet handler rewrite by Max Krasnyansky
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 57 unchanged lines hidden (view full) ---

66 return;
67 }
68 dev->remote_wakeup = 0;
69 dev->addr = 0;
70 dev->state = USB_STATE_DEFAULT;
71 usb_device_handle_reset(dev);
72}
73
1/*
2 * QEMU USB emulation
3 *
4 * Copyright (c) 2005 Fabrice Bellard
5 *
6 * 2008 Generic packet handler rewrite by Max Krasnyansky
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy

--- 57 unchanged lines hidden (view full) ---

66 return;
67 }
68 dev->remote_wakeup = 0;
69 dev->addr = 0;
70 dev->state = USB_STATE_DEFAULT;
71 usb_device_handle_reset(dev);
72}
73
74void usb_wakeup(USBEndpoint *ep)
74void usb_wakeup(USBEndpoint *ep, unsigned int stream)
75{
76 USBDevice *dev = ep->dev;
77 USBBus *bus = usb_bus_from_device(dev);
78
79 if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) {
80 dev->port->ops->wakeup(dev->port);
81 }
82 if (bus->ops->wakeup_endpoint) {
75{
76 USBDevice *dev = ep->dev;
77 USBBus *bus = usb_bus_from_device(dev);
78
79 if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) {
80 dev->port->ops->wakeup(dev->port);
81 }
82 if (bus->ops->wakeup_endpoint) {
83 bus->ops->wakeup_endpoint(bus, ep);
83 bus->ops->wakeup_endpoint(bus, ep, stream);
84 }
85}
86
87/**********************/
88
89/* generic USB device helpers (you are not forced to use them when
90 writing your USB device driver, but they help handling the
91 protocol)

--- 448 unchanged lines hidden (view full) ---

540 } else {
541 trace_usb_packet_state_change(-1, "", -1, p,
542 usb_packet_state_name(p->state),
543 usb_packet_state_name(state));
544 }
545 p->state = state;
546}
547
84 }
85}
86
87/**********************/
88
89/* generic USB device helpers (you are not forced to use them when
90 writing your USB device driver, but they help handling the
91 protocol)

--- 448 unchanged lines hidden (view full) ---

540 } else {
541 trace_usb_packet_state_change(-1, "", -1, p,
542 usb_packet_state_name(p->state),
543 usb_packet_state_name(state));
544 }
545 p->state = state;
546}
547
548void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep, uint64_t id,
549 bool short_not_ok, bool int_req)
548void usb_packet_setup(USBPacket *p, int pid,
549 USBEndpoint *ep, unsigned int stream,
550 uint64_t id, bool short_not_ok, bool int_req)
550{
551 assert(!usb_packet_is_inflight(p));
552 assert(p->iov.iov != NULL);
553 p->id = id;
554 p->pid = pid;
555 p->ep = ep;
551{
552 assert(!usb_packet_is_inflight(p));
553 assert(p->iov.iov != NULL);
554 p->id = id;
555 p->pid = pid;
556 p->ep = ep;
557 p->stream = stream;
556 p->status = USB_RET_SUCCESS;
557 p->actual_length = 0;
558 p->parameter = 0;
559 p->short_not_ok = short_not_ok;
560 p->int_req = int_req;
561 p->combined = NULL;
562 qemu_iovec_reset(&p->iov);
563 usb_packet_set_state(p, USB_PACKET_SETUP);

--- 223 unchanged lines hidden ---
558 p->status = USB_RET_SUCCESS;
559 p->actual_length = 0;
560 p->parameter = 0;
561 p->short_not_ok = short_not_ok;
562 p->int_req = int_req;
563 p->combined = NULL;
564 qemu_iovec_reset(&p->iov);
565 usb_packet_set_state(p, USB_PACKET_SETUP);

--- 223 unchanged lines hidden ---