@@ -1983,7 +1983,6 @@ static struct usb_interface_descriptor bot_intf_desc = {
1983
1983
.bInterfaceClass = USB_CLASS_MASS_STORAGE ,
1984
1984
.bInterfaceSubClass = USB_SC_SCSI ,
1985
1985
.bInterfaceProtocol = USB_PR_BULK ,
1986
- .iInterface = USB_G_STR_INT_UAS ,
1987
1986
};
1988
1987
1989
1988
static struct usb_interface_descriptor uasp_intf_desc = {
@@ -1994,7 +1993,6 @@ static struct usb_interface_descriptor uasp_intf_desc = {
1994
1993
.bInterfaceClass = USB_CLASS_MASS_STORAGE ,
1995
1994
.bInterfaceSubClass = USB_SC_SCSI ,
1996
1995
.bInterfaceProtocol = USB_PR_UAS ,
1997
- .iInterface = USB_G_STR_INT_BBB ,
1998
1996
};
1999
1997
2000
1998
static struct usb_endpoint_descriptor uasp_bi_desc = {
@@ -2215,20 +2213,16 @@ static struct usb_device_descriptor usbg_device_desc = {
2215
2213
.bDeviceClass = USB_CLASS_PER_INTERFACE ,
2216
2214
.idVendor = cpu_to_le16 (UAS_VENDOR_ID ),
2217
2215
.idProduct = cpu_to_le16 (UAS_PRODUCT_ID ),
2218
- .iManufacturer = USB_G_STR_MANUFACTOR ,
2219
- .iProduct = USB_G_STR_PRODUCT ,
2220
- .iSerialNumber = USB_G_STR_SERIAL ,
2221
-
2222
2216
.bNumConfigurations = 1 ,
2223
2217
};
2224
2218
2225
2219
static struct usb_string usbg_us_strings [] = {
2226
- { USB_G_STR_MANUFACTOR , "Target Manufactor" } ,
2227
- { USB_G_STR_PRODUCT , "Target Product" } ,
2228
- { USB_G_STR_SERIAL , "000000000001" } ,
2229
- { USB_G_STR_CONFIG , "default config" } ,
2230
- { USB_G_STR_INT_UAS , "USB Attached SCSI" } ,
2231
- { USB_G_STR_INT_BBB , "Bulk Only Transport" } ,
2220
+ [ USB_G_STR_MANUFACTOR ]. s = "Target Manufactor" ,
2221
+ [ USB_G_STR_PRODUCT ]. s = "Target Product" ,
2222
+ [ USB_G_STR_SERIAL ]. s = "000000000001" ,
2223
+ [ USB_G_STR_CONFIG ]. s = "default config" ,
2224
+ [ USB_G_STR_INT_UAS ]. s = "USB Attached SCSI" ,
2225
+ [ USB_G_STR_INT_BBB ]. s = "Bulk Only Transport" ,
2232
2226
{ },
2233
2227
};
2234
2228
@@ -2250,7 +2244,6 @@ static int guas_unbind(struct usb_composite_dev *cdev)
2250
2244
static struct usb_configuration usbg_config_driver = {
2251
2245
.label = "Linux Target" ,
2252
2246
.bConfigurationValue = 1 ,
2253
- .iConfiguration = USB_G_STR_CONFIG ,
2254
2247
.bmAttributes = USB_CONFIG_ATT_SELFPOWER ,
2255
2248
};
2256
2249
@@ -2423,6 +2416,9 @@ static int usbg_cfg_bind(struct usb_configuration *c)
2423
2416
fu -> function .disable = usbg_disable ;
2424
2417
fu -> tpg = the_only_tpg_I_currently_have ;
2425
2418
2419
+ bot_intf_desc .iInterface = usbg_us_strings [USB_G_STR_INT_BBB ].id ;
2420
+ uasp_intf_desc .iInterface = usbg_us_strings [USB_G_STR_INT_UAS ].id ;
2421
+
2426
2422
ret = usb_add_function (c , & fu -> function );
2427
2423
if (ret )
2428
2424
goto err ;
@@ -2437,6 +2433,17 @@ static int usb_target_bind(struct usb_composite_dev *cdev)
2437
2433
{
2438
2434
int ret ;
2439
2435
2436
+ ret = usb_string_ids_tab (cdev , usbg_us_strings );
2437
+ if (ret )
2438
+ return ret ;
2439
+
2440
+ usbg_device_desc .iManufacturer =
2441
+ usbg_us_strings [USB_G_STR_MANUFACTOR ].id ;
2442
+ usbg_device_desc .iProduct = usbg_us_strings [USB_G_STR_PRODUCT ].id ;
2443
+ usbg_device_desc .iSerialNumber = usbg_us_strings [USB_G_STR_SERIAL ].id ;
2444
+ usbg_config_driver .iConfiguration =
2445
+ usbg_us_strings [USB_G_STR_CONFIG ].id ;
2446
+
2440
2447
ret = usb_add_config (cdev , & usbg_config_driver ,
2441
2448
usbg_cfg_bind );
2442
2449
return 0 ;
0 commit comments