Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: hci_qca: Disable SoC debug logging for WCN3991

By default, WCN3991 sent debug packets to HOST via ACL packet
with header 0xDC2E. This logging is not required on commercial
devices. With this patch SoC logging is disabled post fw
download.

Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Balakrishna Godavarthi and committed by
Marcel Holtmann
590deccf 32929e1f

+29
+27
drivers/bluetooth/btqca.c
··· 400 400 return ret; 401 401 } 402 402 403 + static int qca_disable_soc_logging(struct hci_dev *hdev) 404 + { 405 + struct sk_buff *skb; 406 + u8 cmd[2]; 407 + int err; 408 + 409 + cmd[0] = QCA_DISABLE_LOGGING_SUB_OP; 410 + cmd[1] = 0x00; 411 + skb = __hci_cmd_sync_ev(hdev, QCA_DISABLE_LOGGING, sizeof(cmd), cmd, 412 + HCI_EV_CMD_COMPLETE, HCI_INIT_TIMEOUT); 413 + if (IS_ERR(skb)) { 414 + err = PTR_ERR(skb); 415 + bt_dev_err(hdev, "QCA Failed to disable soc logging(%d)", err); 416 + return err; 417 + } 418 + 419 + kfree_skb(skb); 420 + 421 + return 0; 422 + } 423 + 403 424 int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr) 404 425 { 405 426 struct sk_buff *skb; ··· 505 484 if (err < 0) { 506 485 bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err); 507 486 return err; 487 + } 488 + 489 + if (soc_type >= QCA_WCN3991) { 490 + err = qca_disable_soc_logging(hdev); 491 + if (err < 0) 492 + return err; 508 493 } 509 494 510 495 /* Perform HCI reset */
+2
drivers/bluetooth/btqca.h
··· 14 14 #define EDL_NVM_ACCESS_SET_REQ_CMD (0x01) 15 15 #define MAX_SIZE_PER_TLV_SEGMENT (243) 16 16 #define QCA_PRE_SHUTDOWN_CMD (0xFC08) 17 + #define QCA_DISABLE_LOGGING (0xFC17) 17 18 18 19 #define EDL_CMD_REQ_RES_EVT (0x00) 19 20 #define EDL_PATCH_VER_RES_EVT (0x19) ··· 23 22 #define EDL_CMD_EXE_STATUS_EVT (0x00) 24 23 #define EDL_SET_BAUDRATE_RSP_EVT (0x92) 25 24 #define EDL_NVM_ACCESS_CODE_EVT (0x0B) 25 + #define QCA_DISABLE_LOGGING_SUB_OP (0x14) 26 26 27 27 #define EDL_TAG_ID_HCI (17) 28 28 #define EDL_TAG_ID_DEEP_SLEEP (27)