aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-01-09 03:39:43 -0500
committerLen Brown <len.brown@intel.com>2009-01-09 03:39:43 -0500
commitb2576e1d4408e134e2188c967b1f28af39cd79d4 (patch)
tree004f3c82faab760f304ce031d6d2f572e7746a50 /drivers/pci/pci.h
parent3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff)
parent2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff)
Merge branch 'linus' into release
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r--drivers/pci/pci.h34
1 files changed, 26 insertions, 8 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 9de87e9f98f5..1351bb4addde 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -10,6 +10,10 @@ extern int pci_uevent(struct device *dev, struct kobj_uevent_env *env);
10extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); 10extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
11extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); 11extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
12extern void pci_cleanup_rom(struct pci_dev *dev); 12extern void pci_cleanup_rom(struct pci_dev *dev);
13#ifdef HAVE_PCI_MMAP
14extern int pci_mmap_fits(struct pci_dev *pdev, int resno,
15 struct vm_area_struct *vma);
16#endif
13 17
14/** 18/**
15 * Firmware PM callbacks 19 * Firmware PM callbacks
@@ -40,7 +44,11 @@ struct pci_platform_pm_ops {
40}; 44};
41 45
42extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); 46extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
47extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state);
48extern void pci_disable_enabled_device(struct pci_dev *dev);
43extern void pci_pm_init(struct pci_dev *dev); 49extern void pci_pm_init(struct pci_dev *dev);
50extern void platform_pci_wakeup_init(struct pci_dev *dev);
51extern void pci_allocate_cap_save_buffers(struct pci_dev *dev);
44 52
45extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); 53extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
46extern int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); 54extern int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val);
@@ -50,14 +58,14 @@ extern int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val);
50extern int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val); 58extern int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
51 59
52struct pci_vpd_ops { 60struct pci_vpd_ops {
53 int (*read)(struct pci_dev *dev, int pos, int size, char *buf); 61 ssize_t (*read)(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
54 int (*write)(struct pci_dev *dev, int pos, int size, const char *buf); 62 ssize_t (*write)(struct pci_dev *dev, loff_t pos, size_t count, const void *buf);
55 void (*release)(struct pci_dev *dev); 63 void (*release)(struct pci_dev *dev);
56}; 64};
57 65
58struct pci_vpd { 66struct pci_vpd {
59 unsigned int len; 67 unsigned int len;
60 struct pci_vpd_ops *ops; 68 const struct pci_vpd_ops *ops;
61 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */ 69 struct bin_attribute *attr; /* descriptor for sysfs VPD entry */
62}; 70};
63 71
@@ -98,11 +106,9 @@ extern unsigned int pci_pm_d3_delay;
98#ifdef CONFIG_PCI_MSI 106#ifdef CONFIG_PCI_MSI
99void pci_no_msi(void); 107void pci_no_msi(void);
100extern void pci_msi_init_pci_dev(struct pci_dev *dev); 108extern void pci_msi_init_pci_dev(struct pci_dev *dev);
101extern void __devinit msi_init(void);
102#else 109#else
103static inline void pci_no_msi(void) { } 110static inline void pci_no_msi(void) { }
104static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } 111static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
105static inline void msi_init(void) { }
106#endif 112#endif
107 113
108#ifdef CONFIG_PCIEAER 114#ifdef CONFIG_PCIEAER
@@ -159,16 +165,28 @@ struct pci_slot_attribute {
159}; 165};
160#define to_pci_slot_attr(s) container_of(s, struct pci_slot_attribute, attr) 166#define to_pci_slot_attr(s) container_of(s, struct pci_slot_attribute, attr)
161 167
168enum pci_bar_type {
169 pci_bar_unknown, /* Standard PCI BAR probe */
170 pci_bar_io, /* An io port BAR */
171 pci_bar_mem32, /* A 32-bit memory BAR */
172 pci_bar_mem64, /* A 64-bit memory BAR */
173};
174
175extern int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
176 struct resource *res, unsigned int reg);
177extern int pci_resource_bar(struct pci_dev *dev, int resno,
178 enum pci_bar_type *type);
179extern int pci_bus_add_child(struct pci_bus *bus);
162extern void pci_enable_ari(struct pci_dev *dev); 180extern void pci_enable_ari(struct pci_dev *dev);
163/** 181/**
164 * pci_ari_enabled - query ARI forwarding status 182 * pci_ari_enabled - query ARI forwarding status
165 * @dev: the PCI device 183 * @bus: the PCI bus
166 * 184 *
167 * Returns 1 if ARI forwarding is enabled, or 0 if not enabled; 185 * Returns 1 if ARI forwarding is enabled, or 0 if not enabled;
168 */ 186 */
169static inline int pci_ari_enabled(struct pci_dev *dev) 187static inline int pci_ari_enabled(struct pci_bus *bus)
170{ 188{
171 return dev->ari_enabled; 189 return bus->self && bus->self->ari_enabled;
172} 190}
173 191
174#endif /* DRIVERS_PCI_H */ 192#endif /* DRIVERS_PCI_H */