#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/string.h>
#include <linux/delay.h>
#include "pci.h"
#define VIRTFN_ID_LEN …
int pci_iov_virtfn_bus(struct pci_dev *dev, int vf_id)
{ … }
int pci_iov_virtfn_devfn(struct pci_dev *dev, int vf_id)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_iov_vf_id(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
void *pci_iov_get_pf_drvdata(struct pci_dev *dev, struct pci_driver *pf_driver)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline void pci_iov_set_numvfs(struct pci_dev *dev, int nr_virtfn)
{ … }
static int compute_max_vf_buses(struct pci_dev *dev)
{ … }
static struct pci_bus *virtfn_add_bus(struct pci_bus *bus, int busnr)
{ … }
static void virtfn_remove_bus(struct pci_bus *physbus, struct pci_bus *virtbus)
{ … }
resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno)
{ … }
static void pci_read_vf_config_common(struct pci_dev *virtfn)
{ … }
int pci_iov_sysfs_link(struct pci_dev *dev,
struct pci_dev *virtfn, int id)
{ … }
#ifdef CONFIG_PCI_MSI
static ssize_t sriov_vf_total_msix_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(sriov_vf_total_msix);
static ssize_t sriov_vf_msix_count_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(sriov_vf_msix_count);
#endif
static struct attribute *sriov_vf_dev_attrs[] = …;
static umode_t sriov_vf_attrs_are_visible(struct kobject *kobj,
struct attribute *a, int n)
{ … }
const struct attribute_group sriov_vf_dev_attr_group = …;
int pci_iov_add_virtfn(struct pci_dev *dev, int id)
{ … }
void pci_iov_remove_virtfn(struct pci_dev *dev, int id)
{ … }
static ssize_t sriov_totalvfs_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t sriov_numvfs_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t sriov_numvfs_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t sriov_offset_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t sriov_stride_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t sriov_vf_device_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t sriov_drivers_autoprobe_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t sriov_drivers_autoprobe_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RO(sriov_totalvfs);
static DEVICE_ATTR_RW(sriov_numvfs);
static DEVICE_ATTR_RO(sriov_offset);
static DEVICE_ATTR_RO(sriov_stride);
static DEVICE_ATTR_RO(sriov_vf_device);
static DEVICE_ATTR_RW(sriov_drivers_autoprobe);
static struct attribute *sriov_pf_dev_attrs[] = …;
static umode_t sriov_pf_attrs_are_visible(struct kobject *kobj,
struct attribute *a, int n)
{ … }
const struct attribute_group sriov_pf_dev_attr_group = …;
int __weak pcibios_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
{ … }
int __weak pcibios_sriov_disable(struct pci_dev *pdev)
{ … }
static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs)
{ … }
static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
{ … }
static void sriov_del_vfs(struct pci_dev *dev)
{ … }
static void sriov_disable(struct pci_dev *dev)
{ … }
static int sriov_init(struct pci_dev *dev, int pos)
{ … }
static void sriov_release(struct pci_dev *dev)
{ … }
static void sriov_restore_state(struct pci_dev *dev)
{ … }
int pci_iov_init(struct pci_dev *dev)
{ … }
void pci_iov_release(struct pci_dev *dev)
{ … }
void pci_iov_remove(struct pci_dev *dev)
{ … }
void pci_iov_update_resource(struct pci_dev *dev, int resno)
{ … }
resource_size_t __weak pcibios_iov_resource_alignment(struct pci_dev *dev,
int resno)
{ … }
resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
{ … }
void pci_restore_iov_state(struct pci_dev *dev)
{ … }
void pci_vf_drivers_autoprobe(struct pci_dev *dev, bool auto_probe)
{ … }
int pci_iov_bus_range(struct pci_bus *bus)
{ … }
int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
{ … }
EXPORT_SYMBOL_GPL(…);
void pci_disable_sriov(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_num_vf(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_vfs_assigned(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_sriov_get_totalvfs(struct pci_dev *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_sriov_configure_simple(struct pci_dev *dev, int nr_virtfn)
{ … }
EXPORT_SYMBOL_GPL(…);