public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
@ 2025-03-02 14:47 Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 1/5] wifi: wfx: align declarations between bus_spi.c and bus_sdio.c Jérôme Pouiller
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-02 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel, Jérôme Pouiller

This is the initial support for Wake-on-WLAN of Silicon WF200 chipset. This
version focus on the power management control. For now, the filtering
capabilities of the chip are not exposed. So any multicast frame (= any ARP
request) will wake up the host.

I have this series of patches in my git tree for a while. I hesitated to
send it because the code is based on a proof of concept and I don't have
access to the hardware anymore.

Therefore, this feature is experimental. However, the only way to reach
this code is to run "iw phy phy0 wowlan enable" or explicitly enable it in
/sys. So, I believe it makes sense to merged it in the stable tree. Thus, I
hope some users will be able to report their success (or their failure).

v2:
  - Fix compilation issue reported by "kernel test robot"[1]. Member
    'wowlan' only exist if CONFIG_PM.

[1] https://lore.kernel.org/oe-kbuild-all/202503021057.5qCOqraa-lkp@intel.com/

Jérôme Pouiller (5):
  wifi: wfx: align declarations between bus_spi.c and bus_sdio.c
  wifi: wfx: declare support for WoWLAN
  wifi: wfx: allow SPI device to wake up the host
  wifi: wfx: allow SDIO device to wake up the host
  wifi: wfx: allow to enable WoWLAN using NL80211

 drivers/net/wireless/silabs/wfx/bus.h      |  1 +
 drivers/net/wireless/silabs/wfx/bus_sdio.c | 52 ++++++++++++++++++++++
 drivers/net/wireless/silabs/wfx/bus_spi.c  | 45 +++++++++++++++++--
 drivers/net/wireless/silabs/wfx/main.c     | 12 +++++
 drivers/net/wireless/silabs/wfx/sta.c      | 25 +++++++++++
 drivers/net/wireless/silabs/wfx/sta.h      |  3 ++
 6 files changed, 134 insertions(+), 4 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 1/5] wifi: wfx: align declarations between bus_spi.c and bus_sdio.c
  2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
