fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / pci / hotplug / cpqphp.h
index 4da5bac..298ad7f 100644 (file)
 #ifndef _CPQPHP_H
 #define _CPQPHP_H
 
-#include "pci_hotplug.h"
 #include <linux/interrupt.h>
 #include <asm/io.h>            /* for read? and write? functions */
 #include <linux/delay.h>       /* for delays */
+#include <linux/mutex.h>
 
 #define MY_NAME        "cpqphp"
 
@@ -268,7 +268,7 @@ struct slot {
        struct timer_list task_event;
        u8 hp_slot;
        struct controller *ctrl;
-       void *p_sm_slot;
+       void __iomem *p_sm_slot;
        struct hotplug_slot *hotplug_slot;
 };
 
@@ -286,8 +286,8 @@ struct event_info {
 struct controller {
        struct controller *next;
        u32 ctrl_int_comp;
-       struct semaphore crit_sect;     /* critical section semaphore */
-       void *hpc_reg;                  /* cookie for our pci controller location */
+       struct mutex crit_sect;         /* critical section mutex */
+       void __iomem *hpc_reg;          /* cookie for our pci controller location */
        struct pci_resource *mem_head;
        struct pci_resource *p_mem_head;
        struct pci_resource *io_head;
@@ -317,6 +317,7 @@ struct controller {
        u16 vendor_id;
        struct work_struct int_task_event;
        wait_queue_head_t queue;        /* sleep & wake process */
+       struct dentry *dentry;          /* debugfs dentry */
 };
 
 struct irq_mapping {
@@ -399,13 +400,16 @@ struct resource_lists {
 #define msg_button_ignore      "PCI slot #%d - button press ignored.  (action in progress...)\n"
 
 
-/* sysfs functions for the hotplug controller info */
-extern void cpqhp_create_ctrl_files            (struct controller *ctrl);
+/* debugfs functions for the hotplug controller info */
+extern void cpqhp_initialize_debugfs           (void);
+extern void cpqhp_shutdown_debugfs             (void);
+extern void cpqhp_create_debugfs_files         (struct controller *ctrl);
+extern void cpqhp_remove_debugfs_files         (struct controller *ctrl);
 
 /* controller functions */
 extern void    cpqhp_pushbutton_thread         (unsigned long event_pointer);
-extern irqreturn_t cpqhp_ctrl_intr             (int IRQ, void *data, struct pt_regs *regs);
-extern int     cpqhp_find_available_resources  (struct controller *ctrl, void *rom_start);
+extern irqreturn_t cpqhp_ctrl_intr             (int IRQ, void *data);
+extern int     cpqhp_find_available_resources  (struct controller *ctrl, void __iomem *rom_start);
 extern int     cpqhp_event_start_thread        (void);
 extern void    cpqhp_event_stop_thread         (void);
 extern struct pci_func *cpqhp_slot_create      (unsigned char busnumber);
@@ -707,9 +711,8 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl)
 
        dbg("%s - start\n", __FUNCTION__);
        add_wait_queue(&ctrl->queue, &wait);
-       set_current_state(TASK_INTERRUPTIBLE);
        /* Sleep for up to 1 second to wait for the LED to change. */
-       schedule_timeout(1*HZ);
+       msleep_interruptible(1000);
        remove_wait_queue(&ctrl->queue, &wait);
        if (signal_pending(current))
                retval =  -EINTR;