hw/usb: Introduce Kconfig switches for the CCID card devices
PATCH 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.
--- hw/usb/Kconfig | 10 ++++++++++ hw/usb/Makefile.objs | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
hw/usb/Kconfig +10 -0
@@ -96,3 +96,13 @@ 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 +5 -2
@@ -29,11 +29,14 @@ 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 +ifeq ($(CONFIG_SMARTCARD),y) +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 +endif ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Signature · 1 line
2.18.1
Quoted 34 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]>--- hw/usb/Kconfig | 10 ++++++++++ hw/usb/Makefile.objs | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-)hw/usb/Kconfig +10
-0@@ -96,3 +96,13 @@ 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 +0
-0
hw/usb/Makefile.objs common-obj-$(CONFIG_USB_BLUETOOTH) += dev-bluetooth.o · line 32
Quoted 6 lines
hw/usb/Makefile.objs +1
-2@@ -29,11 +29,14 @@ 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 +ifeq ($(CONFIG_SMARTCARD),y)
We don't need the 'ifeq ($(CONFIG_SMARTCARD),y)' ... endif anymore.
Quoted 11 lines
hw/usb/Makefile.objs +4
-0+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 +endif ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Quoted 35 lines · Philippe Mathieu-Daudé
Quoted 34 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]>---
hw/usb/Kconfig | 10 ++++++++++
hw/usb/Makefile.objs | 7 +++++--2 files changed, 15 insertions(+), 2 deletions(-)hw/usb/Kconfig +0
-0@@ -96,3 +96,13 @@ config USB_STORAGE_MTPbool
default y
depends on USBhw/usb/Kconfig +10
-0+ +config CCID_PASSTHRU + bool + default y + depends on USB_SMARTCARD + +config CCID_EMULATED + bool + default y + depends on USB_SMARTCARDhw/usb/Makefile.objs +0
-0@@ -29,11 +29,14 @@ common-obj-$(CONFIG_USB_BLUETOOTH) +=
Quoted 8 lines
hw/usb/Makefile.objs common-obj-$(CONFIG_USB_BLUETOOTH) += dev-bluetooth.o · line 32
Quoted 6 lines
dev-bluetooth.o
ifeq ($(CONFIG_USB_SMARTCARD),y)
common-obj-y += dev-smartcard-reader.ohw/usb/Makefile.objs +1
-2-common-obj-$(CONFIG_SMARTCARD) += smartcard.mo -smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o +ifeq ($(CONFIG_SMARTCARD),y)We don't need the 'ifeq ($(CONFIG_SMARTCARD),y)' ... endif anymore.
I think we do. Both files #include <libcacard.h> thus can only be compiled if CONFIG_SMARTCARD has been set.
Don't mix CONFIG_SMARTCARD up with CONFIG_USB_SMARTCARD - these are two different switches!
Thomas
Quoted 14 lines
Quoted 13 lines
+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
+endif
ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Quoted 45 lines · Thomas Huth
Quoted 35 lines · Philippe Mathieu-Daudé
Quoted 34 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]>--- hw/usb/Kconfig | 10 ++++++++++ hw/usb/Makefile.objs | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-)hw/usb/Kconfig +10
-0@@ -96,3 +96,13 @@ 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 +0
-0@@ -29,11 +29,14 @@ common-obj-$(CONFIG_USB_BLUETOOTH) +=Quoted 8 lines
hw/usb/Makefile.objs
Quoted 6 lines
dev-bluetooth.o
ifeq ($(CONFIG_USB_SMARTCARD),y)
common-obj-y += dev-smartcard-reader.ohw/usb/Makefile.objs +1
-2-common-obj-$(CONFIG_SMARTCARD) += smartcard.mo -smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o +ifeq ($(CONFIG_SMARTCARD),y)We don't need the 'ifeq ($(CONFIG_SMARTCARD),y)' ... endif anymore.
Quoted 4 lines
I think we do. Both files #include <
libcacard.h> thus can only be compiled ifCONFIG_SMARTCARDhas been set.
Don't mixCONFIG_SMARTCARDup withCONFIG_USB_SMARTCARD- these are two different switches!
OK I missed SMARTCARD is not in Kconfig.host.
What about adding that to your patch and remove the ifeq():
-- >8 --
Kconfig.host +3 -0
@@ -35,3 +35,6 @@ config VIRTFS config PVRDMA bool + +config SMARTCARD + bool
hw/usb/Kconfig +1 -1
@@ -90,7 +90,7 @@ config USB_BLUETOOTH config USB_SMARTCARD bool default y - depends on USB + depends on SMARTCARD && USB config USB_STORAGE_MTP bool
---
Quoted 15 lines
Quoted 14 lines
Quoted 13 lines
+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
+endif
ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o
Quoted 78 lines · Philippe Mathieu-Daudé
Quoted 45 lines · Thomas Huth
Quoted 35 lines · Philippe Mathieu-Daudé
Quoted 34 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]>---
hw/usb/Kconfig | 10 ++++++++++
hw/usb/Makefile.objs | 7 +++++--2 files changed, 15 insertions(+), 2 deletions(-)hw/usb/Kconfig +0
-0@@ -96,3 +96,13 @@ config USB_STORAGE_MTPbool
default y
depends on USBhw/usb/Kconfig +10
-0+ +config CCID_PASSTHRU + bool + default y + depends on USB_SMARTCARD + +config CCID_EMULATED + bool + default y + depends on USB_SMARTCARDhw/usb/Makefile.objs +0
-0@@ -29,11 +29,14 @@ common-obj-$(CONFIG_USB_BLUETOOTH) +=Quoted 8 lines
hw/usb/Makefile.objs
Quoted 6 lines
dev-bluetooth.o
ifeq ($(CONFIG_USB_SMARTCARD),y)
common-obj-y += dev-smartcard-reader.ohw/usb/Makefile.objs +1
-2-common-obj-$(CONFIG_SMARTCARD) += smartcard.mo -smartcard.mo-objs := ccid-card-passthru.o ccid-card-emulated.o +ifeq ($(CONFIG_SMARTCARD),y)We don't need the 'ifeq ($(CONFIG_SMARTCARD),y)' ... endif anymore.
Quoted 4 lines
I think we do. Both files #include <
libcacard.h> thus can only be compiled ifCONFIG_SMARTCARDhas been set.
Don't mixCONFIG_SMARTCARDup withCONFIG_USB_SMARTCARD- these are two different switches!OK I missed SMARTCARD is not in
Kconfig.host.What about adding that to your patch and remove the
ifeq():-- >8 --
Kconfig.host +0
-0@@ -35,3 +35,6 @@ config VIRTFSconfig PVRDMA
boolKconfig.host +3
-0+ +config SMARTCARD + boolhw/usb/Kconfig +0
-0@@ -90,7 +90,7 @@ config USB_BLUETOOTHconfig
USB_SMARTCARD
bool
default y
- depends on USB
+ depends on SMARTCARD && USB
Quoted 2 lines
config
USB_STORAGE_MTP
bool
Yes, this is a good idea.
Paolo
Quoted 18 lines
---
Quoted 15 lines
Quoted 14 lines
Quoted 13 lines
+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
+endif
ifeq ($(CONFIG_POSIX),y) common-obj-$(CONFIG_USB_STORAGE_MTP) += dev-mtp.o