aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/pciehp.h')
-rw-r--r--drivers/pci/hotplug/pciehp.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index b23f8ca03d82..b7054cb885cf 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -75,7 +75,6 @@ struct slot {
75 u8 state; 75 u8 state;
76 u32 number; 76 u32 number;
77 struct controller *ctrl; 77 struct controller *ctrl;
78 struct hpc_ops *hpc_ops;
79 struct hotplug_slot *hotplug_slot; 78 struct hotplug_slot *hotplug_slot;
80 struct delayed_work work; /* work for button event */ 79 struct delayed_work work; /* work for button event */
81 struct mutex lock; 80 struct mutex lock;
@@ -91,7 +90,6 @@ struct controller {
91 struct mutex ctrl_lock; /* controller lock */ 90 struct mutex ctrl_lock; /* controller lock */
92 struct pcie_device *pcie; /* PCI Express port service */ 91 struct pcie_device *pcie; /* PCI Express port service */
93 struct slot *slot; 92 struct slot *slot;
94 struct hpc_ops *hpc_ops;
95 wait_queue_head_t queue; /* sleep & wake process */ 93 wait_queue_head_t queue; /* sleep & wake process */
96 u32 slot_cap; 94 u32 slot_cap;
97 u8 cap_base; 95 u8 cap_base;
@@ -154,7 +152,7 @@ struct controller {
154extern int pciehp_sysfs_enable_slot(struct slot *slot); 152extern int pciehp_sysfs_enable_slot(struct slot *slot);
155extern int pciehp_sysfs_disable_slot(struct slot *slot); 153extern int pciehp_sysfs_disable_slot(struct slot *slot);
156extern u8 pciehp_handle_attention_button(struct slot *p_slot); 154extern u8 pciehp_handle_attention_button(struct slot *p_slot);
157 extern u8 pciehp_handle_switch_change(struct slot *p_slot); 155extern u8 pciehp_handle_switch_change(struct slot *p_slot);
158extern u8 pciehp_handle_presence_change(struct slot *p_slot); 156extern u8 pciehp_handle_presence_change(struct slot *p_slot);
159extern u8 pciehp_handle_power_fault(struct slot *p_slot); 157extern u8 pciehp_handle_power_fault(struct slot *p_slot);
160extern int pciehp_configure_device(struct slot *p_slot); 158extern int pciehp_configure_device(struct slot *p_slot);
@@ -165,32 +163,30 @@ int pcie_init_notification(struct controller *ctrl);
165int pciehp_enable_slot(struct slot *p_slot); 163int pciehp_enable_slot(struct slot *p_slot);
166int pciehp_disable_slot(struct slot *p_slot); 164int pciehp_disable_slot(struct slot *p_slot);
167int pcie_enable_notification(struct controller *ctrl); 165int pcie_enable_notification(struct controller *ctrl);
166int pciehp_power_on_slot(struct slot *slot);
167int pciehp_power_off_slot(struct slot *slot);
168int pciehp_get_power_status(struct slot *slot, u8 *status);
169int pciehp_get_attention_status(struct slot *slot, u8 *status);
170
171int pciehp_set_attention_status(struct slot *slot, u8 status);
172int pciehp_get_latch_status(struct slot *slot, u8 *status);
173int pciehp_get_adapter_status(struct slot *slot, u8 *status);
174int pciehp_get_max_link_speed(struct slot *slot, enum pci_bus_speed *speed);
175int pciehp_get_max_link_width(struct slot *slot, enum pcie_link_width *val);
176int pciehp_get_cur_link_speed(struct slot *slot, enum pci_bus_speed *speed);
177int pciehp_get_cur_link_width(struct slot *slot, enum pcie_link_width *val);
178int pciehp_query_power_fault(struct slot *slot);
179void pciehp_green_led_on(struct slot *slot);
180void pciehp_green_led_off(struct slot *slot);
181void pciehp_green_led_blink(struct slot *slot);
182int pciehp_check_link_status(struct controller *ctrl);
183void pciehp_release_ctrl(struct controller *ctrl);
168 184
169static inline const char *slot_name(struct slot *slot) 185static inline const char *slot_name(struct slot *slot)
170{ 186{
171 return hotplug_slot_name(slot->hotplug_slot); 187 return hotplug_slot_name(slot->hotplug_slot);
172} 188}
173 189
174struct hpc_ops {
175 int (*power_on_slot)(struct slot *slot);
176 int (*power_off_slot)(struct slot *slot);
177 int (*get_power_status)(struct slot *slot, u8 *status);
178 int (*get_attention_status)(struct slot *slot, u8 *status);
179 int (*set_attention_status)(struct slot *slot, u8 status);
180 int (*get_latch_status)(struct slot *slot, u8 *status);
181 int (*get_adapter_status)(struct slot *slot, u8 *status);
182 int (*get_max_bus_speed)(struct slot *slot, enum pci_bus_speed *speed);
183 int (*get_cur_bus_speed)(struct slot *slot, enum pci_bus_speed *speed);
184 int (*get_max_lnk_width)(struct slot *slot, enum pcie_link_width *val);
185 int (*get_cur_lnk_width)(struct slot *slot, enum pcie_link_width *val);
186 int (*query_power_fault)(struct slot *slot);
187 void (*green_led_on)(struct slot *slot);
188 void (*green_led_off)(struct slot *slot);
189 void (*green_led_blink)(struct slot *slot);
190 void (*release_ctlr)(struct controller *ctrl);
191 int (*check_lnk_status)(struct controller *ctrl);
192};
193
194#ifdef CONFIG_ACPI 190#ifdef CONFIG_ACPI
195#include <acpi/acpi.h> 191#include <acpi/acpi.h>
196#include <acpi/acpi_bus.h> 192#include <acpi/acpi_bus.h>