aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/acpiphp.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 18:49:57 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 18:49:57 -0500
commita3ea9b584ed2acdeae817f0dc91a5880e0828a05 (patch)
tree5b4ef9b10c05aa84419a6ba6187d0dcd14654c97 /drivers/pci/hotplug/acpiphp.h
parent554f593d6c411e717a71ffdcb0cfb46bb2394502 (diff)
parentb2e6e3ba7deb525f180df64f32f3fcb214538bea (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (49 commits) [PATCH] acpiphp: fix acpi_path_name [PATCH] ibmphp: remove TRUE and FALSE [PATCH] PCI Hotplug: add common acpi functions to core [PATCH] PCI: kzalloc() conversion in drivers/pci [PATCH] acpiphp: Scan slots under the nested P2P bridge [PATCH] PCI Hotplug: SN: Fix cleanup on hotplug removal of PPB [PATCH] shpchp: cleanup bus speed handling [PATCH] PCI: fix pci_request_region[s] arg [PATCH] PCI: Provide a boot parameter to disable MSI [PATCH] PCI: the scheduled removal of PCI_LEGACY_PROC [PATCH] PCI: cpqphp_ctrl.c: board_replaced(): remove dead code [PATCH] acpiphp: fix bridge handle [PATCH] acpiphp - slot management fix - V4 [PATCH] acpi: remove dock event handling from ibm_acpi [PATCH] acpiphp: add dock event handling [PATCH] acpi: export acpi_bus_trim [PATCH] acpiphp: add new bus to acpi [PATCH] PCI: Move pci_dev_put outside a spinlock [PATCH] PCI: PCI/Cardbus cards hidden, needs pci=assign-busses to fix [PATCH] PCI: fix problems with MSI-X on ia64 ...
Diffstat (limited to 'drivers/pci/hotplug/acpiphp.h')
-rw-r--r--drivers/pci/hotplug/acpiphp.h62
1 files changed, 42 insertions, 20 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index 293603e1b7c3..467ac70a46ff 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -37,6 +37,7 @@
37 37
38#include <linux/acpi.h> 38#include <linux/acpi.h>
39#include <linux/kobject.h> /* for KOBJ_NAME_LEN */ 39#include <linux/kobject.h> /* for KOBJ_NAME_LEN */
40#include <linux/mutex.h>
40#include "pci_hotplug.h" 41#include "pci_hotplug.h"
41 42
42#define dbg(format, arg...) \ 43#define dbg(format, arg...) \
@@ -59,26 +60,10 @@ struct acpiphp_slot;
59 * struct slot - slot information for each *physical* slot 60 * struct slot - slot information for each *physical* slot
60 */ 61 */
61struct slot { 62struct slot {
62 u8 number;
63 struct hotplug_slot *hotplug_slot; 63 struct hotplug_slot *hotplug_slot;
64 struct list_head slot_list;
65
66 struct acpiphp_slot *acpi_slot; 64 struct acpiphp_slot *acpi_slot;
67}; 65};
68 66
69/**
70 * struct hpp_param - ACPI 2.0 _HPP Hot Plug Parameters
71 * @cache_line_size in DWORD
72 * @latency_timer in PCI clock
73 * @enable_SERR 0 or 1
74 * @enable_PERR 0 or 1
75 */
76struct hpp_param {
77 u8 cache_line_size;
78 u8 latency_timer;
79 u8 enable_SERR;
80 u8 enable_PERR;
81};
82 67
83 68
84/** 69/**
@@ -102,7 +87,7 @@ struct acpiphp_bridge {
102 struct pci_dev *pci_dev; 87 struct pci_dev *pci_dev;
103 88
104 /* ACPI 2.0 _HPP parameters */ 89 /* ACPI 2.0 _HPP parameters */
105 struct hpp_param hpp; 90 struct hotplug_params hpp;
106 91
107 spinlock_t res_lock; 92 spinlock_t res_lock;
108}; 93};
@@ -118,9 +103,9 @@ struct acpiphp_slot {
118 struct acpiphp_bridge *bridge; /* parent */ 103 struct acpiphp_bridge *bridge; /* parent */
119 struct list_head funcs; /* one slot may have different 104 struct list_head funcs; /* one slot may have different
120 objects (i.e. for each function) */ 105 objects (i.e. for each function) */
121 struct semaphore crit_sect; 106 struct slot *slot;
107 struct mutex crit_sect;
122 108
123 u32 id; /* slot id (serial #) for hotplug core */
124 u8 device; /* pci device# */ 109 u8 device; /* pci device# */
125 110
126 u32 sun; /* ACPI _SUN (slot unique number) */ 111 u32 sun; /* ACPI _SUN (slot unique number) */
@@ -160,6 +145,25 @@ struct acpiphp_attention_info
160 struct module *owner; 145 struct module *owner;
161}; 146};
162 147
148
149struct dependent_device {
150 struct list_head device_list;
151 struct list_head pci_list;
152 acpi_handle handle;
153 struct acpiphp_func *func;
154};
155
156
157struct acpiphp_dock_station {
158 acpi_handle handle;
159 u32 last_dock_time;
160 u32 flags;
161 struct acpiphp_func *dock_bridge;
162 struct list_head dependent_devices;
163 struct list_head pci_dependent_devices;
164};
165
166
163/* PCI bus bridge HID */ 167/* PCI bus bridge HID */
164#define ACPI_PCI_HOST_HID "PNP0A03" 168#define ACPI_PCI_HOST_HID "PNP0A03"
165 169
@@ -197,19 +201,27 @@ struct acpiphp_attention_info
197#define FUNC_HAS_PS1 (0x00000020) 201#define FUNC_HAS_PS1 (0x00000020)
198#define FUNC_HAS_PS2 (0x00000040) 202#define FUNC_HAS_PS2 (0x00000040)
199#define FUNC_HAS_PS3 (0x00000080) 203#define FUNC_HAS_PS3 (0x00000080)
204#define FUNC_HAS_DCK (0x00000100)
205#define FUNC_IS_DD (0x00000200)
206
207/* dock station flags */
208#define DOCK_DOCKING (0x00000001)
209#define DOCK_HAS_BRIDGE (0x00000002)
200 210
201/* function prototypes */ 211/* function prototypes */
202 212
203/* acpiphp_core.c */ 213/* acpiphp_core.c */
204extern int acpiphp_register_attention(struct acpiphp_attention_info*info); 214extern int acpiphp_register_attention(struct acpiphp_attention_info*info);
205extern int acpiphp_unregister_attention(struct acpiphp_attention_info *info); 215extern int acpiphp_unregister_attention(struct acpiphp_attention_info *info);
216extern int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot);
217extern void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
206 218
207/* acpiphp_glue.c */ 219/* acpiphp_glue.c */
208extern int acpiphp_glue_init (void); 220extern int acpiphp_glue_init (void);
209extern void acpiphp_glue_exit (void); 221extern void acpiphp_glue_exit (void);
210extern int acpiphp_get_num_slots (void); 222extern int acpiphp_get_num_slots (void);
211extern struct acpiphp_slot *get_slot_from_id (int id);
212typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); 223typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
224void handle_hotplug_event_func(acpi_handle, u32, void*);
213 225
214extern int acpiphp_enable_slot (struct acpiphp_slot *slot); 226extern int acpiphp_enable_slot (struct acpiphp_slot *slot);
215extern int acpiphp_disable_slot (struct acpiphp_slot *slot); 227extern int acpiphp_disable_slot (struct acpiphp_slot *slot);
@@ -219,6 +231,16 @@ extern u8 acpiphp_get_latch_status (struct acpiphp_slot *slot);
219extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); 231extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
220extern u32 acpiphp_get_address (struct acpiphp_slot *slot); 232extern u32 acpiphp_get_address (struct acpiphp_slot *slot);
221 233
234/* acpiphp_dock.c */
235extern int find_dock_station(void);
236extern void remove_dock_station(void);
237extern void add_dependent_device(struct dependent_device *new_dd);
238extern void add_pci_dependent_device(struct dependent_device *new_dd);
239extern struct dependent_device *get_dependent_device(acpi_handle handle);
240extern int is_dependent_device(acpi_handle handle);
241extern int detect_dependent_devices(acpi_handle *bridge_handle);
242extern struct dependent_device *alloc_dependent_device(acpi_handle handle);
243
222/* variables */ 244/* variables */
223extern int acpiphp_debug; 245extern int acpiphp_debug;
224 246