On 9/3/24 15:34, Johannes Berg wrote:
On Mon, 2024-09-02 at 12:18 +0530, Aditya Kumar Singh wrote:
@@ -3482,7 +3487,18 @@ void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
link_id++) {
link_data = sdata_dereference(sdata->link[link_id],
sdata);
- if (!link_data)
+ link_conf =
+ rcu_dereference(sdata->vif.link_conf[link_id]);
+ if (!link_data || !link_conf)
+ continue;
Can you not use link_data->conf?
Yeah, can use. Will do so in next version.
+ chanctx_conf =
+ rcu_dereference_protected(link_conf->chanctx_conf,
+ lockdep_is_held(&local->hw.wiphy->mtx));
sdata_dereference or wiphy_dereference or whatever, please don't open-
code it.
Sure.
+ if (!chanctx_conf)
+ continue;
This changes the previous behaviour, is that OK?
As in? The only behavior change is previously, cac_cancel() will cancel
all CACs going on all sdata's. However, with MLO, if let's say link X on
MLD A detects radar, why link B on MLD Y should also cancel the radar?
+ if (ctx && &ctx->conf != chanctx_conf)
continue;
You don't even need the check if you have this though.
Sure. Will remove.
@@ -3491,11 +3507,6 @@ void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
if (!sdata->wdev.links[link_id].cac_started)
continue;
- link_conf =
- rcu_dereference(sdata->vif.link_conf[link_id]);
- if (!link_conf)
- continue;
Actually link_data->conf comment already applies to an earlier patch
then, and it might be better to just remove the link_conf entirely, and
call the link_data just "link" like in more places. That's in patch 6
already.
Sure, will edit patch 6 first and then this.
+static void
+ieee80211_radar_mark_chan_ctx_iterator(struct ieee80211_hw *hw,
+ struct ieee80211_chanctx_conf *chanctx_conf,
+ void *data)
+{
+ struct ieee80211_chanctx *ctx =
+ container_of(chanctx_conf, struct ieee80211_chanctx,
+ conf);
+ struct ieee80211_chanctx_conf *itr_data =
+ (struct ieee80211_chanctx_conf *)data;
The cast isn't needed. But you don't even really need the "itr_data"
variable since you never dereference it.
That's true but we are using it to compare it. If we don't type cast
then pointer comparison later would be problematic right?
--
Aditya