wifi: mt76: mt792x: enable CNM ops for MT7927

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>
This commit is contained in:
Sean Wang 2026-04-25 14:50:09 -05:00 committed by Felix Fietkau
parent bcc6e3358a
commit 298efd8f9f

View File

@ -758,6 +758,13 @@ mt792x_get_offload_capability(struct device *dev, const char *fw_wm)
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;