diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-04 00:23:31 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 22:43:31 -0500 |
commit | 6ddc0485e1a6ecd450140ea40ffa52786f99183c (patch) | |
tree | 77f021e9eb4632c7df1a87978283d6716f731d7f /net/bluetooth/l2cap_sock.c | |
parent | fd83ccdb393e3190633e0240dd73faac8998164b (diff) |
Bluetooth: move L2CAP sock timers function to l2cap_sock.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index fe4f834f03dd..23bb968b314a 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <net/bluetooth/hci_core.h> | 30 | #include <net/bluetooth/hci_core.h> |
31 | #include <net/bluetooth/l2cap.h> | 31 | #include <net/bluetooth/l2cap.h> |
32 | 32 | ||
33 | /* ---- L2CAP timers ---- */ | ||
33 | static void l2cap_sock_timeout(unsigned long arg) | 34 | static void l2cap_sock_timeout(unsigned long arg) |
34 | { | 35 | { |
35 | struct sock *sk = (struct sock *) arg; | 36 | struct sock *sk = (struct sock *) arg; |
@@ -63,6 +64,18 @@ static void l2cap_sock_timeout(unsigned long arg) | |||
63 | sock_put(sk); | 64 | sock_put(sk); |
64 | } | 65 | } |
65 | 66 | ||
67 | void l2cap_sock_set_timer(struct sock *sk, long timeout) | ||
68 | { | ||
69 | BT_DBG("sk %p state %d timeout %ld", sk, sk->sk_state, timeout); | ||
70 | sk_reset_timer(sk, &sk->sk_timer, jiffies + timeout); | ||
71 | } | ||
72 | |||
73 | void l2cap_sock_clear_timer(struct sock *sk) | ||
74 | { | ||
75 | BT_DBG("sock %p state %d", sk, sk->sk_state); | ||
76 | sk_stop_timer(sk, &sk->sk_timer); | ||
77 | } | ||
78 | |||
66 | static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src) | 79 | static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src) |
67 | { | 80 | { |
68 | struct sock *sk; | 81 | struct sock *sk; |