diff options
Diffstat (limited to 'include/linux/pci_hotplug.h')
-rw-r--r-- | include/linux/pci_hotplug.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 20998746518e..4391741b99dc 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -66,17 +66,10 @@ enum pcie_link_speed { | |||
66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | 66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct hotplug_slot; | ||
70 | struct hotplug_slot_attribute { | ||
71 | struct attribute attr; | ||
72 | ssize_t (*show)(struct hotplug_slot *, char *); | ||
73 | ssize_t (*store)(struct hotplug_slot *, const char *, size_t); | ||
74 | }; | ||
75 | #define to_hotplug_attr(n) container_of(n, struct hotplug_slot_attribute, attr); | ||
76 | |||
77 | /** | 69 | /** |
78 | * 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 |
79 | * @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 | ||
80 | * @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 |
81 | * @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 |
82 | * @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 |
@@ -109,6 +102,7 @@ struct hotplug_slot_attribute { | |||
109 | */ | 102 | */ |
110 | struct hotplug_slot_ops { | 103 | struct hotplug_slot_ops { |
111 | struct module *owner; | 104 | struct module *owner; |
105 | const char *mod_name; | ||
112 | int (*enable_slot) (struct hotplug_slot *slot); | 106 | int (*enable_slot) (struct hotplug_slot *slot); |
113 | int (*disable_slot) (struct hotplug_slot *slot); | 107 | int (*disable_slot) (struct hotplug_slot *slot); |
114 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); | 108 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); |
@@ -167,12 +161,21 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) | |||
167 | return pci_slot_name(slot->pci_slot); | 161 | return pci_slot_name(slot->pci_slot); |
168 | } | 162 | } |
169 | 163 | ||
170 | extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr, | 164 | extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, |
171 | const char *name); | 165 | int nr, const char *name, |
166 | struct module *owner, const char *mod_name); | ||
172 | extern int pci_hp_deregister(struct hotplug_slot *slot); | 167 | extern int pci_hp_deregister(struct hotplug_slot *slot); |
173 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | 168 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, |
174 | struct hotplug_slot_info *info); | 169 | struct hotplug_slot_info *info); |
175 | 170 | ||
171 | static 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 | |||
176 | /* PCI Setting Record (Type 0) */ | 179 | /* PCI Setting Record (Type 0) */ |
177 | struct hpp_type0 { | 180 | struct hpp_type0 { |
178 | u32 revision; | 181 | u32 revision; |
@@ -226,7 +229,6 @@ struct hotplug_params { | |||
226 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, | 229 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, |
227 | struct hotplug_params *hpp); | 230 | struct hotplug_params *hpp); |
228 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); | 231 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); |
229 | int acpi_root_bridge(acpi_handle handle); | ||
230 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | 232 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); |
231 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); | 233 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); |
232 | #endif | 234 | #endif |