diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-01-31 05:04:42 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-01-31 05:04:42 +0000 |
commit | 918f9bfc46efcfe1efb81e01dd3d01dafd8995cd (patch) | |
tree | bca51692174ba7baf2826d11f0a4e18974d83b88 /sys/dev/pci/drm | |
parent | b54ef224bad032de739f9a5afbd9f3e75ab72a76 (diff) |
add pci_is_root_bus()
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_linux.h | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 1cefbb8e5e8..9db6ba51ca0 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_drv.c,v 1.156 2018/01/30 08:17:31 jsg Exp $ */ +/* $OpenBSD: drm_drv.c,v 1.157 2018/01/31 05:04:41 jsg Exp $ */ /*- * Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org> * Copyright © 2008 Intel Corporation @@ -430,6 +430,7 @@ drm_attach(struct device *parent, struct device *self, void *aux) dev->pdev->bus = &dev->pdev->_bus; dev->pdev->bus->pc = da->pc; dev->pdev->bus->number = bus; + dev->pdev->bus->bridgetag = da->bridgetag; dev->pdev->devfn = PCI_DEVFN(slot, func); dev->pc = da->pc; diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h index 1c7fd9fb16e..f11ac61e7a7 100644 --- a/sys/dev/pci/drm/drm_linux.h +++ b/sys/dev/pci/drm/drm_linux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_linux.h,v 1.81 2018/01/31 03:26:00 jsg Exp $ */ +/* $OpenBSD: drm_linux.h,v 1.82 2018/01/31 05:04:41 jsg Exp $ */ /* * Copyright (c) 2013, 2014, 2015 Mark Kettenis * Copyright (c) 2017 Martin Pieuchot @@ -1434,6 +1434,7 @@ struct resource { struct pci_bus { pci_chipset_tag_t pc; unsigned char number; + pcitag_t *bridgetag; }; struct pci_dev { @@ -1576,6 +1577,12 @@ pci_pcie_cap(struct pci_dev *pdev) return pos; } +static inline bool +pci_is_root_bus(struct pci_bus *pbus) +{ + return (pbus->bridgetag == NULL); +} + static inline int pcie_capability_read_dword(struct pci_dev *pdev, int off, u32 *val) { |