]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/pciehp.h
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / drivers / pci / hotplug / pciehp.h
index 17167d594472878312cde638cdf32ba1f5e52518..8264a76804354ffb011a8abc8ce6dddc19cdd975 100644 (file)
@@ -43,6 +43,7 @@ extern int pciehp_poll_mode;
 extern int pciehp_poll_time;
 extern int pciehp_debug;
 extern int pciehp_force;
+extern struct workqueue_struct *pciehp_wq;
 
 #define dbg(format, arg...)                                            \
        do {                                                            \
@@ -69,37 +70,33 @@ struct slot {
        struct hotplug_slot *hotplug_slot;
        struct list_head        slot_list;
        char name[SLOT_NAME_SIZE];
+       unsigned long last_emi_toggle;
+       struct delayed_work work;       /* work for button event */
+       struct mutex lock;
 };
 
 struct event_info {
        u32 event_type;
-       u8 hp_slot;
+       struct slot *p_slot;
+       struct work_struct work;
 };
 
-#define MAX_EVENTS             10
 struct controller {
-       struct controller *next;
        struct mutex crit_sect;         /* critical section mutex */
        struct mutex ctrl_lock;         /* controller lock */
        int num_slots;                  /* Number of slots on ctlr */
        int slot_num_inc;               /* 1 or -1 */
        struct pci_dev *pci_dev;
        struct list_head slot_list;
-       struct event_info event_queue[MAX_EVENTS];
-       struct slot *slot;
        struct hpc_ops *hpc_ops;
        wait_queue_head_t queue;        /* sleep & wake process */
-       u8 next_event;
-       u8 bus;
-       u8 device;
-       u8 function;
        u8 slot_device_offset;
        u32 first_slot;         /* First physical slot number */  /* PCIE only has 1 slot */
        u8 slot_bus;            /* Bus where the slots handled by this controller sit */
-       u8 ctrlcap;
-       u16 vendor_id;
+       u32 slot_cap;
        u8 cap_base;
        struct timer_list poll_timer;
+       volatile int cmd_busy;
 };
 
 #define INT_BUTTON_IGNORE              0
@@ -137,28 +134,29 @@ struct controller {
 #define ATTN_LED_PRSN  0x00000008
 #define PWR_LED_PRSN   0x00000010
 #define HP_SUPR_RM_SUP 0x00000020
-
-#define ATTN_BUTTN(cap)                (cap & ATTN_BUTTN_PRSN)
-#define POWER_CTRL(cap)                (cap & PWR_CTRL_PRSN)
-#define MRL_SENS(cap)          (cap & MRL_SENS_PRSN)
-#define ATTN_LED(cap)          (cap & ATTN_LED_PRSN)
-#define PWR_LED(cap)           (cap & PWR_LED_PRSN) 
-#define HP_SUPR_RM(cap)                (cap & HP_SUPR_RM_SUP)
-
-extern int pciehp_event_start_thread(void);
-extern void pciehp_event_stop_thread(void);
-extern int pciehp_enable_slot(struct slot *slot);
-extern int pciehp_disable_slot(struct slot *slot);
+#define EMI_PRSN       0x00020000
+
+#define ATTN_BUTTN(ctrl)       ((ctrl)->slot_cap & ATTN_BUTTN_PRSN)
+#define POWER_CTRL(ctrl)       ((ctrl)->slot_cap & PWR_CTRL_PRSN)
+#define MRL_SENS(ctrl)         ((ctrl)->slot_cap & MRL_SENS_PRSN)
+#define ATTN_LED(ctrl)         ((ctrl)->slot_cap & ATTN_LED_PRSN)
+#define PWR_LED(ctrl)          ((ctrl)->slot_cap & PWR_LED_PRSN)
+#define HP_SUPR_RM(ctrl)       ((ctrl)->slot_cap & HP_SUPR_RM_SUP)
+#define EMI(ctrl)              ((ctrl)->slot_cap & EMI_PRSN)
+
+extern int pciehp_sysfs_enable_slot(struct slot *slot);
+extern int pciehp_sysfs_disable_slot(struct slot *slot);
 extern u8 pciehp_handle_attention_button(u8 hp_slot, struct controller *ctrl);
 extern u8 pciehp_handle_switch_change(u8 hp_slot, struct controller *ctrl);
 extern u8 pciehp_handle_presence_change(u8 hp_slot, struct controller *ctrl);
 extern u8 pciehp_handle_power_fault(u8 hp_slot, struct controller *ctrl);
 extern int pciehp_configure_device(struct slot *p_slot);
 extern int pciehp_unconfigure_device(struct slot *p_slot);
+extern void pciehp_queue_pushbutton_work(struct work_struct *work);
 int pcie_init(struct controller *ctrl, struct pcie_device *dev);
-
-/* Global variables */
-extern struct controller *pciehp_ctrl_list;
+int pciehp_enable_slot(struct slot *p_slot);
+int pciehp_disable_slot(struct slot *p_slot);
+int pcie_init_hardware_part2(struct controller *ctrl, struct pcie_device *dev);
 
 static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
 {
@@ -169,7 +167,7 @@ static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
                        return slot;
        }
 
-       err("%s: slot (device=0x%x) not found\n", __FUNCTION__, device);
+       err("%s: slot (device=0x%x) not found\n", __func__, device);
        return NULL;
 }
 
@@ -181,6 +179,8 @@ struct hpc_ops {
        int (*set_attention_status)(struct slot *slot, u8 status);
        int (*get_latch_status)(struct slot *slot, u8 *status);
        int (*get_adapter_status)(struct slot *slot, u8 *status);
+       int (*get_emi_status)(struct slot *slot, u8 *status);
+       int (*toggle_emi)(struct slot *slot);
        int (*get_max_bus_speed)(struct slot *slot, enum pci_bus_speed *speed);
        int (*get_cur_bus_speed)(struct slot *slot, enum pci_bus_speed *speed);
        int (*get_max_lnk_width)(struct slot *slot, enum pcie_link_width *val);