iPXE - Open Source Boot Firmware

[usb] Use non-zero language ID to retrieve strings
authorMichael Brown <mcb30@ipxe.org>
Mon, 3 Jul 2017 12:38:55 +0000 (13:38 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 3 Jul 2017 12:38:55 +0000 (13:38 +0100)
commit8e48d0df6b5a249e4f9f0759cc55a45af186b564
tree70929b5441de37f12002fd110475cf18bd6b122e
parent1e5c5a216351ffc18004e3e190f09fc04a110b52
[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>
src/drivers/bus/usb.c
src/include/ipxe/usb.h