mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
usb: pass USBEndpoint to usb_wakeup
Devices must specify which endpoint has data to transfer now. The plan is to use the usb_wakeup() not only for remove wakeup support, but for "data ready" signaling in general, so we can move away from constant polling to event driven usb device emulation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
db4be873d3
commit
7567b51fbe
5 changed files with 15 additions and 7 deletions
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
typedef struct USBHIDState {
|
||||
USBDevice dev;
|
||||
USBEndpoint *intr;
|
||||
HIDState hid;
|
||||
} USBHIDState;
|
||||
|
||||
|
|
@ -360,7 +361,7 @@ static void usb_hid_changed(HIDState *hs)
|
|||
{
|
||||
USBHIDState *us = container_of(hs, USBHIDState, hid);
|
||||
|
||||
usb_wakeup(&us->dev);
|
||||
usb_wakeup(us->intr);
|
||||
}
|
||||
|
||||
static void usb_hid_handle_reset(USBDevice *dev)
|
||||
|
|
@ -501,6 +502,7 @@ static int usb_hid_initfn(USBDevice *dev, int kind)
|
|||
USBHIDState *us = DO_UPCAST(USBHIDState, dev, dev);
|
||||
|
||||
usb_desc_init(dev);
|
||||
us->intr = usb_ep_get(dev, USB_TOKEN_IN, 1);
|
||||
hid_init(&us->hid, kind, usb_hid_changed);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue