diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-04-04 21:59:26 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-07 18:47:10 +0200 |
commit | d90aa68236137d4170e39055dba41a5a000c568e (patch) | |
tree | af1ddbd3347f2f94f89537723db5f8d48adc9330 /drivers/bluetooth/hci_ath.c | |
parent | c27799f99f589e76ea84642508a32638091a409a (diff) | |
download | blackbird-op-linux-d90aa68236137d4170e39055dba41a5a000c568e.tar.gz blackbird-op-linux-d90aa68236137d4170e39055dba41a5a000c568e.zip |
Bluetooth: hci_uart: Use h4_recv_buf helper for Atheros AR300x
Instead of using hci_recv_stream_fragment, use the local available
h4_recv_buf helper function.
To ensure that the function is available select BT_HCIUART_H4.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth/hci_ath.c')
-rw-r--r-- | drivers/bluetooth/hci_ath.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c index 4e89d3e33b7b..15beb974f3a0 100644 --- a/drivers/bluetooth/hci_ath.c +++ b/drivers/bluetooth/hci_ath.c @@ -45,6 +45,7 @@ struct ath_struct { struct hci_uart *hu; unsigned int cur_sleep; + struct sk_buff *rx_skb; struct sk_buff_head txq; struct work_struct ctxtsw; }; @@ -136,6 +137,8 @@ static int ath_close(struct hci_uart *hu) skb_queue_purge(&ath->txq); + kfree_skb(ath->rx_skb); + cancel_work_sync(&ath->ctxtsw); hu->priv = NULL; @@ -190,12 +193,13 @@ static struct sk_buff *ath_dequeue(struct hci_uart *hu) /* Recv data */ static int ath_recv(struct hci_uart *hu, const void *data, int count) { - int ret; + struct ath_struct *ath = hu->priv; - ret = hci_recv_stream_fragment(hu->hdev, data, count); - if (ret < 0) { - BT_ERR("Frame Reassembly Failed"); - return ret; + ath->rx_skb = h4_recv_buf(hu->hdev, ath->rx_skb, data, count); + if (IS_ERR(ath->rx_skb)) { + int err = PTR_ERR(ath->rx_skb); + BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err); + return err; } return count; |