public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Walter <stevenrwalter@gmail.com>
To: marcel@holtmann.org, gustavo@padovan.org,
	johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Steven Walter <stevenrwalter@gmail.com>
Subject: [PATCH v3] Bluetooth: automatically flushable packets aren't allowed on LE links
Date: Wed, 19 Nov 2014 12:59:11 -0500	[thread overview]
Message-ID: <1416419951-27659-1-git-send-email-stevenrwalter@gmail.com> (raw)
In-Reply-To: <C7C04F3A-EC21-4E71-9550-68E50901947D@holtmann.org>

The bluetooth spec states that automatically flushable packets may not
be sent over a LE-U link.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
---
 net/bluetooth/l2cap_core.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 4af3821..7c4350f 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) || conn->hcon->type == LE_LINK)
 		flags = ACL_START_NO_FLUSH;
 	else
 		flags = ACL_START;
@@ -784,7 +784,7 @@ static bool __chan_is_moving(struct l2cap_chan *chan)
 static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
 {
 	struct hci_conn *hcon = chan->conn->hcon;
-	u16 flags;
+	u16 flags = ACL_START;
 
 	BT_DBG("chan %p, skb %p len %d priority %u", chan, skb, skb->len,
 	       skb->priority);
@@ -798,11 +798,13 @@ 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 (hcon->type == LE_LINK) {
+		/* LE-U does not support auto-flushing packets */
 		flags = ACL_START_NO_FLUSH;
-	else
-		flags = ACL_START;
+	} else if (!test_bit(FLAG_FLUSHABLE, &chan->flags) &&
+		    lmp_no_flush_capable(hcon->hdev)) {
+		flags = ACL_START_NO_FLUSH;
+	}
 
 	bt_cb(skb)->force_active = test_bit(FLAG_FORCE_ACTIVE, &chan->flags);
 	hci_send_acl(chan->conn->hchan, skb, flags);
-- 
1.9.1


  reply	other threads:[~2014-11-19 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` Steven Walter [this message]
2014-11-20 11:38         ` [PATCH v3] Bluetooth: " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416419951-27659-1-git-send-email-stevenrwalter@gmail.com \
    --to=stevenrwalter@gmail.com \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox