drivers/w1/w1_netlink.h

Source file repositories/reference/linux-study-clean/drivers/w1/w1_netlink.h

File Facts

System
Linux kernel
Corpus path
drivers/w1/w1_netlink.h
Extension
.h
Size
3625 bytes
Lines
136
Domain
Driver Families
Bucket
drivers/w1
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct w1_mst {
			__u32		id;
			__u32		res;
		} mst;
	} id;
	__u8				data[];
};

/**
 * enum w1_commands - commands available for master or slave operations
 *
 * @W1_CMD_READ: read len bytes
 * @W1_CMD_WRITE: write len bytes
 * @W1_CMD_SEARCH: initiate a standard search, returns only the slave
 * devices found during that search
 * @W1_CMD_ALARM_SEARCH: search for devices that are currently alarming
 * @W1_CMD_TOUCH: Touches a series of bytes.
 * @W1_CMD_RESET: sends a bus reset on the given master
 * @W1_CMD_SLAVE_ADD: adds a slave to the given master,
 * 8 byte slave id at data[0]
 * @W1_CMD_SLAVE_REMOVE: removes a slave to the given master,
 * 8 byte slave id at data[0]
 * @W1_CMD_LIST_SLAVES: list of slaves registered on this master
 * @W1_CMD_MAX: number of available commands
 */
enum w1_commands {
	W1_CMD_READ = 0,
	W1_CMD_WRITE,
	W1_CMD_SEARCH,
	W1_CMD_ALARM_SEARCH,
	W1_CMD_TOUCH,
	W1_CMD_RESET,
	W1_CMD_SLAVE_ADD,
	W1_CMD_SLAVE_REMOVE,
	W1_CMD_LIST_SLAVES,
	W1_CMD_MAX
};

/**
 * struct w1_netlink_cmd - holds the command and data
 *
 * @cmd: one of enum w1_commands
 * @res: reserved
 * @len: length of data following w1_netlink_cmd
 * @data: start address of any following data
 *
 * One or more struct w1_netlink_cmd is placed starting at w1_netlink_msg.data
 * each with optional data.
 */
struct w1_netlink_cmd
{
	__u8				cmd;
	__u8				res;
	__u16				len;
	__u8				data[];
};

#ifdef __KERNEL__

void w1_netlink_send(struct w1_master *, struct w1_netlink_msg *);
int w1_init_netlink(void);
void w1_fini_netlink(void);

#endif /* __KERNEL__ */
#endif /* __W1_NETLINK_H */

Annotation

Implementation Notes