diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-20 07:57:27 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-20 14:07:03 -0500 |
commit | 6c9d42a1615c6dc19c4a57a77d9c4b3d779bb741 (patch) | |
tree | 27c2c72dd631c05de40684535d2028441e2d792e /net/bluetooth/smp.c | |
parent | c2ec9c1bbd17cdd1fc962f000b4ecb98c1dad830 (diff) |
Bluetooth: convert security timer to delayed_work
This one also needs to run in process context
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 0b96737d0ad3..0ee2905a6179 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c | |||
@@ -184,7 +184,8 @@ static void smp_send_cmd(struct l2cap_conn *conn, u8 code, u16 len, void *data) | |||
184 | skb->priority = HCI_PRIO_MAX; | 184 | skb->priority = HCI_PRIO_MAX; |
185 | hci_send_acl(conn->hchan, skb, 0); | 185 | hci_send_acl(conn->hchan, skb, 0); |
186 | 186 | ||
187 | mod_timer(&conn->security_timer, jiffies + | 187 | cancel_delayed_work_sync(&conn->security_timer); |
188 | schedule_delayed_work(&conn->security_timer, | ||
188 | msecs_to_jiffies(SMP_TIMEOUT)); | 189 | msecs_to_jiffies(SMP_TIMEOUT)); |
189 | } | 190 | } |
190 | 191 | ||
@@ -240,7 +241,7 @@ static void smp_failure(struct l2cap_conn *conn, u8 reason, u8 send) | |||
240 | 241 | ||
241 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->pend); | 242 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->hcon->pend); |
242 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason); | 243 | mgmt_auth_failed(conn->hcon->hdev, conn->dst, reason); |
243 | del_timer(&conn->security_timer); | 244 | cancel_delayed_work_sync(&conn->security_timer); |
244 | smp_chan_destroy(conn); | 245 | smp_chan_destroy(conn); |
245 | } | 246 | } |
246 | 247 | ||
@@ -800,7 +801,7 @@ int smp_distribute_keys(struct l2cap_conn *conn, __u8 force) | |||
800 | 801 | ||
801 | if (conn->hcon->out || force) { | 802 | if (conn->hcon->out || force) { |
802 | clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend); | 803 | clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->pend); |
803 | del_timer(&conn->security_timer); | 804 | cancel_delayed_work_sync(&conn->security_timer); |
804 | smp_chan_destroy(conn); | 805 | smp_chan_destroy(conn); |
805 | } | 806 | } |
806 | 807 | ||