Lines Matching refs: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;
91 if (!try_module_get(slot->owner)) {
97 if (slot->ops->disable_slot)
98 retval = slot->ops->disable_slot(slot);
102 if (slot->ops->enable_slot)
103 retval = slot->ops->enable_slot(slot);
110 module_put(slot->owner);
139 struct hotplug_slot *slot = pci_slot->hotplug;
140 const struct hotplug_slot_ops *ops = slot->ops;
149 if (!try_module_get(slot->owner)) {
154 retval = ops->set_attention_status(slot, attention);
155 module_put(slot->owner);
206 struct hotplug_slot *slot = pci_slot->hotplug;
215 if (!try_module_get(slot->owner)) {
219 if (slot->ops->hardware_test)
220 retval = slot->ops->hardware_test(slot, test);
221 module_put(slot->owner);
236 struct hotplug_slot *slot = pci_slot->hotplug;
238 if ((!slot) || (!slot->ops))
240 if ((slot->ops->enable_slot) ||
241 (slot->ops->disable_slot) ||
242 (slot->ops->get_power_status))
249 struct hotplug_slot *slot = pci_slot->hotplug;
251 if ((!slot) || (!slot->ops))
253 if ((slot->ops->set_attention_status) ||
254 (slot->ops->get_attention_status))
261 struct hotplug_slot *slot = pci_slot->hotplug;
263 if ((!slot) || (!slot->ops))
265 if (slot->ops->get_latch_status)
272 struct hotplug_slot *slot = pci_slot->hotplug;
274 if ((!slot) || (!slot->ops))
276 if (slot->ops->get_adapter_status)
283 struct hotplug_slot *slot = pci_slot->hotplug;
285 if ((!slot) || (!slot->ops))
287 if (slot->ops->hardware_test)
380 struct hotplug_slot *slot;
382 list_for_each_entry(slot, &pci_hotplug_slot_list, slot_list) {
383 if (strcmp(hotplug_slot_name(slot), name) == 0)
384 return slot;
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,
410 result = __pci_hp_initialize(slot, bus, devnr, name, owner, mod_name);
414 result = pci_hp_add(slot);
416 pci_hp_destroy(slot);
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,
444 if (slot == NULL)
446 if (slot->ops == NULL)
449 slot->owner = owner;
450 slot->mod_name = mod_name;
457 pci_slot = pci_create_slot(bus, devnr, name, slot);
461 slot->pci_slot = pci_slot;
462 pci_slot->hotplug = slot;
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)
479 struct pci_slot *pci_slot = slot->pci_slot;
488 list_add(&slot->slot_list, &pci_hotplug_slot_list);
490 dbg("Added slot %s to the list\n", hotplug_slot_name(slot));
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)
506 pci_hp_del(slot);
507 pci_hp_destroy(slot);
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)
523 if (WARN_ON(!slot))
527 temp = get_slot_from_name(hotplug_slot_name(slot));
528 if (WARN_ON(temp != slot)) {
533 list_del(&slot->slot_list);
535 dbg("Removed slot %s from the list\n", hotplug_slot_name(slot));
536 fs_remove_slot(slot->pci_slot);
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)
553 struct pci_slot *pci_slot = slot->pci_slot;
555 slot->pci_slot = NULL;