aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorSteven Walter <stevenrwalter@gmail.com>2014-11-19 09:41:17 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-11-27 05:12:27 -0500
commitf6af675ef5489c69fc3d4faf8c6f477df3cbf8b9 (patch)
tree5a804169b240e94e081c8a4da2b056dc11de8618 /net/bluetooth/l2cap_core.c
parent3bb30a7cdf9242aca90d49aa41baebf9458f96f0 (diff)
Bluetooth: Automatically flushable packets aren't allowed on LE links
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> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 8e1273173020..c2d1489c228c 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -840,7 +840,10 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len,
840 if (!skb) 840 if (!skb)
841 return; 841 return;
842 842
843 if (lmp_no_flush_capable(conn->hcon->hdev)) 843 /* Use NO_FLUSH if supported or we have an LE link (which does
844 * not support auto-flushing packets) */
845 if (lmp_no_flush_capable(conn->hcon->hdev) ||
846 conn->hcon->type == LE_LINK)
844 flags = ACL_START_NO_FLUSH; 847 flags = ACL_START_NO_FLUSH;
845 else 848 else
846 flags = ACL_START; 849 flags = ACL_START;
@@ -874,8 +877,13 @@ static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
874 return; 877 return;
875 } 878 }
876 879
877 if (!test_bit(FLAG_FLUSHABLE, &chan->flags) && 880 /* Use NO_FLUSH for LE links (where this is the only option) or
878 lmp_no_flush_capable(hcon->hdev)) 881 * if the BR/EDR link supports it and flushing has not been
882 * explicitly requested (through FLAG_FLUSHABLE).
883 */
884 if (hcon->type == LE_LINK ||
885 (!test_bit(FLAG_FLUSHABLE, &chan->flags) &&
886 lmp_no_flush_capable(hcon->hdev)))
879 flags = ACL_START_NO_FLUSH; 887 flags = ACL_START_NO_FLUSH;
880 else 888 else
881 flags = ACL_START; 889 flags = ACL_START;