w1: new netlink commands, add/remove/list slaves
[sfrench/cifs-2.6.git] / drivers / w1 / w1.h
index ca8081a101d64ac34fadbc872aeaf3e0898c4fc8..3376bfbb10f4f6293ed7e319dc57a6562f67ed79 100644 (file)
@@ -150,11 +150,22 @@ struct w1_bus_master
 
        /** Really nice hardware can handles the different types of ROM search
         *  w1_master* is passed to the slave found callback.
+        *  u8 is search_type, W1_SEARCH or W1_ALARM_SEARCH
         */
        void            (*search)(void *, struct w1_master *,
                u8, w1_slave_found_callback);
 };
 
+/**
+ * enum w1_master_flags - bitfields used in w1_master.flags
+ * @W1_ABORT_SEARCH: abort searching early on shutdown
+ * @W1_WARN_MAX_COUNT: limit warning when the maximum count is reached
+ */
+enum w1_master_flags {
+       W1_ABORT_SEARCH = 0,
+       W1_WARN_MAX_COUNT = 1,
+};
+
 struct w1_master
 {
        struct list_head        w1_master_entry;
@@ -167,6 +178,8 @@ struct w1_master
        int                     initialized;
        u32                     id;
        int                     search_count;
+       /* id to start searching on, to continue a search or 0 to restart */
+       u64                     search_id;
 
        atomic_t                refcnt;
 
@@ -178,6 +191,8 @@ struct w1_master
        /** 5V strong pullup duration in milliseconds, zero disabled. */
        int                     pullup_duration;
 
+       long                    flags;
+
        struct task_struct      *thread;
        struct mutex            mutex;
        struct mutex            bus_mutex;
@@ -198,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
@@ -206,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);