[PATCH 1/2] usb: kbd: Ignore Yubikeys

Marek Vasut marex at denx.de
Sun Oct 29 13:13:28 CET 2023


On 10/29/23 08:09, Hector Martin wrote:
> We currently only support one USB keyboard device, but some devices
> emulate keyboards for other purposes. Most commonly, people run into
> this with Yubikeys, so let's ignore those.
> 
> Even if we end up supporting multiple keyboards in the future, it's
> safer to ignore known non-keyboard devices.
> 
> This is particularly important to avoid regressing some users, since
> YubiKeys often *don't* work due to other bugs in the USB stack, but will
> start to work once they are fixed.
> 
> Signed-off-by: Hector Martin <marcan at marcan.st>
> ---
>   common/usb_kbd.c | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
> 
> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
> index 352d86fb2ece..e8c102c567e4 100644
> --- a/common/usb_kbd.c
> +++ b/common/usb_kbd.c
> @@ -120,6 +120,15 @@ struct usb_kbd_pdata {
>   
>   extern int __maybe_unused net_busy_flag;
>   
> +/*
> + * Since we only support one usbkbd device in the iomux,
> + * ignore common keyboard-emulating devices that aren't
> + * real keyboards.
> + */
> +const uint16_t vid_blocklist[] = {
> +	0x1050, /* Yubico */

I wonder if it would be better to have this default, but make the list 
configurable via environment variable too. This way, if users run into 
more weird devices, they could just:

=> setenv vid_blocklist "0x1234,0x5678" ; saveenv ; usb reset


More information about the U-Boot mailing list