]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt792x: enable CNM ops for MT7927
authorSean Wang <sean.wang@mediatek.com>
Sat, 25 Apr 2026 19:50:09 +0000 (14:50 -0500)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jun 2026 10:15:21 +0000 (10:15 +0000)
Enable CNM support for MT7927 so mac80211 keeps remain-on-channel callbacks
available. MT7927 needs them at runtime even when the capability is not
advertised through the normal firmware feature path.

Co-developed-by: Javier Tia <floss@jetm.me>
Signed-off-by: Javier Tia <floss@jetm.me>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20260425195011.790265-20-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt792x_core.c

index 5a5d7534830bbaf5e250976ba40f80a3a2ac9dc5..1d807abc7125a32c6bb5af0914614c9c929c4f34 100644 (file)
@@ -758,6 +758,13 @@ out:
        return offload_caps;
 }
 
+static bool mt792x_needs_cnm_runtime(const void *drv_data)
+{
+       const char *fw_wm = drv_data;
+
+       return fw_wm && !strcmp(fw_wm, MT7927_FIRMWARE_WM);
+}
+
 struct ieee80211_ops *
 mt792x_get_mac80211_ops(struct device *dev,
                        const struct ieee80211_ops *mac80211_ops,
@@ -771,6 +778,10 @@ mt792x_get_mac80211_ops(struct device *dev,
                return NULL;
 
        *fw_features = mt792x_get_offload_capability(dev, drv_data);
+
+       if (mt792x_needs_cnm_runtime(drv_data))
+               *fw_features |= MT792x_FW_CAP_CNM;
+
        if (!(*fw_features & MT792x_FW_CAP_CNM)) {
                ops->remain_on_channel = NULL;
                ops->cancel_remain_on_channel = NULL;