Lines Matching refs:slot

45 static int get_##name(struct hotplug_slot *slot, type *value)		\
47 const struct hotplug_slot_ops *ops = slot->ops; \
50 retval = ops->get_##name(slot, value); \
74 struct hotplug_slot *slot = pci_slot->hotplug; in power_write_file() local
85 if (slot->ops->disable_slot) in power_write_file()
86 retval = slot->ops->disable_slot(slot); in power_write_file()
90 if (slot->ops->enable_slot) in power_write_file()
91 retval = slot->ops->enable_slot(slot); in power_write_file()
125 struct hotplug_slot *slot = pci_slot->hotplug; in attention_write_file() local
126 const struct hotplug_slot_ops *ops = slot->ops; in attention_write_file()
136 retval = ops->set_attention_status(slot, attention); in attention_write_file()
186 struct hotplug_slot *slot = pci_slot->hotplug; in test_write_file() local
195 if (slot->ops->hardware_test) in test_write_file()
196 retval = slot->ops->hardware_test(slot, test); in test_write_file()
208 static bool has_power_file(struct hotplug_slot *slot) in has_power_file() argument
210 if ((slot->ops->enable_slot) || in has_power_file()
211 (slot->ops->disable_slot) || in has_power_file()
212 (slot->ops->get_power_status)) in has_power_file()
217 static bool has_attention_file(struct hotplug_slot *slot) in has_attention_file() argument
219 if ((slot->ops->set_attention_status) || in has_attention_file()
220 (slot->ops->get_attention_status)) in has_attention_file()
225 static bool has_latch_file(struct hotplug_slot *slot) in has_latch_file() argument
227 if (slot->ops->get_latch_status) in has_latch_file()
232 static bool has_adapter_file(struct hotplug_slot *slot) in has_adapter_file() argument
234 if (slot->ops->get_adapter_status) in has_adapter_file()
239 static bool has_test_file(struct hotplug_slot *slot) in has_test_file() argument
241 if (slot->ops->hardware_test) in has_test_file()
246 static int fs_add_slot(struct hotplug_slot *slot, struct pci_slot *pci_slot) in fs_add_slot() argument
252 kobj = kset_find_obj(module_kset, slot->mod_name); in fs_add_slot()
261 if (has_power_file(slot)) { in fs_add_slot()
268 if (has_attention_file(slot)) { in fs_add_slot()
275 if (has_latch_file(slot)) { in fs_add_slot()
282 if (has_adapter_file(slot)) { in fs_add_slot()
289 if (has_test_file(slot)) { in fs_add_slot()
299 if (has_adapter_file(slot)) in fs_add_slot()
303 if (has_latch_file(slot)) in fs_add_slot()
306 if (has_attention_file(slot)) in fs_add_slot()
310 if (has_power_file(slot)) in fs_add_slot()
318 static void fs_remove_slot(struct hotplug_slot *slot, struct pci_slot *pci_slot) in fs_remove_slot() argument
320 if (has_power_file(slot)) in fs_remove_slot()
323 if (has_attention_file(slot)) in fs_remove_slot()
327 if (has_latch_file(slot)) in fs_remove_slot()
330 if (has_adapter_file(slot)) in fs_remove_slot()
334 if (has_test_file(slot)) in fs_remove_slot()
355 int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, in __pci_hp_register() argument
361 result = __pci_hp_initialize(slot, bus, devnr, name, owner, mod_name); in __pci_hp_register()
365 result = pci_hp_add(slot); in __pci_hp_register()
367 pci_hp_destroy(slot); in __pci_hp_register()
389 int __pci_hp_initialize(struct hotplug_slot *slot, struct pci_bus *bus, in __pci_hp_initialize() argument
395 if (slot == NULL) in __pci_hp_initialize()
397 if (slot->ops == NULL) in __pci_hp_initialize()
400 slot->owner = owner; in __pci_hp_initialize()
401 slot->mod_name = mod_name; in __pci_hp_initialize()
408 pci_slot = pci_create_slot(bus, devnr, name, slot); in __pci_hp_initialize()
412 slot->pci_slot = pci_slot; in __pci_hp_initialize()
413 pci_slot->hotplug = slot; in __pci_hp_initialize()
428 int pci_hp_add(struct hotplug_slot *slot) in pci_hp_add() argument
433 if (WARN_ON(!slot)) in pci_hp_add()
436 pci_slot = slot->pci_slot; in pci_hp_add()
438 result = fs_add_slot(slot, pci_slot); in pci_hp_add()
454 void pci_hp_deregister(struct hotplug_slot *slot) in pci_hp_deregister() argument
456 pci_hp_del(slot); in pci_hp_deregister()
457 pci_hp_destroy(slot); in pci_hp_deregister()
467 void pci_hp_del(struct hotplug_slot *slot) in pci_hp_del() argument
469 if (WARN_ON(!slot)) in pci_hp_del()
472 fs_remove_slot(slot, slot->pci_slot); in pci_hp_del()
485 void pci_hp_destroy(struct hotplug_slot *slot) in pci_hp_destroy() argument
487 struct pci_slot *pci_slot = slot->pci_slot; in pci_hp_destroy()
489 slot->pci_slot = NULL; in pci_hp_destroy()