aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h74
1 files changed, 47 insertions, 27 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index f6b58b32a67c..fcd81911b127 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -38,21 +38,21 @@ int pci_probe_reset_function(struct pci_dev *dev);
38 * struct pci_platform_pm_ops - Firmware PM callbacks 38 * struct pci_platform_pm_ops - Firmware PM callbacks
39 * 39 *
40 * @is_manageable: returns 'true' if given device is power manageable by the 40 * @is_manageable: returns 'true' if given device is power manageable by the
41 * platform firmware 41 * platform firmware
42 * 42 *
43 * @set_state: invokes the platform firmware to set the device's power state 43 * @set_state: invokes the platform firmware to set the device's power state
44 * 44 *
45 * @get_state: queries the platform firmware for a device's current power state 45 * @get_state: queries the platform firmware for a device's current power state
46 * 46 *
47 * @choose_state: returns PCI power state of given device preferred by the 47 * @choose_state: returns PCI power state of given device preferred by the
48 * platform; to be used during system-wide transitions from a 48 * platform; to be used during system-wide transitions from a
49 * sleeping state to the working state and vice versa 49 * sleeping state to the working state and vice versa
50 * 50 *
51 * @set_wakeup: enables/disables wakeup capability for the device 51 * @set_wakeup: enables/disables wakeup capability for the device
52 * 52 *
53 * @need_resume: returns 'true' if the given device (which is currently 53 * @need_resume: returns 'true' if the given device (which is currently
54 * suspended) needs to be resumed to be configured for system 54 * suspended) needs to be resumed to be configured for system
55 * wakeup. 55 * wakeup.
56 * 56 *
57 * If given platform is generally capable of power managing PCI devices, all of 57 * If given platform is generally capable of power managing PCI devices, all of
58 * these callbacks are mandatory. 58 * these callbacks are mandatory.
@@ -112,7 +112,7 @@ struct pci_vpd_ops {
112 112
113struct pci_vpd { 113struct pci_vpd {
114 const struct pci_vpd_ops *ops; 114 const struct pci_vpd_ops *ops;
115 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ 115 struct bin_attribute *attr; /* Descriptor for sysfs VPD entry */
116 struct mutex lock; 116 struct mutex lock;
117 unsigned int len; 117 unsigned int len;
118 u16 flag; 118 u16 flag;
@@ -199,7 +199,7 @@ extern const struct attribute_group *pci_bus_groups[];
199 199
200/** 200/**
201 * pci_match_one_device - Tell if a PCI device structure has a matching 201 * pci_match_one_device - Tell if a PCI device structure has a matching
202 * PCI device id structure 202 * PCI device id structure
203 * @id: single PCI device id structure to match 203 * @id: single PCI device id structure to match
204 * @dev: the PCI device structure to match against 204 * @dev: the PCI device structure to match against
205 * 205 *
@@ -231,7 +231,7 @@ struct pci_slot_attribute {
231 231
232enum pci_bar_type { 232enum pci_bar_type {
233 pci_bar_unknown, /* Standard PCI BAR probe */ 233 pci_bar_unknown, /* Standard PCI BAR probe */
234 pci_bar_io, /* An io port BAR */ 234 pci_bar_io, /* An I/O port BAR */
235 pci_bar_mem32, /* A 32-bit memory BAR */ 235 pci_bar_mem32, /* A 32-bit memory BAR */
236 pci_bar_mem64, /* A 64-bit memory BAR */ 236 pci_bar_mem64, /* A 64-bit memory BAR */
237}; 237};
@@ -255,24 +255,24 @@ void pci_disable_bridge_window(struct pci_dev *dev);
255 255
256/* Single Root I/O Virtualization */ 256/* Single Root I/O Virtualization */
257struct pci_sriov { 257struct pci_sriov {
258 int pos; /* capability position */ 258 int pos; /* Capability position */
259 int nres; /* number of resources */ 259 int nres; /* Number of resources */
260 u32 cap; /* SR-IOV Capabilities */ 260 u32 cap; /* SR-IOV Capabilities */
261 u16 ctrl; /* SR-IOV Control */ 261 u16 ctrl; /* SR-IOV Control */
262 u16 total_VFs; /* total VFs associated with the PF */ 262 u16 total_VFs; /* Total VFs associated with the PF */
263 u16 initial_VFs; /* initial VFs associated with the PF */ 263 u16 initial_VFs; /* Initial VFs associated with the PF */
264 u16 num_VFs; /* number of VFs available */ 264 u16 num_VFs; /* Number of VFs available */
265 u16 offset; /* first VF Routing ID offset */ 265 u16 offset; /* First VF Routing ID offset */
266 u16 stride; /* following VF stride */ 266 u16 stride; /* Following VF stride */
267 u16 vf_device; /* VF device ID */ 267 u16 vf_device; /* VF device ID */
268 u32 pgsz; /* page size for BAR alignment */ 268 u32 pgsz; /* Page size for BAR alignment */
269 u8 link; /* Function Dependency Link */ 269 u8 link; /* Function Dependency Link */
270 u8 max_VF_buses; /* max buses consumed by VFs */ 270 u8 max_VF_buses; /* Max buses consumed by VFs */
271 u16 driver_max_VFs; /* max num VFs driver supports */ 271 u16 driver_max_VFs; /* Max num VFs driver supports */
272 struct pci_dev *dev; /* lowest numbered PF */ 272 struct pci_dev *dev; /* Lowest numbered PF */
273 struct pci_dev *self; /* this PF */ 273 struct pci_dev *self; /* This PF */
274 resource_size_t barsz[PCI_SRIOV_NUM_BARS]; /* VF BAR size */ 274 resource_size_t barsz[PCI_SRIOV_NUM_BARS]; /* VF BAR size */
275 bool drivers_autoprobe; /* auto probing of VFs by driver */ 275 bool drivers_autoprobe; /* Auto probing of VFs by driver */
276}; 276};
277 277
278/* pci_dev priv_flags */ 278/* pci_dev priv_flags */
@@ -335,13 +335,33 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
335 if (resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END) 335 if (resno >= PCI_IOV_RESOURCES && resno <= PCI_IOV_RESOURCE_END)
336 return pci_sriov_resource_alignment(dev, resno); 336 return pci_sriov_resource_alignment(dev, resno);
337#endif 337#endif
338 if (dev->class >> 8 == PCI_CLASS_BRIDGE_CARDBUS) 338 if (dev->class >> 8 == PCI_CLASS_BRIDGE_CARDBUS)
339 return pci_cardbus_resource_alignment(res); 339 return pci_cardbus_resource_alignment(res);
340 return resource_alignment(res); 340 return resource_alignment(res);
341} 341}
342 342
343void pci_enable_acs(struct pci_dev *dev); 343void pci_enable_acs(struct pci_dev *dev);
344 344
345#ifdef CONFIG_PCIEASPM
346void pcie_aspm_init_link_state(struct pci_dev *pdev);
347void pcie_aspm_exit_link_state(struct pci_dev *pdev);
348void pcie_aspm_pm_state_change(struct pci_dev *pdev);
349void pcie_aspm_powersave_config_link(struct pci_dev *pdev);
350#else
351static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { }
352static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { }
353static inline void pcie_aspm_pm_state_change(struct pci_dev *pdev) { }
354static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { }
355#endif
356
357#ifdef CONFIG_PCIEASPM_DEBUG
358void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
359void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
360#else
361static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) { }
362static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev) { }
363#endif
364
345#ifdef CONFIG_PCIE_PTM 365#ifdef CONFIG_PCIE_PTM
346void pci_ptm_init(struct pci_dev *dev); 366void pci_ptm_init(struct pci_dev *dev);
347#else 367#else