Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
iov.c File Reference
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/export.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/pci-ats.h>
#include "pci.h"

Go to the source code of this file.


#define VIRTFN_ID_LEN   16


int pci_iov_init (struct pci_dev *dev)
void pci_iov_release (struct pci_dev *dev)
int pci_iov_resource_bar (struct pci_dev *dev, int resno, enum pci_bar_type *type)
resource_size_t pci_sriov_resource_alignment (struct pci_dev *dev, int resno)
void pci_restore_iov_state (struct pci_dev *dev)
int pci_iov_bus_range (struct pci_bus *bus)
int pci_enable_sriov (struct pci_dev *dev, int nr_virtfn)
 EXPORT_SYMBOL_GPL (pci_enable_sriov)
void pci_disable_sriov (struct pci_dev *dev)
 EXPORT_SYMBOL_GPL (pci_disable_sriov)
irqreturn_t pci_sriov_migration (struct pci_dev *dev)
 EXPORT_SYMBOL_GPL (pci_sriov_migration)
int pci_num_vf (struct pci_dev *dev)
 EXPORT_SYMBOL_GPL (pci_num_vf)

Macro Definition Documentation

#define VIRTFN_ID_LEN   16

Definition at line 20 of file iov.c.

Function Documentation

EXPORT_SYMBOL_GPL ( pci_enable_sriov  )
EXPORT_SYMBOL_GPL ( pci_disable_sriov  )
EXPORT_SYMBOL_GPL ( pci_sriov_migration  )
EXPORT_SYMBOL_GPL ( pci_num_vf  )
void pci_disable_sriov ( struct pci_dev dev)

pci_disable_sriov - disable the SR-IOV capability : the PCI device

Definition at line 694 of file iov.c.

int pci_enable_sriov ( struct pci_dev dev,
int  nr_virtfn 

pci_enable_sriov - enable the SR-IOV capability : the PCI device : number of virtual functions to enable

Returns 0 on success, or negative on failure.

Definition at line 679 of file iov.c.

int pci_iov_bus_range ( struct pci_bus bus)

pci_iov_bus_range - find bus range used by Virtual Function : the PCI bus

Returns max number of buses (exclude current one) used by Virtual Functions.

Definition at line 655 of file iov.c.

int pci_iov_init ( struct pci_dev dev)

pci_iov_init - initialize the IOV capability : the PCI device

Returns 0 on success, or negative on failure.

Definition at line 569 of file iov.c.

void pci_iov_release ( struct pci_dev dev)

pci_iov_release - release resources used by the IOV capability : the PCI device

Definition at line 587 of file iov.c.

int pci_iov_resource_bar ( struct pci_dev dev,
int  resno,
enum pci_bar_type type 

pci_iov_resource_bar - get position of the SR-IOV BAR : the PCI device : the resource number : the BAR type to be filled in

Returns position of the BAR encapsulated in the SR-IOV capability.

Definition at line 601 of file iov.c.

int pci_num_vf ( struct pci_dev dev)

pci_num_vf - return number of VFs associated with a PF device_release_driver : the PCI device

Returns number of VFs, or 0 if SR-IOV is not enabled.

Definition at line 730 of file iov.c.

void pci_restore_iov_state ( struct pci_dev dev)

pci_restore_iov_state - restore the state of the IOV capability : the PCI device

Definition at line 642 of file iov.c.

irqreturn_t pci_sriov_migration ( struct pci_dev dev)

pci_sriov_migration - notify SR-IOV core of Virtual Function Migration : the PCI device

Returns IRQ_HANDLED if the IRQ is handled, or IRQ_NONE if not.

Physical Function driver is responsible to register IRQ handler using VF Migration Interrupt Message Number, and call this function when the interrupt is generated by the hardware.

Definition at line 715 of file iov.c.

resource_size_t pci_sriov_resource_alignment ( struct pci_dev dev,
int  resno 

pci_sriov_resource_alignment - get resource alignment for VF BAR : the PCI device : the resource number

Returns the alignment of the VF BAR found in the SR-IOV capability. This is not the same as the resource size which is defined as the VF BAR size multiplied by the number of VFs. The alignment is just the VF BAR size.

Definition at line 625 of file iov.c.