diff options
| author | Miri Korenblit <miriam.rachel.korenblit@intel.com> | 2026-03-18 14:39:16 +0200 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2026-03-25 20:56:05 +0100 |
| commit | 763a5a580f9532d58b6c9f9e9723ceaa8332d5ca (patch) | |
| tree | f6a12a5871b99f3bd268d21cb1d42ec637cd01aa | |
| parent | 6e78b70c9a3d2a627229801f93e3f62869922587 (diff) | |
wifi: cfg80211: make sure NAN chandefs are valid
Until now there was not handling for NAN in reg_wdev_chan_valid.
Now as this wdev might use chandefs, check the validity of those.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260108102921.51b42ffc9a42.Iacb030fc17027afb55707ca1d6dc146631d55767@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260219094725.3846371-4-miriam.rachel.korenblit@intel.com
Link: https://patch.msgid.link/20260318123926.206536-3-miriam.rachel.korenblit@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| -rw-r--r-- | net/wireless/reg.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 20bba7e491c5..4b5450aec72e 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2348,6 +2348,18 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) if (!wdev->netdev || !netif_running(wdev->netdev)) return true; + /* NAN doesn't have links, handle it separately */ + if (iftype == NL80211_IFTYPE_NAN) { + for (int i = 0; i < wdev->u.nan.n_channels; i++) { + ret = cfg80211_reg_can_beacon(wiphy, + &wdev->u.nan.chandefs[i], + NL80211_IFTYPE_NAN); + if (!ret) + return false; + } + return true; + } + for (link = 0; link < ARRAY_SIZE(wdev->links); link++) { struct ieee80211_channel *chan; @@ -2397,9 +2409,6 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) continue; chandef = wdev->u.ocb.chandef; break; - case NL80211_IFTYPE_NAN: - /* we have no info, but NAN is also pretty universal */ - continue; default: /* others not implemented for now */ WARN_ON_ONCE(1); |
