Re: [PATCH] usb: gadget: u_ether: Fix host MAC address case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 26, 2023 at 12:17:53PM +0200, Konrad Gräfe wrote:
> 
> As the CDC-ECM specification states the host MAC address must be sent to
> the host as an uppercase hexadecimal string:
>     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.
> 
> Signed-off-by: Konrad Gräfe <k.graefe@xxxxxxxxxxx>
> ---
> V1 -> V2: Fixed checkpatch.pl warnings

There is no "v2" in the subject line, so our tools will get confused and
have no idea this is a newer patch.

Please fix up and send a v3?

>  	snprintf(host_addr, len, "%pm", dev->host_mac);

Is there no option to print a mac address with all uppercase?  If not,
why not add that instead as it's needed here and maybe other places,
right?

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux