Commit cfd94bc9 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: ethernet gadget, minor fixes

Minor tweaks to the ethernet gadget driver:

 - mention that it requires full-duplex hardware
 - correct the string description:  they're always UTF-8
 - fix minor C error: don't "&array" (Al Borchers)
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent f6b11a81
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
/* /*
* Ethernet gadget driver -- with CDC and non-CDC options * Ethernet gadget driver -- with CDC and non-CDC options
* Builds on hardware support for a full duplex link.
* *
* CDC Ethernet is the standard USB solution for sending Ethernet frames * CDC Ethernet is the standard USB solution for sending Ethernet frames
* using USB. Real hardware tends to use the same framing protocol but look * using USB. Real hardware tends to use the same framing protocol but look
...@@ -859,7 +860,7 @@ static char product_desc [40] = DRIVER_DESC; ...@@ -859,7 +860,7 @@ static char product_desc [40] = DRIVER_DESC;
static char ethaddr [2 * ETH_ALEN + 1]; static char ethaddr [2 * ETH_ALEN + 1];
#endif #endif
/* static strings, in iso 8859/1 */ /* static strings, in UTF-8 */
static struct usb_string strings [] = { static struct usb_string strings [] = {
{ STRING_MANUFACTURER, manufacturer, }, { STRING_MANUFACTURER, manufacturer, },
{ STRING_PRODUCT, product_desc, }, { STRING_PRODUCT, product_desc, },
...@@ -901,9 +902,9 @@ config_buf (enum usb_device_speed speed, ...@@ -901,9 +902,9 @@ config_buf (enum usb_device_speed speed,
if (type == USB_DT_OTHER_SPEED_CONFIG) if (type == USB_DT_OTHER_SPEED_CONFIG)
hs = !hs; hs = !hs;
#define which_fn(t) (hs ? & hs_ ## t ## _function : & fs_ ## t ## _function) #define which_fn(t) (hs ? hs_ ## t ## _function : fs_ ## t ## _function)
#else #else
#define which_fn(t) (& fs_ ## t ## _function) #define which_fn(t) (fs_ ## t ## _function)
#endif #endif
if (index >= device_desc.bNumConfigurations) if (index >= device_desc.bNumConfigurations)
...@@ -915,14 +916,12 @@ config_buf (enum usb_device_speed speed, ...@@ -915,14 +916,12 @@ config_buf (enum usb_device_speed speed,
*/ */
if (device_desc.bNumConfigurations == 2 && index == 0) { if (device_desc.bNumConfigurations == 2 && index == 0) {
config = &rndis_config; config = &rndis_config;
function = (const struct usb_descriptor_header **) function = which_fn (rndis);
which_fn (rndis);
} else } else
#endif #endif
{ {
config = &eth_config; config = &eth_config;
function = (const struct usb_descriptor_header **) function = which_fn (eth);
which_fn (eth);
} }
/* for now, don't advertise srp-only devices */ /* for now, don't advertise srp-only devices */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment