hw/usb: add configuration flags for emulated and passthru usb smartcard
PATCH 1/1 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 two functionalities.
--- hw/usb/Kconfig | 12 ++++++++++++ hw/usb/meson.build | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-)
hw/usb/Kconfig +12 -0
@@ -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
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
Hi
Quoted 16 lines · Jon Maloy
We add two new configuration flags,
USB_SMARTCARD_PASSTHRUandUSB_SMARTCARD_EMULATEDin order to improve configurability of these two functionalities.Signed-off-by Jon Maloy <[email protected]>--- hw/usb/Kconfig | 12 ++++++++++++ hw/usb/meson.build | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-)hw/usb/Kconfig +0
-0
hw/usb/Kconfig config USB_SMARTCARD · line 117
Quoted 10 lines
hw/usb/Kconfig +7
-0@@ -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
Quoted 27 lines
hw/usb/Kconfig +5
-0+ +config USB_SMARTCARD_EMULATED + bool + default y + depends on USB config USB_STORAGE_MTP boolhw/usb/meson.build +2
-3@@ -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
Signature · 1 line
Marc-André Lureau
Il mer 23 nov 2022, 08:59 Marc-André Lureau <[email protected]> ha scritto:
Quoted 10 lines
config
USB_SMARTCARD_PASSTHRU
bool
default y
selectUSB_SMARTCARDconfig
USB_SMARTCARD_EMULATED
bool
default y
selectUSB_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
Quoted 38 lines
hw/usb/meson.build softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true:
Quoted 14 lines
hw/usb/Kconfig +5
-0+ +config USB_SMARTCARD_EMULATED + bool + default y + depends on USB config USB_STORAGE_MTP boolhw/usb/meson.build +0
-0@@ -51,8 +51,8 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true:files('dev-smartcard-reade
hw/usb/meson.build softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade
Quoted 5 lines
hw/usb/meson.build +0
-2if 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')])hw/usb/meson.build softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: · line 53
Quoted 1 line
hw/usb/meson.build +1
-0+ usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_EMULATED', if_true:[cacard, files('ccid-card-emulated.c')])
hw/usb/meson.build softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: · line 54
Quoted 1 line
hw/usb/meson.build +1
-0+ usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD_PASSTHRU', if_true:[cacard, files('ccid-card-passthru.c')])
Quoted 7 lines
hw/usb/meson.build +0
-1hw_usb_modules += {'smartcard': usbsmartcard_ss} endif --2.35.3
--
Marc-André Lureau