From: jsg Date: Mon, 11 Apr 2022 03:02:40 +0000 (+0000) Subject: add pci_upstream_bridge() and pci_pr3_present() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b2e07619b0e9d08d90b232513a961a4ffcd3736f;p=openbsd add pci_upstream_bridge() and pci_pr3_present() needed for changes to amdgpu_device.c in 5.15.y for now always return false when checking for ACPI _PR3 method --- diff --git a/sys/dev/pci/drm/include/linux/pci.h b/sys/dev/pci/drm/include/linux/pci.h index 16eaa870df9..944de95e2ea 100644 --- a/sys/dev/pci/drm/include/linux/pci.h +++ b/sys/dev/pci/drm/include/linux/pci.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.h,v 1.10 2022/03/01 04:08:04 jsg Exp $ */ +/* $OpenBSD: pci.h,v 1.11 2022/04/11 03:02:40 jsg Exp $ */ /* * Copyright (c) 2015 Mark Kettenis * @@ -246,6 +246,21 @@ pci_is_root_bus(struct pci_bus *pbus) return (pbus->bridgetag == NULL); } +static inline struct pci_dev * +pci_upstream_bridge(struct pci_dev *pdev) +{ + if (pci_is_root_bus(pdev->bus)) + return NULL; + return pdev->bus->self; +} + +/* XXX check for ACPI _PR3 */ +static inline bool +pci_pr3_present(struct pci_dev *pdev) +{ + return false; +} + static inline int pcie_capability_read_dword(struct pci_dev *pdev, int off, u32 *val) {