diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-14 22:16:14 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-18 14:07:57 -0500 |
commit | f878fcad1760247c054a9c80964d0b7450d2379b (patch) | |
tree | ca137948498eb9d21a7e1d5fb442ab1d34c959e5 /net/bluetooth | |
parent | 3eff45eaf81780dad25c167bbaafa7d25ae407da (diff) |
Bluetooth: convert info timer to delayed_work
Another step of remove interrupt context from Bluetooth Core.
Use the system workqueue.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 5c5948f09a62..a78cdf7236db 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -698,7 +698,7 @@ static void l2cap_do_start(struct l2cap_chan *chan) | |||
698 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; | 698 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; |
699 | conn->info_ident = l2cap_get_ident(conn); | 699 | conn->info_ident = l2cap_get_ident(conn); |
700 | 700 | ||
701 | mod_timer(&conn->info_timer, jiffies + | 701 | schedule_delayed_work(&conn->info_work, |
702 | msecs_to_jiffies(L2CAP_INFO_TIMEOUT)); | 702 | msecs_to_jiffies(L2CAP_INFO_TIMEOUT)); |
703 | 703 | ||
704 | l2cap_send_cmd(conn, conn->info_ident, | 704 | l2cap_send_cmd(conn, conn->info_ident, |
@@ -998,9 +998,10 @@ static void l2cap_conn_unreliable(struct l2cap_conn *conn, int err) | |||
998 | mutex_unlock(&conn->chan_lock); | 998 | mutex_unlock(&conn->chan_lock); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | static void l2cap_info_timeout(unsigned long arg) | 1001 | static void l2cap_info_timeout(struct work_struct *work) |
1002 | { | 1002 | { |
1003 | struct l2cap_conn *conn = (void *) arg; | 1003 | struct l2cap_conn *conn = container_of(work, struct l2cap_conn, |
1004 | info_work.work); | ||
1004 | 1005 | ||
1005 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; | 1006 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; |
1006 | conn->info_ident = 0; | 1007 | conn->info_ident = 0; |
@@ -1033,7 +1034,7 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err) | |||
1033 | hci_chan_del(conn->hchan); | 1034 | hci_chan_del(conn->hchan); |
1034 | 1035 | ||
1035 | if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) | 1036 | if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) |
1036 | del_timer_sync(&conn->info_timer); | 1037 | cancel_delayed_work_sync(&conn->info_work); |
1037 | 1038 | ||
1038 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) { | 1039 | if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &hcon->pend)) { |
1039 | del_timer(&conn->security_timer); | 1040 | del_timer(&conn->security_timer); |
@@ -1094,8 +1095,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) | |||
1094 | setup_timer(&conn->security_timer, security_timeout, | 1095 | setup_timer(&conn->security_timer, security_timeout, |
1095 | (unsigned long) conn); | 1096 | (unsigned long) conn); |
1096 | else | 1097 | else |
1097 | setup_timer(&conn->info_timer, l2cap_info_timeout, | 1098 | INIT_DELAYED_WORK(&conn->info_work, l2cap_info_timeout); |
1098 | (unsigned long) conn); | ||
1099 | 1099 | ||
1100 | conn->disc_reason = HCI_ERROR_REMOTE_USER_TERM; | 1100 | conn->disc_reason = HCI_ERROR_REMOTE_USER_TERM; |
1101 | 1101 | ||
@@ -2530,7 +2530,7 @@ static inline int l2cap_command_rej(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
2530 | 2530 | ||
2531 | if ((conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) && | 2531 | if ((conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT) && |
2532 | cmd->ident == conn->info_ident) { | 2532 | cmd->ident == conn->info_ident) { |
2533 | del_timer(&conn->info_timer); | 2533 | cancel_delayed_work_sync(&conn->info_work); |
2534 | 2534 | ||
2535 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; | 2535 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; |
2536 | conn->info_ident = 0; | 2536 | conn->info_ident = 0; |
@@ -2656,7 +2656,7 @@ sendresp: | |||
2656 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; | 2656 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT; |
2657 | conn->info_ident = l2cap_get_ident(conn); | 2657 | conn->info_ident = l2cap_get_ident(conn); |
2658 | 2658 | ||
2659 | mod_timer(&conn->info_timer, jiffies + | 2659 | schedule_delayed_work(&conn->info_work, |
2660 | msecs_to_jiffies(L2CAP_INFO_TIMEOUT)); | 2660 | msecs_to_jiffies(L2CAP_INFO_TIMEOUT)); |
2661 | 2661 | ||
2662 | l2cap_send_cmd(conn, conn->info_ident, | 2662 | l2cap_send_cmd(conn, conn->info_ident, |
@@ -3081,7 +3081,7 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm | |||
3081 | conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE) | 3081 | conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE) |
3082 | return 0; | 3082 | return 0; |
3083 | 3083 | ||
3084 | del_timer(&conn->info_timer); | 3084 | cancel_delayed_work_sync(&conn->info_work); |
3085 | 3085 | ||
3086 | if (result != L2CAP_IR_SUCCESS) { | 3086 | if (result != L2CAP_IR_SUCCESS) { |
3087 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; | 3087 | conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; |