[PATCH] shpchp: fix improper write to Command Completion Detect bit
[powerpc.git] / drivers / pci / hotplug / shpchp.h
index 052c11f..55b0cd1 100644 (file)
@@ -32,8 +32,8 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <asm/semaphore.h>
-#include <asm/io.h>            
+#include <linux/sched.h>       /* signal_pending(), struct timer_list */
+
 #include "pci_hotplug.h"
 
 #if !defined(MODULE)
@@ -80,7 +80,7 @@ struct event_info {
 struct controller {
        struct controller *next;
        struct semaphore crit_sect;     /* critical section semaphore */
-       void * hpc_ctlr_handle;         /* HPC controller handle */
+       struct php_ctlr_state_s *hpc_ctlr_handle; /* HPC controller handle */
        int num_slots;                  /* Number of slots on ctlr */
        int slot_num_inc;               /* 1 or -1 */
        struct pci_dev *pci_dev;
@@ -98,6 +98,9 @@ struct controller {
        enum pci_bus_speed speed;
        u32 first_slot;         /* First physical slot number */
        u8 slot_bus;            /* Bus where the slots handled by this controller sit */
+       u32 cap_offset;
+       unsigned long mmio_base;
+       unsigned long mmio_size;
 };
 
 struct hotplug_params {
@@ -175,6 +178,7 @@ extern void get_hp_params_from_firmware(struct pci_dev *dev,
                struct hotplug_params *hpp);
 extern int     shpchprm_get_physical_slot_number(struct controller *ctrl,
                u32 *sun, u8 busnum, u8 devnum);
+extern void    shpchp_remove_ctrl_files(struct controller *ctrl);
 
 
 /* Global variables */
@@ -234,7 +238,7 @@ enum ctrl_offsets {
        SLOT11 =        offsetof(struct ctrl_reg, slot11),
        SLOT12 =        offsetof(struct ctrl_reg, slot12),
 };
-typedef u8(*php_intr_callback_t) (unsigned int change_id, void *instance_id);
+typedef u8(*php_intr_callback_t) (u8 hp_slot, void *instance_id);
 struct php_ctlr_state_s {
        struct php_ctlr_state_s *pnext;
        struct pci_dev *pci_dev;
@@ -295,12 +299,9 @@ static inline struct slot *shpchp_find_slot (struct controller *ctrl, u8 device)
 
        p_slot = ctrl->slot;
 
-       dbg("p_slot = %p\n", p_slot);
-
        while (p_slot && (p_slot->device != device)) {
                tmp_slot = p_slot;
                p_slot = p_slot->next;
-               dbg("In while loop, p_slot = %p\n", p_slot);
        }
        if (p_slot == NULL) {
                err("ERROR: shpchp_find_slot device=0x%x\n", device);
@@ -315,8 +316,6 @@ static inline int wait_for_ctrl_irq (struct controller *ctrl)
     DECLARE_WAITQUEUE(wait, current);
        int retval = 0;
 
-       dbg("%s : start\n",__FUNCTION__);
-
        add_wait_queue(&ctrl->queue, &wait);
 
        if (!shpchp_poll_mode) {
@@ -330,7 +329,6 @@ static inline int wait_for_ctrl_irq (struct controller *ctrl)
        if (signal_pending(current))
                retval =  -EINTR;
 
-       dbg("%s : end\n", __FUNCTION__);
        return retval;
 }
 
@@ -347,11 +345,7 @@ enum php_ctlr_type {
        ACPI
 };
 
-int shpc_init( struct controller *ctrl, struct pci_dev *pdev,
-               php_intr_callback_t attention_button_callback,
-               php_intr_callback_t switch_change_callback,
-               php_intr_callback_t presence_change_callback,
-               php_intr_callback_t power_fault_callback);
+int shpc_init( struct controller *ctrl, struct pci_dev *pdev);
 
 int shpc_get_ctlr_slot_config( struct controller *ctrl,
                int *num_ctlr_slots,
@@ -364,8 +358,6 @@ struct hpc_ops {
        int     (*power_on_slot )               (struct slot *slot);
        int     (*slot_enable )                 (struct slot *slot);
        int     (*slot_disable )                (struct slot *slot);
-       int     (*enable_all_slots)             (struct slot *slot);
-       int     (*pwr_on_all_slots)             (struct slot *slot);
        int     (*set_bus_speed_mode)   (struct slot *slot, enum pci_bus_speed speed);
        int     (*get_power_status)             (struct slot *slot, u8 *status);
        int     (*get_attention_status) (struct slot *slot, u8 *status);