aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2009-06-15 22:01:25 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-16 17:30:11 -0400
commitc825bc94c8c1908750ab20413eb639c6be029e2d (patch)
tree6e5800fe52e0f94f42fdcd4c327b8cfaf803978a /include
parent498a8faf2c7eb974f70b7c5a60a31f0d48c35d44 (diff)
PCI hotplug: create symlink to hotplug driver module
Create symbolic link to hotplug driver module in the PCI slot directory (/sys/bus/pci/slots/<SLOT#>). In the past, we need to load hotplug drivers one by one to identify the hotplug driver that handles the slot, and it was very inconvenient especially for trouble shooting. With this change, we can easily identify the hotplug driver. Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Reviewed-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/linux/pci_hotplug.h15
2 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ea2a153a9126..6a1800ecd95d 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1261,5 +1261,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1261} 1261}
1262#endif 1262#endif
1263 1263
1264#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1265extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
1266extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1267#endif
1268
1264#endif /* __KERNEL__ */ 1269#endif /* __KERNEL__ */
1265#endif /* LINUX_PCI_H */ 1270#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 11936fd0b56d..b3646cd7fd5a 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -69,6 +69,7 @@ enum pcie_link_speed {
69/** 69/**
70 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use 70 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
71 * @owner: The module owner of this structure 71 * @owner: The module owner of this structure
72 * @mod_name: The module name (KBUILD_MODNAME) of this structure
72 * @enable_slot: Called when the user wants to enable a specific pci slot 73 * @enable_slot: Called when the user wants to enable a specific pci slot
73 * @disable_slot: Called when the user wants to disable a specific pci slot 74 * @disable_slot: Called when the user wants to disable a specific pci slot
74 * @set_attention_status: Called to set the specific slot's attention LED to 75 * @set_attention_status: Called to set the specific slot's attention LED to
@@ -101,6 +102,7 @@ enum pcie_link_speed {
101 */ 102 */
102struct hotplug_slot_ops { 103struct hotplug_slot_ops {
103 struct module *owner; 104 struct module *owner;
105 const char *mod_name;
104 int (*enable_slot) (struct hotplug_slot *slot); 106 int (*enable_slot) (struct hotplug_slot *slot);
105 int (*disable_slot) (struct hotplug_slot *slot); 107 int (*disable_slot) (struct hotplug_slot *slot);
106 int (*set_attention_status) (struct hotplug_slot *slot, u8 value); 108 int (*set_attention_status) (struct hotplug_slot *slot, u8 value);
@@ -159,12 +161,21 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)
159 return pci_slot_name(slot->pci_slot); 161 return pci_slot_name(slot->pci_slot);
160} 162}
161 163
162extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr, 164extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus,
163 const char *name); 165 int nr, const char *name,
166 struct module *owner, const char *mod_name);
164extern int pci_hp_deregister(struct hotplug_slot *slot); 167extern int pci_hp_deregister(struct hotplug_slot *slot);
165extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 168extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
166 struct hotplug_slot_info *info); 169 struct hotplug_slot_info *info);
167 170
171static inline int pci_hp_register(struct hotplug_slot *slot,
172 struct pci_bus *pbus,
173 int devnr, const char *name)
174{
175 return __pci_hp_register(slot, pbus, devnr, name,
176 THIS_MODULE, KBUILD_MODNAME);
177}
178
168/* PCI Setting Record (Type 0) */ 179/* PCI Setting Record (Type 0) */
169struct hpp_type0 { 180struct hpp_type0 {
170 u32 revision; 181 u32 revision;