diff options
author | Yu Zhao <yu.zhao@intel.com> | 2009-03-19 23:25:11 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-03-20 13:48:22 -0400 |
commit | d1b054da8f599905f3c18a218961dcf17f9d5f13 (patch) | |
tree | 99b62e6771c3b73142dd0622463bed0e19724342 /include/linux/pci_regs.h | |
parent | 8293b0f629095efbe7c7e3f9b437f8c040c19eb5 (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_regs.h')
-rw-r--r-- | include/linux/pci_regs.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index b647a4df59fc..d4e663877f45 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -375,6 +375,7 @@ | |||
375 | #define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ | 375 | #define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ |
376 | #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ | 376 | #define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ |
377 | #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ | 377 | #define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ |
378 | #define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ | ||
378 | #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ | 379 | #define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ |
379 | #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ | 380 | #define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ |
380 | #define PCI_EXP_DEVCAP 4 /* Device capabilities */ | 381 | #define PCI_EXP_DEVCAP 4 /* Device capabilities */ |
@@ -498,6 +499,7 @@ | |||
498 | #define PCI_EXT_CAP_ID_DSN 3 | 499 | #define PCI_EXT_CAP_ID_DSN 3 |
499 | #define PCI_EXT_CAP_ID_PWR 4 | 500 | #define PCI_EXT_CAP_ID_PWR 4 |
500 | #define PCI_EXT_CAP_ID_ARI 14 | 501 | #define PCI_EXT_CAP_ID_ARI 14 |
502 | #define PCI_EXT_CAP_ID_SRIOV 16 | ||
501 | 503 | ||
502 | /* Advanced Error Reporting */ | 504 | /* Advanced Error Reporting */ |
503 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ | 505 | #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ |
@@ -615,4 +617,35 @@ | |||
615 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ | 617 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ |
616 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ | 618 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ |
617 | 619 | ||
620 | /* Single Root I/O Virtualization */ | ||
621 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | ||
622 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ | ||
623 | #define PCI_SRIOV_CAP_INTR(x) ((x) >> 21) /* Interrupt Message Number */ | ||
624 | #define PCI_SRIOV_CTRL 0x08 /* SR-IOV Control */ | ||
625 | #define PCI_SRIOV_CTRL_VFE 0x01 /* VF Enable */ | ||
626 | #define PCI_SRIOV_CTRL_VFM 0x02 /* VF Migration Enable */ | ||
627 | #define PCI_SRIOV_CTRL_INTR 0x04 /* VF Migration Interrupt Enable */ | ||
628 | #define PCI_SRIOV_CTRL_MSE 0x08 /* VF Memory Space Enable */ | ||
629 | #define PCI_SRIOV_CTRL_ARI 0x10 /* ARI Capable Hierarchy */ | ||
630 | #define PCI_SRIOV_STATUS 0x0a /* SR-IOV Status */ | ||
631 | #define PCI_SRIOV_STATUS_VFM 0x01 /* VF Migration Status */ | ||
632 | #define PCI_SRIOV_INITIAL_VF 0x0c /* Initial VFs */ | ||
633 | #define PCI_SRIOV_TOTAL_VF 0x0e /* Total VFs */ | ||
634 | #define PCI_SRIOV_NUM_VF 0x10 /* Number of VFs */ | ||
635 | #define PCI_SRIOV_FUNC_LINK 0x12 /* Function Dependency Link */ | ||
636 | #define PCI_SRIOV_VF_OFFSET 0x14 /* First VF Offset */ | ||
637 | #define PCI_SRIOV_VF_STRIDE 0x16 /* Following VF Stride */ | ||
638 | #define PCI_SRIOV_VF_DID 0x1a /* VF Device ID */ | ||
639 | #define PCI_SRIOV_SUP_PGSIZE 0x1c /* Supported Page Sizes */ | ||
640 | #define PCI_SRIOV_SYS_PGSIZE 0x20 /* System Page Size */ | ||
641 | #define PCI_SRIOV_BAR 0x24 /* VF BAR0 */ | ||
642 | #define PCI_SRIOV_NUM_BARS 6 /* Number of VF BARs */ | ||
643 | #define PCI_SRIOV_VFM 0x3c /* VF Migration State Array Offset*/ | ||
644 | #define PCI_SRIOV_VFM_BIR(x) ((x) & 7) /* State BIR */ | ||
645 | #define PCI_SRIOV_VFM_OFFSET(x) ((x) & ~7) /* State Offset */ | ||
646 | #define PCI_SRIOV_VFM_UA 0x0 /* Inactive.Unavailable */ | ||
647 | #define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ | ||
648 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | ||
649 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | ||
650 | |||
618 | #endif /* LINUX_PCI_REGS_H */ | 651 | #endif /* LINUX_PCI_REGS_H */ |