From nobody Mon Feb 9 07:05:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1596743729; cv=none; d=zohomail.com; s=zohoarc; b=C4XGbgS1jMTwpkbFxuLbLk6X33Inrj6zzSpWaLuJEpB/pqamls1lrWwT4dKjW+dE2DH0JqlWAIthbp0vG4O9/3OTT9lfyhe8NZx53kDdb1XG9jSw41ipfjyrCIoD69BB+OyaPzXYwJzcEQiXj+ycgOxRfvu3rS2U4iotwPR9zuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596743729; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=f7SvPDSXu/XWWYJ5NEdhWvXE2wztSL+oZQ4rAwm2gy0=; b=ZU6wi5I0tcTvpsHB35NQSEGiCnDK0QQcrla46SUB3mEN84wsa1Z0XZOE2cQ7WgRYRuVaP7iUh9Hy6XDLSSsChGsPoi+OxTrvh5LOuiJMF5vxqtnkzENR9qRZtmYPzKr5grLb+SgMsQCU0+VTFj0WAMxdJhdlgzZajFJncryl5pQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596743729073890.8008715821785; Thu, 6 Aug 2020 12:55:29 -0700 (PDT) Received: from localhost ([::1]:52364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3lz4-00084a-KP for importer@patchew.org; Thu, 06 Aug 2020 15:55:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3lPv-0008M0-Cn for qemu-devel@nongnu.org; Thu, 06 Aug 2020 15:19:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k3lPs-0006hm-SI for qemu-devel@nongnu.org; Thu, 06 Aug 2020 15:19:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-ZNvGxQoqO-iRJ8NbA857qQ-1; Thu, 06 Aug 2020 15:18:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D298B100AA21 for ; Thu, 6 Aug 2020 19:18:58 +0000 (UTC) Received: from 640k.localdomain.com (unknown [10.36.110.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id E41CB5FC3B; Thu, 6 Aug 2020 19:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596741544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f7SvPDSXu/XWWYJ5NEdhWvXE2wztSL+oZQ4rAwm2gy0=; b=PfSo44x/8b/7cjq1JvdRXUQR/1UhLp3FqyeRZP9NzjRI9MWHsQTp7PbwHfEpwzE1M5IwQp N7eMWpgWotEA1jg3T/FmcMd/HdRNVyT9IK+jOflUrLCs/RUNGojVJ17ZO7plxi6rpvhhYj +FCgYTwkgmDFhHizgp7zy2aRMkWdzC0= X-MC-Unique: ZNvGxQoqO-iRJ8NbA857qQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 090/143] meson: convert hw/usb Date: Thu, 6 Aug 2020 21:15:26 +0200 Message-Id: <1596741379-12902-91-git-send-email-pbonzini@redhat.com> In-Reply-To: <1596741379-12902-1-git-send-email-pbonzini@redhat.com> References: <1596741379-12902-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/06 12:59:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- Makefile.target | 1 + hw/Makefile.objs | 1 - hw/meson.build | 1 + hw/usb/Makefile.objs | 71 ------------------------------------------------= ---- hw/usb/meson.build | 69 ++++++++++++++++++++++++++++++++++++++++++++++++= ++ meson.build | 15 +++++++++++ 6 files changed, 86 insertions(+), 72 deletions(-) delete mode 100644 hw/usb/Makefile.objs create mode 100644 hw/usb/meson.build diff --git a/Makefile.target b/Makefile.target index 386378b..3d5a2af 100644 --- a/Makefile.target +++ b/Makefile.target @@ -168,6 +168,7 @@ endif LIBS :=3D $(LIBS) $(BRLAPI_LIBS) $(SDL_LIBS) $(SPICE_LIBS) $(OPENGL_LIBS) = $(SECCOMP_LIBS) LIBS :=3D $(LIBS) $(COREAUDIO_LIBS) $(DSOUND_LIBS) LIBS :=3D $(LIBS) $(VDE_LIBS) $(SLIRP_LIBS) +LIBS :=3D $(LIBS) $(LIBUSB_LIBS) $(SMARTCARD_LIBS) $(USB_REDIR_LIBS) =20 # Hardware support ifeq ($(TARGET_NAME), sparc64) diff --git a/hw/Makefile.objs b/hw/Makefile.objs index f6e08f6..c2619bb 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -30,7 +30,6 @@ devices-dirs-y +=3D sd/ devices-dirs-y +=3D ssi/ devices-dirs-y +=3D timer/ devices-dirs-$(CONFIG_TPM) +=3D tpm/ -devices-dirs-y +=3D usb/ endif =20 common-obj-y +=3D $(devices-dirs-y) diff --git a/hw/meson.build b/hw/meson.build index 4dafc8a..89bd6ad 100644 --- a/hw/meson.build +++ b/hw/meson.build @@ -3,6 +3,7 @@ subdir('mem') subdir('nubus') subdir('semihosting') subdir('smbios') +subdir('usb') subdir('vfio') subdir('virtio') subdir('watchdog') diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs deleted file mode 100644 index e342ff5..0000000 --- a/hw/usb/Makefile.objs +++ /dev/null @@ -1,71 +0,0 @@ -# usb subsystem core -common-obj-y +=3D core.o combined-packet.o bus.o libhw.o -common-obj-$(CONFIG_USB) +=3D desc.o desc-msos.o - -# usb host adapters -common-obj-$(CONFIG_USB_UHCI) +=3D hcd-uhci.o -common-obj-$(CONFIG_USB_OHCI) +=3D hcd-ohci.o -common-obj-$(CONFIG_USB_OHCI_PCI) +=3D hcd-ohci-pci.o -common-obj-$(CONFIG_USB_EHCI) +=3D hcd-ehci.o -common-obj-$(CONFIG_USB_EHCI_PCI) +=3D hcd-ehci-pci.o -common-obj-$(CONFIG_USB_EHCI_SYSBUS) +=3D hcd-ehci-sysbus.o -common-obj-$(CONFIG_USB_XHCI) +=3D hcd-xhci.o -common-obj-$(CONFIG_USB_XHCI_NEC) +=3D hcd-xhci-nec.o -common-obj-$(CONFIG_USB_MUSB) +=3D hcd-musb.o -common-obj-$(CONFIG_USB_DWC2) +=3D hcd-dwc2.o - -common-obj-$(CONFIG_TUSB6010) +=3D tusb6010.o -common-obj-$(CONFIG_IMX) +=3D chipidea.o - -# emulated usb devices -common-obj-$(CONFIG_USB) +=3D dev-hub.o -common-obj-$(CONFIG_USB) +=3D dev-hid.o -common-obj-$(CONFIG_USB_TABLET_WACOM) +=3D dev-wacom.o -common-obj-$(CONFIG_USB_STORAGE_BOT) +=3D dev-storage.o -common-obj-$(CONFIG_USB_STORAGE_UAS) +=3D dev-uas.o -common-obj-$(CONFIG_USB_AUDIO) +=3D dev-audio.o -common-obj-$(CONFIG_USB_SERIAL) +=3D dev-serial.o -common-obj-$(CONFIG_USB_NETWORK) +=3D dev-network.o - -ifeq ($(CONFIG_USB_SMARTCARD),y) -common-obj-y +=3D dev-smartcard-reader.o -ifeq ($(CONFIG_SMARTCARD),y) -common-obj-m +=3D smartcard.mo -smartcard.mo-objs :=3D ccid-card-passthru.o ccid-card-emulated.o -smartcard.mo-cflags :=3D $(SMARTCARD_CFLAGS) -smartcard.mo-libs :=3D $(SMARTCARD_LIBS) -endif -endif - -ifeq ($(CONFIG_POSIX),y) -common-obj-$(CONFIG_USB_STORAGE_MTP) +=3D dev-mtp.o -endif - -# usb redirection -ifeq ($(CONFIG_USB),y) -ifeq ($(CONFIG_USB_REDIR),y) -common-obj-m +=3D redirect.mo -redirect.mo-objs =3D redirect.o quirks.o -redirect.mo-cflags =3D $(USB_REDIR_CFLAGS) -redirect.mo-libs =3D $(USB_REDIR_LIBS) -endif -endif - -# usb pass-through -ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy) -common-obj-y +=3D host-libusb.o -else -common-obj-y +=3D host-stub.o -endif -common-obj-$(CONFIG_ALL) +=3D host-stub.o - -host-libusb.o-cflags :=3D $(LIBUSB_CFLAGS) -host-libusb.o-libs :=3D $(LIBUSB_LIBS) - -ifeq ($(CONFIG_USB_LIBUSB),y) -common-obj-$(CONFIG_XEN) +=3D xen-usb.o -xen-usb.o-cflags :=3D $(LIBUSB_CFLAGS) -xen-usb.o-libs :=3D $(LIBUSB_LIBS) -endif - -common-obj-$(CONFIG_IMX_USBPHY) +=3D imx-usb-phy.o diff --git a/hw/usb/meson.build b/hw/usb/meson.build new file mode 100644 index 0000000..f40d158 --- /dev/null +++ b/hw/usb/meson.build @@ -0,0 +1,69 @@ +hw_usb_modules =3D [] + +# usb subsystem core +softmmu_ss.add(files( + 'bus.c', + 'combined-packet.c', + 'core.c', + 'libhw.c' +)) + +softmmu_ss.add(when: 'CONFIG_USB', if_true: files( + 'desc.c', + 'desc-msos.c', +)) + +# usb host adapters +softmmu_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c')) +softmmu_ss.add(when: 'CONFIG_USB_OHCI', if_true: files('hcd-ohci.c')) +softmmu_ss.add(when: 'CONFIG_USB_OHCI_PCI', if_true: files('hcd-ohci-pci.c= ')) +softmmu_ss.add(when: 'CONFIG_USB_EHCI', if_true: files('hcd-ehci.c')) +softmmu_ss.add(when: 'CONFIG_USB_EHCI_PCI', if_true: files('hcd-ehci-pci.c= ')) +softmmu_ss.add(when: 'CONFIG_USB_EHCI_SYSBUS', if_true: files('hcd-ehci.c'= , 'hcd-ehci-sysbus.c')) +softmmu_ss.add(when: 'CONFIG_USB_XHCI', if_true: files('hcd-xhci.c')) +softmmu_ss.add(when: 'CONFIG_USB_XHCI_NEC', if_true: files('hcd-xhci-nec.c= ')) +softmmu_ss.add(when: 'CONFIG_USB_MUSB', if_true: files('hcd-musb.c')) +softmmu_ss.add(when: 'CONFIG_USB_DWC2', if_true: files('hcd-dwc2.c')) + +softmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c')) +softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c')) +softmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c')) + +# emulated usb devices +softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c')) +softmmu_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c')) +softmmu_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.= c')) +softmmu_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage= .c')) +softmmu_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c')) +softmmu_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c')) +softmmu_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c')) +softmmu_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c')) +softmmu_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: = files('dev-mtp.c')) + +# smartcard +softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard= -reader.c')) + +if config_host.has_key('CONFIG_SMARTCARD') + hw_usb_modules +=3D [['smartcard', files( + 'ccid-card-emulated.c', + 'ccid-card-passthru.c', + ), [cacard], ['CONFIG_USB_SMARTCARD']]] +endif + +# usb redirect +if config_host.has_key('CONFIG_USB_REDIR') + hw_usb_modules +=3D [['redirect', files( + 'redirect.c', + 'quirks.c', + ), [usbredir], ['CONFIG_USB']]] +endif + +# usb pass-through +softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_USB_LIBUSB', libusb], + if_true: files('host-libusb.c'), + if_false: files('host-stub.c')) +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('host-stub.c')) + +softmmu_ss.add(when: ['CONFIG_USB', 'CONFIG_XEN', libusb], if_true: files(= 'xen-usb.c')) + +modules +=3D { 'hw-usb': hw_usb_modules } diff --git a/meson.build b/meson.build index 550e454..e2a80b8 100644 --- a/meson.build +++ b/meson.build @@ -313,6 +313,21 @@ if 'CONFIG_XEN_BACKEND' in config_host xen =3D declare_dependency(compile_args: config_host['XEN_CFLAGS'].split= (), link_args: config_host['XEN_LIBS'].split()) endif +cacard =3D not_found +if 'CONFIG_SMARTCARD' in config_host + cacard =3D declare_dependency(compile_args: config_host['SMARTCARD_CFLAG= S'].split(), + link_args: config_host['SMARTCARD_LIBS'].spl= it()) +endif +usbredir =3D not_found +if 'CONFIG_USB_REDIR' in config_host + usbredir =3D declare_dependency(compile_args: config_host['USB_REDIR_CFL= AGS'].split(), + link_args: config_host['USB_REDIR_LIBS'].s= plit()) +endif +libusb =3D not_found +if 'CONFIG_USB_LIBUSB' in config_host + libusb =3D declare_dependency(compile_args: config_host['LIBUSB_CFLAGS']= .split(), + link_args: config_host['LIBUSB_LIBS'].split(= )) +endif =20 create_config =3D find_program('scripts/create_config') minikconf =3D find_program('scripts/minikconf.py') --=20 1.8.3.1