linux-stable/drivers/usb/gadget
Konrad Gräfe 3c0f4f09c0 usb: gadget: u_ether: Fix host MAC address case
The CDC-ECM specification [1] requires to send the host MAC address as
an uppercase hexadecimal string in chapter "5.4 Ethernet Networking
Functional Descriptor":
    The Unicode character is chosen from the set of values 30h through
    39h and 41h through 46h (0-9 and A-F).

However, snprintf(.., "%pm", ..) generates a lowercase MAC address
string. While most host drivers are tolerant to this, UsbNcm.sys on
Windows 10 is not. Instead it uses a different MAC address with all
bytes set to zero including and after the first byte containing a
lowercase letter. On Windows 11 Microsoft fixed it, but apparently they
did not backport the fix.

This change fixes the issue by upper-casing the MAC to comply with the
specification.

[1]: https://www.usb.org/document-library/class-definitions-communication-devices-12, file ECM120.pdf

Fixes: bcd4a1c40b ("usb: gadget: u_ether: construct with default values and add setters/getters")
Cc: stable@vger.kernel.org
Signed-off-by: Konrad Gräfe <k.graefe@gateware.de>
Link: https://lore.kernel.org/r/20230505143640.443014-1-k.graefe@gateware.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-13 18:46:59 +09:00
..
function usb: gadget: u_ether: Fix host MAC address case 2023-05-13 18:46:59 +09:00
legacy Merge 6.3-rc6 into usb-next 2023-04-10 08:56:59 +02:00
udc Revert "usb: gadget: udc: core: Invoke usb_gadget_connect only when started" 2023-05-13 18:08:09 +09:00
composite.c usb: gadget: Handle function suspend feature selector 2023-03-29 10:27:01 +02:00
config.c usb: fix various gadget panics on 10gbps cabling 2021-06-09 10:40:08 +02:00
configfs.c usb: gadget: Properly configure the device for remote wakeup 2023-03-29 10:27:00 +02:00
configfs.h
epautoconf.c usb: gadget: fix for a typo that conveys logically-inverted information. 2021-09-14 10:27:54 +02:00
functions.c
Kconfig usb: uvc: move uvc_fmts and uvc_format_by_guid to own compile unit 2023-01-31 09:40:42 +01:00
Makefile usb: gadget: Makefile: remove ccflags-y 2022-03-18 12:56:08 +01:00
u_f.c
u_f.h USB: gadget: u_f: Unbreak offset calculation in VLAs 2020-08-27 09:25:06 +02:00
u_os_desc.h
usbstring.c