Bluetooth: Fix IPSP connection callback event issue. 40/317440/1
authorh.sandeep <h.sandeep@samsung.com>
Fri, 16 Sep 2016 09:15:24 +0000 (14:45 +0530)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 2 Jan 2025 06:09:04 +0000 (15:09 +0900)
This patch fixes the IPSP connection callback event issue
between kernel and bluez layer.

Change-Id: I3b1397b82de5f89ad2d3f63819d2201be855cf93
Signed-off-by: h.sandeep <h.sandeep@samsung.com>
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
net/bluetooth/l2cap_core.c

index bf31c5bae218fc2a002f65f7b175cd93b7319627..374de8c3e0e139340da0b6b557a01fd8ad8329c6 100644 (file)
@@ -1236,8 +1236,23 @@ static void l2cap_chan_ready(struct l2cap_chan *chan)
         * case of receiving data before the L2CAP info req/rsp
         * procedure is complete.
         */
+#ifndef TIZEN_BT
        if (chan->state == BT_CONNECTED)
                return;
+#else
+       if (chan->state == BT_CONNECTED) {
+               if (chan->psm == L2CAP_PSM_IPSP) {
+                       struct l2cap_conn *conn = chan->conn;
+
+                       if (conn->hcon->out)
+                               return;
+                       else if (conn->hcon->type != LE_LINK)
+                               return;
+               } else {
+                       return;
+               }
+       }
+#endif
 
        /* This clears all conf flags, including CONF_NOT_COMPLETE */
        chan->conf_state = 0;
@@ -6699,8 +6714,23 @@ static void l2cap_data_channel(struct l2cap_conn *conn, u16 cid,
         * procedure is done simply assume that the channel is supported
         * and mark it as ready.
         */
+#ifndef TIZEN_BT
        if (chan->chan_type == L2CAP_CHAN_FIXED)
                l2cap_chan_ready(chan);
+#else
+       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;