USB: usb-storage: Associate the name of the interface with the scsi host
authorMatthew Wilcox <willy@linux.intel.com>
Thu, 24 Sep 2009 22:19:11 +0000 (16:19 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 19:55:13 +0000 (11:55 -0800)
Instead of reporting "SCSI emulation for USB Mass Storage devices",
report "usb-storage 1-4:1.0".

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/scsiglue.c
drivers/usb/storage/usb.c
drivers/usb/storage/usb.h

index cfa26d56ce60c4f2c69346aae433444a5c812297..e5e6df39e73707989711ea0284a4109d56409b44 100644 (file)
@@ -73,7 +73,8 @@
 
 static const char* host_info(struct Scsi_Host *host)
 {
-       return "SCSI emulation for USB Mass Storage devices";
+       struct us_data *us = host_to_us(host);
+       return us->scsi_name;
 }
 
 static int slave_alloc (struct scsi_device *sdev)
index 8060b85fe1a3fb377476e1cd0a6de55df6de9014..783548485868ef1a32006d97e8be8729de9d87fd 100644 (file)
@@ -929,6 +929,8 @@ int usb_stor_probe2(struct us_data *us)
        result = usb_stor_acquire_resources(us);
        if (result)
                goto BadDevice;
+       snprintf(us->scsi_name, sizeof(us->scsi_name), "usb-storage %s",
+                                       dev_name(&us->pusb_intf->dev));
        result = scsi_add_host(us_to_host(us), &us->pusb_intf->dev);
        if (result) {
                printk(KERN_WARNING USB_STORAGE
index 2609efb2bd7ea86da818450e241aaf835ea46a77..69717134231b5f8469e62614533e1d411705c562 100644 (file)
@@ -132,6 +132,7 @@ struct us_data {
        /* SCSI interfaces */
        struct scsi_cmnd        *srb;            /* current srb         */
        unsigned int            tag;             /* current dCBWTag     */
+       char                    scsi_name[32];   /* scsi_host name      */
 
        /* control and bulk communications data */
        struct urb              *current_urb;    /* USB requests         */