mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
hv: add SRIOV capability read/write entries
Introduce SRIOV capability field for pci_vdev and add SRIOV capability interception entries. Tracked-On: #4433 Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -101,6 +101,22 @@ static inline bool msixcap_access(const struct pci_vdev *vdev, uint32_t offset)
|
||||
return (has_msix_cap(vdev) && in_range(offset, vdev->msix.capoff, vdev->msix.caplen));
|
||||
}
|
||||
|
||||
/*
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
static inline bool has_sriov_cap(const struct pci_vdev *vdev)
|
||||
{
|
||||
return (vdev->sriov.capoff != 0U);
|
||||
}
|
||||
|
||||
/*
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
static inline bool sriovcap_access(const struct pci_vdev *vdev, uint32_t offset)
|
||||
{
|
||||
return (has_sriov_cap(vdev) && in_range(offset, vdev->sriov.capoff, vdev->sriov.caplen));
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
@@ -140,6 +156,10 @@ void vmsix_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes
|
||||
void vmsix_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
void deinit_vmsix(const struct pci_vdev *vdev);
|
||||
|
||||
void init_vsriov(struct pci_vdev *vdev);
|
||||
void read_sriov_cap_reg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||
void write_sriov_cap_reg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
|
||||
uint32_t pci_vdev_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes);
|
||||
void pci_vdev_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
|
||||
|
Reference in New Issue
Block a user