meson.build 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. hw_usb_modules = {}
  2. # usb subsystem core
  3. softmmu_ss.add(when: 'CONFIG_USB', if_true: files(
  4. 'bus.c',
  5. 'combined-packet.c',
  6. 'core.c',
  7. 'desc.c',
  8. 'desc-msos.c',
  9. 'libhw.c',
  10. 'pcap.c',
  11. ))
  12. # usb host adapters
  13. softmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
  14. softmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c'))
  15. softmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c'))
  16. softmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c'))
  17. softmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c'))
  18. softmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c', 'hcd-ehci-sysbus.c'))
  19. softmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c'))
  20. softmmu_ss.add(when: 'CONFIG_USB_XHCI_PCI', if_true: files('hcd-xhci-pci.c'))
  21. softmmu_ss.add(when: 'CONFIG_USB_XHCI_SYSBUS', if_true: files('hcd-xhci-sysbus.c'))
  22. softmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c'))
  23. softmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c'))
  24. softmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c'))
  25. softmmu_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c'))
  26. softmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
  27. softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
  28. softmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
  29. softmmu_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.c'))
  30. softmmu_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c'))
  31. softmmu_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c'))
  32. # emulated usb devices
  33. softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c'))
  34. softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c'))
  35. softmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c'))
  36. softmmu_ss.add(when: 'CONFIG_USB_STORAGE_CORE', if_true: files('dev-storage.c'))
  37. softmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c'))
  38. softmmu_ss.add(when: 'CONFIG_USB_STORAGE_CLASSIC', if_true: files('dev-storage-classic.c'))
  39. softmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
  40. softmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
  41. softmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
  42. softmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
  43. softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: files('dev-mtp.c'))
  44. # smartcard
  45. softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reader.c'))
  46. if cacard.found()
  47. usbsmartcard_ss = ss.source_set()
  48. usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD',
  49. if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')])
  50. hw_usb_modules += {'smartcard': usbsmartcard_ss}
  51. endif
  52. # U2F
  53. softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
  54. softmmu_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')])
  55. if u2f.found()
  56. softmmu_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
  57. endif
  58. # CanoKey
  59. if canokey.found()
  60. softmmu_ss.add(when: 'CONFIG_USB_CANOKEY', if_true: [canokey, files('canokey.c')])
  61. endif
  62. # usb redirect
  63. if usbredir.found()
  64. usbredir_ss = ss.source_set()
  65. usbredir_ss.add(when: 'CONFIG_USB',
  66. if_true: [usbredir, files('redirect.c', 'quirks.c')])
  67. hw_usb_modules += {'redirect': usbredir_ss}
  68. endif
  69. # usb pass-through
  70. if libusb.found()
  71. usbhost_ss = ss.source_set()
  72. usbhost_ss.add(when: ['CONFIG_USB', libusb],
  73. if_true: files('host-libusb.c'))
  74. hw_usb_modules += {'host': usbhost_ss}
  75. endif
  76. softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN_BUS', libusb], if_true: files('xen-usb.c'))
  77. modules += { 'hw-usb': hw_usb_modules }