linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 3/5] wifi: rtw89: configure TX path via H2C command
Date: Wed, 07 Sep 2022 10:43:22 +0300	[thread overview]
Message-ID: <87czc7aaud.fsf@kernel.org> (raw)
In-Reply-To: <20220902124422.13610-4-pkshih@realtek.com> (Ping-Ke Shih's message of "Fri, 2 Sep 2022 20:44:20 +0800")

Ping-Ke Shih <pkshih@realtek.com> writes:

> In order to support TX diversity, add a function to control TX path.
>
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

[...]

> +int rtw89_fw_h2c_txpath_cmac_tbl(struct rtw89_dev *rtwdev,
> +				 struct rtw89_sta *rtwsta)
> +{
> +	const struct rtw89_chip_info *chip = rtwdev->chip;
> +	struct sk_buff *skb;
> +
> +	if (chip->h2c_cctl_func_id != H2C_FUNC_MAC_CCTLINFO_UD)
> +		return 0;
> +
> +	skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, H2C_CMC_TBL_LEN);
> +	if (!skb) {
> +		rtw89_err(rtwdev, "failed to alloc skb for fw dl\n");
> +		return -ENOMEM;
> +	}
> +	skb_put(skb, H2C_CMC_TBL_LEN);
> +	SET_CTRL_INFO_MACID(skb->data, rtwsta->mac_id);
> +	SET_CTRL_INFO_OPERATION(skb->data, 1);
> +
> +	__rtw89_fw_h2c_set_tx_path(rtwdev, skb);
> +
> +	rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
> +			      H2C_CAT_MAC, H2C_CL_MAC_FR_EXCHG,
> +			      H2C_FUNC_MAC_CCTLINFO_UD, 0, 1,
> +			      H2C_CMC_TBL_LEN);
> +
> +	if (rtw89_h2c_tx(rtwdev, skb, false)) {
> +		rtw89_err(rtwdev, "failed to send h2c\n");
> +		goto fail;
> +	}

Please add a separate ret variable:

ret = rtw89_h2c_tx(rtwdev, skb, false);
if (ret) {
	rtw89_err(rtwdev, "failed to send h2c: %d\n", ret);
	goto fail;
}

> +
> +	return 0;
> +fail:
> +	dev_kfree_skb_any(skb);
> +
> +	return -EBUSY;

return ret;

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2022-09-07  7:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 12:44 [PATCH 0/5] wifi: rtw89: support TX diversity for 1T2R variant model Ping-Ke Shih
2022-09-02 12:44 ` [PATCH 1/5] wifi: rtw89: use u32_get_bits to access C2H content of PHY capability Ping-Ke Shih
2022-09-02 12:44 ` [PATCH 2/5] wifi: rtw89: parse phycap of TX/RX antenna number Ping-Ke Shih
2022-09-02 12:44 ` [PATCH 3/5] wifi: rtw89: configure TX path via H2C command Ping-Ke Shih
2022-09-07  7:43   ` Kalle Valo [this message]
2022-09-02 12:44 ` [PATCH 4/5] wifi: rtw89: record signal strength per RF path Ping-Ke Shih
2022-09-02 12:44 ` [PATCH 5/5] wifi: rtw89: support TX diversity for 1T2R chipset Ping-Ke Shih
2022-09-07  7:46   ` Kalle Valo
2022-09-07  9:21     ` Ping-Ke Shih

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=87czc7aaud.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).