diff options
Diffstat (limited to 'usb-linux.c')
-rw-r--r-- | usb-linux.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usb-linux.c b/usb-linux.c index 0a13753d48..77436927cd 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -114,22 +114,21 @@ static int usb_host_handle_control(USBDevice *dev, } } -static int usb_host_handle_data(USBDevice *dev, int pid, - uint8_t devep, - uint8_t *data, int len) +static int usb_host_handle_data(USBDevice *dev, USBPacket *p) { USBHostDevice *s = (USBHostDevice *)dev; struct usbdevfs_bulktransfer bt; int ret; + uint8_t devep = p->devep; /* XXX: optimize and handle all data types by looking at the config descriptor */ - if (pid == USB_TOKEN_IN) + if (p->pid == USB_TOKEN_IN) devep |= 0x80; bt.ep = devep; - bt.len = len; + bt.len = p->len; bt.timeout = 50; - bt.data = data; + bt.data = p->data; ret = ioctl(s->fd, USBDEVFS_BULK, &bt); if (ret < 0) { switch(errno) { |