Home | History | Annotate | Download | only in qemu

Lines Matching refs:DEV

11  *      Added flexible support for /dev/bus/usb /sys/bus/usb/devices in addition
83 #define USBDEVBUS_PATH "/dev/bus/usb"
122 USBDevice dev;
163 static void hostdev_link(USBHostDevice *dev)
165 dev->next = hostdev_list;
166 hostdev_list = dev;
169 static void hostdev_unlink(USBHostDevice *dev)
175 if (pdev == dev) {
176 *prev = dev->next;
255 usb_device_del_addr(0, s->dev.addr);
307 static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration)
319 dev_descr_len = dev->descr[0];
320 if (dev_descr_len > dev->descr_len)
322 nb_configurations = dev->descr[17];
325 while (i < dev->descr_len) {
326 dprintf("husb: i is %d, descr_len is %d, dl %d, dt %d\n", i, dev->descr_len,
327 dev->descr[i], dev->descr[i+1]);
329 if (dev->descr[i+1] != USB_DT_CONFIG) {
330 i += dev->descr[i];
333 config_descr_len = dev->descr[i];
335 printf("husb: config #%d need %d\n", dev->descr[i + 5], configuration);
337 if (configuration < 0 || configuration == dev->descr[i + 5]) {
338 configuration = dev->descr[i + 5];
345 if (i >= dev->descr_len) {
349 nb_interfaces = dev->descr[i + 4];
358 ret = ioctl(dev->fd, USBDEVFS_IOCTL, &ctrl);
369 ret = ioctl(dev->fd, USBDEVFS_CLAIMINTERFACE, &interface);
384 dev->ninterfaces = nb_interfaces;
385 dev->configuration = configuration;
406 static void usb_host_handle_reset(USBDevice *dev)
408 USBHostDevice *s = (USBHostDevice *) dev;
417 static void usb_host_handle_destroy(USBDevice *dev)
419 USBHostDevice *s = (USBHostDevice *)dev;
512 s->dev.addr = addr;
624 static int do_token_setup(USBDevice *dev, USBPacket *p)
626 USBHostDevice *s = (USBHostDevice *) dev;
655 static int do_token_in(USBDevice *dev, USBPacket *p)
657 USBHostDevice *s = (USBHostDevice *) dev;
696 static int do_token_out(USBDevice *dev, USBPacket *p)
698 USBHostDevice *s = (USBHostDevice *) dev;
887 USBHostDevice *dev = NULL;
891 dev = qemu_mallocz(sizeof(USBHostDevice));
893 dev->bus_num = bus_num;
894 dev->addr = addr;
912 dev->descr_len = read(fd, dev->descr, sizeof(dev->descr));
913 if (dev->descr_len <= 0) {
922 for (x = 0; x < dev->descr_len; x++)
923 printf("%02x ", dev->descr[x]);
928 dev->fd = fd;
936 if (!usb_host_claim_interfaces(dev, -1))
947 ret = usb_linux_update_endp_table(dev);
952 dev->dev.speed = USB_SPEED_LOW;
954 dev->dev.speed = USB_SPEED_HIGH;
956 dev->dev.handle_packet = usb_host_handle_packet;
957 dev->dev.handle_reset = usb_host_handle_reset;
958 dev->dev.handle_destroy = usb_host_handle_destroy;
961 snprintf(dev->dev.devname, sizeof(dev->dev.devname),
964 pstrcpy(dev->dev.devname, sizeof(dev->dev.devname),
968 qemu_set_fd_handler(dev->fd, NULL, async_complete, dev);
970 hostdev_link(dev);
972 return (USBDevice *) dev;
975 if (dev)
976 qemu_free(dev);
1024 usb_device_del_addr(0, s->dev.addr);
1054 * Use /proc/bus/usb/devices or /dev/bus/usb/devices file to determine
1096 if (get_tag_value(buf, sizeof(buf), line, "Dev#=", " ") < 0)
1263 const char *fs_type[] = {"unknown", "proc", "dev", "sys"};
1280 /* devices found in /dev/bus/usb/ */
1289 /* devices found in /dev/bus/usb/ (yes - not a mistake!) */
1340 struct USBDevice *dev;
1367 dev = usb_host_device_open_addr(bus_num, addr, product_name);
1368 if (dev)
1369 usb_device_add_dev(dev);
1384 * auto:bus:dev[:vid:pid]
1385 * auto:bus.dev[:vid:pid]
1388 * dev - device number (dec, * means any)
1396 enum { BUS, DEV, VID, PID, DONE };
1415 case DEV: f->addr = strtol(p, NULL, 10); break;
1421 if (i < DEV) {