Bluetooth: Fix IPSP connection callback event issue. 54/90654/2
authorSudha Bheemanna <b.sudha@samsung.com>
Mon, 3 Oct 2016 11:52:52 +0000 (17:22 +0530)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 4 Oct 2016 08:08:22 +0000 (01:08 -0700)
This patch fixes the IPSP connection callback event issue
between kernel and bluez layer.

Change-Id: I3c0308873a1acd270696af300cacd3e0aead0346
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
net/bluetooth/l2cap_core.c

index 50ad6f4..5b67347 100644 (file)
@@ -6910,6 +6910,25 @@ static void l2cap_data_channel(struct l2cap_conn *conn, u16 cid,
 
        BT_DBG("chan %p, len %d", chan, skb->len);
 
+       /* If we receive data on a fixed channel before the info req/rsp
+        * procdure is done simply assume that the channel is supported
+        * and mark it as ready.
+        */
+#ifdef CONFIG_TIZEN_WIP
+       if (chan->chan_type == L2CAP_CHAN_FIXED) {
+               if (chan->psm == L2CAP_PSM_IPSP) {
+                       struct l2cap_conn *conn = chan->conn;
+
+                       if (conn->hcon->out)
+                               l2cap_chan_ready(chan);
+                       else if (conn->hcon->type != LE_LINK)
+                               l2cap_chan_ready(chan);
+               } else {
+                       l2cap_chan_ready(chan);
+               }
+       }
+#endif
+
        if (chan->state != BT_CONNECTED)
                goto drop;