summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown2017-07-03 14:38:55 +0200
committerMichael Brown2017-07-03 14:38:55 +0200
commit8e48d0df6b5a249e4f9f0759cc55a45af186b564 (patch)
tree70929b5441de37f12002fd110475cf18bd6b122e /src/include/ipxe
parent[exanic] Add driver for Exablaze ExaNIC cards (diff)
downloadipxe-8e48d0df6b5a249e4f9f0759cc55a45af186b564.tar.gz
ipxe-8e48d0df6b5a249e4f9f0759cc55a45af186b564.tar.xz
ipxe-8e48d0df6b5a249e4f9f0759cc55a45af186b564.zip
[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>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/usb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/ipxe/usb.h b/src/include/ipxe/usb.h
index e7909d30..68289d26 100644
--- a/src/include/ipxe/usb.h
+++ b/src/include/ipxe/usb.h
@@ -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 */