d5bbeefca8
Introduce struct virtio_pci_ops, to let legacy virtio (v0.95) and modern virtio (1.0) have different implementation regarding to a specific pci action, such as read host status. With that, this patch reimplements all exported pci functions, in a way like: vtpci_foo_bar(struct virtio_hw *hw) { hw->vtpci_ops->foo_bar(hw); } So that we need pay attention to those pci related functions only while adding virtio 1.0 support. This patch introduced a new vtpci function, vtpci_init(), to do proper virtio pci settings. It's pretty simple so far: just sets hw->vtpci_ops to legacy_ops as we don't support 1.0 yet. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Tested-by: Qian Xu <qian.q.xu@intel.com> Reviewed-by: Tetsuya Mukawa <mukawa@igel.co.jp> Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp> Acked-by: Huawei Xie <huawei.xie@intel.com>