linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] l2cap_core: automatically flushable packets aren't supported by LE-only devices
@ 2014-11-18 14:46 Steven Walter
  2014-11-18 22:01 ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Walter @ 2014-11-18 14:46 UTC (permalink / raw)
  To: linux-kernel, linux-bluetooth, marcel, gustavo, johan.hedberg
  Cc: Steven Walter

The bluetooth spec states that automatically flushable packets may not
be sent to a LE-only controller.  The code already supports
non-automatically-flushable packets, but uses a bit in the controller
feature field to determine whether to use them.  That bit is always zero
for LE-only devices, so we need to check for the LE-only case explicitly.
---
 net/bluetooth/l2cap_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 4af3821..29d9b9c 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -764,7 +764,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len,
 	if (!skb)
 		return;
 
-	if (lmp_no_flush_capable(conn->hcon->hdev))
+	if (lmp_no_flush_capable(conn->hcon->hdev) || !lmp_bredr_capable(conn->hcon->hdev))
 		flags = ACL_START_NO_FLUSH;
 	else
 		flags = ACL_START;
@@ -798,8 +798,9 @@ static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
 		return;
 	}
 
-	if (!test_bit(FLAG_FLUSHABLE, &chan->flags) &&
-	    lmp_no_flush_capable(hcon->hdev))
+	if (!lmp_bredr_capable(hcon->hdev) ||
+	    (!test_bit(FLAG_FLUSHABLE, &chan->flags) &&
+	    lmp_no_flush_capable(hcon->hdev)))
 		flags = ACL_START_NO_FLUSH;
 	else
 		flags = ACL_START;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-11-27 10:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 14:46 [PATCH] l2cap_core: automatically flushable packets aren't supported by LE-only devices Steven Walter
2014-11-18 22:01 ` Marcel Holtmann
2014-11-19 14:41   ` [PATCH v2] l2cap_core: automatically flushable packets aren't allowed on LE links Steven Walter
2014-11-19 14:48     ` Marcel Holtmann
2014-11-19 17:59       ` [PATCH v3] Bluetooth: " Steven Walter
2014-11-20 11:38         ` Johan Hedberg
2014-11-20 13:50           ` Marcel Holtmann
2014-11-20 14:57             ` Johan Hedberg
     [not found]             ` <CAK8d-aL+3eB4WZeqO1sv9p3440EVXQiqF6QiTU5YNAKAbZ7f-w@mail.gmail.com>
2014-11-25 14:53               ` Steven Walter
2014-11-26  5:16                 ` Marcel Holtmann
2014-11-27 10:14                   ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).