diff options
author | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-01-09 03:39:43 -0500 |
commit | b2576e1d4408e134e2188c967b1f28af39cd79d4 (patch) | |
tree | 004f3c82faab760f304ce031d6d2f572e7746a50 /drivers/pci/pci.h | |
parent | 3cc8a5f4ba91f67bbdb81a43a99281a26aab8d77 (diff) | |
parent | 2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (diff) |
Merge branch 'linus' into release
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 34 |
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); | |||
10 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); | 10 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); |
11 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); | 11 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); |
12 | extern void pci_cleanup_rom(struct pci_dev *dev); | 12 | extern void pci_cleanup_rom(struct pci_dev *dev); |
13 | #ifdef HAVE_PCI_MMAP | ||
14 | extern 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 | ||
42 | extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); | 46 | extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); |
47 | extern void pci_update_current_state(struct pci_dev *dev, pci_power_t state); | ||
48 | extern void pci_disable_enabled_device(struct pci_dev *dev); | ||
43 | extern void pci_pm_init(struct pci_dev *dev); | 49 | extern void pci_pm_init(struct pci_dev *dev); |
50 | extern void platform_pci_wakeup_init(struct pci_dev *dev); | ||
51 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); | ||
44 | 52 | ||
45 | extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); | 53 | extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); |
46 | extern int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val); | 54 | extern 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); | |||
50 | extern int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val); | 58 | extern int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val); |
51 | 59 | ||
52 | struct pci_vpd_ops { | 60 | struct 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 | ||
58 | struct pci_vpd { | 66 | struct 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 |
99 | void pci_no_msi(void); | 107 | void pci_no_msi(void); |
100 | extern void pci_msi_init_pci_dev(struct pci_dev *dev); | 108 | extern void pci_msi_init_pci_dev(struct pci_dev *dev); |
101 | extern void __devinit msi_init(void); | ||
102 | #else | 109 | #else |
103 | static inline void pci_no_msi(void) { } | 110 | static inline void pci_no_msi(void) { } |
104 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 111 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
105 | static 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 | ||
168 | enum 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 | |||
175 | extern int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | ||
176 | struct resource *res, unsigned int reg); | ||
177 | extern int pci_resource_bar(struct pci_dev *dev, int resno, | ||
178 | enum pci_bar_type *type); | ||
179 | extern int pci_bus_add_child(struct pci_bus *bus); | ||
162 | extern void pci_enable_ari(struct pci_dev *dev); | 180 | extern 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 | */ |
169 | static inline int pci_ari_enabled(struct pci_dev *dev) | 187 | static 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 */ |