From: Anthony Liu <anthony.liu@mediatek.com>
To: <anthony.liu@mediatek.com>
Cc: <Emery.Hsin@mediatek.com>, <Jb.Tsai@mediatek.com>,
<Leon.Yen@mediatek.com>, <Litien.Chang@mediatek.com>,
<Quan.Zhou@mediatek.com>, <Ryder.Lee@mediatek.com>,
<Sean.Wang@mediatek.com>, <kun.wu@mediatek.com>,
<linux-mediatek@lists.infradead.org>,
<linux-wireless@vger.kernel.org>, <lorenzo@kernel.org>,
<nbd@nbd.name>
Subject: [PATCH v5 1/5] wifi: mt76: refactor chip_config to accept generic commands
Date: Thu, 26 Nov 2026 17:54:51 +0800 [thread overview]
Message-ID: <20261126095455.3280998-2-anthony.liu@mediatek.com> (raw)
In-Reply-To: <20261126095455.3280998-1-anthony.liu@mediatek.com>
The API, mt76_connac_mcu_chip_config(), was only used to send reset
command but the chip_config command is a carrier of more commands.
This patch enables other FW commands to be carried over
mt76_connac_mcu_chip_config().
Signed-off-by: Anthony Liu <anthony.liu@mediatek.com>
Reviewed-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c | 2 +-
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 4 ++--
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +-
drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
index 6a1475e3c899..83cffa94bc0e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c
@@ -54,7 +54,7 @@ static int mt7615_config(void *data, u64 val)
int ret;
mt7615_mutex_acquire(dev);
- ret = mt76_connac_mcu_chip_config(&dev->mt76);
+ ret = mt76_connac_mcu_chip_config(&dev->mt76, "assert");
mt7615_mutex_release(dev);
return ret;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
index 744b4d1f6519..0e3f23e52382 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
@@ -2047,13 +2047,13 @@ int mt76_connac_mcu_sched_scan_enable(struct mt76_phy *phy,
}
EXPORT_SYMBOL_GPL(mt76_connac_mcu_sched_scan_enable);
-int mt76_connac_mcu_chip_config(struct mt76_dev *dev)
+int mt76_connac_mcu_chip_config(struct mt76_dev *dev, const char *cmd)
{
struct mt76_connac_config req = {
.resp_type = 0,
};
- strscpy(req.data, "assert");
+ strscpy(req.data, cmd);
return mt76_mcu_send_msg(dev, MCU_CE_CMD(CHIP_CONFIG),
&req, sizeof(req), false);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
index 6a51b1df4fc7..c5fb7e2adab1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
@@ -2122,7 +2122,7 @@ void mt76_connac_mcu_set_suspend_iter(void *priv, u8 *mac,
int mt76_connac_sta_state_dp(struct mt76_dev *dev,
enum ieee80211_sta_state old_state,
enum ieee80211_sta_state new_state);
-int mt76_connac_mcu_chip_config(struct mt76_dev *dev);
+int mt76_connac_mcu_chip_config(struct mt76_dev *dev, const char *cmd);
int mt76_connac_mcu_set_deep_sleep(struct mt76_dev *dev, bool enable);
void mt76_connac_mcu_coredump_event(struct mt76_dev *dev, struct sk_buff *skb,
struct mt76_connac_coredump *coredump);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c
index 825dfcd2c6ac..14c70ffa9665 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c
@@ -238,7 +238,7 @@ static int mt7921_chip_reset(void *data, u64 val)
default:
/* Collect the core dump before reset wifisys. */
mt792x_mutex_acquire(dev);
- ret = mt76_connac_mcu_chip_config(&dev->mt76);
+ ret = mt76_connac_mcu_chip_config(&dev->mt76, "assert");
mt792x_mutex_release(dev);
break;
}
--
2.45.2
next prev parent reply other threads:[~2026-11-26 9:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 7:17 [PATCH v4 5/5] [PATCH v4] [PATCH 05/05] wifi: mt76: mt7922/mt7928: send Tx/Rx statistics to FW for link tuning Anthony Liu (劉良棟)
2026-11-26 9:54 ` [PATCH v5 0/5] wifi: mt76: optimize mt7922/mt7928 T-put per Tx/Rx stats Anthony Liu
2026-11-26 9:54 ` Anthony Liu [this message]
2026-11-26 9:54 ` [PATCH v5 2/5] wifi: mt76: refactor chip_cfg commands to be a generic API Anthony Liu
2026-11-26 9:54 ` [PATCH v5 3/5] wifi: mt76: add ACPI MTFG option for bus configuration Anthony Liu
2026-11-26 9:54 ` [PATCH v5 4/5] wifi: mt76: add PCIe speed tuning for mt7922/mt7928 Anthony Liu
2026-11-26 9:54 ` [PATCH v5 5/5] wifi: mt76: mt7922/mt7928: send Tx/Rx statistics to FW for link tuning Anthony Liu
2026-11-26 16:03 ` [PATCH v5 0/5] wifi: mt76: optimize mt7922/mt7928 T-put per Tx/Rx stats Felix Fietkau
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=20261126095455.3280998-2-anthony.liu@mediatek.com \
--to=anthony.liu@mediatek.com \
--cc=Emery.Hsin@mediatek.com \
--cc=Jb.Tsai@mediatek.com \
--cc=Leon.Yen@mediatek.com \
--cc=Litien.Chang@mediatek.com \
--cc=Quan.Zhou@mediatek.com \
--cc=Ryder.Lee@mediatek.com \
--cc=Sean.Wang@mediatek.com \
--cc=kun.wu@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
/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