aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-03-19 23:25:11 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-03-20 13:48:22 -0400
commitd1b054da8f599905f3c18a218961dcf17f9d5f13 (patch)
tree99b62e6771c3b73142dd0622463bed0e19724342 /include/linux/pci.h
parent8293b0f629095efbe7c7e3f9b437f8c040c19eb5 (diff)
PCI: initialize and release SR-IOV capability
If a device has the SR-IOV capability, initialize it (set the ARI Capable Hierarchy in the lowest numbered PF if necessary; calculate the System Page Size for the VF MMIO, probe the VF Offset, Stride and BARs). A lock for the VF bus allocation is also initialized if a PF is the lowest numbered PF. Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1f6c5ddaae36..8ce2f2d9ab63 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -93,6 +93,12 @@ enum {
93 /* #6: expansion ROM resource */ 93 /* #6: expansion ROM resource */
94 PCI_ROM_RESOURCE, 94 PCI_ROM_RESOURCE,
95 95
96 /* device specific resources */
97#ifdef CONFIG_PCI_IOV
98 PCI_IOV_RESOURCES,
99 PCI_IOV_RESOURCE_END = PCI_IOV_RESOURCES + PCI_SRIOV_NUM_BARS - 1,
100#endif
101
96 /* resources assigned to buses behind the bridge */ 102 /* resources assigned to buses behind the bridge */
97#define PCI_BRIDGE_RESOURCE_NUM 4 103#define PCI_BRIDGE_RESOURCE_NUM 4
98 104
@@ -180,6 +186,7 @@ struct pci_cap_saved_state {
180 186
181struct pcie_link_state; 187struct pcie_link_state;
182struct pci_vpd; 188struct pci_vpd;
189struct pci_sriov;
183 190
184/* 191/*
185 * The pci_dev structure is used to describe PCI devices. 192 * The pci_dev structure is used to describe PCI devices.
@@ -257,6 +264,7 @@ struct pci_dev {
257 unsigned int is_managed:1; 264 unsigned int is_managed:1;
258 unsigned int is_pcie:1; 265 unsigned int is_pcie:1;
259 unsigned int state_saved:1; 266 unsigned int state_saved:1;
267 unsigned int is_physfn:1;
260 pci_dev_flags_t dev_flags; 268 pci_dev_flags_t dev_flags;
261 atomic_t enable_cnt; /* pci_enable_device has been called */ 269 atomic_t enable_cnt; /* pci_enable_device has been called */
262 270
@@ -270,6 +278,9 @@ struct pci_dev {
270 struct list_head msi_list; 278 struct list_head msi_list;
271#endif 279#endif
272 struct pci_vpd *vpd; 280 struct pci_vpd *vpd;
281#ifdef CONFIG_PCI_IOV
282 struct pci_sriov *sriov; /* SR-IOV capability related */
283#endif
273}; 284};
274 285
275extern struct pci_dev *alloc_pci_dev(void); 286extern struct pci_dev *alloc_pci_dev(void);