[PATCH v3 1/2] hw/usb: add configuration flags for emulated and passthru usb smartcard

Jon Maloy posted 2 patches 3 years, 1 month ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
[PATCH v3 1/2] hw/usb: add configuration flags for emulated and passthru usb smartcard
Posted by Jon Maloy 3 years, 1 month ago
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