mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 05:34:13 +08:00
Bluetooth: btqcomsmd: Fix rx/tx stats
HCI RX/TX byte counters were only incremented when sending ACL packets. To reflect the real HCI traffic, we need to increment these counters on HCI events and HCI commands as well. Increment error counter on rpmsg errors. Signed-off-by: Loic Poulain <loic.poulain@linaro.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
e6ba8208a4
commit
61a1ecfc80
@ -65,6 +65,7 @@ static int btqcomsmd_cmd_callback(struct rpmsg_device *rpdev, void *data,
|
||||
{
|
||||
struct btqcomsmd *btq = priv;
|
||||
|
||||
btq->hdev->stat.byte_rx += count;
|
||||
return btqcomsmd_recv(btq->hdev, HCI_EVENT_PKT, data, count);
|
||||
}
|
||||
|
||||
@ -76,12 +77,21 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb)
|
||||
switch (hci_skb_pkt_type(skb)) {
|
||||
case HCI_ACLDATA_PKT:
|
||||
ret = rpmsg_send(btq->acl_channel, skb->data, skb->len);
|
||||
if (ret) {
|
||||
hdev->stat.err_tx++;
|
||||
break;
|
||||
}
|
||||
hdev->stat.acl_tx++;
|
||||
hdev->stat.byte_tx += skb->len;
|
||||
break;
|
||||
case HCI_COMMAND_PKT:
|
||||
ret = rpmsg_send(btq->cmd_channel, skb->data, skb->len);
|
||||
if (ret) {
|
||||
hdev->stat.err_tx++;
|
||||
break;
|
||||
}
|
||||
hdev->stat.cmd_tx++;
|
||||
hdev->stat.byte_tx += skb->len;
|
||||
break;
|
||||
default:
|
||||
ret = -EILSEQ;
|
||||
|
Loading…
Reference in New Issue
Block a user