diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-10-15 04:58:40 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-10-15 08:46:39 -0400 |
commit | d73a098804b4d1d254b1caf1d114e5b707dee060 (patch) | |
tree | 019ccd495a41af86b8890a0aed7038ff4ba1cb91 /net | |
parent | 204a6e54280d53e6990e536998fbf8dfba41ecd3 (diff) |
Bluetooth: AMP: Handle complete frames in l2cap
Check flags type in switch statement and handle new frame
type ACL_COMPLETE used for High Speed data over AMP.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index fca407e17f16..8faa3121bb44 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -5568,6 +5568,8 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
5568 | int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) | 5568 | int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) |
5569 | { | 5569 | { |
5570 | struct l2cap_conn *conn = hcon->l2cap_data; | 5570 | struct l2cap_conn *conn = hcon->l2cap_data; |
5571 | struct l2cap_hdr *hdr; | ||
5572 | int len; | ||
5571 | 5573 | ||
5572 | if (!conn) | 5574 | if (!conn) |
5573 | conn = l2cap_conn_add(hcon, 0); | 5575 | conn = l2cap_conn_add(hcon, 0); |
@@ -5577,10 +5579,10 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) | |||
5577 | 5579 | ||
5578 | BT_DBG("conn %p len %d flags 0x%x", conn, skb->len, flags); | 5580 | BT_DBG("conn %p len %d flags 0x%x", conn, skb->len, flags); |
5579 | 5581 | ||
5580 | if (!(flags & ACL_CONT)) { | 5582 | switch (flags) { |
5581 | struct l2cap_hdr *hdr; | 5583 | case ACL_START: |
5582 | int len; | 5584 | case ACL_START_NO_FLUSH: |
5583 | 5585 | case ACL_COMPLETE: | |
5584 | if (conn->rx_len) { | 5586 | if (conn->rx_len) { |
5585 | BT_ERR("Unexpected start frame (len %d)", skb->len); | 5587 | BT_ERR("Unexpected start frame (len %d)", skb->len); |
5586 | kfree_skb(conn->rx_skb); | 5588 | kfree_skb(conn->rx_skb); |
@@ -5622,7 +5624,9 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) | |||
5622 | skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), | 5624 | skb_copy_from_linear_data(skb, skb_put(conn->rx_skb, skb->len), |
5623 | skb->len); | 5625 | skb->len); |
5624 | conn->rx_len = len - skb->len; | 5626 | conn->rx_len = len - skb->len; |
5625 | } else { | 5627 | break; |
5628 | |||
5629 | case ACL_CONT: | ||
5626 | BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len); | 5630 | BT_DBG("Cont: frag len %d (expecting %d)", skb->len, conn->rx_len); |
5627 | 5631 | ||
5628 | if (!conn->rx_len) { | 5632 | if (!conn->rx_len) { |
@@ -5650,6 +5654,7 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) | |||
5650 | l2cap_recv_frame(conn, conn->rx_skb); | 5654 | l2cap_recv_frame(conn, conn->rx_skb); |
5651 | conn->rx_skb = NULL; | 5655 | conn->rx_skb = NULL; |
5652 | } | 5656 | } |
5657 | break; | ||
5653 | } | 5658 | } |
5654 | 5659 | ||
5655 | drop: | 5660 | drop: |