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:45 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:35:13 -0500
commitf7391f5325ea744f0632f7ef39a90085162743ac (patch)
treea7368b2ca639211743ba7fbc0dab7a9efaea02b7 /drivers/pci/hotplug/shpchp.h
parent68c0b671491088d79611fa965bbf94b3bc0024a4 (diff)
[PATCH] shpchp: event handling rework
The event handler of SHPCHP driver is unnecessarily very complex. In addition, current event handler can only a fixed number of events at the same time, and some of events would be lost if several number of events happened at the same time. This patch simplify the event handler by using 'work queue', and it also fix the above-mentioned issue. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> 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/shpchp.h')
-rw-r--r--drivers/pci/hotplug/shpchp.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index 6e1fb1bdc24..87db07cfebd 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -46,6 +46,7 @@
46extern int shpchp_poll_mode; 46extern int shpchp_poll_mode;
47extern int shpchp_poll_time; 47extern int shpchp_poll_time;
48extern int shpchp_debug; 48extern int shpchp_debug;
49extern struct workqueue_struct *shpchp_wq;
49 50
50/*#define dbg(format, arg...) do { if (shpchp_debug) printk(KERN_DEBUG "%s: " format, MY_NAME , ## arg); } while (0)*/ 51/*#define dbg(format, arg...) do { if (shpchp_debug) printk(KERN_DEBUG "%s: " format, MY_NAME , ## arg); } while (0)*/
51#define dbg(format, arg...) do { if (shpchp_debug) printk("%s: " format, MY_NAME , ## arg); } while (0) 52#define dbg(format, arg...) do { if (shpchp_debug) printk("%s: " format, MY_NAME , ## arg); } while (0)
@@ -70,11 +71,13 @@ struct slot {
70 struct hotplug_slot *hotplug_slot; 71 struct hotplug_slot *hotplug_slot;
71 struct list_head slot_list; 72 struct list_head slot_list;
72 char name[SLOT_NAME_SIZE]; 73 char name[SLOT_NAME_SIZE];
74 struct work_struct work; /* work for button event */
73}; 75};
74 76
75struct event_info { 77struct event_info {
76 u32 event_type; 78 u32 event_type;
77 u8 hp_slot; 79 struct slot *p_slot;
80 struct work_struct work;
78}; 81};
79 82
80struct controller { 83struct controller {
@@ -85,11 +88,9 @@ struct controller {
85 int num_slots; /* Number of slots on ctlr */ 88 int num_slots; /* Number of slots on ctlr */
86 int slot_num_inc; /* 1 or -1 */ 89 int slot_num_inc; /* 1 or -1 */
87 struct pci_dev *pci_dev; 90 struct pci_dev *pci_dev;
88 struct event_info event_queue[10];
89 struct list_head slot_list; 91 struct list_head slot_list;
90 struct hpc_ops *hpc_ops; 92 struct hpc_ops *hpc_ops;
91 wait_queue_head_t queue; /* sleep & wake process */ 93 wait_queue_head_t queue; /* sleep & wake process */
92 u8 next_event;
93 u8 bus; 94 u8 bus;
94 u8 device; 95 u8 device;
95 u8 function; 96 u8 function;
@@ -180,9 +181,6 @@ struct hotplug_params {
180/* sysfs functions for the hotplug controller info */ 181/* sysfs functions for the hotplug controller info */
181extern void shpchp_create_ctrl_files (struct controller *ctrl); 182extern void shpchp_create_ctrl_files (struct controller *ctrl);
182 183
183/* controller functions */
184extern int shpchp_event_start_thread(void);
185extern void shpchp_event_stop_thread(void);
186extern int shpchp_enable_slot(struct slot *slot); 184extern int shpchp_enable_slot(struct slot *slot);
187extern int shpchp_disable_slot(struct slot *slot); 185extern int shpchp_disable_slot(struct slot *slot);
188 186
@@ -201,7 +199,8 @@ extern void get_hp_params_from_firmware(struct pci_dev *dev,
201extern int shpchprm_get_physical_slot_number(struct controller *ctrl, 199extern int shpchprm_get_physical_slot_number(struct controller *ctrl,
202 u32 *sun, u8 busnum, u8 devnum); 200 u32 *sun, u8 busnum, u8 devnum);
203extern void shpchp_remove_ctrl_files(struct controller *ctrl); 201extern void shpchp_remove_ctrl_files(struct controller *ctrl);
204 202extern void cleanup_slots(struct controller *ctrl);
203extern void shpchp_pushbutton_thread(void *data);
205 204
206/* Global variables */ 205/* Global variables */
207extern struct list_head shpchp_ctrl_list; 206extern struct list_head shpchp_ctrl_list;