Chapter 1. W1 API internal to the kernel

Table of Contents

W1 API internal to the kernel
drivers/w1/w1.h
drivers/w1/w1.c
drivers/w1/w1_family.h
drivers/w1/w1_family.c
drivers/w1/w1_int.c
drivers/w1/w1_netlink.h
drivers/w1/w1_io.c

W1 API internal to the kernel

drivers/w1/w1.h

struct w1_reg_num — broken out slave device id
struct w1_slave — holds a single slave device on the bus
struct w1_bus_master — operations available on a bus master
enum w1_master_flags — bitfields used in w1_master.flags
struct w1_master — one per bus master
struct w1_async_cmd — execute callback from the w1_process kthread

W1 core functions.

drivers/w1/w1.c

w1_search — Performs a ROM Search & registers any devices found.
w1_process_callbacks — execute each dev->async_list callback entry

W1 core functions.

drivers/w1/w1_family.h

struct w1_family_ops — operations for a family type
struct w1_family — reference counted family structure.
module_w1_family — Helper macro for registering a 1-Wire families

Allows registering device family operations.

drivers/w1/w1_family.c

w1_register_family — register a device family driver
w1_unregister_family — unregister a device family driver

Allows registering device family operations.

drivers/w1/w1_int.c

w1_add_master_device — registers a new master device
w1_remove_master_device — unregister a master device

W1 internal initialization for master devices.

drivers/w1/w1_netlink.h

enum w1_cn_msg_flags — bitfield flags for struct cn_msg.flags
enum w1_netlink_message_types — message type
struct w1_netlink_msg — holds w1 message type, id, and result
enum w1_commands — commands available for master or slave operations
struct w1_netlink_cmd — holds the command and data

W1 external netlink API structures and commands.

drivers/w1/w1_io.c

w1_write_8 — Writes 8 bits.
w1_triplet — * Does a triplet - used for searching ROM addresses.
w1_read_8 — Reads 8 bits.
w1_write_block — Writes a series of bytes.
w1_touch_block — Touches a series of bytes.
w1_read_block — Reads a series of bytes.
w1_reset_bus — Issues a reset bus sequence.
w1_reset_select_slave — reset and select a slave
w1_reset_resume_command — resume instead of another match ROM
w1_next_pullup — register for a strong pullup
w1_touch_bit — Generates a write-0 or write-1 cycle and samples the level.
w1_write_bit — Generates a write-0 or write-1 cycle.
w1_pre_write — pre-write operations
w1_post_write — post-write options
w1_read_bit — Generates a write-1 cycle and samples the level.

W1 input/output.