All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Andrej Shadura <andrew.shadura@collabora.co.uk>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	kernel@collabora.com, Theodore Ts'o <tytso@mit.edu>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Nick Kossifidis <mickflemm@gmail.com>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2] HID: add driver for U2F Zero built-in LED and RNG
Date: Mon, 18 Mar 2019 15:44:55 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.1903181542260.19912@cbobk.fhfr.pm> (raw)
In-Reply-To: <20190309183213.7598-1-andrew.shadura@collabora.co.uk>

On Sat, 9 Mar 2019, Andrej Shadura wrote:

> U2F Zero supports custom commands for blinking the LED and getting data
> from the internal hardware RNG. Expose the blinking function as a LED
> device, and the internal hardware RNG as an HWRNG so that it can be used
> to feed the enthropy pool.
> 
> Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
> ---
> 
> This version of the patch sets the quality to 1.
> 
> ---
>  drivers/hid/Kconfig       |  15 ++
>  drivers/hid/Makefile      |   1 +
>  drivers/hid/hid-ids.h     |   1 +
>  drivers/hid/hid-u2fzero.c | 371 ++++++++++++++++++++++++++++++++++++++
>  4 files changed, 388 insertions(+)
>  create mode 100644 drivers/hid/hid-u2fzero.c
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 41e9935fc584..4f1b8939561d 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -989,6 +989,21 @@ config HID_UDRAW_PS3
>  	  Say Y here if you want to use the THQ uDraw gaming tablet for
>  	  the PS3.
>  
> +config HID_U2FZERO
> +	tristate "U2F Zero LED and RNG support"
> +	depends on HID
> +	depends on LEDS_CLASS
> +	help
> +	  Support for the LED of the U2F Zero device.
> +
> +	  U2F Zero supports custom commands for blinking the LED
> +	  and getting data from the internal hardware RNG.
> +	  The internal hardware can be used to feed the enthropy pool.
> +
> +	  U2F Zero only supports blinking its LED, so this driver doesn't
> +	  allow setting the brightness to anything but 1, which will
> +	  trigger a single blink and immediately reset to back 0.
> +

This driver isn't really a generic (transport-agnostic) one (which also 
means it's missing USB dependency in Kconfig btw).

Is there a reason why it can't be abstracted that way so that it'd fit our 
principal model in HID subsystem?

Also, I've looked at it really briefly, but can't it be easily implemented 
in userspace?

Thanks,

-- 
Jiri Kosina
SUSE Labs


WARNING: multiple messages have this Message-ID (diff)
From: Jiri Kosina <jikos@kernel.org>
To: Andrej Shadura <andrew.shadura@collabora.co.uk>
Cc: linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	kernel@collabora.com, Theodore Ts'o <tytso@mit.edu>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Nick Kossifidis <mickflemm@gmail.com>,
	linux-crypto@vger.kernel.org
Subject: [v2] HID: add driver for U2F Zero built-in LED and RNG
Date: Mon, 18 Mar 2019 15:44:55 +0100 (CET)	[thread overview]
Message-ID: <nycvar.YFH.7.76.1903181542260.19912@cbobk.fhfr.pm> (raw)

On Sat, 9 Mar 2019, Andrej Shadura wrote:

> U2F Zero supports custom commands for blinking the LED and getting data
> from the internal hardware RNG. Expose the blinking function as a LED
> device, and the internal hardware RNG as an HWRNG so that it can be used
> to feed the enthropy pool.
> 
> Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
> ---
> 
> This version of the patch sets the quality to 1.
> 
> ---
>  drivers/hid/Kconfig       |  15 ++
>  drivers/hid/Makefile      |   1 +
>  drivers/hid/hid-ids.h     |   1 +
>  drivers/hid/hid-u2fzero.c | 371 ++++++++++++++++++++++++++++++++++++++
>  4 files changed, 388 insertions(+)
>  create mode 100644 drivers/hid/hid-u2fzero.c
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 41e9935fc584..4f1b8939561d 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -989,6 +989,21 @@ config HID_UDRAW_PS3
>  	  Say Y here if you want to use the THQ uDraw gaming tablet for
>  	  the PS3.
>  
> +config HID_U2FZERO
> +	tristate "U2F Zero LED and RNG support"
> +	depends on HID
> +	depends on LEDS_CLASS
> +	help
> +	  Support for the LED of the U2F Zero device.
> +
> +	  U2F Zero supports custom commands for blinking the LED
> +	  and getting data from the internal hardware RNG.
> +	  The internal hardware can be used to feed the enthropy pool.
> +
> +	  U2F Zero only supports blinking its LED, so this driver doesn't
> +	  allow setting the brightness to anything but 1, which will
> +	  trigger a single blink and immediately reset to back 0.
> +

This driver isn't really a generic (transport-agnostic) one (which also 
means it's missing USB dependency in Kconfig btw).

Is there a reason why it can't be abstracted that way so that it'd fit our 
principal model in HID subsystem?

Also, I've looked at it really briefly, but can't it be easily implemented 
in userspace?

Thanks,

  reply	other threads:[~2019-03-18 14:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-09 18:32 [PATCH v2] HID: add driver for U2F Zero built-in LED and RNG Andrej Shadura
2019-03-09 18:32 ` [v2] " Andrej Shadura
2019-03-18 14:44 ` Jiri Kosina [this message]
2019-03-18 14:44   ` Jiri Kosina
2019-03-18 14:51   ` [PATCH v2] " Andrej Shadura
2019-03-18 14:51     ` [v2] " Andrej Shadura
2019-03-27 14:07     ` [PATCH v2] " Jiri Kosina
2019-03-27 14:07       ` [v2] " Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YFH.7.76.1903181542260.19912@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=anarsoul@gmail.com \
    --cc=andrew.shadura@collabora.co.uk \
    --cc=kernel@collabora.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mickflemm@gmail.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.