Skip to content

Commit c614ca3

Browse files
bgodavarholtmann
authored andcommitted
Bluetooth: hci_qca: Add support for controller debug logs.
This patch will prevent error messages splashing on console. [ 78.426697] Bluetooth: hci_core.c:hci_acldata_packet() hci0: ACL packet for unknown connection handle 3804 [ 78.436682] Bluetooth: hci_core.c:hci_acldata_packet() hci0: ACL packet for unknown connection handle 3804 [ 78.446639] Bluetooth: hci_core.c:hci_acldata_packet() hci0: ACL packet for unknown connection handle 3804 [ 78.456596] Bluetooth: hci_core.c:hci_acldata_packet() hci0: ACL packet for unknown connection handle 3804 QCA wcn3990 will send the debug logs in the form of ACL packets. While decoding packet in qca_recv(), marking the received debug log packet as diagnostic packet. Signed-off-by: Harish Bandi <[email protected]> Signed-off-by: Balakrishna Godavarthi <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 1411a26 commit c614ca3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <linux/platform_device.h>
4141
#include <linux/regulator/consumer.h>
4242
#include <linux/serdev.h>
43+
#include <asm/unaligned.h>
4344

4445
#include <net/bluetooth/bluetooth.h>
4546
#include <net/bluetooth/hci_core.h>
@@ -63,6 +64,9 @@
6364
/* susclk rate */
6465
#define SUSCLK_RATE_32KHZ 32768
6566

67+
/* Controller debug log header */
68+
#define QCA_DEBUG_HANDLE 0x2EDC
69+
6670
/* HCI_IBS transmit side sleep protocol states */
6771
enum tx_ibs_states {
6872
HCI_IBS_TX_ASLEEP,
@@ -849,6 +853,19 @@ static int qca_ibs_wake_ack(struct hci_dev *hdev, struct sk_buff *skb)
849853
return 0;
850854
}
851855

856+
static int qca_recv_acl_data(struct hci_dev *hdev, struct sk_buff *skb)
857+
{
858+
/* We receive debug logs from chip as an ACL packets.
859+
* Instead of sending the data to ACL to decode the
860+
* received data, we are pushing them to the above layers
861+
* as a diagnostic packet.
862+
*/
863+
if (get_unaligned_le16(skb->data) == QCA_DEBUG_HANDLE)
864+
return hci_recv_diag(hdev, skb);
865+
866+
return hci_recv_frame(hdev, skb);
867+
}
868+
852869
#define QCA_IBS_SLEEP_IND_EVENT \
853870
.type = HCI_IBS_SLEEP_IND, \
854871
.hlen = 0, \
@@ -871,7 +888,7 @@ static int qca_ibs_wake_ack(struct hci_dev *hdev, struct sk_buff *skb)
871888
.maxlen = HCI_MAX_IBS_SIZE
872889

873890
static const struct h4_recv_pkt qca_recv_pkts[] = {
874-
{ H4_RECV_ACL, .recv = hci_recv_frame },
891+
{ H4_RECV_ACL, .recv = qca_recv_acl_data },
875892
{ H4_RECV_SCO, .recv = hci_recv_frame },
876893
{ H4_RECV_EVENT, .recv = hci_recv_frame },
877894
{ QCA_IBS_WAKE_IND_EVENT, .recv = qca_ibs_wake_ind },

0 commit comments

Comments
 (0)