hw/usb: Introduce Kconfig switches for the CCID card devices
PATCH v2 1/1 hw/usb: Introduce Kconfig switches for the CCID card devices
In our downstream distribution of QEMU, we need more fine-grained control on the set of CCID card devices that we want to include. So let's introduce some proper Kconfig switches that it is easier to disable them without modifying the corresponding Makefile.objs.
---
v2: Use CONFIG_SMARTCARD in Kconfig.host as suggested by Philippe
Kconfig.host | 3 +++ Makefile | 3 ++- hw/usb/Kconfig | 12 +++++++++++- hw/usb/Makefile.objs | 9 ++++----- 4 files changed, 20 insertions(+), 7 deletions(-)
Kconfig.host +3 -0
@@ -35,3 +35,6 @@ config VIRTFS config PVRDMA bool + +config SMARTCARD + bool
Makefile +2 -1
@@ -388,7 +388,8 @@ MINIKCONF_ARGS = \ CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \ CONFIG_VIRTFS=$(CONFIG_VIRTFS) \ CONFIG_LINUX=$(CONFIG_LINUX) \ - CONFIG_PVRDMA=$(CONFIG_PVRDMA) + CONFIG_PVRDMA=$(CONFIG_PVRDMA) \ + CONFIG_SMARTCARD=$(CONFIG_SMARTCARD) MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig \ $(wildcard $(SRC_PATH)/hw/*/Kconfig)
hw/usb/Kconfig +11 -1
@@ -90,9 +90,19 @@ config USB_BLUETOOTH config USB_SMARTCARD bool default y - depends on USB + depends on USB && SMARTCARD config USB_STORAGE_MTP bool default y depends on USB + +config CCID_PASSTHRU + bool + default y + depends on USB_SMARTCARD + +config CCID_EMULATED + bool + default y + depends on USB_SMARTCARD
hw/usb/Makefile.objs +4 -5
@@ -27,13 +27,12 @@ common-obj-$(CONFIG_USB_SERIAL) += dev-serial.o common-obj-$(CONFIG_USB_NETWORK) += dev-network.o common-obj-$(CONFIG_USB_BLUETOOTH) += dev-bluetooth.o -ifeq ($(CONFIG_USB_SMARTCARD),y) -common-obj-y += dev-smartcard-reader.o -common-obj-$(CONFIG_SMARTCARD) += smartcard.mo -smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o +common-obj-$(CONFIG_USB_SMARTCARD) += dev-smartcard-reader.o +common-obj-$(call lor,$(CONFIG_CCID_PASSTHRU),$(CONFIG_CCID_EMULATED)) += smartcard.mo +smartcard.mo-objs := $(call lif,$(CONFIG_CCID_PASSTHRU),ccid-card-passthru.o) \ + $(call lif,$(CONFIG_CCID_EMULATED),ccid-card-emulated.o) smartcard.mo-cflags := $(SMARTCARD_CFLAGS) smartcard.mo-libs := $(SMARTCARD_LIBS) -endif ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Signature · 1 line
2.18.1
Quoted 31 lines · Thomas Huth
In our downstream distribution of QEMU, we need more fine-grained control on the set of CCID card devices that we want to include. So let's introduce some proper
Kconfigswitches that it is easier to disable them without modifying the corresponding Makefile.objs.Signed-off-by Thomas Huth <[email protected]>---
v2: UseCONFIG_SMARTCARDinKconfig.hostas suggested by PhilippeKconfig.host | 3 +++ Makefile | 3 ++- hw/usb/Kconfig | 12 +++++++++++- hw/usb/Makefile.objs | 9 ++++----- 4 files changed, 20 insertions(+), 7 deletions(-)Kconfig.host +3
-0@@ -35,3 +35,6 @@ config VIRTFS config PVRDMA bool + +config SMARTCARD + boolMakefile +0
-0
Makefile MINIKCONF_ARGS = \ · line 392
Quoted 6 lines
Makefile +2
-1@@ -388,7 +388,8 @@ MINIKCONF_ARGS = \ CONFIG_VHOST_USER=$(CONFIG_VHOST_USER) \ CONFIG_VIRTFS=$(CONFIG_VIRTFS) \ CONFIG_LINUX=$(CONFIG_LINUX) \ - CONFIG_PVRDMA=$(CONFIG_PVRDMA) + CONFIG_PVRDMA=$(CONFIG_PVRDMA) \ + CONFIG_SMARTCARD=$(CONFIG_SMARTCARD)
Oh I missed this detail :)
Quoted 51 lines
Makefile +0
-0MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig \ $(wildcard $(SRC_PATH)/hw/*/Kconfig)hw/usb/Kconfig +11
-1@@ -90,9 +90,19 @@ config USB_BLUETOOTH config USB_SMARTCARD bool default y - depends on USB + depends on USB && SMARTCARD config USB_STORAGE_MTP bool default y depends on USB + +config CCID_PASSTHRU + bool + default y + depends on USB_SMARTCARD + +config CCID_EMULATED + bool + default y + depends on USB_SMARTCARDhw/usb/Makefile.objs +4
-5@@ -27,13 +27,12 @@ common-obj-$(CONFIG_USB_SERIAL) += dev-serial.o common-obj-$(CONFIG_USB_NETWORK) += dev-network.o common-obj-$(CONFIG_USB_BLUETOOTH) += dev-bluetooth.o -ifeq ($(CONFIG_USB_SMARTCARD),y) -common-obj-y += dev-smartcard-reader.o -common-obj-$(CONFIG_SMARTCARD) += smartcard.mo -smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o +common-obj-$(CONFIG_USB_SMARTCARD) += dev-smartcard-reader.o +common-obj-$(call lor,$(CONFIG_CCID_PASSTHRU),$(CONFIG_CCID_EMULATED)) += smartcard.mo +smartcard.mo-objs := $(call lif,$(CONFIG_CCID_PASSTHRU),ccid-card-passthru.o) \ + $(call lif,$(CONFIG_CCID_EMULATED),ccid-card-emulated.o) smartcard.mo-cflags := $(SMARTCARD_CFLAGS) smartcard.mo-libs := $(SMARTCARD_LIBS) -endif ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Quoted 6 lines · Thomas Huth
In our downstream distribution of QEMU, we need more fine-grained control on the set of CCID card devices that we want to include. So let's introduce some proper
Kconfigswitches that it is easier to disable them without modifying the corresponding Makefile.objs.Signed-off-by Thomas Huth <[email protected]>
Added to usb queue.
thanks,
Gerd
Quoted 9 lines · Gerd Hoffmann
Quoted 6 lines · Thomas Huth
In our downstream distribution of QEMU, we need more fine-grained control on the set of CCID card devices that we want to include. So let's introduce some proper
Kconfigswitches that it is easier to disable them without modifying the corresponding Makefile.objs.Signed-off-by Thomas Huth <[email protected]>Added to usb queue.
Oops, this patch breaks "make check" on openbsd (make TARGET_LIST=x86_64-softmmu vm-build-openbsd). Unqueued.
cheers,
Gerd
Quoted 7 lines · Gerd Hoffmann
Quoted 6 lines · Gerd Hoffmann
Quoted 5 lines · Thomas Huth
In our downstream distribution of QEMU, we need more fine-grained control on the set of CCID card devices that we want to include. So let's introduce some proper
Kconfigswitches that it is easier to disable them without modifying the corresponding Makefile.objs.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Thomas Huth <[email protected]>Added to usb queue.
Oops, this patch breaks "make check" on openbsd (make TARGET_LIST=x86_64-softmmu vm-build-openbsd). Unqueued.
Sorry, I missed that tests/qtest/usb-hcd-xhci-test.c uses the "usb-ccid" device ... I'll fix my patch and send a v3.
Thomas