acrn-hypervisor/devicemodel/include/pci_util.h
Minggui Cao 483b7b1280 dm: fix: TSN in multi-hostbridge could crash
fix bug: if PTM-CAP device, like TSN in multi-hostbridge could cause
acrn-dm crash.

original PTM PCI code has not handled multi-hostbridge case, and just
handled hostbridge (00:00.0) case.

this patch calls PCI access API to handle PTM-CAP device/bridge
(root port) structure, to avoid scan PCI hierarchical.

Tracked-On: #7045
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Signed-off-by: Minggui Cao <minggui.cao@intel.com>
2022-01-28 11:10:44 +08:00

21 lines
443 B
C

/*
* Copyright (C) 2021 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef __PCI_UTIL_H
#define __PCI_UTIL_H
#include <stdbool.h>
#include "pciaccess.h"
int pci_find_cap(struct pci_device *pdev, const int cap_id);
int pci_find_ext_cap(struct pci_device *pdev, int cap_id);
int pci_get_pcie_type(struct pci_device *dev);
bool is_root_port(struct pci_device *pdev);
bool is_mfdev(struct pci_device *pdev);
#endif