From: Agustin Santiago Isasmendi <isasmendi.agus@gmail.com>
To: Navid Ghahremani <ghahramani.navid@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>
Cc: "David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Junyang Han" <han.junyang@zte.com.cn>,
"Stefan Dösinger" <stefandoesinger@gmail.com>,
"Felix Fietkau" <nbd@nbd.name>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-wireless@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [RFC PATCH net-next 5/5] net: ethernet: zte: zx279128s: debugfs knobs for the WLAN ring
Date: Wed, 11 Nov 2026 15:44:26 +0100 [thread overview]
Message-ID: <20261111144426.1321237-6-isasmendi.agus@gmail.com> (raw)
In-Reply-To: <20261111144426.1321237-1-isasmendi.agus@gmail.com>
wlan_state (counters and port table), wlan_inject_all (inject every
frame of the bound interfaces, as the vendor firmware does, to exercise
the ring and the trap path without flows) and wlan_bind (bind an
interface by name). Testing aids, kept apart so they can be dropped.
Assisted-by: LLM
Signed-off-by: Agustin Santiago Isasmendi <isasmendi.agus@gmail.com>
---
drivers/net/ethernet/zte/zx279128s-wlan.c | 34 +++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/drivers/net/ethernet/zte/zx279128s-wlan.c b/drivers/net/ethernet/zte/zx279128s-wlan.c
index 6c6f6a36d34f..29970db47a41 100644
--- a/drivers/net/ethernet/zte/zx279128s-wlan.c
+++ b/drivers/net/ethernet/zte/zx279128s-wlan.c
@@ -18,6 +18,7 @@
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/tcp.h>
+#include <linux/uaccess.h>
#include <linux/udp.h>
#include <net/arp.h>
#include <net/cfg80211.h>
@@ -751,6 +752,38 @@ static int zx_wlan_state_show(struct seq_file *s, void *data)
return 0;
}
+/* Bind an interface by name without waiting for a flow (testing) */
+static ssize_t zx_wlan_bind_write(struct file *file, const char __user *ubuf,
+ size_t count, loff_t *ppos)
+{
+ struct zx_eth_adapter *adapter = file->private_data;
+ char name[IFNAMSIZ + 1];
+ struct net_device *vif;
+ int ret;
+
+ if (count == 0 || count > IFNAMSIZ)
+ return -EINVAL;
+ if (copy_from_user(name, ubuf, count))
+ return -EFAULT;
+ name[count] = 0;
+ strim(name);
+ vif = dev_get_by_name(dev_net(adapter->wlan->napi.dev), name);
+ if (!vif)
+ return -ENODEV;
+ mutex_lock(&adapter->ppe_lock);
+ ret = zx_wlan_is_ap(vif) ? zx_wlan_port_get(adapter->wlan, vif) : -EINVAL;
+ mutex_unlock(&adapter->ppe_lock);
+ dev_put(vif);
+ return ret < 0 ? ret : count;
+}
+
+static const struct file_operations zx_wlan_bind_fops = {
+ .owner = THIS_MODULE,
+ .open = simple_open,
+ .write = zx_wlan_bind_write,
+ .llseek = noop_llseek,
+};
+
void zx_wlan_debugfs_init(struct zx_eth_adapter *adapter, struct dentry *dir)
{
if (!adapter->wlan)
@@ -759,6 +792,7 @@ void zx_wlan_debugfs_init(struct zx_eth_adapter *adapter, struct dentry *dir)
zx_wlan_state_show);
debugfs_create_bool("wlan_inject_all", 0600, dir,
&adapter->wlan->inject_all);
+ debugfs_create_file("wlan_bind", 0200, dir, adapter, &zx_wlan_bind_fops);
}
/* ---- init / fini --------------------------------------------------- */
--
2.30.2
prev parent reply other threads:[~2026-11-11 14:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 14:44 [RFC PATCH net-next 0/5] net: ethernet: zte: zx279128s: offload flows to and from WLAN interfaces Agustin Santiago Isasmendi
2026-11-11 14:44 ` [RFC PATCH net-next 1/5] dt-bindings: net: zte,zx279128s-gmac: add the WLAN DMA interrupt Agustin Santiago Isasmendi
2026-11-11 14:44 ` [RFC PATCH net-next 2/5] ARM: dts: zte: zx279128s: " Agustin Santiago Isasmendi
2026-11-11 14:44 ` [RFC PATCH net-next 3/5] net: ethernet: zte: zx279128s: WLAN DMA ring and logical ports Agustin Santiago Isasmendi
2026-11-11 14:44 ` [RFC PATCH net-next 4/5] net: ethernet: zte: zx279128s: offload flows to and from WLAN ports Agustin Santiago Isasmendi
2026-11-11 14:44 ` Agustin Santiago Isasmendi [this message]
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=20261111144426.1321237-6-isasmendi.agus@gmail.com \
--to=isasmendi.agus@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=ghahramani.navid@gmail.com \
--cc=han.junyang@zte.com.cn \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=stefandoesinger@gmail.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
all inboxes | Powered by JetHome®