All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <linux-wireless@vger.kernel.org>
Subject: [PATCH rtw-next 08/10] wifi: rtw89: fw: add CMAC H2C command for punctured for RTL8922D
Date: Fri, 2 Jan 2026 15:08:38 +0800	[thread overview]
Message-ID: <20260102070840.62047-9-pkshih@realtek.com> (raw)
In-Reply-To: <20260102070840.62047-1-pkshih@realtek.com>

CMAC H2C command is to configure CMAC such as TX retry and padding. Add to
update CMAC function block while puncturing is changing.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/fw.c | 42 +++++++++++++++++++++++++
 drivers/net/wireless/realtek/rtw89/fw.h |  3 ++
 2 files changed, 45 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index 300d70ac22f8..587b1ba0b14a 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -4293,6 +4293,48 @@ int rtw89_fw_h2c_punctured_cmac_tbl_g7(struct rtw89_dev *rtwdev,
 }
 EXPORT_SYMBOL(rtw89_fw_h2c_punctured_cmac_tbl_g7);
 
+int rtw89_fw_h2c_punctured_cmac_tbl_be(struct rtw89_dev *rtwdev,
+				       struct rtw89_vif_link *rtwvif_link,
+				       u16 punctured)
+{
+	struct rtw89_h2c_cctlinfo_ud_be *h2c;
+	u32 len = sizeof(*h2c);
+	struct sk_buff *skb;
+	int ret;
+
+	skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len);
+	if (!skb) {
+		rtw89_err(rtwdev, "failed to alloc skb for punctured cmac be\n");
+		return -ENOMEM;
+	}
+	skb_put(skb, len);
+	h2c = (struct rtw89_h2c_cctlinfo_ud_be *)skb->data;
+
+	h2c->c0 = le32_encode_bits(rtwvif_link->mac_id, BE_CCTL_INFO_C0_V1_MACID) |
+		  le32_encode_bits(1, BE_CCTL_INFO_C0_V1_OP);
+
+	h2c->w4 = le32_encode_bits(~punctured, BE_CCTL_INFO_W4_ACT_SUBCH_CBW);
+	h2c->m4 = cpu_to_le32(BE_CCTL_INFO_W4_ACT_SUBCH_CBW);
+
+	rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
+			      H2C_CAT_MAC, H2C_CL_MAC_FR_EXCHG,
+			      H2C_FUNC_MAC_CCTLINFO_UD_G7, 0, 1,
+			      len);
+
+	ret = rtw89_h2c_tx(rtwdev, skb, false);
+	if (ret) {
+		rtw89_err(rtwdev, "failed to send h2c\n");
+		goto fail;
+	}
+
+	return 0;
+fail:
+	dev_kfree_skb_any(skb);
+
+	return ret;
+}
+EXPORT_SYMBOL(rtw89_fw_h2c_punctured_cmac_tbl_be);
+
 int rtw89_fw_h2c_txpath_cmac_tbl(struct rtw89_dev *rtwdev,
 				 struct rtw89_sta_link *rtwsta_link)
 {
diff --git a/drivers/net/wireless/realtek/rtw89/fw.h b/drivers/net/wireless/realtek/rtw89/fw.h
index 2a2d101b9071..4b87d9e777c9 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.h
+++ b/drivers/net/wireless/realtek/rtw89/fw.h
@@ -5027,6 +5027,9 @@ int rtw89_fw_h2c_txtime_cmac_tbl_be(struct rtw89_dev *rtwdev,
 int rtw89_fw_h2c_punctured_cmac_tbl_g7(struct rtw89_dev *rtwdev,
 				       struct rtw89_vif_link *rtwvif_link,
 				       u16 punctured);
+int rtw89_fw_h2c_punctured_cmac_tbl_be(struct rtw89_dev *rtwdev,
+				       struct rtw89_vif_link *rtwvif_link,
+				       u16 punctured);
 int rtw89_fw_h2c_txpath_cmac_tbl(struct rtw89_dev *rtwdev,
 				 struct rtw89_sta_link *rtwsta_link);
 int rtw89_fw_h2c_update_beacon(struct rtw89_dev *rtwdev,
-- 
2.25.1


  parent reply	other threads:[~2026-01-02  7:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02  7:08 [PATCH rtw-next 00/10] wifi: rtw89: prepare TX/RX WD and D/C-MAC H2C command for RTL8922D Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 01/10] wifi: rtw89: update TXWD v3 " Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 02/10] wifi: rtw89: update query RXDESC " Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 03/10] wifi: rtw89: fw: add DMAC v3 H2C command " Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 04/10] wifi: rtw89: fw: add CMAC H2C command to initialize default value " Ping-Ke Shih
2026-01-03 14:50   ` kernel test robot
2026-01-05  1:27     ` Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 05/10] wifi: rtw89: fw: add CMAC H2C command for association " Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 06/10] wifi: rtw89: fw: add CMAC H2C command for TX AMPDU " Ping-Ke Shih
2026-01-02  7:08 ` [PATCH rtw-next 07/10] wifi: rtw89: fw: add CMAC H2C command for TX time " Ping-Ke Shih
2026-01-02  7:08 ` Ping-Ke Shih [this message]
2026-01-02  7:08 ` [PATCH rtw-next 09/10] wifi: rtw89: fw: consider hardware AID for firmware elements Ping-Ke Shih
2026-01-03 16:28   ` kernel test robot
2026-01-02  7:08 ` [PATCH rtw-next 10/10] wifi: rtw89: fw: set RACK bit every 4 H2C command for WiFi 6 chips only 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=20260102070840.62047-9-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-wireless@vger.kernel.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.