lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH v2] Bluetooth: btqca: sequential validation
Date


-----Original Message-----
From: Marcel Holtmann <marcel@holtmann.org>
Sent: Thursday, December 9, 2021 4:15 PM
To: Sai Teja Aluvala (Temp) (QUIC) <quic_saluvala@quicinc.com>
Cc: Johan Hedberg <johan.hedberg@gmail.com>; Matthias Kaehlcke <mka@chromium.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>; linux-bluetooth <linux-bluetooth@vger.kernel.org>; Hemant Gupta (QUIC) <quic_hemantg@quicinc.com>; MSM <linux-arm-msm@vger.kernel.org>; quic_bgodavar <quic_bgodavar@quicinc.com>; Rocky Liao <rjliao@codeaurora.org>; hbandi@codeaurora.org; Abhishek Pandit-Subedi <abhishekpandit@chromium.org>; Miao-chen Chou <mcchou@chromium.org>; PANICKER HARISH (Temp) (QUIC) <quic_pharish@quicinc.com>
Subject: Re: [PATCH v2] Bluetooth: btqca: sequential validation

Hi Sai,

> This change will have sequential validation support & patch config
> command is added
>
> Signed-off-by: Sai Teja Aluvala <quic_saluvala@quicinc.com>
> ---
> drivers/bluetooth/btqca.c | 50
> +++++++++++++++++++++++++++++++++++++++++++++++
> drivers/bluetooth/btqca.h | 2 ++
> 2 files changed, 52 insertions(+)
>
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
> index be04d74..633a24c 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c
> @@ -141,6 +141,53 @@ static int qca_read_fw_build_info(struct hci_dev *hdev)
> return err;
> }
>
> +static int qca_send_patch_config_cmd(struct hci_dev *hdev) {
> + struct sk_buff *skb;
> + int err = 0;
> + u8 cmd[] = {EDL_PATCH_CONFIG_CMD, 0x01, 0, 0, 0};

is there are reason not to address review comments?
[Sai] : I will address in next patch

const u8 cmd[] = { EDL_PATCH_CONFIG_CMD, 0x01, 0, 0, 0 };

> + u8 rlen = 0x02;
> + struct edl_event_hdr *edl;
> + u8 rtype = EDL_PATCH_CONFIG_CMD;

I missed these two and must have assumed there are used somewhere, rlen and rtype are a waste to be declared.
[Sai] : I will delete rlen in next patch.

> +
> + bt_dev_dbg(hdev, "QCA Patch config");
> +
> + skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, sizeof(cmd),
> + cmd, HCI_EV_VENDOR, HCI_INIT_TIMEOUT);
> + if (IS_ERR(skb)) {
> + err = PTR_ERR(skb);
> + bt_dev_err(hdev, "Sending QCA Patch config failed (%d)", err);
> + return err;
> + }
> +
> + if (skb->len != rlen) {

if (skb->len != 2) {
> + bt_dev_err(hdev, "QCA Patch config cmd size mismatch len %d", skb->len);
> + err = -EILSEQ;
> + goto out;
> + }
> +
> + 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 != rtype) {

edl->rtype != EDL_PATCH_CONFIG_CMD) {
[Sai] : I will update in next patch.


> + bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp,
> + edl->rtype);
> + err = -EIO;
> + goto out;
> + }
> +
> +out:
> + kfree(skb);
> + if (err)
> + bt_dev_err(hdev, "QCA Patch config cmd failed (%d)", err);
> +
> + return err;
> +}
> +

Regards

Marcel

\
 
 \ /
  Last update: 2021-12-15 12:28    [W:0.046 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site