aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/pciehp.h')
-rw-r--r--drivers/pci/hotplug/pciehp.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index 9e6cec67e1c..b2801a7ee37 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -57,19 +57,30 @@ extern struct workqueue_struct *pciehp_wq;
57#define warn(format, arg...) \ 57#define warn(format, arg...) \
58 printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) 58 printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
59 59
60#define ctrl_dbg(ctrl, format, arg...) \
61 do { \
62 if (pciehp_debug) \
63 dev_printk(, &ctrl->pcie->device, \
64 format, ## arg); \
65 } while (0)
66#define ctrl_err(ctrl, format, arg...) \
67 dev_err(&ctrl->pcie->device, format, ## arg)
68#define ctrl_info(ctrl, format, arg...) \
69 dev_info(&ctrl->pcie->device, format, ## arg)
70#define ctrl_warn(ctrl, format, arg...) \
71 dev_warn(&ctrl->pcie->device, format, ## arg)
72
60#define SLOT_NAME_SIZE 10 73#define SLOT_NAME_SIZE 10
61struct slot { 74struct slot {
62 u8 bus; 75 u8 bus;
63 u8 device; 76 u8 device;
64 u32 number;
65 u8 state; 77 u8 state;
66 struct timer_list task_event;
67 u8 hp_slot; 78 u8 hp_slot;
79 u32 number;
68 struct controller *ctrl; 80 struct controller *ctrl;
69 struct hpc_ops *hpc_ops; 81 struct hpc_ops *hpc_ops;
70 struct hotplug_slot *hotplug_slot; 82 struct hotplug_slot *hotplug_slot;
71 struct list_head slot_list; 83 struct list_head slot_list;
72 char name[SLOT_NAME_SIZE];
73 unsigned long last_emi_toggle; 84 unsigned long last_emi_toggle;
74 struct delayed_work work; /* work for button event */ 85 struct delayed_work work; /* work for button event */
75 struct mutex lock; 86 struct mutex lock;
@@ -87,6 +98,7 @@ struct controller {
87 int num_slots; /* Number of slots on ctlr */ 98 int num_slots; /* Number of slots on ctlr */
88 int slot_num_inc; /* 1 or -1 */ 99 int slot_num_inc; /* 1 or -1 */
89 struct pci_dev *pci_dev; 100 struct pci_dev *pci_dev;
101 struct pcie_device *pcie; /* PCI Express port service */
90 struct list_head slot_list; 102 struct list_head slot_list;
91 struct hpc_ops *hpc_ops; 103 struct hpc_ops *hpc_ops;
92 wait_queue_head_t queue; /* sleep & wake process */ 104 wait_queue_head_t queue; /* sleep & wake process */
@@ -98,6 +110,7 @@ struct controller {
98 struct timer_list poll_timer; 110 struct timer_list poll_timer;
99 int cmd_busy; 111 int cmd_busy;
100 unsigned int no_cmd_complete:1; 112 unsigned int no_cmd_complete:1;
113 unsigned int link_active_reporting:1;
101}; 114};
102 115
103#define INT_BUTTON_IGNORE 0 116#define INT_BUTTON_IGNORE 0
@@ -161,6 +174,11 @@ int pciehp_enable_slot(struct slot *p_slot);
161int pciehp_disable_slot(struct slot *p_slot); 174int pciehp_disable_slot(struct slot *p_slot);
162int pcie_enable_notification(struct controller *ctrl); 175int pcie_enable_notification(struct controller *ctrl);
163 176
177static inline const char *slot_name(struct slot *slot)
178{
179 return hotplug_slot_name(slot->hotplug_slot);
180}
181
164static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device) 182static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
165{ 183{
166 struct slot *slot; 184 struct slot *slot;
@@ -170,7 +188,7 @@ static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device)
170 return slot; 188 return slot;
171 } 189 }
172 190
173 err("%s: slot (device=0x%x) not found\n", __func__, device); 191 ctrl_err(ctrl, "Slot (device=0x%02x) not found\n", device);
174 return NULL; 192 return NULL;
175} 193}
176 194