@ 2025-03-02 14:47 ` Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN Jérôme Pouiller
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-02 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel, Jérôme Pouiller

Just declare fields in the same order in bus_spi.c and bus_sdio.c

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/net/wireless/silabs/wfx/bus_spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/silabs/wfx/bus_spi.c b/drivers/net/wireless/silabs/wfx/bus_spi.c
index 160b90114aad..46278dce7ffc 100644
--- a/drivers/net/wireless/silabs/wfx/bus_spi.c
+++ b/drivers/net/wireless/silabs/wfx/bus_spi.c
@@ -274,11 +274,11 @@ MODULE_DEVICE_TABLE(of, wfx_spi_of_match);
 #endif
 
 struct spi_driver wfx_spi_driver = {
+	.id_table = wfx_spi_id,
+	.probe = wfx_spi_probe,
+	.remove = wfx_spi_remove,
 	.driver = {
 		.name = "wfx-spi",
 		.of_match_table = of_match_ptr(wfx_spi_of_match),
 	},
-	.id_table = wfx_spi_id,
-	.probe = wfx_spi_probe,
-	.remove = wfx_spi_remove,
 };
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN
  2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 1/5] wifi: wfx: align declarations between bus_spi.c and bus_sdio.c Jérôme Pouiller
@ 2025-03-02 14:47 ` Jérôme Pouiller
  2025-03-03 15:05   ` kernel test robot
  2025-03-03 16:28   ` kernel test robot
  2025-03-02 14:47 ` [PATCH v2 3/5] wifi: wfx: allow SPI device to wake up the host Jérôme Pouiller
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-02 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel, Jérôme Pouiller

WF200 is able to keep the connection with the AP alive while the host is
asleep. So, let's expose this capability to the user.

For now, we don't provide any way to control the device filtering
features. The user has to allow wake-up on any received packets and on
disconnections.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/net/wireless/silabs/wfx/main.c | 11 +++++++++++
 drivers/net/wireless/silabs/wfx/sta.c  | 15 +++++++++++++++
 drivers/net/wireless/silabs/wfx/sta.h  |  2 ++
 3 files changed, 28 insertions(+)

diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c
index 64441c8bc460..62586786a45c 100644
--- a/drivers/net/wireless/silabs/wfx/main.c
+++ b/drivers/net/wireless/silabs/wfx/main.c
@@ -121,6 +121,10 @@ static const struct ieee80211_iface_combination wfx_iface_combinations[] = {
 	}
 };
 
+static const struct wiphy_wowlan_support wfx_wowlan_support = {
+	.flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_DISCONNECT,
+};
+
 static const struct ieee80211_ops wfx_ops = {
 	.start                   = wfx_start,
 	.stop                    = wfx_stop,
@@ -153,6 +157,10 @@ static const struct ieee80211_ops wfx_ops = {
 	.unassign_vif_chanctx    = wfx_unassign_vif_chanctx,
 	.remain_on_channel       = wfx_remain_on_channel,
 	.cancel_remain_on_channel = wfx_cancel_remain_on_channel,
+#ifdef CONFIG_PM
+	.suspend                 = wfx_suspend,
+	.resume                  = wfx_resume,
+#endif
 };
 
 bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor)
@@ -289,6 +297,9 @@ struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_da
 					NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P |
 					NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U;
 	hw->wiphy->features |= NL80211_FEATURE_AP_SCAN;
+#ifdef CONFIG_PM
+	hw->wiphy->wowlan = &wfx_wowlan_support;
+#endif
 	hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
 	hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
 	hw->wiphy->max_remain_on_channel_duration = 5000;
diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c
index 7c04810dbf3d..9e06f8b8b90d 100644
--- a/drivers/net/wireless/silabs/wfx/sta.c
+++ b/drivers/net/wireless/silabs/wfx/sta.c
@@ -803,6 +803,21 @@ void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	}
 }
 
+#ifdef CONFIG_PM
+int wfx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
+{
+	/* FIXME: hardware also support WIPHY_WOWLAN_MAGIC_PKT and other filters */
+	if (!wowlan->any || !wowlan->disconnect)
+		return -EINVAL;
+	return 0;
+}
+
+int wfx_resume(struct ieee80211_hw *hw)
+{
+	return 0;
+}
+#endif
+
 int wfx_start(struct ieee80211_hw *hw)
 {
 	return 0;
diff --git a/drivers/net/wireless/silabs/wfx/sta.h b/drivers/net/wireless/silabs/wfx/sta.h
index 7817c7c6f3dd..70ccc8cb7ec7 100644
--- a/drivers/net/wireless/silabs/wfx/sta.h
+++ b/drivers/net/wireless/silabs/wfx/sta.h
@@ -56,6 +56,8 @@ int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			      struct ieee80211_bss_conf *link_conf,
 			      struct ieee80211_chanctx_conf *conf);
+int wfx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan);
+int wfx_resume(struct ieee80211_hw *hw);
 
 /* Hardware API Callbacks */
 void wfx_cooling_timeout_work(struct work_struct *work);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 3/5] wifi: wfx: allow SPI device to wake up the host
  2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 1/5] wifi: wfx: align declarations between bus_spi.c and bus_sdio.c Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN Jérôme Pouiller
@ 2025-03-02 14:47 ` Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 4/5] wifi: wfx: allow SDIO " Jérôme Pouiller
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-02 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel, Jérôme Pouiller

When the host is asleep, the device has wake up the host using the
usual SPI IRQ.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/net/wireless/silabs/wfx/bus_spi.c | 31 ++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/silabs/wfx/bus_spi.c b/drivers/net/wireless/silabs/wfx/bus_spi.c
index 46278dce7ffc..1d6bf3525f4e 100644
--- a/drivers/net/wireless/silabs/wfx/bus_spi.c
+++ b/drivers/net/wireless/silabs/wfx/bus_spi.c
@@ -13,6 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/pm.h>
 
 #include "bus.h"
 #include "wfx.h"
@@ -189,6 +190,26 @@ static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
 	.align_size      = wfx_spi_align_size,
 };
 
+static int wfx_spi_suspend(struct device *dev)
+{
+	struct spi_device *func = to_spi_device(dev);
+	struct wfx_spi_priv *bus = spi_get_drvdata(func);
+
+	if (!device_may_wakeup(dev))
+		return 0;
+	flush_work(&bus->core->hif.bh);
+	return enable_irq_wake(func->irq);
+}
+
+static int wfx_spi_resume(struct device *dev)
+{
+	struct spi_device *func = to_spi_device(dev);
+
+	if (!device_may_wakeup(dev))
+		return 0;
+	return disable_irq_wake(func->irq);
+}
+
 static int wfx_spi_probe(struct spi_device *func)
 {
 	struct wfx_platform_data *pdata;
@@ -239,7 +260,12 @@ static int wfx_spi_probe(struct spi_device *func)
 	if (!bus->core)
 		return -EIO;
 
-	return wfx_probe(bus->core);
+	ret = wfx_probe(bus->core);
+	if (ret)
+		return ret;
+
+	device_set_wakeup_capable(&func->dev, true);
+	return 0;
 }
 
 static void wfx_spi_remove(struct spi_device *func)
