Search Linux Wireless

Re: [PATCH v5 8/8] wifi: mac80211: handle ieee80211_radar_detected() for MLO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

> +			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.

> +			if (!chanctx_conf)
> +				continue;

This changes the previous behaviour, is that OK?

> +			if (ctx && &ctx->conf != chanctx_conf)
>  				continue;

You don't even need the check if you have this though.

> @@ -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.

> +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.

johannes





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux