|
@@ -30,6 +30,7 @@
|
|
|
#include <net/bluetooth/hci_core.h>
|
|
|
#include <net/bluetooth/l2cap.h>
|
|
|
|
|
|
+/* ---- L2CAP timers ---- */
|
|
|
static void l2cap_sock_timeout(unsigned long arg)
|
|
|
{
|
|
|
struct sock *sk = (struct sock *) arg;
|
|
@@ -63,6 +64,18 @@ static void l2cap_sock_timeout(unsigned long arg)
|
|
|
sock_put(sk);
|
|
|
}
|
|
|
|
|
|
+void l2cap_sock_set_timer(struct sock *sk, long timeout)
|
|
|
+{
|
|
|
+ BT_DBG("sk %p state %d timeout %ld", sk, sk->sk_state, timeout);
|
|
|
+ sk_reset_timer(sk, &sk->sk_timer, jiffies + timeout);
|
|
|
+}
|
|
|
+
|
|
|
+void l2cap_sock_clear_timer(struct sock *sk)
|
|
|
+{
|
|
|
+ BT_DBG("sock %p state %d", sk, sk->sk_state);
|
|
|
+ sk_stop_timer(sk, &sk->sk_timer);
|
|
|
+}
|
|
|
+
|
|
|
static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
|
|
|
{
|
|
|
struct sock *sk;
|