STRUCT SUBSYS_INTERFACE(9)
π struct_subsys_interface(9) β like, the whole Kernel API Manual thing, but make it make sense
okay bestie, sit down, grab a strawberry drink π, because we're talking about struct subsys_interface from the Kernel API Manual β and honestly? she's giving supporting character who secretly runs the whole group chat. no cap. π
β¨ NAME β¨
struct subsys_interface β interfaces to device functions π«Ά
like, literally just that. interfaces. to device functions. iykyk.
π SYNOPSIS π
here's the shape of her, character for character, no edits, no vibes-based "fixes":
struct subsys_interface {
const char *name;
const struct bus_type *subsys;
struct list_head node;
int (*add_dev)(struct device *dev, struct subsys_interface *sif);
void (*remove_dev)(struct device *dev, struct subsys_interface
*sif);
};
she's small. she's tidy. she has two function pointers and she knows how to use them. π
πΈ Members πΈ
let's do a vibe check on every single field, one by one, because nobody gets skipped in this house:
nameβ the name of the device function β¨ that's it, that's the whole job, and she does it iconicallysubsysβ the subsystem of the devices to attach to π¦ (note the type up top:const struct bus_type *subsysβ it's a bus type, keep that in mind)nodeβ the list of functions registered at the subsystem π so the subsystem keeps a little list of all the functions hanging out on itadd_devβ device hookup to device function handler π₯ this is yourint (*add_dev)(struct device *dev, struct subsys_interface *sif);β returns an int, takes a device and asifremove_devβ device hookup to device function handler π yep, same description asadd_dev, because that's literally what the manpage says, and it's thevoid (*remove_dev)(struct device *dev, struct subsys_interface *sif);counterpart. one adds, one removes. balance. π§
π Description π
so what is she, actually?
Simple interfaces attached to a subsystem. that's the whole thesis, bestie. π
Multiple interfaces can attach to a subsystem and its devices β not just one, multiple, she's not possessive. πΈ
and here's the part that matters, the main character distinction: unlike drivers, they do not exclusively claim or control devices. π¨ like, drivers are out here fighting over devices like it's the last seat in the cafeteria, and interfaces are just vibing. they don't claim. they don't control. they simply exist. we love a low-drama queen. π
Interfaces usually represent a specific functionality of a subsystem/class of devices. so think "this is the thing this subsystem does" β she's the specialty, the niche, the little extra flavor. π
okay but fr fr don't @ me about drivers here β the manpage said "they do not exclusively claim or control devices" and i'm just the messenger, bestie. π
β SEE ALSO β
okay this list is long long, but we do not skip anyone in this group chat. every single one of these gets a shoutout. π«Ά
Kernel file ./include/linux/device.h:
struct device_attribute(9)struct dev_ext_attribute(9)DEVICE_ATTR(9)DEVICE_ATTR_RW(9)DEVICE_ATTR_ADMIN_RW(9)DEVICE_ATTR_RW_NAMED(9)DEVICE_ATTR_RO(9)DEVICE_ATTR_ADMIN_RO(9)DEVICE_ATTR_RO_NAMED(9)DEVICE_ATTR_WO(9)DEVICE_ATTR_WO_NAMED(9)DEVICE_ULONG_ATTR(9)DEVICE_INT_ATTR(9)DEVICE_BOOL_ATTR(9)DEVICE_STRING_ATTR_RO(9)enum device_link_state(9)enum dl_dev_state(9)enum device_removable(9)struct dev_links_info(9)struct dev_msi_info(9)enum device_physical_location_panel(9)enum device_physical_location_vertical_position(9)enum device_physical_location_horizontal_position(9)struct device_physical_location(9)enum struct_device_flags(9)struct device(9)struct device_link(9)device_set_driver_override(9)device_has_driver_override(9)device_match_driver_override(9)device_iommu_mapped(9)dev_name(9)dev_bus_name(9)device_find_child_by_name(9)device_find_any_child(9)device_lock_set_class(9)device_lock_reset_class(9)
yeah. thirty-eight of them. i counted. not me doing homework for a manpage π but every single one is here and none of them got left on read. π
and that's the whole page! π¦ she lives in ./include/linux and the version/date stamped on this read of the page is October 2026 β so if you're reading this from the future, hi, love you, hope your subsystem is thriving. mwah. πβ¨π
π¦ 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