All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard
@ 2022-12-12 22:09 Jon Maloy
  2022-12-12 22:09 ` [PATCH v3 1/2] " Jon Maloy
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Jon Maloy @ 2022-12-12 22:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, pbonzini, jmaloy, jasowang, philmd, stefanha

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

Signed-off-by: Jon Maloy <jmaloy@redhat.com>

---
v2: Added a LIBACARD flag, plus reversed 'select' clauses, as suggested
    by Paolo Bonzini and Marc-André Lureau.

v3: Split in two commits, so that LIBCACARD is added separately, as suggested
    by Philippe Mathieu-Daudé.


Jon Maloy (2):
  hw/usb: add configuration flags for emulated and passthru usb
    smartcard
  hw/usb: add configuration flag for Common Access Card library code

 Kconfig.host       |  3 +++
 hw/usb/Kconfig     | 14 ++++++++++++++
 hw/usb/meson.build | 11 ++++-------
 meson.build        |  1 +
 4 files changed, 22 insertions(+), 7 deletions(-)

-- 
2.35.3



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

* [PATCH v3 1/2] hw/usb: add configuration flags for emulated and passthru usb smartcard
  2022-12-12 22:09 [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
@ 2022-12-12 22:09 ` Jon Maloy
  2022-12-12 22:09 ` [PATCH v3 2/2] hw/usb: add configuration flag for Common Access Card library code Jon Maloy
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jon Maloy @ 2022-12-12 22:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, pbonzini, jmaloy, jasowang, philmd, stefanha

We add two new configuration flags, USB_SMARTCARD_PASSTHRU and
USB_SMARTCARD_EMULATED in order to improve configurability of these
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..6b29e91593 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -109,6 +109,18 @@ config USB_SMARTCARD
     default y
     depends on USB
 
+config USB_SMARTCARD_PASSTHRU
+    bool
+    default y
+    depends on USB
+    select USB_SMARTCARD
+
+config USB_SMARTCARD_EMULATED
+    bool
+    default y
+    depends on USB
+    select USB_SMARTCARD
+
 config USB_STORAGE_MTP
     bool
     default y
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] 6+ messages in thread

* [PATCH v3 2/2] hw/usb: add configuration flag for Common Access Card library code
  2022-12-12 22:09 [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
  2022-12-12 22:09 ` [PATCH v3 1/2] " Jon Maloy
@ 2022-12-12 22:09 ` Jon Maloy
  2022-12-12 22:13 ` [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Philippe Mathieu-Daudé
  2022-12-13 21:02 ` Stefan Hajnoczi
  3 siblings, 0 replies; 6+ messages in thread
From: Jon Maloy @ 2022-12-12 22:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, pbonzini, jmaloy, jasowang, philmd, stefanha

We add a new configuration flag, LIBCACARD, indicating availability of the
libcacard code for building. This way, we can eliminate the explicit test
for cacard.found() when configuring USB_SMARTCARD_EMULATED/USB_SMARTCARD_PASSTHRU
in hw/usb/meson.build.

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
---
 Kconfig.host       |  3 +++
 hw/usb/Kconfig     |  2 ++
 hw/usb/meson.build | 11 ++++-------
 meson.build        |  1 +
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Kconfig.host b/Kconfig.host
index d763d89269..d7fd4a2203 100644
--- a/Kconfig.host
+++ b/Kconfig.host
@@ -39,6 +39,9 @@ config MULTIPROCESS_ALLOWED
     bool
     imply MULTIPROCESS
 
+config LIBCACARD
+    bool
+
 config FUZZ
     bool
     select SPARSE_MEM
diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig
index 6b29e91593..5c3da7c34d 100644
--- a/hw/usb/Kconfig
+++ b/hw/usb/Kconfig
@@ -113,12 +113,14 @@ config USB_SMARTCARD_PASSTHRU
     bool
     default y
     depends on USB
+    depends on LIBCACARD
     select USB_SMARTCARD
 
 config USB_SMARTCARD_EMULATED
     bool
     default y
     depends on USB
+    depends on LIBCACARD
     select USB_SMARTCARD
 
 config USB_STORAGE_MTP
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 353006fb6c..499be1122c 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -48,13 +48,10 @@ softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files(
 
 # smartcard
 softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
-
-if cacard.found()
-  usbsmartcard_ss = ss.source_set()
-  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
+usbsmartcard_ss = ss.source_set()
+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}
 
 # U2F
 softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
diff --git a/meson.build b/meson.build
index 5c6b5a1c75..10e9b77ec1 100644
--- a/meson.build
+++ b/meson.build
@@ -2493,6 +2493,7 @@ have_ivshmem = config_host_data.get('CONFIG_EVENTFD')
 host_kconfig = \
   (get_option('fuzzing') ? ['CONFIG_FUZZ=y'] : []) + \
   (have_tpm ? ['CONFIG_TPM=y'] : []) + \
+  (cacard.found() ? ['CONFIG_LIBCACARD=y'] : []) + \
   (spice.found() ? ['CONFIG_SPICE=y'] : []) + \
   (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
   (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \
-- 
2.35.3



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

* Re: [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard
  2022-12-12 22:09 [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
  2022-12-12 22:09 ` [PATCH v3 1/2] " Jon Maloy
  2022-12-12 22:09 ` [PATCH v3 2/2] hw/usb: add configuration flag for Common Access Card library code Jon Maloy
@ 2022-12-12 22:13 ` Philippe Mathieu-Daudé
  2022-12-13 21:02 ` Stefan Hajnoczi
  3 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-12 22:13 UTC (permalink / raw)
  To: Jon Maloy, qemu-devel
  Cc: marcandre.lureau, pbonzini, jasowang, philmd, stefanha

On 12/12/22 23:09, Jon Maloy wrote:
> We add three new configuration flags, LIBCACARD, USB_SMARTCARD_PASSTHRU
> and USB_SMARTCARD_EMULATED in order to improve configurability of these
> functionalities.

> Jon Maloy (2):
>    hw/usb: add configuration flags for emulated and passthru usb
>      smartcard
>    hw/usb: add configuration flag for Common Access Card library code

Series:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



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

* Re: [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard
  2022-12-12 22:09 [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
                   ` (2 preceding siblings ...)
  2022-12-12 22:13 ` [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Philippe Mathieu-Daudé
@ 2022-12-13 21:02 ` Stefan Hajnoczi
  2023-01-19 23:47   ` Jon Maloy
  3 siblings, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2022-12-13 21:02 UTC (permalink / raw)
  To: Jon Maloy
  Cc: qemu-devel, marcandre.lureau, pbonzini, jasowang, philmd, kraxel

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

On Mon, Dec 12, 2022 at 05:09:47PM -0500, Jon Maloy wrote:
> We add three new configuration flags, LIBCACARD, USB_SMARTCARD_PASSTHRU
> and USB_SMARTCARD_EMULATED in order to improve configurability of these
> functionalities.
> 
> Signed-off-by: Jon Maloy <jmaloy@redhat.com>
> 
> ---
> v2: Added a LIBACARD flag, plus reversed 'select' clauses, as suggested
>     by Paolo Bonzini and Marc-André Lureau.
> 
> v3: Split in two commits, so that LIBCACARD is added separately, as suggested
>     by Philippe Mathieu-Daudé.
> 
> 
> Jon Maloy (2):
>   hw/usb: add configuration flags for emulated and passthru usb
>     smartcard
>   hw/usb: add configuration flag for Common Access Card library code
> 
>  Kconfig.host       |  3 +++
>  hw/usb/Kconfig     | 14 ++++++++++++++
>  hw/usb/meson.build | 11 ++++-------
>  meson.build        |  1 +
>  4 files changed, 22 insertions(+), 7 deletions(-)
> 
> -- 
> 2.35.3
> 

I have CCed Gerd Hoffmann since he is the hw/usb/ maintainer.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard
  2022-12-13 21:02 ` Stefan Hajnoczi
@ 2023-01-19 23:47   ` Jon Maloy
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Maloy @ 2023-01-19 23:47 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: qemu-devel, marcandre.lureau, pbonzini, jasowang, philmd,
	Stefan Hajnoczi



On 2022-12-13 16:02, Stefan Hajnoczi wrote:
> On Mon, Dec 12, 2022 at 05:09:47PM -0500, Jon Maloy wrote:
>> We add three new configuration flags, LIBCACARD, USB_SMARTCARD_PASSTHRU
>> and USB_SMARTCARD_EMULATED in order to improve configurability of these
>> functionalities.
>>
>> Signed-off-by: Jon Maloy <jmaloy@redhat.com>
>>
>> ---
>> v2: Added a LIBACARD flag, plus reversed 'select' clauses, as suggested
>>      by Paolo Bonzini and Marc-André Lureau.
>>
>> v3: Split in two commits, so that LIBCACARD is added separately, as suggested
>>      by Philippe Mathieu-Daudé.
>>
>>
>> Jon Maloy (2):
>>    hw/usb: add configuration flags for emulated and passthru usb
>>      smartcard
>>    hw/usb: add configuration flag for Common Access Card library code
>>
>>   Kconfig.host       |  3 +++
>>   hw/usb/Kconfig     | 14 ++++++++++++++
>>   hw/usb/meson.build | 11 ++++-------
>>   meson.build        |  1 +
>>   4 files changed, 22 insertions(+), 7 deletions(-)
>>
>> -- 
>> 2.35.3
>>
> I have CCed Gerd Hoffmann since he is the hw/usb/ maintainer.
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Hi Gerd,
It seems this one was forgotten, and never applied.
Could you have a look?

Thanks
///jon



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

end of thread, other threads:[~2023-01-19 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 22:09 [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Jon Maloy
2022-12-12 22:09 ` [PATCH v3 1/2] " Jon Maloy
2022-12-12 22:09 ` [PATCH v3 2/2] hw/usb: add configuration flag for Common Access Card library code Jon Maloy
2022-12-12 22:13 ` [PATCH v3 0/2] hw/usb: add configuration flags for emulated and passthru usb smartcard Philippe Mathieu-Daudé
2022-12-13 21:02 ` Stefan Hajnoczi
2023-01-19 23:47   ` Jon Maloy

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.