diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2005-06-03 17:29:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-22 00:43:12 -0400 |
commit | 6adf87bd7b7832105b9c6bc08adf6a4d229f1e79 (patch) | |
tree | 1c6d17df3c4f4d753021e970a7bb898c1aabeb82 /drivers/w1/w1_int.c | |
parent | 4754639d88e922af451b399af09ac1bb442c35e5 (diff) |
[PATCH] w1: reconnect feature.
I've created reconnect feature - if on start there are no registered families
all new devices will have defailt family, later when driver for appropriate
family is loaded, slaves, which were faound earlier, will still have defult
family instead of right one. Reconnect feature will force control thread to run
through all master devices and all slaves found and search for slaves with
default family id and try to reconnect them.
It does not store newly registered family and does not check only those slaves
which have reg_num.family the same as being registered one - all slaves with
default family are reconnected.
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/w1/w1_int.c')
-rw-r--r-- | drivers/w1/w1_int.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index cf18f1324f03..35e85d961702 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c | |||
@@ -124,10 +124,9 @@ int w1_add_master_device(struct w1_bus_master *master) | |||
124 | 124 | ||
125 | /* validate minimum functionality */ | 125 | /* validate minimum functionality */ |
126 | if (!(master->touch_bit && master->reset_bus) && | 126 | if (!(master->touch_bit && master->reset_bus) && |
127 | !(master->write_bit && master->read_bit)) | 127 | !(master->write_bit && master->read_bit)) { |
128 | { | 128 | printk(KERN_ERR "w1_add_master_device: invalid function set\n"); |
129 | printk(KERN_ERR "w1_add_master_device: invalid function set\n"); | 129 | return(-EINVAL); |
130 | return(-EINVAL); | ||
131 | } | 130 | } |
132 | 131 | ||
133 | dev = w1_alloc_dev(w1_ids++, w1_max_slave_count, w1_max_slave_ttl, &w1_driver, &w1_device); | 132 | dev = w1_alloc_dev(w1_ids++, w1_max_slave_count, w1_max_slave_ttl, &w1_driver, &w1_device); |
@@ -163,7 +162,7 @@ int w1_add_master_device(struct w1_bus_master *master) | |||
163 | return 0; | 162 | return 0; |
164 | 163 | ||
165 | err_out_kill_thread: | 164 | err_out_kill_thread: |
166 | dev->need_exit = 1; | 165 | set_bit(W1_MASTER_NEED_EXIT, &dev->flags); |
167 | if (kill_proc(dev->kpid, SIGTERM, 1)) | 166 | if (kill_proc(dev->kpid, SIGTERM, 1)) |
168 | dev_err(&dev->dev, | 167 | dev_err(&dev->dev, |
169 | "Failed to send signal to w1 kernel thread %d.\n", | 168 | "Failed to send signal to w1 kernel thread %d.\n", |
@@ -181,7 +180,7 @@ void __w1_remove_master_device(struct w1_master *dev) | |||
181 | int err; | 180 | int err; |
182 | struct w1_netlink_msg msg; | 181 | struct w1_netlink_msg msg; |
183 | 182 | ||
184 | dev->need_exit = 1; | 183 | set_bit(W1_MASTER_NEED_EXIT, &dev->flags); |
185 | err = kill_proc(dev->kpid, SIGTERM, 1); | 184 | err = kill_proc(dev->kpid, SIGTERM, 1); |
186 | if (err) | 185 | if (err) |
187 | dev_err(&dev->dev, | 186 | dev_err(&dev->dev, |