Revert "Bluetooth: Fix rejected connection not disconnecting ACL link"
authorNick Pelly <npelly@google.com>
Thu, 18 Feb 2010 04:45:48 +0000 (20:45 -0800)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:28 +0000 (17:49 -0700)
This reverts commit 9e726b17422bade75fba94e625cd35fd1353e682.

Change-Id: I3bc2e4caa2a0e0c36b9c7de4a09b03276adae4e1
Signed-off-by: Nick Pelly <npelly@google.com>
include/net/bluetooth/rfcomm.h
net/bluetooth/rfcomm/core.c

index a140847d622c4e5ad4dc252bd117a0d2e1861efe..76937710e5166d246e952a9308690d42570177e2 100644 (file)
@@ -29,7 +29,6 @@
 #define RFCOMM_CONN_TIMEOUT (HZ * 30)
 #define RFCOMM_DISC_TIMEOUT (HZ * 20)
 #define RFCOMM_AUTH_TIMEOUT (HZ * 25)
-#define RFCOMM_IDLE_TIMEOUT (HZ * 2)
 
 #define RFCOMM_DEFAULT_MTU     127
 #define RFCOMM_DEFAULT_CREDITS 7
@@ -155,7 +154,6 @@ struct rfcomm_msc {
 struct rfcomm_session {
        struct list_head list;
        struct socket   *sock;
-       struct timer_list timer;
        unsigned long    state;
        unsigned long    flags;
        atomic_t         refcnt;
index 1d786425511bfa28b084187f2cc940679beebd54..dac41ad6fc3dc27577a1eeea446cf7d3871f4df2 100644 (file)
@@ -248,32 +248,6 @@ static inline int rfcomm_check_security(struct rfcomm_dlc *d)
                                                                auth_type);
 }
 
-static void rfcomm_session_timeout(unsigned long arg)
-{
-       struct rfcomm_session *s = (void *) arg;
-
-       BT_DBG("session %p state %ld", s, s->state);
-
-       set_bit(RFCOMM_TIMED_OUT, &s->flags);
-       rfcomm_schedule(RFCOMM_SCHED_TIMEO);
-}
-
-static void rfcomm_session_set_timer(struct rfcomm_session *s, long timeout)
-{
-       BT_DBG("session %p state %ld timeout %ld", s, s->state, timeout);
-
-       if (!mod_timer(&s->timer, jiffies + timeout))
-               rfcomm_session_hold(s);
-}
-
-static void rfcomm_session_clear_timer(struct rfcomm_session *s)
-{
-       BT_DBG("session %p state %ld", s, s->state);
-
-       if (timer_pending(&s->timer) && del_timer(&s->timer))
-               rfcomm_session_put(s);
-}
-
 /* ---- RFCOMM DLCs ---- */
 static void rfcomm_dlc_timeout(unsigned long arg)
 {
@@ -350,7 +324,6 @@ static void rfcomm_dlc_link(struct rfcomm_session *s, struct rfcomm_dlc *d)
 
        rfcomm_session_hold(s);
 
-       rfcomm_session_clear_timer(s);
        rfcomm_dlc_hold(d);
        list_add(&d->list, &s->dlcs);
        d->session = s;
@@ -366,9 +339,6 @@ static void rfcomm_dlc_unlink(struct rfcomm_dlc *d)
        d->session = NULL;
        rfcomm_dlc_put(d);
 
-       if (list_empty(&s->dlcs))
-               rfcomm_session_set_timer(s, RFCOMM_IDLE_TIMEOUT);
-
        rfcomm_session_put(s);
 }
 
@@ -600,8 +570,6 @@ static struct rfcomm_session *rfcomm_session_add(struct socket *sock, int state)
 
        BT_DBG("session %p sock %p", s, sock);
 
-       setup_timer(&s->timer, rfcomm_session_timeout, (unsigned long) s);
-
        INIT_LIST_HEAD(&s->dlcs);
        s->state = state;
        s->sock  = sock;
@@ -633,7 +601,6 @@ static void rfcomm_session_del(struct rfcomm_session *s)
        if (state == BT_CONNECTED)
                rfcomm_send_disc(s, 0);
 
-       rfcomm_session_clear_timer(s);
        sock_release(s->sock);
        kfree(s);
 
@@ -675,7 +642,6 @@ static void rfcomm_session_close(struct rfcomm_session *s, int err)
                __rfcomm_dlc_close(d, err);
        }
 
-       rfcomm_session_clear_timer(s);
        rfcomm_session_put(s);
 }
 
@@ -1922,13 +1888,6 @@ static inline void rfcomm_process_sessions(void)
                struct rfcomm_session *s;
                s = list_entry(p, struct rfcomm_session, list);
 
-               if (test_and_clear_bit(RFCOMM_TIMED_OUT, &s->flags)) {
-                       s->state = BT_DISCONN;
-                       rfcomm_send_disc(s, 0);
-                       rfcomm_session_put(s);
-                       continue;
-               }
-
                if (s->state == BT_LISTEN) {
                        rfcomm_accept_connection(s);
                        continue;