STRUCT CONTROLLER(9)
π struct controller(9) β PCIe hotplug controller π
okay so bestie, welcome to the Kernel API Manual page for struct controller. Itβs the PCIe hotplug controller, and yes, itβs giving main character energy. β¨
πΈ NAME πΈ
struct controller β PCIe hotplug controller π
π¦ SYNOPSIS π¦
struct controller {
struct pcie_device *pcie;
u64 dsn;
u32 slot_cap;
unsigned int inband_presence_disabled:1;
u16 slot_ctrl;
struct mutex ctrl_lock;
unsigned long cmd_started;
unsigned int cmd_busy:1;
wait_queue_head_t queue;
atomic_t pending_events;
unsigned int notification_enabled:1;
unsigned int power_fault_detected;
struct task_struct *poll_thread;
u8 state;
struct mutex state_lock;
struct delayed_work button_work;
struct hotplug_slot hotplug_slot;
struct rw_semaphore reset_lock;
unsigned int depth;
unsigned int ist_running;
int request_result;
wait_queue_head_t requester;
};
π Members π
pcieβ pointer to the controllerβs PCIe port service device. πdsnβ cached copy of the Device Serial Number of Function 0 in the hotplug slot (PCIe r6.2 sec 7.9.3); itβs used to determine whether a hotplugged device was replaced with a different one during system sleep.slot_capβ cached copy of the Slot Capabilities register.inband_presence_disabledβ In-Band Presence Detect Disable supported by the controller and disabled per the spec recommendation (PCIe r5.0, appendix I implementation note).slot_ctrlβ cached copy of the Slot Control register.ctrl_lockβ serializes writes to the Slot Control register.cmd_startedβ jiffies when the Slot Control register was last written; the next write is allowed 1 second later, absent a Command Completed interrupt (PCIe r4.0, sec 6.7.3.2).cmd_busyβ flag set on Slot Control register write, cleared by the IRQ handler on reception of a Command Completed event.queueβ wait queue to wake up on reception of a Command Completed event, used for synchronous writes to the Slot Control register.pending_eventsβ used by the IRQ handler to save events retrieved from the Slot Status register for later consumption by the IRQ thread.notification_enabledβ whether the IRQ was requested successfully.power_fault_detectedβ whether a power fault was detected by the hardware that has not yet been cleared by the user.poll_threadβ thread to poll for slot events if no IRQ is available, enabled with thepciehp_poll_modemodule parameter.stateβ current state machine position.state_lockβ protects reads and writes ofstate; protects scheduling, execution and cancellation ofbutton_work.button_workβ work item to turn the slot on or off after 5 seconds in response to an Attention Button press.hotplug_slotβ structure registered with the PCI hotplug core.reset_lockβ prevents access to the Data Link Layer Link Active bit in the Link Status register and to the Presence Detect State bit in the Slot Status register during a slot reset which may cause them to flap.depthβ Number of additional hotplug ports in the path to the root bus, used as lock subclass forreset_lock.ist_runningβ flag to keep user request waiting while the IRQ thread is running.request_resultβ result of last user request submitted to the IRQ thread.requesterβ wait queue to wake up on completion of user request, used for synchronous slot enable/disable request viasysfs.
πΈ Description πΈ
PCIe hotplug has a 1:1 relationship between controller and slot, hence unlike other drivers, the two arenβt represented by separate structures. slay, simplicity. π
π SEE ALSO π
Kernel file ./drivers/pci/hotplug/pciehp.hSlot state(9)Flags to request an action from the IRQ thread(9)
mwah π this cutie comes from ./drivers/pci/hotplug, dated October 2026. source/version + date sign-off complete, bestie. π«Άπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms