diff options
author | Kristen Accardi <kristen.c.accardi@intel.com> | 2006-02-23 20:56:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:15 -0500 |
commit | 20416ea54087c25502d6fb973b8e119973e16341 (patch) | |
tree | 47ca50997cbb408852021315ff4da315292467c2 /drivers/pci/hotplug/acpiphp.h | |
parent | ceaba663055e38226a070a9668eac5881d65a2cc (diff) |
[PATCH] acpiphp: add dock event handling
These patches add generic dock event handling to acpiphp. If there are
pci devices that need to be inserted/removed after the dock event, the
event notification will be handed down to the normal pci hotplug event
handler in acpiphp so that new bridges/devices can be enumerated.
Because some dock stations do not have pci bridges or pci devices that
need to be inserted after a dock, acpiphp will remain loaded to handle
dock events even if no hotpluggable pci slots are discovered.
You probably need to have the pci=assign-busses kernel parameter enabled
to use these patches, and you may not allow ibm_acpi to handle docking
notifications and use this patch.
This patch incorporates feedback provided by many.
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp.h')
-rw-r--r-- | drivers/pci/hotplug/acpiphp.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index 6a91cfb0f688..885838a2e93f 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h | |||
@@ -161,6 +161,25 @@ struct acpiphp_attention_info | |||
161 | struct module *owner; | 161 | struct module *owner; |
162 | }; | 162 | }; |
163 | 163 | ||
164 | |||
165 | struct dependent_device { | ||
166 | struct list_head device_list; | ||
167 | struct list_head pci_list; | ||
168 | acpi_handle handle; | ||
169 | struct acpiphp_func *func; | ||
170 | }; | ||
171 | |||
172 | |||
173 | struct acpiphp_dock_station { | ||
174 | acpi_handle handle; | ||
175 | u32 last_dock_time; | ||
176 | u32 flags; | ||
177 | struct acpiphp_func *dock_bridge; | ||
178 | struct list_head dependent_devices; | ||
179 | struct list_head pci_dependent_devices; | ||
180 | }; | ||
181 | |||
182 | |||
164 | /* PCI bus bridge HID */ | 183 | /* PCI bus bridge HID */ |
165 | #define ACPI_PCI_HOST_HID "PNP0A03" | 184 | #define ACPI_PCI_HOST_HID "PNP0A03" |
166 | 185 | ||
@@ -198,6 +217,12 @@ struct acpiphp_attention_info | |||
198 | #define FUNC_HAS_PS1 (0x00000020) | 217 | #define FUNC_HAS_PS1 (0x00000020) |
199 | #define FUNC_HAS_PS2 (0x00000040) | 218 | #define FUNC_HAS_PS2 (0x00000040) |
200 | #define FUNC_HAS_PS3 (0x00000080) | 219 | #define FUNC_HAS_PS3 (0x00000080) |
220 | #define FUNC_HAS_DCK (0x00000100) | ||
221 | #define FUNC_IS_DD (0x00000200) | ||
222 | |||
223 | /* dock station flags */ | ||
224 | #define DOCK_DOCKING (0x00000001) | ||
225 | #define DOCK_HAS_BRIDGE (0x00000002) | ||
201 | 226 | ||
202 | /* function prototypes */ | 227 | /* function prototypes */ |
203 | 228 | ||
@@ -211,6 +236,7 @@ extern void acpiphp_glue_exit (void); | |||
211 | extern int acpiphp_get_num_slots (void); | 236 | extern int acpiphp_get_num_slots (void); |
212 | extern struct acpiphp_slot *get_slot_from_id (int id); | 237 | extern struct acpiphp_slot *get_slot_from_id (int id); |
213 | typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); | 238 | typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); |
239 | void handle_hotplug_event_func(acpi_handle, u32, void*); | ||
214 | 240 | ||
215 | extern int acpiphp_enable_slot (struct acpiphp_slot *slot); | 241 | extern int acpiphp_enable_slot (struct acpiphp_slot *slot); |
216 | extern int acpiphp_disable_slot (struct acpiphp_slot *slot); | 242 | extern int acpiphp_disable_slot (struct acpiphp_slot *slot); |
@@ -220,6 +246,16 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot); | |||
220 | extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); | 246 | extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); |
221 | extern u32 acpiphp_get_address (struct acpiphp_slot *slot); | 247 | extern u32 acpiphp_get_address (struct acpiphp_slot *slot); |
222 | 248 | ||
249 | /* acpiphp_dock.c */ | ||
250 | extern int find_dock_station(void); | ||
251 | extern void remove_dock_station(void); | ||
252 | extern void add_dependent_device(struct dependent_device *new_dd); | ||
253 | extern void add_pci_dependent_device(struct dependent_device *new_dd); | ||
254 | extern struct dependent_device *get_dependent_device(acpi_handle handle); | ||
255 | extern int is_dependent_device(acpi_handle handle); | ||
256 | extern int detect_dependent_devices(acpi_handle *bridge_handle); | ||
257 | extern struct dependent_device *alloc_dependent_device(acpi_handle handle); | ||
258 | |||
223 | /* variables */ | 259 | /* variables */ |
224 | extern int acpiphp_debug; | 260 | extern int acpiphp_debug; |
225 | 261 | ||