STRUCT W1_SLAVE(9)
π¦ STRUCT W1_SLAVE(9) β the manual, but make it cute π¦
okay so bestie, we're in the Kernel API Manual today and we're talking about struct w1_slave(9). it's a lil kernel struct, it's giving "one (1) whole entire slave device on the bus" energy. iconic. let's get into it π
β¨ NAME β¨
struct w1_slave β literally just holds a single slave device on the bus. that's her job. that's what she does. π
πΈ SYNOPSIS πΈ
struct w1_slave {
struct module *owner;
unsigned char name[W1_MAXNAMELEN];
struct list_head w1_slave_entry;
struct w1_reg_num reg_num;
atomic_t refcnt;
int ttl;
unsigned long flags;
struct w1_master *master;
struct w1_family *family;
void *family_data;
struct device dev;
struct device *hwmon;
};
no cap, that's the whole vibe right there. every field, every one, copied exactly β we do not play about the struct definition π
π MEMBERS π
okay now the fun part, let's meet the cast π«Ά every single member, none skipped, we're thorough besties:
ownerβ points to the one wire "wire" kernel module. she's the owner, she's the main character β¨nameβ the device id, and it's ascii. simple, readable, slay πw1_slave_entryβ data for the linked list. yes bestie, she's linked πreg_numβ the slave id, but in binary this time. same info, different fit π₯refcntβ reference count, and the rule is delete when it hits0. goodbye when the count says goodbye πttlβ decrement per search this slave isn't found,deatchat0. so if nobody finds her, her time-to-live ticks down each search until she's gone πflagsβ bit flags forW1_SLAVE_ACTIVEandW1_SLAVE_DETACH. little status bits doing little status bit things πmasterβ the bus which this slave is on. know your bus, respect your bus πfamilyβ module for the device family type. found family fr fr πfamily_dataβ pointer for use by the family module. it's their data, hands off π«Άdevβ the kernel device identifier π¦hwmonβ pointer to the hwmon device β
π SEE ALSO π
go read these too, iykyk, they're all in the kernel file ./include/linux/w1.h:
struct w1_reg_num(9)struct w1_bus_master(9)enum w1_master_flags(9)struct w1_master(9)struct w1_family_ops(9)struct w1_family(9)module_w1_family(9)
ngl bestie, if you're poking at one-wire stuff in the kernel, read these before you touch anything. future you will be obsessed with past you. π
and that's the page!! mwah π this one lives in ./include/linux, from October 2026, and it's struct w1_slave(9) β periodt. π§ββοΈβ¨
π¦ 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