aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp.h
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2006-02-21 18:45:48 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:35:13 -0500
commita246fa4e9f0f1b5096a1cad0659d22fb10fb3732 (patch)
tree21490f4d1d2794a9ccd64529431fbbd8f4e234e7 /drivers/pci/hotplug/shpchp.h
parentf7391f5325ea744f0632f7ef39a90085162743ac (diff)
[PATCH] shpchp: Fix slot state handling
Current SHPCHP driver doesn't care about the confliction between hotplug operation via sysfs and hotplug operation via attention button. So if those ware conflicted, slot could be an unexpected state. This patch changes SHPCHP driver to handle slot state properly. With this patch, slot events are handled according to the current slot state as shown at the Table below. Table. Slot States and Event Handling ========================================================================= Slot State Event and Action ========================================================================= STATIC - Go to POWERON state if user initiates (Slot enabled, insertion request via sysfs Slot disabled) - Go to POWEROFF state if user initiates removal request via sysfs - Go to BLINKINGON state if user presses attention button when the slot is disabled - Go to BLINKINGOFF state if user presses attention button when the slot is enabled
Diffstat (limited to 'drivers/pci/hotplug/shpchp.h')
-rw-r--r--drivers/pci/hotplug/shpchp.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index 87db07cfebdf..dd449512cf68 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -72,6 +72,7 @@ struct slot {
72 struct list_head slot_list; 72 struct list_head slot_list;
73 char name[SLOT_NAME_SIZE]; 73 char name[SLOT_NAME_SIZE];
74 struct work_struct work; /* work for button event */ 74 struct work_struct work; /* work for button event */
75 struct mutex lock;
75}; 76};
76 77
77struct event_info { 78struct event_info {
@@ -181,8 +182,8 @@ struct hotplug_params {
181/* sysfs functions for the hotplug controller info */ 182/* sysfs functions for the hotplug controller info */
182extern void shpchp_create_ctrl_files (struct controller *ctrl); 183extern void shpchp_create_ctrl_files (struct controller *ctrl);
183 184
184extern int shpchp_enable_slot(struct slot *slot); 185extern int shpchp_sysfs_enable_slot(struct slot *slot);
185extern int shpchp_disable_slot(struct slot *slot); 186extern int shpchp_sysfs_disable_slot(struct slot *slot);
186 187
187extern u8 shpchp_handle_attention_button(u8 hp_slot, void *inst_id); 188extern u8 shpchp_handle_attention_button(u8 hp_slot, void *inst_id);
188extern u8 shpchp_handle_switch_change(u8 hp_slot, void *inst_id); 189extern u8 shpchp_handle_switch_change(u8 hp_slot, void *inst_id);
@@ -200,7 +201,7 @@ extern int shpchprm_get_physical_slot_number(struct controller *ctrl,
200 u32 *sun, u8 busnum, u8 devnum); 201 u32 *sun, u8 busnum, u8 devnum);
201extern void shpchp_remove_ctrl_files(struct controller *ctrl); 202extern void shpchp_remove_ctrl_files(struct controller *ctrl);
202extern void cleanup_slots(struct controller *ctrl); 203extern void cleanup_slots(struct controller *ctrl);
203extern void shpchp_pushbutton_thread(void *data); 204extern void queue_pushbutton_work(void *data);
204 205
205/* Global variables */ 206/* Global variables */
206extern struct list_head shpchp_ctrl_list; 207extern struct list_head shpchp_ctrl_list;