SCSI and USB async IO support.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2107 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
pbrook 2006-08-12 01:04:27 +00:00
parent 4ca9c76f36
commit 4d611c9a2f
14 changed files with 745 additions and 292 deletions

View file

@ -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) {