hv: change function parameters: pci_pdev_read_cfg and pci_pdev_write_cfg

In order to allow these functions to be called without an associated
struct pci_pdev (for example, at the time of PCI bus enumeration), these
two functions can not take the struct vdev as input parameter.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Zide Chen
2018-10-08 08:59:10 -07:00
committed by lijinxia
parent 19e1b9675f
commit 9cc1f57f63
4 changed files with 11 additions and 11 deletions

View File

@@ -44,14 +44,14 @@ static uint32_t pci_pdev_calc_address(union pci_bdf bdf, uint32_t offset)
return addr;
}
uint32_t pci_pdev_read_cfg(struct pci_pdev *pdev, uint32_t offset, uint32_t bytes)
uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes)
{
uint32_t addr;
uint32_t val;
spinlock_obtain(&pci_device_lock);
addr = pci_pdev_calc_address(pdev->bdf, offset);
addr = pci_pdev_calc_address(bdf, offset);
/* Write address to ADDRESS register */
pio_write32(addr, PCI_CONFIG_ADDR);
@@ -73,14 +73,13 @@ uint32_t pci_pdev_read_cfg(struct pci_pdev *pdev, uint32_t offset, uint32_t byte
return val;
}
void pci_pdev_write_cfg(struct pci_pdev *pdev, uint32_t offset, uint32_t bytes,
uint32_t val)
void pci_pdev_write_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes, uint32_t val)
{
uint32_t addr;
spinlock_obtain(&pci_device_lock);
addr = pci_pdev_calc_address(pdev->bdf, offset);
addr = pci_pdev_calc_address(bdf, offset);
/* Write address to ADDRESS register */
pio_write32(addr, PCI_CONFIG_ADDR);