Greg:

This patch adds iConfiguration and iInterface strings to the
g_file_storage driver (just to spiff it up and help in testing software
that looks at those strings).  It also enlarges the space reserved for the
Manufacturer string, since combinations of long kernel names and long UDC
driver names were sometimes getting truncated.

Alan Stern



Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

===== drivers/usb/gadget/file_storage.c 1.38 vs edited =====
--- 1.38/drivers/usb/gadget/file_storage.c      2005-02-03 00:13:48 -05:00
+++ edited/drivers/usb/gadget/file_storage.c    2005-02-25 10:39:06 -05:00
@@ -1,7 +1,7 @@
 /*
  * file_storage.c -- File-backed USB Storage Gadget, for USB development
  *
- * Copyright (C) 2003, 2004 Alan Stern
+ * Copyright (C) 2003-2005 Alan Stern
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -832,6 +832,8 @@
 #define STRING_MANUFACTURER    1
 #define STRING_PRODUCT         2
 #define STRING_SERIAL          3
+#define STRING_CONFIG          4
+#define STRING_INTERFACE       5
 
 /* There is only one configuration. */
 #define        CONFIG_VALUE            1
@@ -863,6 +865,7 @@
        /* wTotalLength computed by usb_gadget_config_buf() */
        .bNumInterfaces =       1,
        .bConfigurationValue =  CONFIG_VALUE,
+       .iConfiguration =       STRING_CONFIG,
        .bmAttributes =         USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
        .bMaxPower =            1,      // self-powered
 };
@@ -886,6 +889,7 @@
        .bInterfaceClass =      USB_CLASS_MASS_STORAGE,
        .bInterfaceSubClass =   USB_SC_SCSI,    // Adjusted during fsg_bind()
        .bInterfaceProtocol =   USB_PR_BULK,    // Adjusted during fsg_bind()
+       .iInterface =           STRING_INTERFACE,
 };
 
 /* Three full-speed endpoint descriptors: bulk-in, bulk-out,
@@ -1009,7 +1013,7 @@
 
 /* The CBI specification limits the serial string to 12 uppercase hexadecimal
  * characters. */
-static char                            manufacturer[50];
+static char                            manufacturer[64];
 static char                            serial[13];
 
 /* Static strings, in UTF-8 (for simplicity we use only ASCII characters) */
@@ -1017,6 +1021,8 @@
        {STRING_MANUFACTURER,   manufacturer},
        {STRING_PRODUCT,        longname},
        {STRING_SERIAL,         serial},
+       {STRING_CONFIG,         "Self-powered"},
+       {STRING_INTERFACE,      "Mass Storage"},
        {}
 };
 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to