Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252070
b: refs/heads/master
c: 963bb10
h: refs/heads/master
v: v3
  • Loading branch information
David Fries authored and Linus Torvalds committed May 27, 2011
1 parent 191d586 commit fec155a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26a6afb917a8e3eb603358be1238a69e8a16d0ee
refs/heads/master: 963bb101010169b9bb32b5c21af785e2f9abdaf3
12 changes: 9 additions & 3 deletions trunk/drivers/w1/w1.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ void w1_reconnect_slaves(struct w1_family *f, int attach)
mutex_unlock(&w1_mlock);
}

static void w1_slave_found(struct w1_master *dev, u64 rn)
void w1_slave_found(struct w1_master *dev, u64 rn)
{
struct w1_slave *sl;
struct w1_reg_num *tmp;
Expand Down Expand Up @@ -933,14 +933,15 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
}
}

void w1_search_process(struct w1_master *dev, u8 search_type)
void w1_search_process_cb(struct w1_master *dev, u8 search_type,
w1_slave_found_callback cb)
{
struct w1_slave *sl, *sln;

list_for_each_entry(sl, &dev->slist, w1_slave_entry)
clear_bit(W1_SLAVE_ACTIVE, (long *)&sl->flags);

w1_search_devices(dev, search_type, w1_slave_found);
w1_search_devices(dev, search_type, cb);

list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) {
if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl)
Expand All @@ -953,6 +954,11 @@ void w1_search_process(struct w1_master *dev, u8 search_type)
dev->search_count--;
}

static void w1_search_process(struct w1_master *dev, u8 search_type)
{
w1_search_process_cb(dev, search_type, w1_slave_found);
}

int w1_process(void *data)
{
struct w1_master *dev = (struct w1_master *) data;
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/w1/w1.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ void w1_destroy_master_attributes(struct w1_master *master);
void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb);
void w1_search_devices(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb);
struct w1_slave *w1_search_slave(struct w1_reg_num *id);
void w1_search_process(struct w1_master *dev, u8 search_type);
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_master *w1_search_master_id(u32 id);

/* Disconnect and reconnect devices in the given family. Used for finding
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/w1/w1_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ static void w1_send_slave(struct w1_master *dev, u64 rn)
struct w1_netlink_cmd *cmd = (struct w1_netlink_cmd *)(hdr + 1);
int avail;

/* update kernel slave list */
w1_slave_found(dev, rn);

avail = dev->priv_size - cmd->len;

if (avail > 8) {
Expand Down Expand Up @@ -85,7 +88,7 @@ static int w1_process_search_command(struct w1_master *dev, struct cn_msg *msg,
dev->priv = msg;
dev->priv_size = avail;

w1_search_devices(dev, search_type, w1_send_slave);
w1_search_process_cb(dev, search_type, w1_send_slave);

msg->ack = 0;
cn_netlink_send(msg, 0, GFP_KERNEL);
Expand Down

0 comments on commit fec155a

Please sign in to comment.