BT chip vendor and customer often needs to use tool btattach to perform various development,verification and evaluation test for vendor's BT module, but tool btattach is not working fine for any QCA BT controller currently, this patch series are to solve this issue. There are many QCA soc types defined by drivers/bluetooth/btqca.h enum qca_btsoc_type { QCA_INVALID = -1, QCA_AR3002, QCA_ROME, QCA_WCN3988, QCA_WCN3990, QCA_WCN3998, QCA_WCN3991, QCA_QCA2066, QCA_QCA6390, QCA_WCN6750, QCA_WCN6855, QCA_WCN7850, QCA_MAX, }; and every soc type stands for a kind of QCA BT controller, this patch series are to solve below 2 tool btattach issues for QCA soc types: 1) tool btattach will cause kernel crash when used for QCA_ROME 2) tool btattach does not support any other soc type except QCA_ROME For hci_uart derived from tool btattach, it is allocated by hci_ldisc and is Non-serdev device, its @serdev is NULL and its soc type is currenlty hard coded as QCA_ROME. The 1st issue is caused by dereferencing nullptr hu->serdev, in order to solve the 2nd issue, a new ioctl is introduced for user to specify soc type by a new added tool btattach option. Changes v1 -> v2 - Add patch 2/4 - Correct cover letter Zijun Hu (4): Bluetooth: qca: Fix crash caused by tool btattach for QCA_ROME Bluetooth: qca: Fix nullptr dereference for non-serdev devices Bluetooth: hci_ldisc: Add a ioctl HCIUARTSETPROTODATA Bluetooth: qca: Fix wrong soc type returned for tool btattach drivers/bluetooth/btqca.h | 1 + drivers/bluetooth/hci_ldisc.c | 10 ++++++++++ drivers/bluetooth/hci_qca.c | 19 +++++++++++++------ drivers/bluetooth/hci_uart.h | 3 +++ 4 files changed, 27 insertions(+), 6 deletions(-) -- 2.7.4