mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
dm: PTM: Add a few pci utility functions
Add a few pci utility functions to help easy access of pci functionalities. 1. pci_find_capability(): find position of specified pci capability register 2. pci_find_ext_cap(): find extend capability register position from cap_id 3. pci_pcie_type(): find pci-e device type 4. is_root_port(): check whether pdev is a pci root port 5. is_bridge(): check whether pdev is a bridge Tracked-On: #5915 Signed-off-by: Rong Liu <rong.l.liu@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
20
devicemodel/include/pci_util.h
Normal file
20
devicemodel/include/pci_util.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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_bridge(struct pci_device *pdev);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user