diff options
author | Russell Currey <ruscur@russell.cc> | 2017-08-17 16:04:44 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-08-21 11:58:19 +1000 |
commit | f77837bda34f4ad68ba0c5723a4e2fafa8a9e017 (patch) | |
tree | 0fed23ea33b225f6ffb261bd6f1ebca75f975e62 | |
parent | 2a54e4f87be5c39baecf9403f0faac5121d23358 (diff) | |
download | skiboot-f77837bda34f4ad68ba0c5723a4e2fafa8a9e017.zip skiboot-f77837bda34f4ad68ba0c5723a4e2fafa8a9e017.tar.gz skiboot-f77837bda34f4ad68ba0c5723a4e2fafa8a9e017.tar.bz2 |
pci: Track whether a PCI device is a virtual function
This can be checked from config space, but we will need to know this when
restoring the PCI topology, and it is not always safe to access config
space during this period.
Signed-off-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/pci-iov.c | 1 | ||||
-rw-r--r-- | core/pci.c | 1 | ||||
-rw-r--r-- | include/pci.h | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/core/pci-iov.c b/core/pci-iov.c index 9d75b37..06fc4c6 100644 --- a/core/pci-iov.c +++ b/core/pci-iov.c @@ -175,6 +175,7 @@ static void pci_iov_init_VF(struct pci_device *pd, struct pci_device *vf) { vf->is_bridge = false; vf->is_multifunction = false; + vf->is_vf = true; vf->dev_type = PCIE_TYPE_ENDPOINT; vf->scan_map = -1; vf->vdid = pd->vdid; @@ -273,6 +273,7 @@ static struct pci_device *pci_scan_one(struct phb *phb, struct pci_device *paren } pd->is_multifunction = !!(htype & 0x80); pd->is_bridge = (htype & 0x7f) != 0; + pd->is_vf = false; pd->scan_map = 0xffffffff; /* Default */ pd->primary_bus = (bdfn >> 8); diff --git a/include/pci.h b/include/pci.h index 54a62fd..884ce62 100644 --- a/include/pci.h +++ b/include/pci.h @@ -65,6 +65,7 @@ struct pci_device { uint16_t bdfn; bool is_bridge; bool is_multifunction; + bool is_vf; uint8_t dev_type; /* PCIE */ uint8_t primary_bus; uint8_t secondary_bus; |