Search Linux Wireless

Re: [PATCH 2/2] wifi: mac80211: restructure vif and link conf for mlo mbssid support

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

 



On Tue, 2024-09-10 at 13:45 -0700, Muna Sinada wrote:
> 
> +++ b/include/net/mac80211.h
> @@ -682,6 +682,8 @@ struct ieee80211_parsed_tpe {
>   *	responder functionality.
>   * @ftmr_params: configurable lci/civic parameter when enabling FTM responder.
>   * @nontransmitted: this BSS is a nontransmitted BSS profile
> + * @mbssid_tx_vif: Pointer to the transmitting interface if MBSSID is enabled.
> + * @mbssid_tx_vif_linkid: Link id of Tx link for non-Tx link.

It seems it might be simpler to link to the ieee80211_bss_conf? You can
derive all from that (vif and link ID), but it's probably simpler than
having to do lookups (RCU or protected etc.) based on the link ID? And
we can guarantee that the pointer lifetime is valid, so I guess don't
need to RCU protect it?

But otherwise, also again, need to document non-MLO values. Probably
want 0 not -1 as you did, otherwise driver always needs to check to get
to bss_conf.

> +++ b/net/mac80211/cfg.c
> @@ -142,8 +142,10 @@ static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata,
>  					   struct ieee80211_bss_conf *link_conf)
>  {
>  	struct ieee80211_sub_if_data *tx_sdata;
> +	struct ieee80211_link_data *tx_link;
>  
> -	sdata->vif.mbssid_tx_vif = NULL;
> +	link_conf->mbssid_tx_vif = NULL;
> +	link_conf->mbssid_tx_vif_linkid = -1;
>  	link_conf->bssid_index = 0;
>  	link_conf->nontransmitted = false;
>  	link_conf->ema_ap = false;
> @@ -157,9 +159,25 @@ static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata,
>  		return -EINVAL;
>  
>  	if (tx_sdata == sdata) {
> -		sdata->vif.mbssid_tx_vif = &sdata->vif;
> +		link_conf->mbssid_tx_vif = &sdata->vif;
> +		link_conf->mbssid_tx_vif_linkid = link_conf->link_id;
>  	} else {
> -		sdata->vif.mbssid_tx_vif = &tx_sdata->vif;
> +		rcu_read_lock();

No, absolutely not. Please review this with someone who understands RCU,
I'll stop here now.

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