106677ce1SPaolo Bonzinihw_usb_modules = {} 206677ce1SPaolo Bonzini 306677ce1SPaolo Bonzini# usb subsystem core 406677ce1SPaolo Bonzinisoftmmu_ss.add(files( 506677ce1SPaolo Bonzini 'bus.c', 606677ce1SPaolo Bonzini 'combined-packet.c', 706677ce1SPaolo Bonzini 'core.c', 80f6dba14SGerd Hoffmann 'pcap.c', 906677ce1SPaolo Bonzini 'libhw.c' 1006677ce1SPaolo Bonzini)) 1106677ce1SPaolo Bonzini 1206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files( 1306677ce1SPaolo Bonzini 'desc.c', 1406677ce1SPaolo Bonzini 'desc-msos.c', 1506677ce1SPaolo Bonzini)) 1606677ce1SPaolo Bonzini 1706677ce1SPaolo Bonzini# usb host adapters 1806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c')) 1906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c')) 2006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c')) 2106677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c')) 2206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c')) 2306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 'hcd-ehci-sysbus.c')) 2406677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c')) 25755fba11SSai Pavan Boddusoftmmu_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c')) 26f00ff136SSai Pavan Boddusoftmmu_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sysbus.c')) 2706677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c')) 2806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c')) 2906677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c')) 308bbe61f3SVikram Garhwalsoftmmu_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c')) 3106677ce1SPaolo Bonzini 3206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c')) 3306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c')) 3406677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c')) 356f2bcd5fSPhilippe Mathieu-Daudésoftmmu_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.c')) 3650e76a73SSai Pavan Bodduspecific_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c')) 37e29c7db1SSai Pavan Bodduspecific_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c')) 3806677ce1SPaolo Bonzini 3906677ce1SPaolo Bonzini# emulated usb devices 4006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c')) 4106677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c')) 4206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c')) 4306677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage.c')) 44*31b7bed8SGerd Hoffmannsoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c')) 4506677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c')) 4606677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c')) 4706677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c')) 4806677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c')) 4906677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c')) 5006677ce1SPaolo Bonzini 5106677ce1SPaolo Bonzini# smartcard 5206677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c')) 5306677ce1SPaolo Bonzini 5406677ce1SPaolo Bonziniif config_host.has_key('CONFIG_SMARTCARD') 5506677ce1SPaolo Bonzini usbsmartcard_ss = ss.source_set() 5606677ce1SPaolo Bonzini usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD', 5706677ce1SPaolo Bonzini if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')]) 5806677ce1SPaolo Bonzini hw_usb_modules += {'smartcard': usbsmartcard_ss} 5906677ce1SPaolo Bonziniendif 6006677ce1SPaolo Bonzini 610a40bcb7SCésar Belley# U2F 620a40bcb7SCésar Belleysoftmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c')) 63d7c1523fSCésar Belleysoftmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')]) 640a40bcb7SCésar Belleyif u2f.found() 650a40bcb7SCésar Belley softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')]) 660a40bcb7SCésar Belleyendif 670a40bcb7SCésar Belley 6806677ce1SPaolo Bonzini# usb redirect 6906677ce1SPaolo Bonziniif config_host.has_key('CONFIG_USB_REDIR') 7006677ce1SPaolo Bonzini usbredir_ss = ss.source_set() 7106677ce1SPaolo Bonzini usbredir_ss.add(when: 'CONFIG_USB', 7206677ce1SPaolo Bonzini if_true: [usbredir, files('redirect.c', 'quirks.c')]) 7306677ce1SPaolo Bonzini hw_usb_modules += {'redirect': usbredir_ss} 7406677ce1SPaolo Bonziniendif 7506677ce1SPaolo Bonzini 7606677ce1SPaolo Bonzini# usb pass-through 7706677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', libusb], 7806677ce1SPaolo Bonzini if_true: files('host-libusb.c'), 7906677ce1SPaolo Bonzini if_false: files('host-stub.c')) 8006677ce1SPaolo Bonzinisoftmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c')) 8106677ce1SPaolo Bonzini 8206677ce1SPaolo Bonzinisoftmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files('xen-usb.c')) 8306677ce1SPaolo Bonzini 8406677ce1SPaolo Bonzinimodules += { 'hw-usb': hw_usb_modules } 85