Skip to content

Commit 61a1ecf

Browse files
Loic Poulainholtmann
authored andcommitted
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 <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent e6ba820 commit 61a1ecf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/bluetooth/btqcomsmd.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ static int btqcomsmd_cmd_callback(struct rpmsg_device *rpdev, void *data,
6565
{
6666
struct btqcomsmd *btq = priv;
6767

68+
btq->hdev->stat.byte_rx += count;
6869
return btqcomsmd_recv(btq->hdev, HCI_EVENT_PKT, data, count);
6970
}
7071

@@ -76,12 +77,21 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb)
7677
switch (hci_skb_pkt_type(skb)) {
7778
case HCI_ACLDATA_PKT:
7879
ret = rpmsg_send(btq->acl_channel, skb->data, skb->len);
80+
if (ret) {
81+
hdev->stat.err_tx++;
82+
break;
83+
}
7984
hdev->stat.acl_tx++;
8085
hdev->stat.byte_tx += skb->len;
8186
break;
8287
case HCI_COMMAND_PKT:
8388
ret = rpmsg_send(btq->cmd_channel, skb->data, skb->len);
89+
if (ret) {
90+
hdev->stat.err_tx++;
91+
break;
92+
}
8493
hdev->stat.cmd_tx++;
94+
hdev->stat.byte_tx += skb->len;
8595
break;
8696
default:
8797
ret = -EILSEQ;

0 commit comments

Comments
 (0)