qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/usb: add configuration flags for emulated and passthru usb smartcard
@ 2022-11-23  2:18 Jon Maloy
  2022-11-23  7:59 ` Marc-André Lureau
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Maloy @ 2022-11-23  2:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: jmaloy, jasowang, philmd, stefanha

We add two new configuration flags, USB_SMARTCARD_PASSTHRU and
USB_SMARTCARD_EMULATED in order to improve configurability
of these two functionalities.

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
---
 hw/usb/Kconfig     | 12 ++++++++++++
 hw/usb/meson.build |  4 ++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index ce4f433976..50a82badd6 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -108,6 +108,18 @@ config USB_SMARTCARD
     bool
     default y
     depends on USB
+    select USB_SMARTCARD_PASSTHRU
+    select USB_SMARTCARD_EMULATED
+
+config USB_SMARTCARD_PASSTHRU
+    bool
+    default y
+    depends on USB
+
+config USB_SMARTCARD_EMULATED
+    bool
+    default y
+    depends on USB
 
 config USB_STORAGE_MTP
     bool
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 793df42e21..353006fb6c 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -51,8 +51,8 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade
 
 if cacard.found()
   usbsmartcard_ss = ss.source_set()
-  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
-                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
+  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true: [cacard, files('ccid-card-emulated.c')])
+  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true: [cacard, files('ccid-card-passthru.c')])
   hw_usb_modules += {'smartcard': usbsmartcard_ss}
 endif
 
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/usb: add configuration flags for emulated and passthru usb smartcard
  2022-11-23  2:18 [PATCH] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
@ 2022-11-23  7:59 ` Marc-André Lureau
  2022-11-24  7:09   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Marc-André Lureau @ 2022-11-23  7:59 UTC (permalink / raw)
  To: Jon Maloy; +Cc: qemu-devel, jasowang, philmd, stefanha, Paolo Bonzini

Hi

On Wed, Nov 23, 2022 at 6:21 AM Jon Maloy <jmaloy@redhat.com> wrote:
>
> We add two new configuration flags, USB_SMARTCARD_PASSTHRU and
> USB_SMARTCARD_EMULATED in order to improve configurability
> of these two functionalities.
>
> Signed-off-by: Jon Maloy <jmaloy@redhat.com>
> ---
>  hw/usb/Kconfig     | 12 ++++++++++++
>  hw/usb/meson.build |  4 ++--
>  2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
> index ce4f433976..50a82badd6 100644
> --- a/hw/usb/Kconfig
> +++ b/hw/usb/Kconfig
> @@ -108,6 +108,18 @@ config USB_SMARTCARD
>      bool
>      default y
>      depends on USB
> +    select USB_SMARTCARD_PASSTHRU
> +    select USB_SMARTCARD_EMULATED
> +
> +config USB_SMARTCARD_PASSTHRU
> +    bool
> +    default y
> +    depends on USB

Wouldn't this be better instead? (I don't think USB_SMARTCARD should
select PASSTHRU & EMULATED, but rather be selected for common shared
code)

config USB_SMARTCARD
    bool
    depends on USB

config USB_SMARTCARD_PASSTHRU
    bool
    default y
    select USB_SMARTCARD

config USB_SMARTCARD_EMULATED
    bool
    default y
    select USB_SMARTCARD


> +
> +config USB_SMARTCARD_EMULATED
> +    bool
> +    default y
> +    depends on USB
>
>  config USB_STORAGE_MTP
>      bool
> diff --git a/hw/usb/meson.build b/hw/usb/meson.build
> index 793df42e21..353006fb6c 100644
> --- a/hw/usb/meson.build
> +++ b/hw/usb/meson.build
> @@ -51,8 +51,8 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade
>
>  if cacard.found()
>    usbsmartcard_ss = ss.source_set()
> -  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
> -                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
> +  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true: [cacard, files('ccid-card-emulated.c')])
> +  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true: [cacard, files('ccid-card-passthru.c')])
>    hw_usb_modules += {'smartcard': usbsmartcard_ss}
>  endif
>
> --
> 2.35.3
>
>


-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/usb: add configuration flags for emulated and passthru usb smartcard
  2022-11-23  7:59 ` Marc-André Lureau
@ 2022-11-24  7:09   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-11-24  7:09 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: Jon Maloy, qemu-devel, Wang, Jason, philmd, Hajnoczi, Stefan

[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]

Il mer 23 nov 2022, 08:59 Marc-André Lureau <marcandre.lureau@gmail.com> ha
scritto:

> config USB_SMARTCARD_PASSTHRU
>     bool
>     default y
>     select USB_SMARTCARD
>
> config USB_SMARTCARD_EMULATED
>     bool
>     default y
>     select USB_SMARTCARD
>

Yes, this is the way. (TM)

Also, you should add a "config LIBCACARD" (resp. "CONFIG_LIBCACARD=y")
symbol to Kconfig.host and the root meson.build, so that you can make these
symbols "depends on CACARD" and remove the "if cacard.found()" below.

Paolo


>
> > +
> > +config USB_SMARTCARD_EMULATED
> > +    bool
> > +    default y
> > +    depends on USB
> >
> >  config USB_STORAGE_MTP
> >      bool
> > diff --git a/hw/usb/meson.build b/hw/usb/meson.build
> > index 793df42e21..353006fb6c 100644
> > --- a/hw/usb/meson.build
> > +++ b/hw/usb/meson.build
> > @@ -51,8 +51,8 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true:
> files('dev-smartcard-reade
> >
> >  if cacard.found()
> >    usbsmartcard_ss = ss.source_set()
> > -  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
> > -                      if_true: [cacard, files('ccid-card-emulated.c',
> 'ccid-card-passthru.c')])
> > +  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true:
> [cacard, files('ccid-card-emulated.c')])
> > +  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true:
> [cacard, files('ccid-card-passthru.c')])
> >    hw_usb_modules += {'smartcard': usbsmartcard_ss}
> >  endif
> >
> > --
> > 2.35.3
> >
> >
>
>
> --
> Marc-André Lureau
>
>

[-- Attachment #2: Type: text/html, Size: 2499 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-24  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-23  2:18 [PATCH] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
2022-11-23  7:59 ` Marc-André Lureau
2022-11-24  7:09   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).