From nobody Wed Jan 18 16:24:50 2023 X-Original-To: dev-commits-src-branches@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 4Nxrh32nFSz2yJRN; Wed, 18 Jan 2023 16:24:51 +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 4Nxrh26M0gz3Dtn; Wed, 18 Jan 2023 16:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059090; 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=yY3nLDIotnDsi6egIHIdlzHTb1sB2hSXExm6LhwT45w=; b=L0UXr7zDFIFKIvf5dmSO7kUr2vP7pVDJXRj433RTlWBpNrLQpF+lRgYlYPo+kkD/5TtkH/ Lzf6nQBlwBqAcPBUuWYKjKBUN0e0mi0l2iKpr+iD/KJdeXOQjslGBq0YSFLa4+eHbVhSod zAHXZGqbHM0QLrs4cn8fnerj0sEPigDBP+4m7Sw/zoJoYKZUV7SyLkZV3L3ABrYzSSv3Xy HeWyVJMzHY9BqnoBOV0pEVH/iMe7XoyByKtehGameKsk+paGu8hkZRGP6EGmO1HXhWJQlW Wg7z38xBjGgTfs/TNbHfNkttPkABL4aFXDiwB4/tCWKliDn+ksNrGSLbZii6Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674059090; 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=yY3nLDIotnDsi6egIHIdlzHTb1sB2hSXExm6LhwT45w=; b=rIXuXPTWidZPZQlNoHBIAZ8//A23JxZKX5w1Zd/lgXE8aHvvDFY3eKF5qKZQXjQVOySTQl 9uzYbwdq4dvVPVObXtZx6WdyOHcDvaet9PyoEIKCBMMKd3WVsmSM8JV6UFEs9z8NW7cY1k Q5QP48ywQJQwcjqifnb5kguJK6Lt217eyt2FE/KFaXwRh95p3Nd03byvYQXuvCofYm5W49 TNOtzsjxc9LCiLhYDE0CyZZH2oHqWvXUAGu21TXUKA6cN5MCoreeTQnuLL/I6OigdAcFnh dMCIxxVk36fvp2DV/gtZET8Xw/B8IdCMI0/oOkX7GSixi1Zz0xhc51ZJ31KmNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674059090; a=rsa-sha256; cv=none; b=AwYLyRxWTTHvtN2BfXqI5DkpR/Aqy+Sn0BJlNpptJIbR0Yl21aJujBDgrTchs1VSwk8Pfz 6aUwdWVUKVdsB9BXPXrGFXGM04ofLcnLc6XRu2Wv2kCc4fgqyZvEGfsruRRcQyKxBTkR+N yUiQCTV4RNC8s+xk/4FbNJ8n6U/Wts6h4133eCihh/kroPnJWmNGNi2elRBxDgBMiEI7iL OpmRbxG/OEtngqOzfjbOc8A1wslZiHvLHISy+4in5Faks11Dg9L1v1SF7IKniNJJ+nOQzZ SzZfQvNvWUjDfrZSbVsTulFn1/DHRMn5kKY0TH6a8jTJ+xKkyott/tDVjTEBxA== 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 4Nxrh25Q31zHpB; Wed, 18 Jan 2023 16:24:50 +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 30IGOo7D037963; Wed, 18 Jan 2023 16:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30IGOogt037962; Wed, 18 Jan 2023 16:24:50 GMT (envelope-from git) Date: Wed, 18 Jan 2023 16:24:50 GMT Message-Id: <202301181624.30IGOogt037962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4073b7ddf14a - stable/13 - LinuxKPI: pci.h add more MSI related constanst and pci_is_enabled() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4073b7ddf14a2ff5adf5f18e3cc37a3fbb7994f3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4073b7ddf14a2ff5adf5f18e3cc37a3fbb7994f3 commit 4073b7ddf14a2ff5adf5f18e3cc37a3fbb7994f3 Author: Bjoern A. Zeeb AuthorDate: 2022-10-31 22:14:10 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-18 13:24:22 +0000 LinuxKPI: pci.h add more MSI related constanst and pci_is_enabled() Add more MSI related constansts defined to our native defines and pci_is_enabled(). All are needed for another wireless driver. Differential Revision: https://reviews.freebsd.org/D37225 (cherry picked from commit 5f2f582ccceec8729ee85bf191a2f7373c2994a4) --- sys/compat/linuxkpi/common/include/linux/pci.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 79999c3912f7..f870b039254c 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -163,6 +163,11 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ #define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ #define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ +#define PCI_MSI_ADDRESS_LO PCIR_MSI_ADDR +#define PCI_MSI_ADDRESS_HI PCIR_MSI_ADDR_HIGH +#define PCI_MSI_FLAGS PCIR_MSI_CTRL +#define PCI_MSI_FLAGS_ENABLE PCIM_MSICTRL_MSI_ENABLE + #define PCI_EXP_LNKCAP_CLKPM 0x00040000 #define PCI_EXP_DEVSTA_TRPND 0x0020 @@ -1611,4 +1616,12 @@ pcie_get_readrq(struct pci_dev *dev) return (128 << ((ctl & PCI_EXP_DEVCTL_READRQ) >> 12)); } +static inline bool +pci_is_enabled(struct pci_dev *pdev) +{ + + return ((pci_read_config(pdev->dev.bsddev, PCIR_COMMAND, 2) & + PCIM_CMD_BUSMASTEREN) != 0); +} + #endif /* _LINUXKPI_LINUX_PCI_H_ */