linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Crispin <john@phrozen.org>
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org
Subject: Re: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
Date: Thu, 27 Aug 2020 15:08:33 +0200	[thread overview]
Message-ID: <2f1de2e5672f1516ac1d94520f54b00153fd24f3.camel@sipsolutions.net> (raw)
In-Reply-To: <20200812150050.2683396-3-john@phrozen.org>


> +	struct {
> +		struct ieee80211_vif *parent;
> +		struct list_head list;
> +		bool non_transmitted;
> +	} multiple_bssid;

Oh, and also - surely parent isn't set for the transmitted BSSID, so the
bool non_transmitted is redundant? It's basically the same as !!parent?

Which also applies at the cfg80211 level.

> +static int ieee80211_set_multiple_bssid_options(struct ieee80211_sub_if_data *sdata,
> +						struct vif_params *params)
> +{
> +	struct ieee80211_local *local = sdata->local;
> +	struct wiphy *wiphy = local->hw.wiphy;
> +	struct net_device *parent;
> +	struct ieee80211_sub_if_data *psdata;
> +
> +	if (!ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID_AP))
> +		return 0;

That was probably meant to be an error? Otherwise the function can be
void.

> +++ b/net/mac80211/iface.c
> @@ -810,6 +810,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
>  	bool cancel_scan;
>  	struct cfg80211_nan_func *func;
>  
> +	if (sdata->vif.type == NL80211_IFTYPE_AP &&
> +	    sdata->vif.multiple_bssid.non_transmitted)
> +		/* make sure the parent is already down */
> +		if (sdata->vif.multiple_bssid.parent &&
> +		    ieee80211_sdata_running(vif_to_sdata(sdata->vif.multiple_bssid.parent)))
> +			dev_close(vif_to_sdata(sdata->vif.multiple_bssid.parent)->wdev.netdev);
> +
> 

This is nice but somewhere you also need to actually NULL the pointer.
As it is now, it seems you could set up two interfaces, say

wlan_nontx
wlan_tx

then ifup both, then delete wlan_tx (forcing wlan_nontx down) and then
set wlan_nontx back up and back down or whatever, but the parent pointer
wasn't cleared so ... bad things will happen?

Maybe this stuff could even happen at the cfg80211 level? Might be
useful for others too.

johannes


  parent reply	other threads:[~2020-08-27 14:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 15:00 [PATCH V3 0/9] mac80211: add multiple bssid / EMA John Crispin
2020-08-12 15:00 ` [PATCH V3 1/9] nl80211: add basic multiple bssid support John Crispin
2020-08-19  2:48   ` Aloka Dixit
2020-08-27 12:58   ` Johannes Berg
2020-08-12 15:00 ` [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling John Crispin
2020-08-27 13:03   ` Johannes Berg
2020-08-27 13:08   ` Johannes Berg [this message]
2020-10-08  0:33   ` Pradeep Kumar Chitrapu
2020-10-08  8:06     ` John Crispin
2020-10-08 17:21       ` Pradeep Kumar Chitrapu
2020-10-08 19:42         ` John Crispin
2020-08-12 15:00 ` [PATCH V3 3/9] mac80211: add multiple bssid support to beacon handling John Crispin
2020-08-12 15:00 ` [PATCH V3 4/9] mac80211: add multiple bssid/ema support to bcn templating John Crispin
2020-08-27 13:10   ` Johannes Berg
2020-08-28  3:20   ` Aloka Dixit
2020-08-12 15:00 ` [PATCH V3 5/9] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up John Crispin
2020-08-12 15:00 ` [PATCH V3 6/9] ath11k: add the multiple bssid WMI commands John Crispin
2020-08-12 15:00 ` [PATCH V3 7/9] ath11k: add multiple bssid support to device creation John Crispin
2020-08-12 15:00 ` [PATCH V3 8/9] ath11k: add EMA beacon support John Crispin
2020-08-12 15:00 ` [PATCH V3 9/9] ath11k: set the multiple bssid hw flags and capabilities John Crispin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f1de2e5672f1516ac1d94520f54b00153fd24f3.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ath11k@lists.infradead.org \
    --cc=john@phrozen.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).