xref: /qemu/hw/usb/meson.build (revision f41af4c5857b6983766aaffc041580ff170d0679)
106677ce1SPaolo Bonzinihw_usb_modules = {}
206677ce1SPaolo Bonzini
306677ce1SPaolo Bonzini# usb subsystem core
4de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB', if_true: files(
506677ce1SPaolo Bonzini  'bus.c',
606677ce1SPaolo Bonzini  'combined-packet.c',
706677ce1SPaolo Bonzini  'core.c',
806677ce1SPaolo Bonzini  'desc.c',
906677ce1SPaolo Bonzini  'desc-msos.c',
109c3c834bSPhilippe Mathieu-Daudé  'libhw.c',
119c3c834bSPhilippe Mathieu-Daudé  'pcap.c',
1289857312SPaolo Bonzini), if_false: files('bus-stub.c'))
1306677ce1SPaolo Bonzini
1406677ce1SPaolo Bonzini# usb host adapters
15de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
16de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
17de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
1815f07fb8SPaolo Bonzinisystem_ss.add(when: 'CONFIG_USB_OHCI_SYSBUS', if_true: files('hcd-ohci-sysbus.c'))
19de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
20de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
21fa4fa205SPaolo Bonzinisystem_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci-sysbus.c'))
22de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
23de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c'))
24de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sysbus.c'))
25de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
26de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
27de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c'))
28*464ce71aSBernhard Beschowsystem_ss.add(when: 'CONFIG_USB_CHIPIDEA', if_true: files('chipidea.c'))
2906677ce1SPaolo Bonzini
30de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
31de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.c'))
32de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c'))
33de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c'))
3406677ce1SPaolo Bonzini
3506677ce1SPaolo Bonzini# emulated usb devices
367c239764SGerd Hoffmannsystem_ss.add(when: 'CONFIG_USB_HUB', if_true: files('dev-hub.c'))
377c239764SGerd Hoffmannsystem_ss.add(when: 'CONFIG_USB_HID', if_true: files('dev-hid.c'))
38de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
39de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_CORE', if_true: files('dev-storage.c'))
40de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c'))
41de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_CLASSIC', if_true: files('dev-storage-classic.c'))
42de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
43de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
44de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
45de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
46d0cda6f4SPaolo Bonziniif host_os != 'windows'
47dc495494SPaolo Bonzini  system_ss.add(when: 'CONFIG_USB_STORAGE_MTP', if_true: files('dev-mtp.c'))
48dc495494SPaolo Bonziniendif
4906677ce1SPaolo Bonzini
5006677ce1SPaolo Bonzini# smartcard
51de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
5206677ce1SPaolo Bonzini
535f364c57SPaolo Bonziniif cacard.found()
5406677ce1SPaolo Bonzini  usbsmartcard_ss = ss.source_set()
5506677ce1SPaolo Bonzini  usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
5606677ce1SPaolo Bonzini                      if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
5706677ce1SPaolo Bonzini  hw_usb_modules += {'smartcard': usbsmartcard_ss}
5806677ce1SPaolo Bonziniendif
5906677ce1SPaolo Bonzini
600a40bcb7SCésar Belley# U2F
61de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
62d0cda6f4SPaolo Bonziniif host_os == 'linux'
6353e8868dSPaolo Bonzini  system_ss.add(when: 'CONFIG_USB_U2F', if_true: [libudev, files('u2f-passthru.c')])
6453e8868dSPaolo Bonziniendif
650a40bcb7SCésar Belleyif u2f.found()
66de6cd759SPhilippe Mathieu-Daudé  system_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
670a40bcb7SCésar Belleyendif
680a40bcb7SCésar Belley
698caef850SHongren (Zenithal) Zheng# CanoKey
708caef850SHongren (Zenithal) Zhengif canokey.found()
71de6cd759SPhilippe Mathieu-Daudé  system_ss.add(when: 'CONFIG_USB_CANOKEY', if_true: [canokey, files('canokey.c')])
728caef850SHongren (Zenithal) Zhengendif
738caef850SHongren (Zenithal) Zheng
7406677ce1SPaolo Bonzini# usb redirect
7518f31e60SPaolo Bonziniif usbredir.found()
7606677ce1SPaolo Bonzini  usbredir_ss = ss.source_set()
7706677ce1SPaolo Bonzini  usbredir_ss.add(when: 'CONFIG_USB',
7806677ce1SPaolo Bonzini                  if_true: [usbredir, files('redirect.c', 'quirks.c')])
7906677ce1SPaolo Bonzini  hw_usb_modules += {'redirect': usbredir_ss}
8006677ce1SPaolo Bonziniendif
8106677ce1SPaolo Bonzini
8206677ce1SPaolo Bonzini# usb pass-through
83670b3591SGerd Hoffmannif libusb.found()
84627302afSGerd Hoffmann  usbhost_ss = ss.source_set()
85627302afSGerd Hoffmann  usbhost_ss.add(when: ['CONFIG_USB', libusb],
86f1a74bf9SGerd Hoffmann                 if_true: files('host-libusb.c'))
87627302afSGerd Hoffmann  hw_usb_modules += {'host': usbhost_ss}
88627302afSGerd Hoffmannendif
8906677ce1SPaolo Bonzini
90de6cd759SPhilippe Mathieu-Daudésystem_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN_BUS', libusb], if_true: files('xen-usb.c'))
9106677ce1SPaolo Bonzini
9206677ce1SPaolo Bonzinimodules += { 'hw-usb': hw_usb_modules }
93