All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sai Teja Aluvala (Temp) (QUIC)" <quic_saluvala@quicinc.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	"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" <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] Bluetooth: btqca: sequential validation
Date: Thu, 9 Dec 2021 05:23:13 +0000	[thread overview]
Message-ID: <SN4PR0201MB8725FF3A009D033258592A1AE3709@SN4PR0201MB8725.namprd02.prod.outlook.com> (raw)
In-Reply-To: <2DFAE4A9-5101-49B9-86BB-2D82883E930C@holtmann.org>



-----Original Message-----
From: Marcel Holtmann <marcel@holtmann.org> 
Sent: Wednesday, December 8, 2021 8:18 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] 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 | 45 
> +++++++++++++++++++++++++++++++++++++++++++++
> drivers/bluetooth/btqca.h |  3 +++
> 2 files changed, 48 insertions(+)
> 
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c 
> index be04d74..9a2fd17 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c
> @@ -141,6 +141,49 @@ static int qca_read_fw_build_info(struct hci_dev *hdev)
> 	return err;
> }
> 
> +int qca_send_patch_config_cmd(struct hci_dev *hdev, enum 
> +qca_btsoc_type soc_type) {

look, I have limited understanding for people ignoring warnings. The missing static declaration is obvious and when you compile the code it will actually tell you about it.
[Sai] : will update in next patch

> +	struct sk_buff *skb;
> +	int err = 0;
> +	u8 cmd[5] = {EDL_PATCH_CONFIG_CMD, 0x01, 0, 0, 0};

const u8 cmd[] = { EDL.., .., 0 };
[sai]: will update in next patch

> +	u8 rlen = 0x02;
> +	struct edl_event_hdr *edl;
> +	u8 rtype = EDL_PATCH_CONFIG_CMD;
> +
> +	bt_dev_dbg(hdev, "QCA Patch config");
> +
> +	skb = __hci_cmd_sync_ev(hdev, EDL_PATCH_CMD_OPCODE, 
> +EDL_PATCH_CONFIG_CMD_LEN,

sizeof(cmd)
[sai]: will update in next patch

> +			cmd, HCI_EV_VENDOR, HCI_INIT_TIMEOUT);

Indentation is wrong.
[sai] : will update in next patch
> +	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) {
> +		bt_dev_err(hdev, "QCA Patch config cmd size mismatch len %d", skb->len);
> +		err = -EILSEQ;
> +		goto out;
> +	}

Extra empty line,
[Sai]: will remove extra line in next patch
> +	edl = (struct edl_event_hdr *)(skb->data);
> +	if (!edl) {
> +		bt_dev_err(hdev, "QCA Patch config with no header");
> +		err = -EILSEQ;
> +		goto out;
> +	}

Here as well.
[Sai]: will remove in next patch
> +	if (edl->cresp != EDL_PATCH_CONFIG_RES_EVT || edl->rtype != rtype) {
> +		bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp,
> +		 edl->rtype);

Wrong indentation.
[Sai] : will update in next patch.
> +		err = -EIO;
> +		goto out;
> +	}
> +out:
> +	kfree(skb);
> +	if (err)
> +		bt_dev_err(hdev, "QCA Patch config cmd failed (%d)", err);
> +
> +	return err;
> +}
> +
> static int qca_send_reset(struct hci_dev *hdev) {
> 	struct sk_buff *skb;
> @@ -551,6 +594,8 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
> 	 */
> 	rom_ver = ((soc_ver & 0x00000f00) >> 0x04) | (soc_ver & 0x0000000f);
> 
> +	if (soc_type == QCA_WCN6750)
> +		qca_send_patch_config_cmd(hdev, soc_type);

Extra empty line.
If you are not using the soc_type, then don’t add it as parameter.
[Sai] : will remove in next patch.

> 	/* Download rampatch file */
> 	config.type = TLV_TYPE_PATCH;
> 	if (qca_is_wcn399x(soc_type)) {
> diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h 
> index 30afa77..8fbb4c7 100644
> --- a/drivers/bluetooth/btqca.h
> +++ b/drivers/bluetooth/btqca.h
> @@ -13,6 +13,8 @@
> #define EDL_PATCH_TLV_REQ_CMD		(0x1E)
> #define EDL_GET_BUILD_INFO_CMD		(0x20)
> #define EDL_NVM_ACCESS_SET_REQ_CMD	(0x01)
> +#define EDL_PATCH_CONFIG_CMD_LEN	(0x05)

Not needed.
[Sai] : will remove in next patch.

> +#define EDL_PATCH_CONFIG_CMD		(0x28)
> #define MAX_SIZE_PER_TLV_SEGMENT	(243)
> #define QCA_PRE_SHUTDOWN_CMD		(0xFC08)
> #define QCA_DISABLE_LOGGING		(0xFC17)
> @@ -24,6 +26,7 @@
> #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_HCI			(17)

Regards

Marcel


  reply	other threads:[~2021-12-09  5:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08  8:26 [PATCH] Bluetooth: btqca: sequential validation Sai Teja Aluvala
2021-12-08 13:27 ` kernel test robot
2021-12-08 13:27   ` kernel test robot
2021-12-08 13:50 ` kernel test robot
2021-12-08 13:50   ` kernel test robot
2021-12-08 14:48 ` Marcel Holtmann
2021-12-09  5:23   ` Sai Teja Aluvala (Temp) (QUIC) [this message]
2021-12-08 19:38 kernel test robot
2021-12-09 13:30 ` [kbuild] " Dan Carpenter
2021-12-09 13:30 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN4PR0201MB8725FF3A009D033258592A1AE3709@SN4PR0201MB8725.namprd02.prod.outlook.com \
    --to=quic_saluvala@quicinc.com \
    --cc=abhishekpandit@chromium.org \
    --cc=hbandi@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mcchou@chromium.org \
    --cc=mka@chromium.org \
    --cc=quic_bgodavar@quicinc.com \
    --cc=quic_hemantg@quicinc.com \
    --cc=quic_pharish@quicinc.com \
    --cc=rjliao@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.