Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279260
b: refs/heads/master
c: 19c40e3
h: refs/heads/master
v: v3
  • Loading branch information
Gustavo F. Padovan committed Dec 18, 2011
1 parent 713f4ea commit 01338a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 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: 09fd0de5bd8f8ef3317e5365f92f1a13dcd89aa9
refs/heads/master: 19c40e3bcaf2d969f5d4ee85bbe1330b54d36d9c
8 changes: 5 additions & 3 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ struct hci_conn {
struct sk_buff_head data_q;
struct list_head chan_list;

struct timer_list disc_timer;
struct delayed_work disc_work;
struct timer_list idle_timer;
struct timer_list auto_accept_timer;

Expand Down Expand Up @@ -517,7 +517,7 @@ void hci_conn_put_device(struct hci_conn *conn);
static inline void hci_conn_hold(struct hci_conn *conn)
{
atomic_inc(&conn->refcnt);
del_timer(&conn->disc_timer);
cancel_delayed_work_sync(&conn->disc_work);
}

static inline void hci_conn_put(struct hci_conn *conn)
Expand All @@ -536,7 +536,9 @@ static inline void hci_conn_put(struct hci_conn *conn)
} else {
timeo = msecs_to_jiffies(10);
}
mod_timer(&conn->disc_timer, jiffies + timeo);
cancel_delayed_work_sync(&conn->disc_work);
queue_delayed_work(conn->hdev->workqueue,
&conn->disc_work, jiffies + timeo);
}
}

Expand Down
9 changes: 5 additions & 4 deletions trunk/net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,10 @@ void hci_sco_setup(struct hci_conn *conn, __u8 status)
}
}

static void hci_conn_timeout(unsigned long arg)
static void hci_conn_timeout(struct work_struct *work)
{
struct hci_conn *conn = (void *) arg;
struct hci_conn *conn = container_of(work, struct hci_conn,
disc_work.work);
struct hci_dev *hdev = conn->hdev;
__u8 reason;

Expand Down Expand Up @@ -412,7 +413,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)

INIT_LIST_HEAD(&conn->chan_list);;

setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn);
INIT_DELAYED_WORK(&conn->disc_work, hci_conn_timeout);
setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn);
setup_timer(&conn->auto_accept_timer, hci_conn_auto_accept,
(unsigned long) conn);
Expand Down Expand Up @@ -444,7 +445,7 @@ int hci_conn_del(struct hci_conn *conn)

del_timer(&conn->idle_timer);

del_timer(&conn->disc_timer);
cancel_delayed_work_sync(&conn->disc_work);

del_timer(&conn->auto_accept_timer);

Expand Down

0 comments on commit 01338a0

Please sign in to comment.