STRUCT HOTPLUG_SLOT_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct hotplug_slot_ops(9) ✨

okay bestie, gather round, because this is the kernel API manual page for struct hotplug_slot_ops and it's literally the plug-and-play blueprint for hotplug PCI slay πŸ’…


πŸŽ€ NAME πŸŽ€

struct hotplug_slot_ops β€” the callbacks that the hotplug pci core can use 🫢


🌸 SYNOPSIS 🌸

no cap, here's the struct in all its glory, every pointer exactly as it lives in the header:

struct hotplug_slot_ops {
    int (*enable_slot)              (struct hotplug_slot *slot);
    int (*disable_slot)             (struct hotplug_slot *slot);
    int (*set_attention_status)     (struct hotplug_slot *slot, u8
value);
    int (*hardware_test)            (struct hotplug_slot *slot, u32
value);
    int (*get_power_status)         (struct hotplug_slot *slot, u8
*value);
    int (*get_attention_status)     (struct hotplug_slot *slot, u8
*value);
    int (*get_latch_status)         (struct hotplug_slot *slot, u8
*value);
    int (*get_adapter_status)       (struct hotplug_slot *slot, u8
*value);
    int (*reset_slot)               (struct hotplug_slot *slot, bool
probe);
 };

πŸ¦‹ Members πŸ¦‹

  • enable_slot β€” called when the user wants to enable a specific pci slot. it's giving "turn it on bestie" energy ✨
  • disable_slot β€” called when the user wants to disable a specific pci slot. the opposite vibe, also iconic 🫢
  • set_attention_status β€” called to set the specific slot's attention LED to the specified value. yes, there's a whole callback just for the blinkenlight πŸ’‘
  • hardware_test β€” called to run a specified hardware test on the specified slot. science time, no cap πŸ”₯
  • get_power_status β€” called to get the current power status of a slot. is it fed or is it starving, we must know ⚑
  • get_attention_status β€” called to get the current attention status of a slot. checking the LED's vibe πŸ’…
  • get_latch_status β€” called to get the current latch status of a slot. the little mechanical gate's whole deal πŸŽ€
  • get_adapter_status β€” called to get see if an adapter is present in the slot or not. (fr fr that's the original wording, we keep it verbatim: "get see") πŸ‘€
  • reset_slot β€” optional interface to allow override of a bus reset for the slot for cases where a secondary bus reset can result in spurious hotplug events or where a slot can be reset independent of the bus. optional, but highkey main character behavior 🌈

πŸ’œ Description πŸ’œ

so basically this is the table of function pointers that is passed to the hotplug pci core by a hotplug pci driver. these functions are called by the hotplug pci core when the user wants to do something to a specific slot β€” like query it for information, set an LED, enable / disable power, etc. it's giving "the driver hands the core a whole menu of things it can do," and honestly? obsessed 🧚


⭐ SEE ALSO ⭐

  • Kernel file ./include/linux/pci_hotplug.h struct hotplug_slot(9)

bestie reminder: reset_slot is the only optional one in this table, and it exists for exactly those two cases listed above. don't invent extra behavior, the manpage is not the vibe, the facts are 😭

that's the whole page, periodt πŸ’– from ./include/linux, dated October 2026 β€” signed off with the source path and version, slay πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from