diff options
Diffstat (limited to 'drivers/pci/hotplug/pciehp.h')
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 0aac6a61337d..92c1f0f1e1ad 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/sched.h> /* signal_pending() */ | 35 | #include <linux/sched.h> /* signal_pending() */ |
36 | #include <linux/pcieport_if.h> | 36 | #include <linux/pcieport_if.h> |
37 | #include <linux/mutex.h> | ||
37 | #include "pci_hotplug.h" | 38 | #include "pci_hotplug.h" |
38 | 39 | ||
39 | #define MY_NAME "pciehp" | 40 | #define MY_NAME "pciehp" |
@@ -49,12 +50,6 @@ extern int pciehp_force; | |||
49 | #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) | 50 | #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) |
50 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) | 51 | #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) |
51 | 52 | ||
52 | struct hotplug_params { | ||
53 | u8 cache_line_size; | ||
54 | u8 latency_timer; | ||
55 | u8 enable_serr; | ||
56 | u8 enable_perr; | ||
57 | }; | ||
58 | 53 | ||
59 | struct slot { | 54 | struct slot { |
60 | struct slot *next; | 55 | struct slot *next; |
@@ -96,7 +91,7 @@ struct php_ctlr_state_s { | |||
96 | #define MAX_EVENTS 10 | 91 | #define MAX_EVENTS 10 |
97 | struct controller { | 92 | struct controller { |
98 | struct controller *next; | 93 | struct controller *next; |
99 | struct semaphore crit_sect; /* critical section semaphore */ | 94 | struct mutex crit_sect; /* critical section mutex */ |
100 | struct php_ctlr_state_s *hpc_ctlr_handle; /* HPC controller handle */ | 95 | struct php_ctlr_state_s *hpc_ctlr_handle; /* HPC controller handle */ |
101 | int num_slots; /* Number of slots on ctlr */ | 96 | int num_slots; /* Number of slots on ctlr */ |
102 | int slot_num_inc; /* 1 or -1 */ | 97 | int slot_num_inc; /* 1 or -1 */ |
@@ -191,9 +186,6 @@ extern u8 pciehp_handle_power_fault (u8 hp_slot, void *inst_id); | |||
191 | /* pci functions */ | 186 | /* pci functions */ |
192 | extern int pciehp_configure_device (struct slot *p_slot); | 187 | extern int pciehp_configure_device (struct slot *p_slot); |
193 | extern int pciehp_unconfigure_device (struct slot *p_slot); | 188 | extern int pciehp_unconfigure_device (struct slot *p_slot); |
194 | extern int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev); | ||
195 | extern void pciehp_get_hp_params_from_firmware(struct pci_dev *dev, | ||
196 | struct hotplug_params *hpp); | ||
197 | 189 | ||
198 | 190 | ||
199 | 191 | ||
@@ -285,4 +277,19 @@ struct hpc_ops { | |||
285 | int (*check_lnk_status) (struct controller *ctrl); | 277 | int (*check_lnk_status) (struct controller *ctrl); |
286 | }; | 278 | }; |
287 | 279 | ||
280 | |||
281 | #ifdef CONFIG_ACPI | ||
282 | #define pciehp_get_hp_hw_control_from_firmware(dev) \ | ||
283 | pciehp_acpi_get_hp_hw_control_from_firmware(dev) | ||
284 | static inline int pciehp_get_hp_params_from_firmware(struct pci_dev *dev, | ||
285 | struct hotplug_params *hpp) | ||
286 | { | ||
287 | if (ACPI_FAILURE(acpi_get_hp_params_from_firmware(dev, hpp))) | ||
288 | return -ENODEV; | ||
289 | return 0; | ||
290 | } | ||
291 | #else | ||
292 | #define pciehp_get_hp_hw_control_from_firmware(dev) 0 | ||
293 | #define pciehp_get_hp_params_from_firmware(dev, hpp) (-ENODEV) | ||
294 | #endif /* CONFIG_ACPI */ | ||
288 | #endif /* _PCIEHP_H */ | 295 | #endif /* _PCIEHP_H */ |