STRUCT W1_MASTER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ struct w1_master(9) πŸ‘‘

okay so welcome to the Kernel API Manual, bestie β€” this entry is all about struct w1_master, and the whole vibe is literally one per bus master. no cap.


🌸 NAME 🌸

struct w1_master β€” one per bus master. that's it, that's the energy. icon.

✨ SYNOPSIS ✨

here's the full struct, no skipping, no summarizing, we respect the whole thing:

struct w1_master {
    struct list_head        w1_master_entry;
    struct module           *owner;
    unsigned char           name[W1_MAXNAMELEN];
    struct mutex            list_mutex;
    struct list_head        slist;
    struct list_head        async_list;
    int max_slave_count, slave_count;
    unsigned long           attempts;
    int slave_ttl;
    int initialized;
    u32 id;
    int search_count;
    u64 search_id;
    atomic_t refcnt;
    void *priv;
    int enable_pullup;
    int pullup_duration;
    long flags;
    struct task_struct      *thread;
    struct mutex            mutex;
    struct mutex            bus_mutex;
    struct device_driver    *driver;
    struct device           dev;
    struct w1_bus_master    *bus_master;
    u32 seq;
 };

🧚 Members 🧚

okay so every member, one by one, because we do not leave the group chat on read:

  • w1_master_entry β€” the master linked list. it's giving linked-list energy.
  • owner β€” the module owner.
  • name β€” a dynamically allocated bus name.
  • list_mutex β€” protects slist and async_list.
  • slist β€” the linked list of slaves.
  • async_list β€” the linked list of netlink commands to execute.
  • max_slave_count β€” the maximum number of slaves to search for at a time.
  • slave_count β€” the current number of slaves known.
  • attempts β€” the number of searches run.
  • slave_ttl β€” the number of searches before a slave is timed out.
  • initialized β€” prevents init/removal race conditions.
  • id β€” the w1 bus number.
  • search_count β€” the number of automatic searches to run; -1 means unlimited.
  • search_id β€” allows continuing a search.
  • refcnt β€” the reference count.
  • priv β€” private data storage.
  • enable_pullup β€” allows a strong pullup.
  • pullup_duration β€” the time for the next strong pullup.
  • flags β€” one of w1_master_flags.
  • thread β€” the thread for bus search and netlink commands.
  • mutex β€” protects most of w1_master.
  • bus_mutex β€” protects concurrent bus access (the page says pretect, iconic typo, same meaning tho).
  • driver β€” the sysfs driver.
  • dev β€” the sysfs device.
  • bus_master β€” the I/O operations available.
  • seq β€” the sequence number used for netlink broadcasts.

πŸ’« SEE ALSO πŸ’«

go look at these too, bestie β€” the kernel file is ./include/linux/w1.h, and the whole friend group is:

  • struct w1_reg_num(9)
  • struct w1_slave(9)
  • struct w1_bus_master(9)
  • enum w1_master_flags(9)
  • struct w1_family_ops(9)
  • struct w1_family(9)
  • module_w1_family(9)

xoxo, source/version ./include/linux, dated October 2026 β€” byeee bestie, slay responsibly πŸ’…πŸ’–

πŸ“¦ where this page comes from