diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-01-12 13:23:01 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-02-10 11:31:57 +0100 |
commit | 079d0b7f1eedcc634c371fe05b617fdc55c8b762 (patch) | |
tree | 60ee42f36b295edb49fcb62af5912f769efa9991 /hw/usb-hid.c | |
parent | 63095ab54c1ce554b1fc825fc678394ccb129e5b (diff) | |
download | qemu-079d0b7f1eedcc634c371fe05b617fdc55c8b762.zip qemu-079d0b7f1eedcc634c371fe05b617fdc55c8b762.tar.gz qemu-079d0b7f1eedcc634c371fe05b617fdc55c8b762.tar.bz2 |
usb: Set USBEndpoint in usb_packet_setup().
With the separation of the device lookup (via usb_find_device) and
packet processing we can lookup device and endpoint before setting up
the usb packet. So we can initialize USBPacket->ep early and keep it
valid for the whole lifecycle of the USBPacket. Also the devaddr and
devep fields are not needed any more.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-hid.c')
-rw-r--r-- | hw/usb-hid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb-hid.c b/hw/usb-hid.c index c648980..4d00c28 100644 --- a/hw/usb-hid.c +++ b/hw/usb-hid.c @@ -463,7 +463,7 @@ static int usb_hid_handle_data(USBDevice *dev, USBPacket *p) switch (p->pid) { case USB_TOKEN_IN: - if (p->devep == 1) { + if (p->ep->nr == 1) { int64_t curtime = qemu_get_clock_ns(vm_clock); if (!hid_has_events(hs) && (!hs->idle || hs->next_idle_clock - curtime > 0)) { |