Commit d90aa682 authored by Marcel Holtmann's avatar Marcel Holtmann

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: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent c27799f9
...@@ -62,6 +62,7 @@ config BT_HCIUART_BCSP ...@@ -62,6 +62,7 @@ config BT_HCIUART_BCSP
config BT_HCIUART_ATH3K config BT_HCIUART_ATH3K
bool "Atheros AR300x serial support" bool "Atheros AR300x serial support"
depends on BT_HCIUART depends on BT_HCIUART
select BT_HCIUART_H4
help help
HCIATH3K (HCI Atheros AR300x) is a serial protocol for HCIATH3K (HCI Atheros AR300x) is a serial protocol for
communication between host and Atheros AR300x Bluetooth devices. communication between host and Atheros AR300x Bluetooth devices.
......
...@@ -45,6 +45,7 @@ struct ath_struct { ...@@ -45,6 +45,7 @@ struct ath_struct {
struct hci_uart *hu; struct hci_uart *hu;
unsigned int cur_sleep; unsigned int cur_sleep;
struct sk_buff *rx_skb;
struct sk_buff_head txq; struct sk_buff_head txq;
struct work_struct ctxtsw; struct work_struct ctxtsw;
}; };
...@@ -136,6 +137,8 @@ static int ath_close(struct hci_uart *hu) ...@@ -136,6 +137,8 @@ static int ath_close(struct hci_uart *hu)
skb_queue_purge(&ath->txq); skb_queue_purge(&ath->txq);
kfree_skb(ath->rx_skb);
cancel_work_sync(&ath->ctxtsw); cancel_work_sync(&ath->ctxtsw);
hu->priv = NULL; hu->priv = NULL;
...@@ -190,12 +193,13 @@ static struct sk_buff *ath_dequeue(struct hci_uart *hu) ...@@ -190,12 +193,13 @@ static struct sk_buff *ath_dequeue(struct hci_uart *hu)
/* Recv data */ /* Recv data */
static int ath_recv(struct hci_uart *hu, const void *data, int count) 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); ath->rx_skb = h4_recv_buf(hu->hdev, ath->rx_skb, data, count);
if (ret < 0) { if (IS_ERR(ath->rx_skb)) {
BT_ERR("Frame Reassembly Failed"); int err = PTR_ERR(ath->rx_skb);
return ret; BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err);
return err;
} }
return count; return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment