aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2015-07-17 15:15:19 -0500
committerBjorn Helgaas <bhelgaas@google.com>2015-08-13 15:57:21 -0500
commitd544d75ac96aa1b0a8a378826626a0fbd8ce4380 (patch)
treec289b1bd150373bfea74cbf2a224d9bd2569ae28 /include/linux
parentPCI: Allocate ATS struct during enumeration (diff)
downloadlinux-dev-d544d75ac96aa1b0a8a378826626a0fbd8ce4380.tar.xz
linux-dev-d544d75ac96aa1b0a8a378826626a0fbd8ce4380.zip
PCI: Embed ATS info directly into struct pci_dev
The pci_ats struct is small and will get smaller, so I don't think it's worth allocating it separately from the pci_dev struct. Embed the ATS fields directly into struct pci_dev. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci-ats.h10
-rw-r--r--include/linux/pci.h8
2 files changed, 6 insertions, 12 deletions
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index e2dcc2ff3d0e..5d81d47b0a95 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -4,14 +4,6 @@
#include <linux/pci.h>
/* Address Translation Service */
-struct pci_ats {
- int pos; /* capability position */
- int stu; /* Smallest Translation Unit */
- int qdep; /* Invalidate Queue Depth */
- atomic_t ref_cnt; /* number of VFs with ATS enabled */
- unsigned int is_enabled:1; /* Enable bit is set */
-};
-
#ifdef CONFIG_PCI_ATS
int pci_enable_ats(struct pci_dev *dev, int ps);
@@ -26,7 +18,7 @@ int pci_ats_queue_depth(struct pci_dev *dev);
*/
static inline int pci_ats_enabled(struct pci_dev *dev)
{
- return dev->ats && dev->ats->is_enabled;
+ return dev->ats_cap && dev->ats_enabled;
}
#else /* CONFIG_PCI_ATS */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1817819ba57b..8bc16b5e4747 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -343,6 +343,7 @@ struct pci_dev {
unsigned int msi_enabled:1;
unsigned int msix_enabled:1;
unsigned int ari_enabled:1; /* ARI forwarding */
+ unsigned int ats_enabled:1; /* Address Translation Service */
unsigned int is_managed:1;
unsigned int needs_freset:1; /* Dev requires fundamental reset */
unsigned int state_saved:1;
@@ -375,7 +376,10 @@ struct pci_dev {
struct pci_sriov *sriov; /* SR-IOV capability related */
struct pci_dev *physfn; /* the PF this VF is associated with */
};
- struct pci_ats *ats; /* Address Translation Service */
+ int ats_cap; /* ATS Capability offset */
+ int ats_stu; /* ATS Smallest Translation Unit */
+ int ats_qdep; /* ATS Invalidate Queue Depth */
+ atomic_t ats_ref_cnt; /* number of VFs with ATS enabled */
#endif
phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */
size_t romlen; /* Length of ROM if it's not from the BAR */
@@ -1297,10 +1301,8 @@ void ht_destroy_irq(unsigned int irq);
#ifdef CONFIG_PCI_ATS
/* Address Translation Service */
void pci_ats_init(struct pci_dev *dev);
-void pci_ats_free(struct pci_dev *dev);
#else
static inline void pci_ats_init(struct pci_dev *dev) { }
-static inline void pci_ats_free(struct pci_dev *dev) { }
#endif
void pci_cfg_access_lock(struct pci_dev *dev);