mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-21 10:05:00 +08:00
d89c8169bd
Split common codes from virtio-pci-legacy so vDPA driver can reuse it later. Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/71605acde5e97fcb2760a6973e406279fb1bbd33.1635493219.git.wuzongyong@linux.alibaba.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
43 lines
1.5 KiB
C
43 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_VIRTIO_PCI_LEGACY_H
|
|
#define _LINUX_VIRTIO_PCI_LEGACY_H
|
|
|
|
#include "linux/mod_devicetable.h"
|
|
#include <linux/pci.h>
|
|
#include <linux/virtio_pci.h>
|
|
|
|
struct virtio_pci_legacy_device {
|
|
struct pci_dev *pci_dev;
|
|
|
|
/* Where to read and clear interrupt */
|
|
u8 __iomem *isr;
|
|
/* The IO mapping for the PCI config space (legacy mode only) */
|
|
void __iomem *ioaddr;
|
|
|
|
struct virtio_device_id id;
|
|
};
|
|
|
|
u64 vp_legacy_get_features(struct virtio_pci_legacy_device *ldev);
|
|
u64 vp_legacy_get_driver_features(struct virtio_pci_legacy_device *ldev);
|
|
void vp_legacy_set_features(struct virtio_pci_legacy_device *ldev,
|
|
u32 features);
|
|
u8 vp_legacy_get_status(struct virtio_pci_legacy_device *ldev);
|
|
void vp_legacy_set_status(struct virtio_pci_legacy_device *ldev,
|
|
u8 status);
|
|
u16 vp_legacy_queue_vector(struct virtio_pci_legacy_device *ldev,
|
|
u16 idx, u16 vector);
|
|
u16 vp_legacy_config_vector(struct virtio_pci_legacy_device *ldev,
|
|
u16 vector);
|
|
void vp_legacy_set_queue_address(struct virtio_pci_legacy_device *ldev,
|
|
u16 index, u32 queue_pfn);
|
|
bool vp_legacy_get_queue_enable(struct virtio_pci_legacy_device *ldev,
|
|
u16 idx);
|
|
void vp_legacy_set_queue_size(struct virtio_pci_legacy_device *ldev,
|
|
u16 idx, u16 size);
|
|
u16 vp_legacy_get_queue_size(struct virtio_pci_legacy_device *ldev,
|
|
u16 idx);
|
|
int vp_legacy_probe(struct virtio_pci_legacy_device *ldev);
|
|
void vp_legacy_remove(struct virtio_pci_legacy_device *ldev);
|
|
|
|
#endif
|