]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: wfx: declare support for WoWLAN
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 4 Mar 2025 15:32:21 +0000 (16:32 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 7 Mar 2025 08:24:21 +0000 (09:24 +0100)
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>
Link: https://patch.msgid.link/20250304153224.39083-3-jerome.pouiller@silabs.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/silabs/wfx/main.c
drivers/net/wireless/silabs/wfx/sta.c
drivers/net/wireless/silabs/wfx/sta.h

index 64441c8bc4606cd4e6c4f245190f4864cf500a41..55573d975cf91936a95ea08c6e4755c648e2dd98 100644 (file)
@@ -121,6 +121,12 @@ static const struct ieee80211_iface_combination wfx_iface_combinations[] = {
        }
 };
 
+#ifdef CONFIG_PM
+static const struct wiphy_wowlan_support wfx_wowlan_support = {
+       .flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_DISCONNECT,
+};
+#endif
+
 static const struct ieee80211_ops wfx_ops = {
        .start                   = wfx_start,
        .stop                    = wfx_stop,
@@ -153,6 +159,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 +299,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;
index 7c04810dbf3dcabed7f10fcfb4b6dd25f49e58c4..9e06f8b8b90d99198d83aaf05e7ec92e27b5d090 100644 (file)
@@ -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;
index 7817c7c6f3ddec47dc31e6363c10b47447783320..70ccc8cb7ec71926b740e70a418e915ef65f300b 100644 (file)
@@ -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);