From: h.sandeep Date: Fri, 16 Sep 2016 09:15:24 +0000 (+0530) Subject: Bluetooth: Fix IPSP connection callback event issue. X-Git-Tag: accepted/tizen/unified/20250514.114144~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f686c324e6121309f41becba334ad1bfa026176e;p=platform%2Fkernel%2Flinux-riscv.git Bluetooth: Fix IPSP connection callback event issue. This patch fixes the IPSP connection callback event issue between kernel and bluez layer. Change-Id: I3b1397b82de5f89ad2d3f63819d2201be855cf93 Signed-off-by: h.sandeep Signed-off-by: Sudha Bheemanna Signed-off-by: Amit Purwar Signed-off-by: Wootak Jung Signed-off-by: Jaehoon Chung --- diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index d4dcdb2370cc..e9762b2a51f4 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1243,8 +1243,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; @@ -6653,8 +6668,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;