]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/pciehp.h
PCI hotplug: pciehp: message refinement
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / pciehp.h
index 9e6cec67e1cc33d62690e8a3ebcf462c706956ca..b2801a7ee37f8d14864f6275181f2616bd8e7fd1 100644 (file)
@@ -57,19 +57,30 @@ extern struct workqueue_struct *pciehp_wq;
 #define warn(format, arg...)                                           \
        printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
 
+#define ctrl_dbg(ctrl, format, arg...)                                 \
+       do {                                                            \
+               if (pciehp_debug)                                       \
+                       dev_printk(, &ctrl->pcie->device,               \
+                                       format, ## arg);                \
+       } while (0)
+#define ctrl_err(ctrl, format, arg...)                                 \
+       dev_err(&ctrl->pcie->device, format, ## arg)
+#define ctrl_info(ctrl, format, arg...)                                        \
+       dev_info(&ctrl->pcie->device, format, ## arg)
+#define ctrl_warn(ctrl, format, arg...)                                        \
+       dev_warn(&ctrl->pcie->device, format, ## arg)
+
 #define SLOT_NAME_SIZE 10
 struct slot {
        u8 bus;
        u8 device;
-       u32 number;
        u8 state;
-       struct timer_list task_event;
        u8 hp_slot;
+       u32 number;
        struct controller *ctrl;
        struct hpc_ops *hpc_ops;
        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;
@@ -87,6 +98,7 @@ struct controller {
        int num_slots;                  /* Number of slots on ctlr */
        int slot_num_inc;               /* 1 or -1 */
        struct pci_dev *pci_dev;
+       struct pcie_device *pcie;       /* PCI Express port service */
        struct list_head slot_list;
        struct hpc_ops *hpc_ops;
        wait_queue_head_t queue;        /* sleep & wake process */
@@ -98,6 +110,7 @@ struct controller {
        struct timer_list poll_timer;
        int cmd_busy;
        unsigned int no_cmd_complete:1;
+       unsigned int link_active_reporting:1;
 };
 
 #define INT_BUTTON_IGNORE              0
@@ -161,6 +174,11 @@ int pciehp_enable_slot(struct slot *p_slot);
 int pciehp_disable_slot(struct slot *p_slot);
 int pcie_enable_notification(struct controller *ctrl);
 
+static inline const char *slot_name(struct slot *slot)
+{
+       return hotplug_slot_name(slot->hotplug_slot);
+}
+
 static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
 {
        struct slot *slot;
@@ -170,7 +188,7 @@ static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
                        return slot;
        }
 
-       err("%s: slot (device=0x%x) not found\n", __func__, device);
+       ctrl_err(ctrl, "Slot (device=0x%02x) not found\n", device);
        return NULL;
 }