Lines Matching full:slot
50 static int get_##name(struct hotplug_slot *slot, type *value) \
52 const struct hotplug_slot_ops *ops = slot->ops; \
54 if (!try_module_get(slot->owner)) \
57 retval = ops->get_##name(slot, value); \
58 module_put(slot->owner); \
82 struct hotplug_slot *slot = pci_slot->hotplug; in power_write_file() local
91 if (!try_module_get(slot->owner)) { in power_write_file()
97 if (slot->ops->disable_slot) in power_write_file()
98 retval = slot->ops->disable_slot(slot); in power_write_file()
102 if (slot->ops->enable_slot) in power_write_file()
103 retval = slot->ops->enable_slot(slot); in power_write_file()
110 module_put(slot->owner); in power_write_file()
139 struct hotplug_slot *slot = pci_slot->hotplug; in attention_write_file() local
140 const struct hotplug_slot_ops *ops = slot->ops; in attention_write_file()
149 if (!try_module_get(slot->owner)) { in attention_write_file()
154 retval = ops->set_attention_status(slot, attention); in attention_write_file()
155 module_put(slot->owner); in attention_write_file()
206 struct hotplug_slot *slot = pci_slot->hotplug; in test_write_file() local
215 if (!try_module_get(slot->owner)) { in test_write_file()
219 if (slot->ops->hardware_test) in test_write_file()
220 retval = slot->ops->hardware_test(slot, test); in test_write_file()
221 module_put(slot->owner); in test_write_file()
236 struct hotplug_slot *slot = pci_slot->hotplug; in has_power_file() local
238 if ((!slot) || (!slot->ops)) in has_power_file()
240 if ((slot->ops->enable_slot) || in has_power_file()
241 (slot->ops->disable_slot) || in has_power_file()
242 (slot->ops->get_power_status)) in has_power_file()
249 struct hotplug_slot *slot = pci_slot->hotplug; in has_attention_file() local
251 if ((!slot) || (!slot->ops)) in has_attention_file()
253 if ((slot->ops->set_attention_status) || in has_attention_file()
254 (slot->ops->get_attention_status)) in has_attention_file()
261 struct hotplug_slot *slot = pci_slot->hotplug; in has_latch_file() local
263 if ((!slot) || (!slot->ops)) in has_latch_file()
265 if (slot->ops->get_latch_status) in has_latch_file()
272 struct hotplug_slot *slot = pci_slot->hotplug; in has_adapter_file() local
274 if ((!slot) || (!slot->ops)) in has_adapter_file()
276 if (slot->ops->get_adapter_status) in has_adapter_file()
283 struct hotplug_slot *slot = pci_slot->hotplug; in has_test_file() local
285 if ((!slot) || (!slot->ops)) in has_test_file()
287 if (slot->ops->hardware_test) in has_test_file()
380 struct hotplug_slot *slot; in get_slot_from_name() local
382 list_for_each_entry(slot, &pci_hotplug_slot_list, slot_list) { in get_slot_from_name()
383 if (strcmp(hotplug_slot_name(slot), name) == 0) in get_slot_from_name()
384 return slot; in get_slot_from_name()
391 * @bus: bus this slot is on
392 * @slot: pointer to the &struct hotplug_slot to register
398 * Prepares a hotplug slot for in-kernel use and immediately publishes it to
404 int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus, in __pci_hp_register() argument
410 result = __pci_hp_initialize(slot, bus, devnr, name, owner, mod_name); in __pci_hp_register()
414 result = pci_hp_add(slot); in __pci_hp_register()
416 pci_hp_destroy(slot); in __pci_hp_register()
423 * __pci_hp_initialize - prepare hotplug slot for in-kernel use
424 * @slot: pointer to the &struct hotplug_slot to initialize
425 * @bus: bus this slot is on
426 * @devnr: slot number
431 * Allocate and fill in a PCI slot for use by a hotplug driver. Once this has
432 * been called, the driver may invoke hotplug_slot_name() to get the slot's
438 int __pci_hp_initialize(struct hotplug_slot *slot, struct pci_bus *bus, in __pci_hp_initialize() argument
444 if (slot == NULL) in __pci_hp_initialize()
446 if (slot->ops == NULL) in __pci_hp_initialize()
449 slot->owner = owner; in __pci_hp_initialize()
450 slot->mod_name = mod_name; in __pci_hp_initialize()
457 pci_slot = pci_create_slot(bus, devnr, name, slot); in __pci_hp_initialize()
461 slot->pci_slot = pci_slot; in __pci_hp_initialize()
462 pci_slot->hotplug = slot; in __pci_hp_initialize()
468 * pci_hp_add - publish hotplug slot to user space
469 * @slot: pointer to the &struct hotplug_slot to publish
471 * Make a hotplug slot's sysfs interface available and inform user space of its
477 int pci_hp_add(struct hotplug_slot *slot) in pci_hp_add() argument
479 struct pci_slot *pci_slot = slot->pci_slot; in pci_hp_add()
488 list_add(&slot->slot_list, &pci_hotplug_slot_list); in pci_hp_add()
490 dbg("Added slot %s to the list\n", hotplug_slot_name(slot)); in pci_hp_add()
497 * @slot: pointer to the &struct hotplug_slot to deregister
499 * The @slot must have been registered with the pci hotplug subsystem
504 void pci_hp_deregister(struct hotplug_slot *slot) in pci_hp_deregister() argument
506 pci_hp_del(slot); in pci_hp_deregister()
507 pci_hp_destroy(slot); in pci_hp_deregister()
512 * pci_hp_del - unpublish hotplug slot from user space
513 * @slot: pointer to the &struct hotplug_slot to unpublish
515 * Remove a hotplug slot's sysfs interface.
519 void pci_hp_del(struct hotplug_slot *slot) in pci_hp_del() argument
523 if (WARN_ON(!slot)) in pci_hp_del()
527 temp = get_slot_from_name(hotplug_slot_name(slot)); in pci_hp_del()
528 if (WARN_ON(temp != slot)) { in pci_hp_del()
533 list_del(&slot->slot_list); in pci_hp_del()
535 dbg("Removed slot %s from the list\n", hotplug_slot_name(slot)); in pci_hp_del()
536 fs_remove_slot(slot->pci_slot); in pci_hp_del()
541 * pci_hp_destroy - remove hotplug slot from in-kernel use
542 * @slot: pointer to the &struct hotplug_slot to destroy
544 * Destroy a PCI slot used by a hotplug driver. Once this has been called,
545 * the driver may no longer invoke hotplug_slot_name() to get the slot's
551 void pci_hp_destroy(struct hotplug_slot *slot) in pci_hp_destroy() argument
553 struct pci_slot *pci_slot = slot->pci_slot; in pci_hp_destroy()
555 slot->pci_slot = NULL; in pci_hp_destroy()