]> git.proxmox.com Git - qemu.git/blobdiff - usb-linux.c
usb-uhci: symbolic names for pci registers
[qemu.git] / usb-linux.c
index 285ac227a380283d101f2f0c82aced946a70696d..88728e927e3b32803d66464c872d5dd6813790ca 100644 (file)
@@ -933,10 +933,10 @@ static int usb_host_open(USBHostDevice *dev, int bus_num,
         dev->dev.speed = USB_SPEED_HIGH;
 
     if (!prod_name || prod_name[0] == '\0')
-        snprintf(dev->dev.devname, sizeof(dev->dev.devname),
+        snprintf(dev->dev.product_desc, sizeof(dev->dev.product_desc),
                  "host:%d.%d", bus_num, addr);
     else
-        pstrcpy(dev->dev.devname, sizeof(dev->dev.devname),
+        pstrcpy(dev->dev.product_desc, sizeof(dev->dev.product_desc),
                 prod_name);
 
     /* USB devio uses 'write' flag to check for async completions */
@@ -979,8 +979,8 @@ static int usb_host_initfn(USBDevice *dev)
 }
 
 static struct USBDeviceInfo usb_host_dev_info = {
-    .qdev.name      = "USB Host Device",
-    .qdev.alias     = "usb-host",
+    .product_desc   = "USB Host Device",
+    .qdev.name      = "usb-host",
     .qdev.size      = sizeof(USBHostDevice),
     .init           = usb_host_initfn,
     .handle_packet  = usb_host_handle_packet,
@@ -1010,7 +1010,7 @@ USBDevice *usb_host_device_open(const char *devname)
     USBHostDevice *s;
     char *p;
 
-    dev = usb_create(NULL /* FIXME */, "USB Host Device");
+    dev = usb_create(NULL /* FIXME */, "usb-host");
     s = DO_UPCAST(USBHostDevice, dev, dev);
 
     if (strstr(devname, "auto:")) {
@@ -1206,7 +1206,8 @@ static int usb_host_read_file(char *line, size_t line_size, const char *device_f
         ret = 1;
 #if 0
     } else {
-        monitor_printf(mon, "husb: could not open %s\n", filename);
+        if (mon)
+            monitor_printf(mon, "husb: could not open %s\n", filename);
 #endif
     }
 
@@ -1339,15 +1340,17 @@ static int usb_host_scan(void *opaque, USBScanFunc *func)
         }
     found_devices:
         if (!usb_fs_type) {
-            monitor_printf(mon, "husb: unable to access USB devices\n");
+            if (mon)
+                monitor_printf(mon, "husb: unable to access USB devices\n");
             return -ENOENT;
         }
 
         /* the module setting (used later for opening devices) */
         usb_host_device_path = qemu_mallocz(strlen(devpath)+1);
         strcpy(usb_host_device_path, devpath);
-        monitor_printf(mon, "husb: using %s file-system with %s\n",
-                       fs_type[usb_fs_type], usb_host_device_path);
+        if (mon)
+            monitor_printf(mon, "husb: using %s file-system with %s\n",
+                           fs_type[usb_fs_type], usb_host_device_path);
     }
 
     switch (usb_fs_type) {