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 V2 03/10] mac80211: add multiple bssid support
Date: Thu, 30 Jul 2020 15:03:56 +0200 [thread overview]
Message-ID: <518246cd35a827a3652a0fcc5fc655fc4686ca76.camel@sipsolutions.net> (raw)
In-Reply-To: <20200706115219.663650-3-john@phrozen.org>
On Mon, 2020-07-06 at 13:52 +0200, John Crispin wrote:
>
> +/**
> + * ieee80211_get_multi_bssid_mode - get a vifs multi bssid mode.
> + *
> + * This function is used to help look up the multi bssid mode which is tracked
> + * inside the wdev.
> + *
> + * @vif: &struct ieee80211_vif pointer from the add_interface callback.
> + */
> +enum nl80211_multi_bssid_mode ieee80211_get_multi_bssid_mode(struct ieee80211_vif *vif);
> +
> +/**
> + * ieee80211_get_multi_bssid_parent - get a vifs multi bssid parent.
> + *
> + * This function is used to help look up the multi bssid parent which is tracked
> + * inside the wdev.
> + *
> + * @vif: &struct ieee80211_vif pointer from the add_interface callback.
> + */
> +struct ieee80211_vif *ieee80211_get_multi_bssid_parent(struct ieee80211_vif *vif);
All this can be a lot simpler if you don't just push the data that I
just mentioned from the wdev down to the sdata, but actually down to the
vif. Then these are just something like
vif->multi_bssid.parent
without a need to call a function. That'd probably result in
significantly smaller code too, since exporting a function takes quite a
bit of space.
(Also, if you insist that it must be in the wdev, you can use the
function that obtains the wdev from the vif, and dereference that -
still wouldn't require exporting a lot of new functions.)
> + if (params->multi_bssid_mode &&
> + !ieee80211_hw_check(&local->hw, SUPPORTS_MULTI_BSSID))
> + return -ENOTSUPP;
IMHO that needs to be a new, separate feature bit, probably even at
nl80211 level. This here was more of a client-side thing, and now you're
doing AP side. I don't think we can mix those (and iwlwifi surely would
have issues with that.)
> static int ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev)
> {
> + struct ieee80211_sub_if_data *sdata;
> + struct wireless_dev *child, *tmp;
> +
> + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
> + switch (sdata->wdev.multi_bssid_mode) {
> + case NL80211_MULTIPLE_BSSID_TRANSMITTED:
> + if (list_empty(&sdata->wdev.multi_bssid_list))
> + break;
> + sdata_info(sdata, "deleting while non-transmitting children still exist\n");
Is that even worth a message? I mean, you could just destroy the
children too, and document it in the API that way?
> + list_for_each_entry_safe(child, tmp, &sdata->wdev.multi_bssid_list,
> + multi_bssid_list) {
> + list_del(&child->multi_bssid_list);
> + child->multi_bssid_parent = NULL;
> + }
It also seems you shouldn't just NULL out the pointer but dev_close()
them so they stop operating?
> case NL80211_IFTYPE_AP:
> sdata->bss = &sdata->u.ap;
> + if (wdev->multi_bssid_mode == NL80211_MULTIPLE_BSSID_TRANSMITTED) {
> + struct wireless_dev *child;
> + int children_down = 0;
> +
> + /* check if all children are already up */
> + list_for_each_entry(child, &wdev->multi_bssid_list,
> + multi_bssid_list)
> + if (!wdev_running(child))
> + children_down = 1;
> + if (children_down)
> + sdata_info(sdata, "non-transmitting children are not up yet\n");
reject it?
> @@ -800,6 +812,7 @@ static int ieee80211_open(struct net_device *dev)
> static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
> bool going_down)
> {
> + struct wireless_dev *wdev = ieee80211_vif_to_wdev(&sdata->vif);
> struct ieee80211_local *local = sdata->local;
> unsigned long flags;
> struct sk_buff *skb, *tmp;
> @@ -810,6 +823,12 @@ 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 &&
> + wdev->multi_bssid_mode == NL80211_MULTIPLE_BSSID_NON_TRANSMITTED)
> + /* make sure the parent is already down */
> + if (wdev->multi_bssid_parent && wdev_running(wdev->multi_bssid_parent))
> + sdata_info(sdata, "transmitting parent is still up\n");
Reject it? Or dev_close() the parent?
johannes
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2020-07-30 13:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 11:52 [PATCH V2 01/10] nl80211: add basic multiple bssid support John Crispin
2020-07-06 11:52 ` [PATCH V2 02/10] nl80211: add attributes for multiple bssid related settings John Crispin
2020-07-30 12:57 ` Johannes Berg
2020-07-06 11:52 ` [PATCH V2 03/10] mac80211: add multiple bssid support John Crispin
2020-07-30 13:03 ` Johannes Berg [this message]
2020-07-06 11:52 ` [PATCH V2 04/10] mac80211: add multiple bssid IE parsing John Crispin
2020-07-30 13:05 ` Johannes Berg
2020-07-06 11:52 ` [PATCH V2 05/10] mac80211: propagate multi bssid settings when starting John Crispin
2020-07-30 13:06 ` Johannes Berg
2020-07-06 11:52 ` [PATCH V2 06/10] ath11k: pass multiple bssid info to FW when a new vdev is created John Crispin
2020-08-02 15:02 ` Shay Bar
2020-08-02 15:40 ` John Crispin
2020-07-06 11:52 ` [PATCH V2 07/10] ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up John Crispin
2020-07-06 11:52 ` [PATCH V2 08/10] ath11k: add the multiple bssid IE offset to the beacon template John Crispin
2020-07-06 11:52 ` [PATCH V2 09/10] ath11k: set beacon tx mode John Crispin
2020-07-06 11:52 ` [PATCH V2 10/10] ath11k: set the multiple bssid hw cap John Crispin
2020-07-30 12:55 ` [PATCH V2 01/10] nl80211: add basic multiple bssid support Johannes Berg
2020-07-30 12:57 ` Johannes Berg
2020-07-30 14:37 ` Johannes Berg
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=518246cd35a827a3652a0fcc5fc655fc4686ca76.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