diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-04-05 00:59:25 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-07 12:47:10 -0400 |
commit | c27799f99f589e76ea84642508a32638091a409a (patch) | |
tree | f14857fd52bf495c16b287b76689ab7cb6e1f6cb /drivers/bluetooth | |
parent | e1a38d70d8e07db6fbf93621f289c08bbcca0ba3 (diff) |
Bluetooth: hci_uart: Use h4_recv_buf helper for H:4 protocol
Instead of using hci_recv_stream_fragment, use the local available
h4_recv_buf helper function.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/hci_h4.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index 09270bc26654..d8414540f743 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #define VERSION "1.2" | 49 | #define VERSION "1.2" |
50 | 50 | ||
51 | struct h4_struct { | 51 | struct h4_struct { |
52 | struct sk_buff *rx_skb; | ||
52 | struct sk_buff_head txq; | 53 | struct sk_buff_head txq; |
53 | }; | 54 | }; |
54 | 55 | ||
@@ -92,6 +93,8 @@ static int h4_close(struct hci_uart *hu) | |||
92 | 93 | ||
93 | skb_queue_purge(&h4->txq); | 94 | skb_queue_purge(&h4->txq); |
94 | 95 | ||
96 | kfree_skb(h4->rx_skb); | ||
97 | |||
95 | hu->priv = NULL; | 98 | hu->priv = NULL; |
96 | kfree(h4); | 99 | kfree(h4); |
97 | 100 | ||
@@ -115,15 +118,16 @@ static int h4_enqueue(struct hci_uart *hu, struct sk_buff *skb) | |||
115 | /* Recv data */ | 118 | /* Recv data */ |
116 | static int h4_recv(struct hci_uart *hu, const void *data, int count) | 119 | static int h4_recv(struct hci_uart *hu, const void *data, int count) |
117 | { | 120 | { |
118 | int ret; | 121 | struct h4_struct *h4 = hu->priv; |
119 | 122 | ||
120 | if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) | 123 | if (!test_bit(HCI_UART_REGISTERED, &hu->flags)) |
121 | return -EUNATCH; | 124 | return -EUNATCH; |
122 | 125 | ||
123 | ret = hci_recv_stream_fragment(hu->hdev, data, count); | 126 | h4->rx_skb = h4_recv_buf(hu->hdev, h4->rx_skb, data, count); |
124 | if (ret < 0) { | 127 | if (IS_ERR(h4->rx_skb)) { |
125 | BT_ERR("Frame Reassembly Failed"); | 128 | int err = PTR_ERR(h4->rx_skb); |
126 | return ret; | 129 | BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err); |
130 | return err; | ||
127 | } | 131 | } |
128 | 132 | ||
129 | return count; | 133 | return count; |