hw/usb: add configuration flags for emulated and passthru usb smartcard
v3 cover hw/usb: add configuration flags for emulated and passthru usb smartcard
We add three new configuration flags, LIBCACARD, USB_SMARTCARD_PASSTHRU and USB_SMARTCARD_EMULATED in order to improve configurability of these functionalities.
---
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(-)
Signature · 1 line
2.35.3
PATCH v3 1/2 hw/usb: add configuration flags for emulated and passthru usb smartcard
We add two new configuration flags, USB_SMARTCARD_PASSTHRU and USB_SMARTCARD_EMULATED in order to improve configurability of these functionalities.
--- hw/usb/Kconfig | 12 ++++++++++++ hw/usb/meson.build | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-)
hw/usb/Kconfig +12 -0
@@ -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
hw/usb/meson.build +2 -2
@@ -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
Signature · 1 line
2.35.3
PATCH v3 2/2 hw/usb: add configuration flag for Common Access Card library code
In reply to Jon MaloyWe 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.
--- Kconfig.host | 3 +++ hw/usb/Kconfig | 2 ++ hw/usb/meson.build | 11 ++++------- meson.build | 1 + 4 files changed, 10 insertions(+), 7 deletions(-)
Kconfig.host +3 -0
@@ -39,6 +39,9 @@ config MULTIPROCESS_ALLOWED bool imply MULTIPROCESS +config LIBCACARD + bool + config FUZZ bool select SPARSE_MEM
hw/usb/Kconfig +2 -0
@@ -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
hw/usb/meson.build +4 -7
@@ -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'))
meson.build +1 -0
@@ -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'] : []) + \
Signature · 1 line
2.35.3
Quoted 8 lines · Jon Maloy
We add three new configuration flags, LIBCACARD,
USB_SMARTCARD_PASSTHRUandUSB_SMARTCARD_EMULATEDin 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:
Quoted 19 lines · Jon Maloy
We add three new configuration flags, LIBCACARD,
USB_SMARTCARD_PASSTHRUandUSB_SMARTCARD_EMULATEDin order to improve configurability of these functionalities.Signed-off-by Jon Maloy <[email protected]>---
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
Quoted 9 lines
Kconfig.host | 3 +++ hw/usb/Kconfig | 14 ++++++++++++++ hw/usb/meson.build | 11 ++++------- meson.build | 1 + 4 files changed, 22 insertions(+), 7 deletions(-)Signature · 1 line
2.35.3
I have CCed Gerd Hoffmann since he is the hw/usb/ maintainer.
Quoted 26 lines · Stefan Hajnoczi
Quoted 25 lines · Jon Maloy
We add three new configuration flags, LIBCACARD,
USB_SMARTCARD_PASSTHRUandUSB_SMARTCARD_EMULATEDin order to improve configurability of these functionalities.Signed-off-by Jon Maloy <[email protected]>---
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 codeKconfig.host | 3 +++ hw/usb/Kconfig | 14 ++++++++++++++ hw/usb/meson.build | 11 ++++------- meson.build | 1 + 4 files changed, 22 insertions(+), 7 deletions(-)
Quoted 6 lines
Quoted 3 lines
Signature · 1 line
2.35.3I have CCed Gerd Hoffmann since he is the hw/usb/ maintainer.
Reviewed-by Stefan Hajnoczi <[email protected]>
Hi Gerd,
It seems this one was forgotten, and never applied. Could you have a look?
Thanks
///jon