So if I split this into 6 separate functions, you'll take it?

Does anyone know how to create a sub-directory when using the SCSI
attributes list?  Or should I just prefix all of the entries with 'usb_'?

Matt

On Fri, Jan 23, 2004 at 02:52:59PM -0800, Greg KH wrote:
> On Sun, Jan 11, 2004 at 04:46:45PM -0800, Matthew Dharm wrote:
> > This patch adds a sysfs attribute to the usb-storage SCSI devices.  This
> > attribute (read-only) is basically a clone of the information available in
> > /proc/scsi/scsi -- since that interface is going away, adding a new sysfs
> > attribute seemed like a good idea.
> > 
> > Greg, please apply.
> 
> Oops, I never should have applied this.
> 
> I've now applied this patch and will be sending it to Linus.  Remember,
> sysfs is 1 value per file.  No multivalue file crud now...
> 
> thanks,
> 
> greg k-h
> 
> # USB storage: remove info sysfs file as it violates the sysfs 1 value per file rule.
> 
> diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> --- a/drivers/usb/storage/scsiglue.c  Fri Jan 23 14:50:46 2004
> +++ b/drivers/usb/storage/scsiglue.c  Fri Jan 23 14:50:46 2004
> @@ -309,44 +309,6 @@
>   * Sysfs interface
>   ***********************************************************************/
>  
> -/* Output routine for the sysfs info file */
> -static ssize_t show_info(struct device *dev, char *buffer)
> -{
> -     char *pos = buffer;
> -     const int length = PAGE_SIZE;
> -
> -     struct scsi_device *sdev = to_scsi_device(dev);
> -     struct us_data *us = (struct us_data*)sdev->host->hostdata[0];
> -
> -     /* print the controller name */
> -     SPRINTF("   Host scsi%d: usb-storage\n", sdev->host->host_no);
> -
> -     /* print product, vendor, and serial number strings */
> -     SPRINTF("       Vendor: %s\n", us->vendor);
> -     SPRINTF("      Product: %s\n", us->product);
> -     SPRINTF("Serial Number: %s\n", us->serial);
> -
> -     /* show the protocol and transport */
> -     SPRINTF("     Protocol: %s\n", us->protocol_name);
> -     SPRINTF("    Transport: %s\n", us->transport_name);
> -
> -     /* show the device flags */
> -     if (pos < buffer + length) {
> -             pos += sprintf(pos, "       Quirks:");
> -
> -             DO_FLAG(SINGLE_LUN);
> -             DO_FLAG(SCM_MULT_TARG);
> -             DO_FLAG(FIX_INQUIRY);
> -             DO_FLAG(FIX_CAPACITY);
> -
> -             *(pos++) = '\n';
> -     }
> -
> -     return (pos - buffer);
> -}
> -
> -static DEVICE_ATTR(info, S_IRUGO, show_info, NULL);
> -
>  /* Output routine for the sysfs max_sectors file */
>  static ssize_t show_max_sectors(struct device *dev, char *buf)
>  {
> @@ -373,7 +335,6 @@
>               store_max_sectors);
>  
>  static struct device_attribute *sysfs_device_attr_list[] = {
> -             &dev_attr_info,
>               &dev_attr_max_sectors,
>               NULL,
>               };
> _______________________________________________
> usb-storage mailing list
> [EMAIL PROTECTED]
> http://www2.one-eyed-alien.net/mailman/listinfo/usb-storage

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

I say, what are all those naked people doing?
                                        -- Big client to Stef
User Friendly, 12/14/1997

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to