@@ -273,6 +299,8 @@ static const struct of_device_id wfx_spi_of_match[] = {
 MODULE_DEVICE_TABLE(of, wfx_spi_of_match);
 #endif
 
+DEFINE_SIMPLE_DEV_PM_OPS(wfx_spi_pm_ops, wfx_spi_suspend, wfx_spi_resume);
+
 struct spi_driver wfx_spi_driver = {
 	.id_table = wfx_spi_id,
 	.probe = wfx_spi_probe,
@@ -280,5 +308,6 @@ struct spi_driver wfx_spi_driver = {
 	.driver = {
 		.name = "wfx-spi",
 		.of_match_table = of_match_ptr(wfx_spi_of_match),
+		.pm = &wfx_spi_pm_ops,
 	},
 };
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 4/5] wifi: wfx: allow SDIO device to wake up the host
  2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
                   ` (2 preceding siblings ...)
  2025-03-02 14:47 ` [PATCH v2 3/5] wifi: wfx: allow SPI device to wake up the host Jérôme Pouiller
@ 2025-03-02 14:47 ` Jérôme Pouiller
  2025-03-02 14:47 ` [PATCH v2 5/5] wifi: wfx: allow to enable WoWLAN using NL80211 Jérôme Pouiller
  2025-03-03  8:20 ` [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Johannes Berg
  5 siblings, 0 replies; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-02 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel, Jérôme Pouiller

If the device is connected with SDIO bus, it can wake up the host using
either the SDIO controller (that requires MMC_PM_WAKE_SDIO_IRQ
capability) or the out-of-bound IRQ. This patch allows both.

Obviously, the SDIO controller must be able to keep the SDIO device
powered on.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/net/wireless/silabs/wfx/bus_sdio.c | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/drivers/net/wireless/silabs/wfx/bus_sdio.c b/drivers/net/wireless/silabs/wfx/bus_sdio.c
index f290eecde773..bd8e1ffb61bb 100644
--- a/drivers/net/wireless/silabs/wfx/bus_sdio.c
+++ b/drivers/net/wireless/silabs/wfx/bus_sdio.c
@@ -14,6 +14,7 @@
 #include <linux/of_irq.h>
 #include <linux/irq.h>
 #include <linux/align.h>
+#include <linux/pm.h>
 
 #include "bus.h"
 #include "wfx.h"
@@ -191,9 +192,46 @@ static const struct of_device_id wfx_sdio_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, wfx_sdio_of_match);
 
+static int wfx_sdio_suspend(struct device *dev)
+{
+	struct sdio_func *func = dev_to_sdio_func(dev);
+	struct wfx_sdio_priv *bus = sdio_get_drvdata(func);
+	int ret;
+
+	if (!device_may_wakeup(dev))
+		return 0;
+
+	flush_work(&bus->core->hif.bh);
+	// Either "wakeup-source" attribute or out-of-band IRQ is required for WoWLAN
+	if (bus->of_irq) {
+		ret = enable_irq_wake(bus->of_irq);
+		if (ret)
+			return ret;
+	} else {
+		ret = sdio_set_host_pm_flags(func, MMC_PM_WAKE_SDIO_IRQ);
+		if (ret)
+			return ret;
+	}
+	return sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
+}
+
+static int wfx_sdio_resume(struct device *dev)
+{
+	struct sdio_func *func = dev_to_sdio_func(dev);
+	struct wfx_sdio_priv *bus = sdio_get_drvdata(func);
+
+	if (!device_may_wakeup(dev))
+		return 0;
+	if (bus->of_irq)
+		return disable_irq_wake(bus->of_irq);
+	else
+		return 0;
+}
+
 static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 {
 	const struct wfx_platform_data *pdata = of_device_get_match_data(&func->dev);
+	mmc_pm_flag_t pm_flag = sdio_get_host_pm_caps(func);
 	struct device_node *np = func->dev.of_node;
 	struct wfx_sdio_priv *bus;
 	int ret;
@@ -235,6 +273,9 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i
 	if (ret)
 		goto sdio_release;
 
+	if (pm_flag & MMC_PM_KEEP_POWER)
+		device_set_wakeup_capable(&func->dev, true);
+
 	return 0;
 
 sdio_release:
@@ -261,6 +302,8 @@ static const struct sdio_device_id wfx_sdio_ids[] = {
 };
 MODULE_DEVICE_TABLE(sdio, wfx_sdio_ids);
 
+DEFINE_SIMPLE_DEV_PM_OPS(wfx_sdio_pm_ops, wfx_sdio_suspend, wfx_sdio_resume);
+
 struct sdio_driver wfx_sdio_driver = {
 	.name = "wfx-sdio",
 	.id_table = wfx_sdio_ids,
@@ -268,5 +311,6 @@ struct sdio_driver wfx_sdio_driver = {
 	.remove = wfx_sdio_remove,
 	.drv = {
 		.of_match_table = wfx_sdio_of_match,
+		.pm = &wfx_sdio_pm_ops,
 	}
 };
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 5/5] wifi: wfx: allow to enable WoWLAN using NL80211
  2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
                   ` (3 preceding siblings ...)
  2025-03-02 14:47 ` [PATCH v2 4/5] wifi: wfx: allow SDIO " Jérôme Pouiller
@ 2025-03-02 14:47 ` Jérôme Pouiller
  2025-03-03  8:20 ` [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Johannes Berg
  5 siblings, 0 replies; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-02 14:47 UTC (permalink / raw)
  To: linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel, Jérôme Pouiller

It is possible to use nl80211 to request to the driver to do allow the
required bus configuration to wake-up the host.

This patch implements the required API for nl80211.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/net/wireless/silabs/wfx/bus.h      |  1 +
 drivers/net/wireless/silabs/wfx/bus_sdio.c |  8 ++++++++
 drivers/net/wireless/silabs/wfx/bus_spi.c  |  8 ++++++++
 drivers/net/wireless/silabs/wfx/main.c     |  1 +
 drivers/net/wireless/silabs/wfx/sta.c      | 10 ++++++++++
 drivers/net/wireless/silabs/wfx/sta.h      |  1 +
 6 files changed, 29 insertions(+)

diff --git a/drivers/net/wireless/silabs/wfx/bus.h b/drivers/net/wireless/silabs/wfx/bus.h
index ccadfdd6873c..79edaef20881 100644
--- a/drivers/net/wireless/silabs/wfx/bus.h
+++ b/drivers/net/wireless/silabs/wfx/bus.h
@@ -28,6 +28,7 @@ struct wfx_hwbus_ops {
 	void (*lock)(void *bus_priv);
 	void (*unlock)(void *bus_priv);
 	size_t (*align_size)(void *bus_priv, size_t size);
+	void (*set_wakeup)(void *priv, bool enabled);
 };
 
 extern struct sdio_driver wfx_sdio_driver;
diff --git a/drivers/net/wireless/silabs/wfx/bus_sdio.c b/drivers/net/wireless/silabs/wfx/bus_sdio.c
index bd8e1ffb61bb..5540f2c66075 100644
--- a/drivers/net/wireless/silabs/wfx/bus_sdio.c
+++ b/drivers/net/wireless/silabs/wfx/bus_sdio.c
@@ -173,6 +173,13 @@ static size_t wfx_sdio_align_size(void *priv, size_t size)
 	return sdio_align_size(bus->func, size);
 }
 
+static void wfx_sdio_set_wakeup(void *priv, bool enabled)
+{
+	struct wfx_sdio_priv *bus = priv;
+
+	device_set_wakeup_enable(&bus->func->dev, enabled);
+}
+
 static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
 	.copy_from_io    = wfx_sdio_copy_from_io,
 	.copy_to_io      = wfx_sdio_copy_to_io,
@@ -181,6 +188,7 @@ static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
 	.lock            = wfx_sdio_lock,
 	.unlock          = wfx_sdio_unlock,
 	.align_size      = wfx_sdio_align_size,
+	.set_wakeup      = wfx_sdio_set_wakeup,
 };
 
 static const struct of_device_id wfx_sdio_of_match[] = {
diff --git a/drivers/net/wireless/silabs/wfx/bus_spi.c b/drivers/net/wireless/silabs/wfx/bus_spi.c
index 1d6bf3525f4e..257bc3cd1197 100644
--- a/drivers/net/wireless/silabs/wfx/bus_spi.c
+++ b/drivers/net/wireless/silabs/wfx/bus_spi.c
@@ -180,6 +180,13 @@ static size_t wfx_spi_align_size(void *priv, size_t size)
 	return ALIGN(size, 4);
 }
 
+static void wfx_spi_set_wakeup(void *priv, bool enabled)
+{
+	struct wfx_spi_priv *bus = priv;
+
+	device_set_wakeup_enable(&bus->func->dev, enabled);
+}
+
 static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
 	.copy_from_io    = wfx_spi_copy_from_io,
 	.copy_to_io      = wfx_spi_copy_to_io,
@@ -188,6 +195,7 @@ static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
 	.lock            = wfx_spi_lock,
 	.unlock          = wfx_spi_unlock,
 	.align_size      = wfx_spi_align_size,
+	.set_wakeup      = wfx_spi_set_wakeup,
 };
 
 static int wfx_spi_suspend(struct device *dev)
diff --git a/drivers/net/wireless/silabs/wfx/main.c b/drivers/net/wireless/silabs/wfx/main.c
index 62586786a45c..bd0cf4d29e5a 100644
--- a/drivers/net/wireless/silabs/wfx/main.c
+++ b/drivers/net/wireless/silabs/wfx/main.c
@@ -160,6 +160,7 @@ static const struct ieee80211_ops wfx_ops = {
 #ifdef CONFIG_PM
 	.suspend                 = wfx_suspend,
 	.resume                  = wfx_resume,
+	.set_wakeup              = wfx_set_wakeup,
 #endif
 };
 
diff --git a/drivers/net/wireless/silabs/wfx/sta.c b/drivers/net/wireless/silabs/wfx/sta.c
index 9e06f8b8b90d..e95b9ded17d9 100644
--- a/drivers/net/wireless/silabs/wfx/sta.c
+++ b/drivers/net/wireless/silabs/wfx/sta.c
@@ -10,6 +10,7 @@
 
 #include "sta.h"
 #include "wfx.h"
+#include "bus.h"
 #include "fwio.h"
 #include "bh.h"
 #include "key.h"
@@ -816,6 +817,15 @@ int wfx_resume(struct ieee80211_hw *hw)
 {
 	return 0;
 }
+
+void wfx_set_wakeup(struct ieee80211_hw *hw, bool enabled)
+{
+	struct wfx_dev *wdev = hw->priv;
+
+	if (enabled)
+		dev_info(wdev->dev, "support for WoWLAN is experimental\n");
+	wdev->hwbus_ops->set_wakeup(wdev->hwbus_priv, enabled);
+}
 #endif
 
 int wfx_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/silabs/wfx/sta.h b/drivers/net/wireless/silabs/wfx/sta.h
index 70ccc8cb7ec7..8702eed5267f 100644
--- a/drivers/net/wireless/silabs/wfx/sta.h
+++ b/drivers/net/wireless/silabs/wfx/sta.h
@@ -58,6 +58,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif
 			      struct ieee80211_chanctx_conf *conf);
 int wfx_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan);
 int wfx_resume(struct ieee80211_hw *hw);
+void wfx_set_wakeup(struct ieee80211_hw *hw, bool enabled);
 
 /* Hardware API Callbacks */
 void wfx_cooling_timeout_work(struct work_struct *work);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
                   ` (4 preceding siblings ...)
  2025-03-02 14:47 ` [PATCH v2 5/5] wifi: wfx: allow to enable WoWLAN using NL80211 Jérôme Pouiller
@ 2025-03-03  8:20 ` Johannes Berg
  2025-03-04 15:22   ` Jérôme Pouiller
  5 siblings, 1 reply; 15+ messages in thread
From: Johannes Berg @ 2025-03-03  8:20 UTC (permalink / raw)
  To: Jérôme Pouiller, linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel

On Sun, 2025-03-02 at 15:47 +0100, Jérôme Pouiller wrote:
> This is the initial support for Wake-on-WLAN of Silicon WF200 chipset. This
> version focus on the power management control. For now, the filtering
> capabilities of the chip are not exposed. So any multicast frame (= any ARP
> request) will wake up the host.
> 
> I have this series of patches in my git tree for a while. I hesitated to
> send it because the code is based on a proof of concept and I don't have
> access to the hardware anymore.
> 
> Therefore, this feature is experimental. However, the only way to reach
> this code is to run "iw phy phy0 wowlan enable" or explicitly enable it in
> /sys. So, I believe it makes sense to merged it in the stable tree. Thus, I
> hope some users will be able to report their success (or their failure).
> 
> v2:
>   - Fix compilation issue reported by "kernel test robot"[1]. Member
>     'wowlan' only exist if CONFIG_PM.

You should probably check patchwork too - now that we're running some
checks, a missing 'static' jumped out:

https://patchwork.kernel.org/project/linux-wireless/list/?series=939353

johannes

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN
  2025-03-02 14:47 ` [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN Jérôme Pouiller
@ 2025-03-03 15:05   ` kernel test robot
  2025-03-03 16:28   ` kernel test robot
  1 sibling, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-03-03 15:05 UTC (permalink / raw)
  To: Jérôme Pouiller, linux-wireless
  Cc: llvm, oe-kbuild-all, linux-kernel, Kalle Valo, linux-devel,
	Jérôme Pouiller

Hi Jérôme,

kernel test robot noticed the following build warnings:

[auto build test WARNING on wireless-next/main]
[also build test WARNING on wireless/main linus/master v6.14-rc5 next-20250303]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/J-r-me-Pouiller/wifi-wfx-align-declarations-between-bus_spi-c-and-bus_sdio-c/20250302-231700
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/20250302144731.117409-3-jerome.pouiller%40silabs.com
patch subject: [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250303/202503032232.o7HgZDMO-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250303/202503032232.o7HgZDMO-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503032232.o7HgZDMO-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/silabs/wfx/main.c:124:42: warning: unused variable 'wfx_wowlan_support' [-Wunused-const-variable]
     124 | static const struct wiphy_wowlan_support wfx_wowlan_support = {
         |                                          ^~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +/wfx_wowlan_support +124 drivers/net/wireless/silabs/wfx/main.c

   123	
 > 124	static const struct wiphy_wowlan_support wfx_wowlan_support = {
   125		.flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_DISCONNECT,
   126	};
   127	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN
  2025-03-02 14:47 ` [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN Jérôme Pouiller
  2025-03-03 15:05   ` kernel test robot
@ 2025-03-03 16:28   ` kernel test robot
  1 sibling, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-03-03 16:28 UTC (permalink / raw)
  To: Jérôme Pouiller, linux-wireless
  Cc: oe-kbuild-all, linux-kernel, Kalle Valo, linux-devel,
	Jérôme Pouiller

Hi Jérôme,

kernel test robot noticed the following build warnings:

[auto build test WARNING on wireless-next/main]
[also build test WARNING on wireless/main linus/master v6.14-rc5 next-20250303]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/J-r-me-Pouiller/wifi-wfx-align-declarations-between-bus_spi-c-and-bus_sdio-c/20250302-231700
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/20250302144731.117409-3-jerome.pouiller%40silabs.com
patch subject: [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20250303/202503032358.4QbNFRfz-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250303/202503032358.4QbNFRfz-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503032358.4QbNFRfz-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/wireless/silabs/wfx/main.c:124:42: warning: 'wfx_wowlan_support' defined but not used [-Wunused-const-variable=]
     124 | static const struct wiphy_wowlan_support wfx_wowlan_support = {
         |                                          ^~~~~~~~~~~~~~~~~~


vim +/wfx_wowlan_support +124 drivers/net/wireless/silabs/wfx/main.c

   123	
 > 124	static const struct wiphy_wowlan_support wfx_wowlan_support = {
   125		.flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_DISCONNECT,
   126	};
   127	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-03  8:20 ` [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Johannes Berg
@ 2025-03-04 15:22   ` Jérôme Pouiller
  2025-03-05  7:40     ` Johannes Berg
  0 siblings, 1 reply; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-04 15:22 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg; +Cc: linux-kernel, Kalle Valo, linux-devel

On Monday 3 March 2025 09:20:11 CET Johannes Berg wrote:
> On Sun, 2025-03-02 at 15:47 +0100, Jérôme Pouiller wrote:
> > This is the initial support for Wake-on-WLAN of Silicon WF200 chipset. This
> > version focus on the power management control. For now, the filtering
> > capabilities of the chip are not exposed. So any multicast frame (= any ARP
> > request) will wake up the host.
> >
> > I have this series of patches in my git tree for a while. I hesitated to
> > send it because the code is based on a proof of concept and I don't have
> > access to the hardware anymore.
> >
> > Therefore, this feature is experimental. However, the only way to reach
> > this code is to run "iw phy phy0 wowlan enable" or explicitly enable it in
> > /sys. So, I believe it makes sense to merged it in the stable tree. Thus, I
> > hope some users will be able to report their success (or their failure).
> >
> > v2:
> >   - Fix compilation issue reported by "kernel test robot"[1]. Member
> >     'wowlan' only exist if CONFIG_PM.
> 
> You should probably check patchwork too - now that we're running some
> checks, a missing 'static' jumped out:
> 
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-wireless/list/?series=939353__;!!N30Cs7Jr!Ru1BMHVjq3TxTX0c6bA3EDM0EzKM7JcHyeEUJ3_-J4TFLsLpY-jDSudnehLp3DzQ4Nutky9oKreyyjRstvmwuPVT0tM$


Patchwork also reports two warnings that I am going to ignore:

  - "Target tree name not specified in the subject", I assume it
    is "wireless-next", but in the doubt I prefer to refrain.

  - Lines are larger then 80 columns. Checkpatch.pl now accepts up
    to 100 columns. I am not aware any local exception in net/, right?



-- 
Jérôme Pouiller



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-04 15:22   ` Jérôme Pouiller
@ 2025-03-05  7:40     ` Johannes Berg
  2025-03-05 15:18       ` Jérôme Pouiller
  0 siblings, 1 reply; 15+ messages in thread
From: Johannes Berg @ 2025-03-05  7:40 UTC (permalink / raw)
  To: Jérôme Pouiller, linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel

On Tue, 2025-03-04 at 16:22 +0100, Jérôme Pouiller wrote:
> 
> Patchwork also reports two warnings that I am going to ignore:
> 
>   - "Target tree name not specified in the subject", I assume it
>     is "wireless-next", but in the doubt I prefer to refrain.

It should be wireless-next for anything that isn't fixes for the current
cycle, and please do add it - without it the checker won't always be
able to pick up the patches to test them:

https://lore.kernel.org/linux-wireless/ec3a3d891acfe5ed8763271a1df4151d75daf25f.camel@sipsolutions.net/

>   - Lines are larger then 80 columns. Checkpatch.pl now accepts up
>     to 100 columns. I am not aware any local exception in net/, right?

It looks like that's not documented
(https://docs.kernel.org/process/maintainer-netdev.html), but I had a
conversation with Jakub about this in the past and he prefers to have
the checks still at 80 because people were, in his telling, abusing it
in a way and making really long lines for no good reason.

I'm not going to be super strict about it, but I'd encourage everyone
who sees that warning to see if they can do better.

In this particular case, it's just a comment, so could trivially be
wrapped, but I'm not going to complain about 85 columns. If someone's
going to 100 columns with (text) comments though then I think that'd
raise some eyebrows. Narrower text is easier to read anyway.

johannes

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-05  7:40     ` Johannes Berg
@ 2025-03-05 15:18       ` Jérôme Pouiller
  2025-03-06  8:10         ` Johannes Berg
  0 siblings, 1 reply; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-05 15:18 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg; +Cc: linux-kernel, Kalle Valo, linux-devel

On Wednesday 5 March 2025 08:40:51 CET Johannes Berg wrote:
> On Tue, 2025-03-04 at 16:22 +0100, Jérôme Pouiller wrote:
> >
> > Patchwork also reports two warnings that I am going to ignore:
> >
> >   - "Target tree name not specified in the subject", I assume it
> >     is "wireless-next", but in the doubt I prefer to refrain.
> 
> It should be wireless-next for anything that isn't fixes for the current
> cycle, and please do add it - without it the checker won't always be
> able to pick up the patches to test them:
> 
> https://urldefense.com/v3/__https://lore.kernel.org/linux-wireless/ec3a3d891acfe5ed8763271a1df4151d75daf25f.camel@sipsolutions.net/__;!!N30Cs7Jr!X-PjgfbhIZWbgAa9xgbQsoUtAFxrhIPOL3GoEq_3Nan4ktwxzvTu7V17Q3HSxfYgjtdupGn3xRoIJwxLu9f0CcZx3Ys$
> 
> >   - Lines are larger then 80 columns. Checkpatch.pl now accepts up
> >     to 100 columns. I am not aware any local exception in net/, right?
> 
> It looks like that's not documented
> (https://urldefense.com/v3/__https://docs.kernel.org/process/maintainer-netdev.html__;!!N30Cs7Jr!X-PjgfbhIZWbgAa9xgbQsoUtAFxrhIPOL3GoEq_3Nan4ktwxzvTu7V17Q3HSxfYgjtdupGn3xRoIJwxLu9f0sNiJZZA$ ), but I had a
> conversation with Jakub about this in the past and he prefers to have
> the checks still at 80 because people were, in his telling, abusing it
> in a way and making really long lines for no good reason.
> 
> I'm not going to be super strict about it, but I'd encourage everyone
> who sees that warning to see if they can do better.
> 
> In this particular case, it's just a comment, so could trivially be
> wrapped, but I'm not going to complain about 85 columns. If someone's
> going to 100 columns with (text) comments though then I think that'd
> raise some eyebrows. Narrower text is easier to read anyway.

Thank you for the detailed answer.

I will send a new version in a couple of days. Thus the various robots
have time to test it.

-- 
Jérôme Pouiller



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-05 15:18       ` Jérôme Pouiller
@ 2025-03-06  8:10         ` Johannes Berg
  2025-03-06  8:35           ` Jérôme Pouiller
  0 siblings, 1 reply; 15+ messages in thread
From: Johannes Berg @ 2025-03-06  8:10 UTC (permalink / raw)
  To: Jérôme Pouiller, linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel

On Wed, 2025-03-05 at 16:18 +0100, Jérôme Pouiller wrote:
> 
> I will send a new version in a couple of days. Thus the various robots
> have time to test it.

Any particular reason? I don't think you need to break the lines in
these two minor cases, it's only a couple of characters wider.

IOW, I think I'd take these patches, but if you have something else to
change about them I guess let me know.

johannes

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-06  8:10         ` Johannes Berg
@ 2025-03-06  8:35           ` Jérôme Pouiller
  2025-03-06  8:37             ` Johannes Berg
  0 siblings, 1 reply; 15+ messages in thread
From: Jérôme Pouiller @ 2025-03-06  8:35 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg; +Cc: linux-kernel, Kalle Valo, linux-devel

On Thursday 6 March 2025 09:10:05 CET Johannes Berg wrote:
> 
> On Wed, 2025-03-05 at 16:18 +0100, Jérôme Pouiller wrote:
> >
> > I will send a new version in a couple of days. Thus the various robots
> > have time to test it.
> 
> Any particular reason? I don't think you need to break the lines in
> these two minor cases, it's only a couple of characters wider.

I have not opinion. I do as you prefer.

> IOW, I think I'd take these patches, but if you have something else to
> change about them I guess let me know.

I though the missing target tree name was a blocker.

If this is not a blocker, then you can merge it.

-- 
Jérôme Pouiller



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200
  2025-03-06  8:35           ` Jérôme Pouiller
@ 2025-03-06  8:37             ` Johannes Berg
  0 siblings, 0 replies; 15+ messages in thread
From: Johannes Berg @ 2025-03-06  8:37 UTC (permalink / raw)
  To: Jérôme Pouiller, linux-wireless
  Cc: linux-kernel, Kalle Valo, linux-devel

On Thu, 2025-03-06 at 09:35 +0100, Jérôme Pouiller wrote:
> 
> I though the missing target tree name was a blocker.
> 

Ah, no. That's just because it doesn't _always_ manage to apply it. It's
only a blocker if that's the only thing it reported, but here it just
said it was missing but went ahead anyway.

Honestly, I have no idea why all that is, sorry.

johannes

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-03-06  8:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-02 14:47 [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Jérôme Pouiller
2025-03-02 14:47 ` [PATCH v2 1/5] wifi: wfx: align declarations between bus_spi.c and bus_sdio.c Jérôme Pouiller
2025-03-02 14:47 ` [PATCH v2 2/5] wifi: wfx: declare support for WoWLAN Jérôme Pouiller
2025-03-03 15:05   ` kernel test robot
2025-03-03 16:28   ` kernel test robot
2025-03-02 14:47 ` [PATCH v2 3/5] wifi: wfx: allow SPI device to wake up the host Jérôme Pouiller
2025-03-02 14:47 ` [PATCH v2 4/5] wifi: wfx: allow SDIO " Jérôme Pouiller
2025-03-02 14:47 ` [PATCH v2 5/5] wifi: wfx: allow to enable WoWLAN using NL80211 Jérôme Pouiller
2025-03-03  8:20 ` [PATCH v2 0/5] wfx: add support for WoWLAN on Silabs WF200 Johannes Berg
2025-03-04 15:22   ` Jérôme Pouiller
2025-03-05  7:40     ` Johannes Berg
2025-03-05 15:18       ` Jérôme Pouiller
2025-03-06  8:10         ` Johannes Berg
2025-03-06  8:35           ` Jérôme Pouiller
2025-03-06  8:37             ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox