From patchwork Wed May 1 12:34:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 794218 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95FDF1DFF0; Wed, 1 May 2024 12:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; cv=none; b=e54FHMkyr028BChRAGpOSf5RaqJK7s6/sccY/UA3PzzLW3+NlJ4qd9jzt7IlWqNmn8pNFwA6q9L0RILgERhyLpsJR1FUqpXVF7/XKf3ng7Bv/p5NRqRd/t+HwkowgbmCPJv12noTzW/MqQ3TPMOu0QzD0BzFywZwlGBmzDCrL2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; c=relaxed/simple; bh=yxAjPYd7QIYgUwysaKCWGKv4Li4Z9nbUIl7p5X3foOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UCGxS53p7K3V5Gjhic2wRypW+qOfdyugO1Nxvv4k/7ZdUZIuj9Oj44YozXHhlSlhPywTx1njdJXfIfSU4y30sbhT8Cygqi67YfTjAVcke3aW+jhLicaOda1pm7I41dP6ZTO45L/nhwLqY0hMHWTLeezUJl+koGmHCXO599ETZZ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vo3LGkDV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vo3LGkDV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 323C0C4AF18; Wed, 1 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714566914; bh=yxAjPYd7QIYgUwysaKCWGKv4Li4Z9nbUIl7p5X3foOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vo3LGkDVfYGH/7nw9R4n2TL5EiDNmaR0GP3B/IVekpMdxCdNHqaM0rZ3snErJKqBD Px/a5XoJUs+Scem+HuWa4IogT80RP3Vq034hqM63eyiEq5jRDXrh6HB9CaQBPrSEVp JZWjjvQumETidV3eAl5fJ0+2UTxjw+3fLm8aHZF1rC6xt5Jh8suOpJV7oxoYV5ckWi 7aI34IJrApPT7ObWWbH8OTheCCUZF+hrCe8H7do7eDmUnNZQc2+gMjuTx6FdAeRIXf KUUpeSk+fDM8u2+ffuQlbDdZH9X4Qc18O2um1v1gavJBUYQyWJeC2sKXvHnZVUN4/+ wjlqbhqEx9N1w== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s29B6-000000001ky-3dgV; Wed, 01 May 2024 14:35:16 +0200 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Janaki Ramaiah Thota , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 1/5] Bluetooth: qca: fix info leak when fetching fw build id Date: Wed, 1 May 2024 14:34:52 +0200 Message-ID: <20240501123456.6712-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240501123456.6712-1-johan+linaro@kernel.org> References: <20240501123456.6712-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the missing sanity checks and move the 255-byte build-id buffer off the stack to avoid leaking stack data through debugfs in case the build-info reply is malformed. Fixes: c0187b0bd3e9 ("Bluetooth: btqca: Add support to read FW build version for WCN3991 BTSoC") Cc: stable@vger.kernel.org # 5.12 Signed-off-by: Johan Hovold --- drivers/bluetooth/btqca.c | 25 +++++++++++++++++++++---- drivers/bluetooth/btqca.h | 1 - 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 38a770278103..a508d79d9aaa 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -99,7 +99,8 @@ static int qca_read_fw_build_info(struct hci_dev *hdev) { struct sk_buff *skb; struct edl_event_hdr *edl; - char cmd, build_label[QCA_FW_BUILD_VER_LEN]; + char *build_label; + char cmd; int build_lbl_len, err = 0; bt_dev_dbg(hdev, "QCA read fw build info"); @@ -114,6 +115,11 @@ static int qca_read_fw_build_info(struct hci_dev *hdev) return err; } + if (skb->len < sizeof(*edl)) { + err = -EILSEQ; + goto out; + } + edl = (struct edl_event_hdr *)(skb->data); if (!edl) { bt_dev_err(hdev, "QCA read fw build info with no header"); @@ -129,14 +135,25 @@ static int qca_read_fw_build_info(struct hci_dev *hdev) goto out; } + if (skb->len < sizeof(*edl) + 1) { + err = -EILSEQ; + goto out; + } + build_lbl_len = edl->data[0]; - if (build_lbl_len <= QCA_FW_BUILD_VER_LEN - 1) { - memcpy(build_label, edl->data + 1, build_lbl_len); - *(build_label + build_lbl_len) = '\0'; + + if (skb->len < sizeof(*edl) + 1 + build_lbl_len) { + err = -EILSEQ; + goto out; } + build_label = kstrndup(&edl->data[1], build_lbl_len, GFP_KERNEL); + if (!build_label) + goto out; + hci_set_fw_info(hdev, "%s", build_label); + kfree(build_label); out: kfree_skb(skb); return err; diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h index 49ad668d0d0b..215433fd76a1 100644 --- a/drivers/bluetooth/btqca.h +++ b/drivers/bluetooth/btqca.h @@ -48,7 +48,6 @@ #define get_soc_ver(soc_id, rom_ver) \ ((le32_to_cpu(soc_id) << 16) | (le16_to_cpu(rom_ver))) -#define QCA_FW_BUILD_VER_LEN 255 #define QCA_HSP_GF_SOC_ID 0x1200 #define QCA_HSP_GF_SOC_MASK 0x0000ff00 From patchwork Wed May 1 12:34:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 793814 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 960361DFFB; Wed, 1 May 2024 12:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; cv=none; b=KJkM/CD0gKlS9CCC7KBBY6zABTK9dT8yewXHtCusO65naXM5sbfO00g+a5F/c0Nt25oOTFuvnrduo6A6h7RjVK3L8ihHRXdqDUFgj4O3ThGI5+c2CTZusk3KvJRxOy2Xn9YUM3cE0IbLCO4qZDvwE7wsaDB84PtAyr8cgZw2tco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; c=relaxed/simple; bh=+/0WsjYl9G9pdjlSPEHqHyblMh1LaeTcks5oxwjbiKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l022Pg06HiYCw2YTtfqaRl6UlbobVWpCPBjPbC3rnqQT7yh543Rx9PTRIJmOq/FSbH3sDq/egG3KyCMTkfquGPpERLy+9A13n3mlaKQVMMUpAyEfxEnPk3D2PGjRkTpjcGVEBKvIKIjAhdVaQ5hsz6hI5IA9VEm3C950rzh6UhI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qTMc7JsX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qTMc7JsX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EFE2C4AF19; Wed, 1 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714566914; bh=+/0WsjYl9G9pdjlSPEHqHyblMh1LaeTcks5oxwjbiKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qTMc7JsXqc9iPsLa1w/O/X6JTsRjo3rYNdwrR59cQcgcEgNQM9Qujul5XXLjvZmgl GSJ7EGYwwj/L43ZXaXRmmv+L+BiUaCvZNvI8cjhv5iDWfPjnDUH+PNuCpmvtWlMj8y n7POqGaVo2pVNhqq79PstQIJppeG9vBk9oYitiYTwFsemN3/xgVC9ddytCIhgVmhcq GI8GB/XBWT1n+3B1VQhRmhCyBROKXQrh7LoqDeGwM0dG0awsl8B9ukmmctEHSDIicz 0tQet3T9ga/PssvPV+EPrJfE7beYVxrWlLhYD9tlzqliHz+JJVx0prxTOCcBrBuqAx HQExJ3PfxT6uA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s29B6-000000001l0-3yAb; Wed, 01 May 2024 14:35:16 +0200 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Janaki Ramaiah Thota , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org, Tim Jiang Subject: [PATCH 2/5] Bluetooth: qca: fix info leak when fetching board id Date: Wed, 1 May 2024 14:34:53 +0200 Message-ID: <20240501123456.6712-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240501123456.6712-1-johan+linaro@kernel.org> References: <20240501123456.6712-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the missing sanity check when fetching the board id to avoid leaking slab data when later requesting the firmware. Fixes: a7f8dedb4be2 ("Bluetooth: qca: add support for QCA2066") Cc: stable@vger.kernel.org # 6.7 Cc: Tim Jiang Signed-off-by: Johan Hovold --- drivers/bluetooth/btqca.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index a508d79d9aaa..638074992c82 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -252,6 +252,11 @@ static int qca_read_fw_board_id(struct hci_dev *hdev, u16 *bid) goto out; } + if (skb->len < 3) { + err = -EILSEQ; + goto out; + } + *bid = (edl->data[1] << 8) + edl->data[2]; bt_dev_dbg(hdev, "%s: bid = %x", __func__, *bid); From patchwork Wed May 1 12:34:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 794219 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 960041DFF7; Wed, 1 May 2024 12:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; cv=none; b=BO36EmpXfvdDlT91eiJXa8qpZQwTf7eC63jH1vRftCPdLE6fVmUdAwW04PbKKXtb56hzYaPG9yYg191j1W3BWtvelsmEM8XLap1mIS1US4FMQS7xMMBoDzWyCxNmtTvn7cfvT5FDhSXSiILPKuRAU7LMH52gBQp6ms48EQivalI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; c=relaxed/simple; bh=aVCy5Wv4CfQbYy32F82+h1WTcZq2oIhWZtBHkh54KtQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uTq0Wh+4FgZjzB9f04k3yG+SRFMHPWUmB4JucK6U2+cJUTW3IjOizciMuu0+SDoNy+sdVAm3AW9jYu5WJcfZYX8vmWPd9AJWhkXYQQMnmojSa/loDbW3dg0ao/Jx/JxWskO7TQHFUZ8zvHHYpUmYgifMMH/2YVwVno6xq9j6+jA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DrpxwJis; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DrpxwJis" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29B3AC113CC; Wed, 1 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714566914; bh=aVCy5Wv4CfQbYy32F82+h1WTcZq2oIhWZtBHkh54KtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DrpxwJis1f+ftfpR42MZljNakzzqkkNLgj3PV/jl21no13KLMOpo0APyn9xy7Da/6 1H8j58v26zGajPJCZ+TeJhdMr4y66BR7U2k9aHEML67lY/pKAOtrkHpBIipYzzhIgs su1a1y0XDRO5q1v3a2z893ffk56wu0DQNsYdva/84SKtznm4+2dZ5RE3bjHGXWKrYd pZ0BswXEmtwOBwonX2O0HN1nigV2t2olGknThpzUdiWzJ7ZqP3j1ndU0xEogJx8O0+ jOagorrJqWGE0qZ6GXSeqXcD4uUqiyxO4gU02cQ8Dj4Dlrys+TcoQBJ3R0x0L/o+TG nEsE219PA6rpA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s29B7-000000001l3-06Gn; Wed, 01 May 2024 14:35:17 +0200 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Janaki Ramaiah Thota , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 3/5] Bluetooth: qca: drop bogus edl header checks Date: Wed, 1 May 2024 14:34:54 +0200 Message-ID: <20240501123456.6712-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240501123456.6712-1-johan+linaro@kernel.org> References: <20240501123456.6712-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The skb->data pointer is never NULL so drop the bogus sanity checks when initialising the EDL header pointer. Signed-off-by: Johan Hovold --- drivers/bluetooth/btqca.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 638074992c82..2ba1f21f0320 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -55,11 +55,6 @@ int qca_read_soc_version(struct hci_dev *hdev, struct qca_btsoc_version *ver, } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "QCA TLV with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_CMD_REQ_RES_EVT || edl->rtype != rtype) { @@ -121,11 +116,6 @@ static int qca_read_fw_build_info(struct hci_dev *hdev) } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "QCA read fw build info with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_CMD_REQ_RES_EVT || edl->rtype != EDL_GET_BUILD_INFO_CMD) { @@ -183,11 +173,6 @@ static int qca_send_patch_config_cmd(struct hci_dev *hdev) } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "QCA Patch config with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_PATCH_CONFIG_RES_EVT || edl->rtype != EDL_PATCH_CONFIG_CMD) { bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp, @@ -502,11 +487,6 @@ static int qca_tlv_send_segment(struct hci_dev *hdev, int seg_size, } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "TLV with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_CMD_REQ_RES_EVT || edl->rtype != rtype) { bt_dev_err(hdev, "QCA TLV with error stat 0x%x rtype 0x%x", From patchwork Wed May 1 12:34:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 793813 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF8822137F; Wed, 1 May 2024 12:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; cv=none; b=u4nY3mshLC4rKzAUYIhocZjo1G8rNUgnc4Z9wKhe377FFBdT7fPb3X114Acmp9crwlrXPkJMI7KOhbHRyjs+cRGZG2IY7veVf1Goi46DUTck8Ol3Ey8Mdvuf8nCYj9/Ak21AoKPFtOCL8uOyms+WdAZnKgoBe3bsnMXM/YOHb1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; c=relaxed/simple; bh=S5cbOf4wzYWFaZnxwKUPJYwrWwfrm64ZxfqElfQ3dUc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tBVKw/cAkL1eYeTpoyu+PF+vhxAxHPfrFFy5OtsYlugCNRGJvX8j1oWQeD+/RSdNJ136wTEi+sgMiALOFuWtoHItXuI3xozdg18UC+UvDRIx2tBg2pWjhfR8djEiJFaSHWbiA8ESkGRnJXH1FFMvAfHfi3swDsB7lLJ6JtdFy54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rr2+9ToM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rr2+9ToM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 370BEC4AF1B; Wed, 1 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714566914; bh=S5cbOf4wzYWFaZnxwKUPJYwrWwfrm64ZxfqElfQ3dUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rr2+9ToM8ykgR9t0p0CU6MACKpuWcMzoDCthW1srAeuXcr9T36+U9dmSAgv8UbF5v 8aV7usk9zVKCkSmD9rwrwkCgNlMvSUPsru39fTsH79SLJyoOFkfejrlRqSBUl5jEpq JnFgDhd+oXmpNkUr4vT7i+1d7dAyEdxj5BRPJEVWr2RvTdR5wfuzyEztsTLcX1x6jQ 9Eh1+Yc8/DcRXU+wkwo1k4gIRgOmO7ewh6d28VYrmcJB0Jo8bPphbe9fLgfxP/enDv +z0jV5zvj+T9z5l8rgTrEnB462T57UjStQf95i5XxXiCS8dbB6qYlWqeBcxpbijG81 7GC5Xf0LUy66w== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s29B7-000000001l6-0PWw; Wed, 01 May 2024 14:35:17 +0200 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Janaki Ramaiah Thota , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 4/5] Bluetooth: qca: drop bogus module version Date: Wed, 1 May 2024 14:34:55 +0200 Message-ID: <20240501123456.6712-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240501123456.6712-1-johan+linaro@kernel.org> References: <20240501123456.6712-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Random module versions serves no purpose, what matters is the kernel version. Drop the bogus module version which has never been updated. Signed-off-by: Johan Hovold --- drivers/bluetooth/btqca.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 2ba1f21f0320..8980e31e5094 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -13,8 +13,6 @@ #include "btqca.h" -#define VERSION "0.1" - int qca_read_soc_version(struct hci_dev *hdev, struct qca_btsoc_version *ver, enum qca_btsoc_type soc_type) { @@ -941,6 +939,5 @@ EXPORT_SYMBOL_GPL(qca_set_bdaddr); MODULE_AUTHOR("Ben Young Tae Kim "); -MODULE_DESCRIPTION("Bluetooth support for Qualcomm Atheros family ver " VERSION); -MODULE_VERSION(VERSION); +MODULE_DESCRIPTION("Bluetooth support for Qualcomm Atheros family"); MODULE_LICENSE("GPL"); From patchwork Wed May 1 12:34:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 794217 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF8B422313; Wed, 1 May 2024 12:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; cv=none; b=qRd07diz6iF3owWZ7hhfMwaMR8sJn6ObjBVhYK/l8BuXL0NceCqBeU9ZzmhT0AsF5R6C6hNBm2p16fD80qBJh4ifVoBXGoWaouR50HrElhUQx+8VaHZw4Ztyy8Oo/qZ7UqpIyVfahcVWV1Odp5EjvwreXOqDLRUw9pEyEld9Rsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; c=relaxed/simple; bh=38GjNkh+bP9qOQWBippcQ8WykGLhFZV02w+RzMyVR7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fiezs14/oN/dsSQNsUu5ugA0/45X2fib9gas3RjOAj8WvXzmAhSxL/Z9Lw1kSkYc/lb60rQbHzpuLipA2TeKz16+mdd4FanhoDPOebV/RUHXBVBdfBapaLQf/KxwxGIqdbUjLv6N5ZNCSkCQWPqEZxIiDg9/FW+npIjbEojt/S0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A3QKPWsC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A3QKPWsC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3485DC4AF1C; Wed, 1 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714566914; bh=38GjNkh+bP9qOQWBippcQ8WykGLhFZV02w+RzMyVR7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3QKPWsCEt+N/9hYwDUIfmI03tymgX5lslI9OoJrD9pGWK1jegwFxPi7Ud11B4BJX nxJMsZGmXdpkcxkQgFWHx5HkK75pakwIq2vMnVUTc23kx2pfB6UHVLIA0piUed7klh Nk55tOh8w+M/n+87TIOPYXkG5Q4EzV/+2XJ/HyzfyueKuJB1fvxtM2OLflev+mEMqp y0KqvZUgFDmtuibhM2Y9CIg7FjA2MwsWyB3u8PhyNmItzOy7wPCZoXi8Ssouuk4vvo DRyYxgiwyDWOrK39AnptFeDnKe72k/c0CgedpFuz1pDv0jXQ2LkPflIroAAuP1FXjZ 0vXbE6o0gpZxg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s29B7-000000001l9-0iYI; Wed, 01 May 2024 14:35:17 +0200 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Janaki Ramaiah Thota , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 5/5] Bluetooth: qca: clean up defines Date: Wed, 1 May 2024 14:34:56 +0200 Message-ID: <20240501123456.6712-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240501123456.6712-1-johan+linaro@kernel.org> References: <20240501123456.6712-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Clean up the QCA driver defines by dropping redundant parentheses around values and making sure they are aligned (using tabs only). Signed-off-by: Johan Hovold --- drivers/bluetooth/btqca.h | 60 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h index 215433fd76a1..bb5207d7a8c7 100644 --- a/drivers/bluetooth/btqca.h +++ b/drivers/bluetooth/btqca.h @@ -5,33 +5,33 @@ * Copyright (c) 2015 The Linux Foundation. All rights reserved. */ -#define EDL_PATCH_CMD_OPCODE (0xFC00) -#define EDL_NVM_ACCESS_OPCODE (0xFC0B) -#define EDL_WRITE_BD_ADDR_OPCODE (0xFC14) -#define EDL_PATCH_CMD_LEN (1) -#define EDL_PATCH_VER_REQ_CMD (0x19) -#define EDL_PATCH_TLV_REQ_CMD (0x1E) -#define EDL_GET_BUILD_INFO_CMD (0x20) -#define EDL_GET_BID_REQ_CMD (0x23) -#define EDL_NVM_ACCESS_SET_REQ_CMD (0x01) -#define EDL_PATCH_CONFIG_CMD (0x28) -#define MAX_SIZE_PER_TLV_SEGMENT (243) -#define QCA_PRE_SHUTDOWN_CMD (0xFC08) -#define QCA_DISABLE_LOGGING (0xFC17) - -#define EDL_CMD_REQ_RES_EVT (0x00) -#define EDL_PATCH_VER_RES_EVT (0x19) -#define EDL_APP_VER_RES_EVT (0x02) -#define EDL_TVL_DNLD_RES_EVT (0x04) -#define EDL_CMD_EXE_STATUS_EVT (0x00) -#define EDL_SET_BAUDRATE_RSP_EVT (0x92) -#define EDL_NVM_ACCESS_CODE_EVT (0x0B) -#define EDL_PATCH_CONFIG_RES_EVT (0x00) -#define QCA_DISABLE_LOGGING_SUB_OP (0x14) +#define EDL_PATCH_CMD_OPCODE 0xFC00 +#define EDL_NVM_ACCESS_OPCODE 0xFC0B +#define EDL_WRITE_BD_ADDR_OPCODE 0xFC14 +#define EDL_PATCH_CMD_LEN 1 +#define EDL_PATCH_VER_REQ_CMD 0x19 +#define EDL_PATCH_TLV_REQ_CMD 0x1E +#define EDL_GET_BUILD_INFO_CMD 0x20 +#define EDL_GET_BID_REQ_CMD 0x23 +#define EDL_NVM_ACCESS_SET_REQ_CMD 0x01 +#define EDL_PATCH_CONFIG_CMD 0x28 +#define MAX_SIZE_PER_TLV_SEGMENT 243 +#define QCA_PRE_SHUTDOWN_CMD 0xFC08 +#define QCA_DISABLE_LOGGING 0xFC17 + +#define EDL_CMD_REQ_RES_EVT 0x00 +#define EDL_PATCH_VER_RES_EVT 0x19 +#define EDL_APP_VER_RES_EVT 0x02 +#define EDL_TVL_DNLD_RES_EVT 0x04 +#define EDL_CMD_EXE_STATUS_EVT 0x00 +#define EDL_SET_BAUDRATE_RSP_EVT 0x92 +#define EDL_NVM_ACCESS_CODE_EVT 0x0B +#define EDL_PATCH_CONFIG_RES_EVT 0x00 +#define QCA_DISABLE_LOGGING_SUB_OP 0x14 #define EDL_TAG_ID_BD_ADDR 2 -#define EDL_TAG_ID_HCI (17) -#define EDL_TAG_ID_DEEP_SLEEP (27) +#define EDL_TAG_ID_HCI 17 +#define EDL_TAG_ID_DEEP_SLEEP 27 #define QCA_WCN3990_POWERON_PULSE 0xFC #define QCA_WCN3990_POWEROFF_PULSE 0xC0 @@ -39,7 +39,7 @@ #define QCA_HCI_CC_OPCODE 0xFC00 #define QCA_HCI_CC_SUCCESS 0x00 -#define QCA_WCN3991_SOC_ID (0x40014320) +#define QCA_WCN3991_SOC_ID 0x40014320 /* QCA chipset version can be decided by patch and SoC * version, combination with upper 2 bytes from SoC @@ -48,11 +48,11 @@ #define get_soc_ver(soc_id, rom_ver) \ ((le32_to_cpu(soc_id) << 16) | (le16_to_cpu(rom_ver))) -#define QCA_HSP_GF_SOC_ID 0x1200 -#define QCA_HSP_GF_SOC_MASK 0x0000ff00 +#define QCA_HSP_GF_SOC_ID 0x1200 +#define QCA_HSP_GF_SOC_MASK 0x0000ff00 enum qca_baudrate { - QCA_BAUDRATE_115200 = 0, + QCA_BAUDRATE_115200 = 0, QCA_BAUDRATE_57600, QCA_BAUDRATE_38400, QCA_BAUDRATE_19200, @@ -71,7 +71,7 @@ enum qca_baudrate { QCA_BAUDRATE_1600000, QCA_BAUDRATE_3200000, QCA_BAUDRATE_3500000, - QCA_BAUDRATE_AUTO = 0xFE, + QCA_BAUDRATE_AUTO = 0xFE, QCA_BAUDRATE_RESERVED };