~ubuntu-branches/ubuntu/precise/qemu-kvm/precise

« back to all changes in this revision

Viewing changes to usb-bsd.c

  • Committer: Serge Hallyn
  • Date: 2011-12-06 22:40:24 UTC
  • mfrom: (1.2.8)
  • Revision ID: serge.hallyn@ubuntu.com-20111206224024-x6bw4wnn65pgf55v
Tags: 1.0+noroms-0ubuntu1
* New upstream release
* Remaining changes from upstream:
  - removed all binary roms and tests/pi_10.com
* debian/qemu-kvm.links: qemu is now called qemu-system-i386, don't symlink
  it
* remove patches applied upstream:
  - debian/patches/vpc.patch
  - debian/patches/e1000-Dont-set-the-Capabilities-List-bit.patch
  - debian/patches/CVE-2011-4111.patch
* replace default-to-tcg.patch with simpler fallback-to-tcg.patch
* keep remaining patches:
  - larger_default_ram_size.patch
  - CVE-2011-2212-virtqueue-indirect-overflow.patch
  - qemuifup-fix-paths.patch
  - dont-try-to-hotplug-cpu.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
} USBHostDevice;
63
63
 
64
64
 
65
 
#if 0
66
65
static int ensure_ep_open(USBHostDevice *dev, int ep, int mode)
67
66
{
68
67
    char buf[32];
110
109
        epnum++;
111
110
    }
112
111
}
113
 
#endif
114
112
 
115
113
static void usb_host_handle_reset(USBDevice *dev)
116
114
{
119
117
#endif
120
118
}
121
119
 
122
 
#if 0
123
120
/* XXX:
124
121
 * -check device states against transfer requests
125
122
 *  and return appropriate response
256
253
    }
257
254
 
258
255
    if (p->pid == USB_TOKEN_IN)
259
 
        ret = read(fd, p->data, p->len);
 
256
        ret = readv(fd, p->iov.iov, p->iov.niov);
260
257
    else
261
 
        ret = write(fd, p->data, p->len);
 
258
        ret = writev(fd, p->iov.iov, p->iov.niov);
262
259
 
263
260
    sigprocmask(SIG_SETMASK, &old_mask, NULL);
264
261
 
278
275
        return ret;
279
276
    }
280
277
}
281
 
#endif
282
278
 
283
279
static void usb_host_handle_destroy(USBDevice *opaque)
284
280
{
294
290
 
295
291
    close(s->devfd);
296
292
 
297
 
    qemu_free(s);
 
293
    g_free(s);
298
294
}
299
295
 
300
296
static int usb_host_initfn(USBDevice *dev)
305
301
USBDevice *usb_host_device_open(const char *devname)
306
302
{
307
303
    struct usb_device_info bus_info, dev_info;
308
 
    USBDevice *d = NULL;
309
 
    USBHostDevice *dev, *ret = NULL;
 
304
    USBDevice *d = NULL, *ret = NULL;
 
305
    USBHostDevice *dev;
310
306
    char ctlpath[PATH_MAX + 1];
311
307
    char buspath[PATH_MAX + 1];
312
308
    int bfd, dfd, bus, address, i;
408
404
    .init           = usb_host_initfn,
409
405
    .handle_packet  = usb_generic_handle_packet,
410
406
    .handle_reset   = usb_host_handle_reset,
411
 
#if 0
412
407
    .handle_control = usb_host_handle_control,
413
408
    .handle_data    = usb_host_handle_data,
414
 
#endif
415
409
    .handle_destroy = usb_host_handle_destroy,
416
410
};
417
411