From nobody Wed Jan 25 22:15:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P2J6w57Z0z3bbfK; Wed, 25 Jan 2023 22:15:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P2J6w4fbNz468K; Wed, 25 Jan 2023 22:15:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674684904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MrUWnO6CSUs7HO9+UgRCAHmKcki10FdAdh+5j/IN+G0=; b=l8yqKGz6qeEFn05W+of/JCkiLaruDsdXUoz4M0rggGPn8W3HgAre3Piyh9+eL8YrH1JllA qrjwgrk/ec2s1YE207zQm0R93HRgoIfSL8tBPhKZ5nghwbZvCqKQi+AJX9I+l/fdgcP3Eg FKdbnI23HLy4V4qcttEnQPBXhHU9FUm9/aDHq84StaUpMZKMYmBEcXzsIt8QfSsqQUfIdU 9fU/jDhAXDAk5Ivkt0ippBAGw7CBhDrPFwOo7PgK4NxvGM2L4cC0mJPGTNOH5kJVIwmnIh WCxP8GCCfDd+UmzbcLvX7m4xH2pF0974Y5IygLQcFrKFlMxOpUUzJoFEnNIjDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674684904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MrUWnO6CSUs7HO9+UgRCAHmKcki10FdAdh+5j/IN+G0=; b=ooKH4YjMnuKTEW173F/COw+oW3c8NIHre3NI4HiuFtKrSp5aSoFr62zVbzUJVE5xI1rycI xF+QpLo9xcGeNn1K8UTweuDqzSC5wimfOndaw+rvS6NJdgicucHU4ZNJDzcNUaZ6rH+MRs 3/0Q9/rqVpxA3uLr42dZKAOs7h8GVpeyrDA0YMbgOaX+RuOK0P538y8TnbBFTJzUzaE2mN OPsvrHC4OoKb7R3YcAGq13ZMzISXrutqbpso7ly1EX2fY32iyIDBqN2eJFa8NwQZuxWUsO WLc2cu2E7GnKarR8R+JhNC5QShuun3gvWJNeVlj6a1DiRrcH2B+uxqWDoFfWqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674684904; a=rsa-sha256; cv=none; b=mC9f1ubsiszqld0NlZh7UveTcGfaI+1sAKil7NPJ8N4UT3nMSiIyR/Qri/Mk+itc75BpRA f1XqhwCC/evX0uLphIHEjmQUKSdJRY4k0AK1bMAGdN6QpL/vwgcSgiyIFa4bTKKSVjJr0x OmaOBTKMUludsfpiN2RtYOKka/xwQ+5VypaH3LbaiCmf6Y7Iv3D2jP8h36Aul4VpMoXo8l TF6iIZ1AkgpxgJLZWkaXc1t2kRHqAyL89x8c9FzzN0QEaf/XcYIq4vyeeu6BoqH1iAOfCz cC1mI7I2LBv+Iwe0YZw1v0EaINe47+FOp4PAsZdT9DVXjJD8r6VuoBYliFORnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P2J6w3kvCz15Xy; Wed, 25 Jan 2023 22:15:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30PMF4JE064191; Wed, 25 Jan 2023 22:15:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30PMF4BD064190; Wed, 25 Jan 2023 22:15:04 GMT (envelope-from git) Date: Wed, 25 Jan 2023 22:15:04 GMT Message-Id: <202301252215.30PMF4BD064190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 49b6d5ed142d - main - linuxkpi: Add `pci_device_is_present()` List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49b6d5ed142d6c59b7a517ff5660165d8647bd01 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=49b6d5ed142d6c59b7a517ff5660165d8647bd01 commit 49b6d5ed142d6c59b7a517ff5660165d8647bd01 Author: Jean-Sébastien Pédron AuthorDate: 2023-01-19 17:46:37 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-25 21:49:38 +0000 linuxkpi: Add `pci_device_is_present()` This calls bus_child_present(9) internally. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38148 --- sys/compat/linuxkpi/common/include/linux/pci.h | 9 +++++++++ sys/compat/linuxkpi/common/src/linux_pci.c | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 6651fd62b44b..b54b5cc8dd70 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -1672,4 +1672,13 @@ pci_is_enabled(struct pci_dev *pdev) PCIM_CMD_BUSMASTEREN) != 0); } +static inline int +pci_wait_for_pending_transaction(struct pci_dev *pdev) +{ + + return (0); +} + +bool pci_device_is_present(struct pci_dev *pdev); + #endif /* _LINUXKPI_LINUX_PCI_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index da5430eb0d7b..aa29d0654cd1 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -996,6 +996,16 @@ lkpi_pci_msi_desc_alloc(int irq) return (desc); } +bool +pci_device_is_present(struct pci_dev *pdev) +{ + device_t dev; + + dev = pdev->dev.bsddev; + + return (bus_child_present(dev)); +} + CTASSERT(sizeof(dma_addr_t) <= sizeof(uint64_t)); struct linux_dma_obj {