From 70b34d2ed807b722413894975a8c60617defb887 Mon Sep 17 00:00:00 2001 From: David Fries Date: Wed, 15 Jan 2014 22:29:17 -0600 Subject: w1: new netlink commands, add/remove/list slaves Introduce new commands to add, remove, and list slave devices through the netlink interface. This can be useful to skip the search on a static network. They could previously only be added or removed through automatic search or sysfs, and this allows a program to only use netlink. Only allocate memory when needed, so move kzalloc into w1_get_slaves where it was used. Signed-off-by: David Fries Acked-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- drivers/w1/w1.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/w1/w1.h') diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 80fbdf908919..3376bfbb10f4 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h @@ -213,6 +213,8 @@ struct w1_slave *w1_search_slave(struct w1_reg_num *id); void w1_slave_found(struct w1_master *dev, u64 rn); void w1_search_process_cb(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb); +struct w1_slave *w1_slave_search_device(struct w1_master *dev, + struct w1_reg_num *rn); struct w1_master *w1_search_master_id(u32 id); /* Disconnect and reconnect devices in the given family. Used for finding @@ -221,6 +223,7 @@ struct w1_master *w1_search_master_id(u32 id); * has just been registered, to 0 when it has been unregistered. */ void w1_reconnect_slaves(struct w1_family *f, int attach); +int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn); void w1_slave_detach(struct w1_slave *sl); u8 w1_triplet(struct w1_master *dev, int bdir); -- cgit v1.2.3-58-ga151