From: Lorenzo Bianconi <lorenzo@kernel.org>
To: netdev@vger.kernel.org
Cc: lorenzo.bianconi@redhat.com, nbd@nbd.name, john@phrozen.org,
sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Subject: [PATCH net-next] net: ethernet: mtk_wed: do not assume offload callbacks are always set
Date: Tue, 12 Sep 2023 10:26:07 +0200 [thread overview]
Message-ID: <cedc0a98fb419f3d520a38271628e5d35a01be97.1694507095.git.lorenzo@kernel.org> (raw)
Check if wlan.offload_enable and wlan.offload_disable callbacks are set
in mtk_wed_flow_add/mtk_wed_flow_remove since mt7996 will not rely
on them.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 94376aa2b34c..d8cd59f44401 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -1718,6 +1718,9 @@ int mtk_wed_flow_add(int index)
if (!hw || !hw->wed_dev)
return -ENODEV;
+ if (!hw->wed_dev->wlan.offload_enable)
+ return 0;
+
if (hw->num_flows) {
hw->num_flows++;
return 0;
@@ -1747,6 +1750,9 @@ void mtk_wed_flow_remove(int index)
if (!hw)
return;
+ if (!hw->wed_dev->wlan.offload_disable)
+ return;
+
if (--hw->num_flows)
return;
--
2.41.0
next reply other threads:[~2023-09-12 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 8:26 Lorenzo Bianconi [this message]
2023-09-12 18:06 ` [PATCH net-next] net: ethernet: mtk_wed: do not assume offload callbacks are always set Simon Horman
2023-09-12 20:31 ` Lorenzo Bianconi
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=cedc0a98fb419f3d520a38271628e5d35a01be97.1694507095.git.lorenzo@kernel.org \
--to=lorenzo@kernel.org \
--cc=Mark-MC.Lee@mediatek.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=john@phrozen.org \
--cc=kuba@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.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).