From 103dd90703e881fda52d093a7877e3cb2e01047c Mon Sep 17 00:00:00 2001 From: Suraj Sumangala Date: Wed, 14 Jul 2010 13:02:19 +0530 Subject: [PATCH] --- yaml --- r: 203879 b: refs/heads/master c: 9981151086385eecc2febf4ba95a14593f834b3d h: refs/heads/master i: 203877: 1b5a84e2fffc3041de0b63c600424157957002de 203875: 57295c9b59194bc49f2c215b9f7af3bc651e1855 203871: cf91b8d31a3af7bded9180cad9a94affa6320d5d v: v3 --- [refs] | 2 +- trunk/include/net/bluetooth/hci_core.h | 1 + trunk/net/bluetooth/hci_core.c | 35 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index b36e3da84def..5ae97940bbf5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f39a3c06404d01ef2ce47e821bc778dfb1836df9 +refs/heads/master: 9981151086385eecc2febf4ba95a14593f834b3d diff --git a/trunk/include/net/bluetooth/hci_core.h b/trunk/include/net/bluetooth/hci_core.h index 28e5eeefdec8..350b3e6964bd 100644 --- a/trunk/include/net/bluetooth/hci_core.h +++ b/trunk/include/net/bluetooth/hci_core.h @@ -437,6 +437,7 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); int hci_recv_frame(struct sk_buff *skb); int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); +int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); int hci_register_sysfs(struct hci_dev *hdev); void hci_unregister_sysfs(struct hci_dev *hdev); diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index 451e266840ad..995c9f9b84d0 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -1163,6 +1163,41 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count) } EXPORT_SYMBOL(hci_recv_fragment); +#define STREAM_REASSEMBLY 0 + +int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count) +{ + int type; + int rem = 0; + + do { + struct sk_buff *skb = hdev->reassembly[STREAM_REASSEMBLY]; + + if (!skb) { + struct { char type; } *pkt; + + /* Start of the frame */ + pkt = data; + type = pkt->type; + + data++; + count--; + } else + type = bt_cb(skb)->pkt_type; + + rem = hci_reassembly(hdev, type, data, + count, STREAM_REASSEMBLY, GFP_ATOMIC); + if (rem < 0) + return rem; + + data += (count - rem); + count = rem; + } while (count); + + return rem; +} +EXPORT_SYMBOL(hci_recv_stream_fragment); + /* ---- Interface to upper protocols ---- */ /* Register/Unregister protocols.