mirror of
https://github.com/ipxe/ipxe
synced 2026-04-16 03:00:10 +03:00
[usb] Use non-zero language ID to retrieve strings
We currently use a zero language ID to retrieve strings such as the ECM/NCM MAC address. This works on most hardware devices, but is known to fail on some software emulated CDC-NCM devices. Fix by using the first supported language ID, falling back to English (0x0409) if any error occurs when fetching the list of supported languages. This matches the behaviour of the Linux kernel. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -223,6 +223,9 @@ struct usb_string_descriptor {
|
||||
/** A USB string descriptor */
|
||||
#define USB_STRING_DESCRIPTOR 3
|
||||
|
||||
/** Language ID for English */
|
||||
#define USB_LANG_ENGLISH 0x0409
|
||||
|
||||
/** A USB interface descriptor */
|
||||
struct usb_interface_descriptor {
|
||||
/** Descriptor header */
|
||||
@@ -728,6 +731,9 @@ struct usb_device {
|
||||
struct usb_endpoint control;
|
||||
/** Completed control transfers */
|
||||
struct list_head complete;
|
||||
|
||||
/** Default language ID (if known) */
|
||||
unsigned int language;
|
||||
};
|
||||
|
||||
/** USB device host controller operations */
|
||||
|
||||
Reference in New Issue
Block a user