Search Linux Wireless

Re: [PATCH] wifi: mac80211: validate link status before deciding on off channel Tx

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

 



On Tue, 2024-03-12 at 21:16 +0530, Aditya Kumar Singh wrote:

> In such cases, the bss active flag might not provide the exact
> status of the MLD links.

That's ... true I guess, but then I'm suspicious, why are you sending
this patch? Does that mean 'active' is managed incorrectly and actually
becomes false when one link is removed, rather than all? Can you fix
that too? And if you fix that ... yeah we probably still should have
this patch but ... _without_ this:

> +	/* This is consolidated status of the MLD or non ML bss */
> +	if (sdata->bss->active)
> +		return true;

I'd think?

> While at it, when source address is same as the link conf's address and
> if userspace requested Tx on a specific link, add changes to use the same
> link id if the link bss is matching the requested channel.

Why not separate that? It's really not related much?

> +	if (link_id < 0)
> +		return false;
> +
> +	if (!sdata->vif.valid_links)
> +		return false;
> +
> +	if (!(sdata->vif.valid_links & BIT(link_id)))
> +		return false;

The second condition seems useless then?

But probably better to check *active* links, and then might as well use
ieee80211_vif_link_active()?

> +	link = sdata_dereference(sdata->link[link_id], sdata);
> +	if (!link)
> +		return false;

That might be a WARN_ON()? After all, if links are valid (or active per
above) that really should be there?

>  int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>  		      struct cfg80211_mgmt_tx_params *params, u64 *cookie)
>  {
> @@ -817,7 +850,7 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>  	case NL80211_IFTYPE_P2P_GO:
>  		if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
>  		    !ieee80211_vif_is_mesh(&sdata->vif) &&
> -		    !sdata->bss->active)
> +		    !ieee80211_is_link_bss_active(sdata, params->link_id))
>  			need_offchan = true;
>  
>  		rcu_read_lock();
> @@ -897,8 +930,17 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>  				break;
>  			}
>  
> -			if (ether_addr_equal(conf->addr, mgmt->sa))
> +			if (ether_addr_equal(conf->addr, mgmt->sa)) {
> +				/* If userspace requested Tx on a specific link
> +				 * use the same link id if the link bss is matching
> +				 * the requested chan.
> +				 */
> +				if (sdata->vif.valid_links &&
> +				    params->link_id >= 0 && params->link_id == i &&
> +				    params->chan == chanctx_conf->def.chan)
> +					link_id = i;
>  				break;
> +			}
>  
>  			chanctx_conf = NULL;
>  		}
> 
> base-commit: c2b25092864a16c7865e406badedece5cc25fc2b






[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