multiple bssid and EMA support in AP mode
Subsystems (2)
v11 cover multiple bssid and EMA support in AP mode
This patchset adds support for multiple BSSID and enhanced multi-BSSID advertisements for AP mode. Individual patches describe the changes in this version.
John Crispin (4):
nl80211: MBSSID and EMA support in AP mode
mac80211: MBSSID support in interface handling
mac80211: MBSSID and EMA support in beacon handling
mac80211: channel switch for non-transmitting interfaces
include/net/cfg80211.h | 44 ++++++ include/net/mac80211.h | 93 +++++++++++++ include/uapi/linux/nl80211.h | 76 +++++++++- net/mac80211/cfg.c | 170 +++++++++++++++++++++-- net/mac80211/ieee80211_i.h | 2 + net/mac80211/iface.c | 29 +++- net/mac80211/tx.c | 173 ++++++++++++++++++++--- net/wireless/nl80211.c | 261 +++++++++++++++++++++++++++++------ 8 files changed, 772 insertions(+), 76 deletions(-)
base-commit: 5e437416ff66981d8154687cfdf7de50b1d82bfc
Signature · 1 line
2.31.1
PATCH v11 1/4 nl80211: MBSSID and EMA support in AP mode
From: John Crispin <[email protected]>
This commit adds new attributes to configure support for multiple BSSID and advanced multi-BSSID advertisements (EMA) in AP mode.
- NL80211_ATTR_MBSSID_CONFIG used for per interface configuration.
- NL80211_ATTR_MBSSID_ELEMS used to passing MBSSID elements to be added in beacons.
Memory for the elements is allocated dynamically. This change frees the memory in existing functions which call nl80211_parse_beacon(), a comment is added to indicate the new references to do the same.
---
v11: removed NL80211_MBSSID_CONFIG_ATTR_COUNT and
NL80211_MBSSID_ELEMS_ATTR_COUNT, NL80211_EXT_FEATURE_MBSSID_AP, NL80211_EXT_FEATURE_EMA_AP.
Cfg80211 passes passes pointer to the transitting interface to mac80211 instead of interface index.
Renamed NL80211_MBSSID_CONFIG_ATTR_PARENT as NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX.
v10: Shorter variable names and more descriptive comments
include/net/cfg80211.h | 44 ++++++ include/uapi/linux/nl80211.h | 76 +++++++++- net/wireless/nl80211.c | 261 +++++++++++++++++++++++++++++------ 3 files changed, 341 insertions(+), 40 deletions(-)
include/net/cfg80211.h +44 -0
@@ -1040,6 +1040,36 @@ struct cfg80211_crypto_settings {enum nl80211_sae_pwe_mechanism sae_pwe; }; +/** +* struct cfg80211_mbssid_config - AP settings for multi bssid +* +* @tx_dev: pointer to the transmitted interface in the MBSSID set +* @index: index of this AP in the multi bssid group. +* @ema: set to true if the beacons should be sent out in EMA mode. +*/ +struct cfg80211_mbssid_config { +struct wireless_dev *tx_dev; +u8 index; +bool ema; +}; + +/** +* struct cfg80211_mbssid_elems - Multiple BSSID elements +* +* @cnt: Number of elements in array %elems. +* +* @elem: Array of multiple BSSID element(s) to be added into Beacon frames. +* @elem.data: Data for multiple BSSID elements. +* @elem.len: Length of data. +*/ +struct cfg80211_mbssid_elems { +u8 cnt; +struct { +u8 *data; +size_t len; + } elem[]; +}; +/** * struct cfg80211_beacon_data - beacon data * @head: head portion of beacon (before TIM IE)
@@ -1058,6 +1088,7 @@ struct cfg80211_crypto_settings {* @assocresp_ies_len: length of assocresp_ies in octets * @probe_resp_len: length of probe response template (@probe_resp) * @probe_resp: probe response template (AP mode only) +* @mbssid_ies: multiple BSSID elements * @ftm_responder: enable FTM responder functionality; -1 for no change * (which also implies no change in LCI/civic location data) * @lci: Measurement Report element content, starting with Measurement Token
@@ -1075,6 +1106,7 @@ struct cfg80211_beacon_data {const u8 *probe_resp;const u8 *lci;const u8 *civicloc; +struct cfg80211_mbssid_elems *mbssid_ies;s8 ftm_responder;size_t head_len, tail_len;
@@ -1189,6 +1221,7 @@ enum cfg80211_ap_settings_flags {* @he_oper: HE operation IE (or %NULL if HE isn't enabled) * @fils_discovery: FILS discovery transmission parameters * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters +* @mbssid_config: AP settings for multiple bssid */ struct cfg80211_ap_settings {struct cfg80211_chan_def chandef;
@@ -1221,6 +1254,7 @@ struct cfg80211_ap_settings {struct cfg80211_he_bss_color he_bss_color;struct cfg80211_fils_discovery fils_discovery;struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; +struct cfg80211_mbssid_config mbssid_config; };/**
@@ -4955,6 +4989,13 @@ struct wiphy_iftype_akm_suites {* %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes * @sar_capa: SAR control capabilities * @rfkill: a pointer to the rfkill structure +* +* @mbssid_max_interfaces: maximum number of interfaces supported by the driver +* in a multiple BSSID set. This field must be set to a non-zero value +* by the driver to advertise MBSSID support. +* @mbssid_max_ema_profile_periodicity: maximum profile periodicity supported by +* the driver. Setting this field to a non-zero value indicates that the +* driver supports enhanced multi-BSSID advertisements (EMA AP). */ struct wiphy {struct mutex mtx;
@@ -5099,6 +5140,9 @@ struct wiphy {struct rfkill *rfkill; +u8 mbssid_max_interfaces; +u8 ema_max_profile_periodicity; +char priv[]__aligned(NETDEV_ALIGN) ; };
include/uapi/linux/nl80211.h +75 -1
98 lines not on this page · raw message
net/wireless/nl80211.c +222 -39
422 lines not on this page · raw message
Signature · 1 line
2.31.1
Johannes Berg
maintainerRe: [PATCH v11 1/4] nl80211: MBSSID and EMA support in AP mode
Hi,
I don't know if this issue was already present before, but it's certainly due to the locking changes I had made with the RTNL some time ago...
net/wireless/nl80211.c static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, · line 5029
Quoted 8 lines
net/wireless/nl80211.c +8
-0+static int nl80211_parse_mbssid_config (struct wiphy *wiphy, +struct net_device *dev, +struct nlattr *attrs, +struct cfg80211_mbssid_config *config, +u8 num_elems) +{ +struct nlattr *tb[NL80211_MBSSID_CONFIG_ATTR_MAX +1 ]; +struct net_device *tx_dev = dev;
Here tx_dev defaults to the dev, that's fine, it might be the transmitting interface.
net/wireless/nl80211.c static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, · line 5055
Quoted 8 lines
net/wireless/nl80211.c +8
-0+if (tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX ]) { + tx_ifindex = +nla_get_u32 (tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX ]); + +if (!config->index && tx_ifindex != dev->ifindex) +return -EINVAL ; + + tx_dev =__dev_get_by_index (wiphy_net (wiphy), tx_ifindex);
Here you try to look up the other transmitting device, and use __dev_get_by_index() for that - but we don't hold any relevant lock here!
This is (only) called from nl80211_start_ap(), which doesn't hold the RTNL since commit a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver"):
{
.cmd = NL80211_CMD_START_AP,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.flags = GENL_UNS_ADMIN_PERM,
.doit = nl80211_start_ap,
- .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
- NL80211_FLAG_NEED_RTNL,
+ .internal_flags = NL80211_FLAG_NEED_NETDEV_UP,
},I'd fix this, but it's not really trivial - we'd need to use dev_get_by_index() and ensure we dev_put() appropriately, but *only* if it's different from the original dev ... could probably do that in this function.
All told though this doesn't make me really very confident you tested this recently, seems like something would've complained here?
+ if (!tx_dev || !tx_dev->ieee80211_ptr ||
+ tx_dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP)
+ return -EINVAL;
Btw, this really should also check tx_dev->ieee80211_ptr->wiphy == wiphy because we don't want to have a transmitting dev that's for a different wiphy.
+ } else if (config->index &&
+ !tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX]) {
+ return -EINVAL;
+ }
+
+ config->tx_dev = tx_dev->ieee80211_ptr;
+ config->ema = nla_get_flag(tb[NL80211_MBSSID_CONFIG_ATTR_EMA]);
+ if (config->ema) {
+ if (!wiphy->ema_max_profile_periodicity)
+ return -EOPNOTSUPP;
+
+ if (num_elems > wiphy->ema_max_profile_periodicity)
+ return -EINVAL;
+ }
+
+ return 0;
+}
and given the structure of this code it's hard to dev_put() in the right place.
+
+static struct cfg80211_mbssid_elems * +nl80211_parse_mbssid_elems(struct wiphy *wiphy, struct nlattr *attrs) +{
+ struct nlattr *nl_elems;
+ struct cfg80211_mbssid_elems *elems = NULL;
+ int rem_elems;
+ u8 i = 0, num_elems = 0;
+
+ if (!wiphy->mbssid_max_interfaces)
+ return NULL;
+
+ nla_for_each_nested(nl_elems, attrs, rem_elems)
+ num_elems++;
+
+ elems = kzalloc(struct_size(elems, elem, num_elems), GFP_KERNEL);
+ if (!elems)
+ return NULL;
This seems like something we might want to distinguish from the unsupported case?
+ if (attrs[NL80211_ATTR_MBSSID_ELEMS]) {
+ bcn->mbssid_ies =
+ nl80211_parse_mbssid_elems(&rdev->wiphy,
+ attrs[NL80211_ATTR_MBSSID_ELEMS]);
+ if (!bcn->mbssid_ies)
+ return -EINVAL;
and actually get -ENOMEM here, so maybe don't return pointer/NULL but pointer/ERR_PTR?
out:
- kfree(params.acl);
-
+ if (!IS_ERR(params.acl))
+ kfree(params.acl);
+ kfree(params.beacon.mbssid_ies);
I guess this also gives you a place to dev_put().
johannes
Re: [PATCH v11 1/4] nl80211: MBSSID and EMA support in AP mode
Quoted 47 lines · Johannes Berg
Hi,
I don't know if this issue was already present before, but it's certainly due to the locking changes I had made with the RTNL some time ago...
net/wireless/nl80211.c static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, · line 5029
Quoted 8 lines
net/wireless/nl80211.c +8
-0+static int nl80211_parse_mbssid_config (struct wiphy *wiphy, +struct net_device *dev, +struct nlattr *attrs, +struct cfg80211_mbssid_config *config, +u8 num_elems) +{ +struct nlattr *tb[NL80211_MBSSID_CONFIG_ATTR_MAX +1 ]; +struct net_device *tx_dev = dev;Here
tx_devdefaults to the dev, that's fine, it might be the transmitting interface.net/wireless/nl80211.c static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, · line 5055
Quoted 8 lines
net/wireless/nl80211.c +8
-0+if (tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX ]) { + tx_ifindex = +nla_get_u32 (tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX ]); + +if (!config->index && tx_ifindex != dev->ifindex) +return -EINVAL ; + + tx_dev =__dev_get_by_index (wiphy_net (wiphy), tx_ifindex);Here you try to look up the other transmitting device, and use
__dev_get_by_index()for that - but we don't hold any relevant lock here!This is (only) called from
nl80211_start_ap(), which doesn't hold the RTNL since commita05829a7222e("cfg80211: avoid holding the RTNL when calling the driver"):{ .cmd = NL80211_CMD_START_AP, .validate = GENL_DONT_VALIDATE_STRICT |
GENL_DONT_VALIDATE_DUMP,
.flags =GENL_UNS_ADMIN_PERM,
.doit =nl80211_start_ap,(quoted diff) +1
-2- .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + .internal_flags = NL80211_FLAG_NEED_NETDEV_UP, },
Quoted 8 lines
I'd fix this, but it's not really trivial - we'd need to use
dev_get_by_index()and ensure wedev_put()appropriately, but *only* if it's different from the original dev ... could probably do that in this function.All told though this doesn't make me really very confident you tested this recently, seems like something would've complained here?
I tested a flavored version, testing without that this time.
Other instances of calls to __dev_get_by_index() which don't already hold RTNL explicitly call rtnl_lock()/unlock().
Is it okay to do same here?
Regarding the reference, I will call dev_hold() before assigning the value to 'tx_dev' pointer if different than the current net_device, and dev_put() after the processing is done.
Thanks.
Johannes Berg
maintainerRe: [PATCH v11 1/4] nl80211: MBSSID and EMA support in AP mode
Quoted 39 lines · Aloka Dixit
Quoted 30 lines
net/wireless/nl80211.c static int validate_beacon_tx_rate(struct cfg80211_registered_device *rdev, · line 5055
Quoted 9 lines
net/wireless/nl80211.c +8
-0+if (tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX ]) { + tx_ifindex = +nla_get_u32 (tb[NL80211_MBSSID_CONFIG_ATTR_TRANSMITTING_IFINDEX ]); + +if (!config->index && tx_ifindex != dev->ifindex) +return -EINVAL ; + + tx_dev =__dev_get_by_index (wiphy_net (wiphy), tx_ifindex);Here you try to look up the other transmitting device, and use
__dev_get_by_index()for that - but we don't hold any relevant lock here!This is (only) called from
nl80211_start_ap(), which doesn't hold the RTNL since commita05829a7222e("cfg80211: avoid holding the RTNL when calling the driver"):{
.cmd =NL80211_CMD_START_AP, .validate =GENL_DONT_VALIDATE_STRICT|GENL_DONT_VALIDATE_DUMP,
.flags =GENL_UNS_ADMIN_PERM, .doit =nl80211_start_ap,(quoted diff) +1
-2- .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + .internal_flags = NL80211_FLAG_NEED_NETDEV_UP,},
Quoted 8 lines
I'd fix this, but it's not really trivial - we'd need to use
dev_get_by_index()and ensure wedev_put()appropriately, but *only* if it's different from the original dev ... could probably do that in this function.All told though this doesn't make me really very confident you tested this recently, seems like something would've complained here?
Quoted 8 lines
I tested a flavored version, testing without that this time.
Other instances of calls to
__dev_get_by_index()which don't already hold
RTNL explicitly call rtnl_lock()/unlock().Is it okay to do same here?
I don't think so, we're holding other locks, so that would create an ABBA deadlock - sometimes we do take RTNL->wiphy_mutex, but here you'd end up doing the opposite.
But why not just use dev_get_by_index()?
Quoted 4 lines
Regarding the reference, I will call
dev_hold()before assigning the value
to 'tx_dev' pointer if different than the currentnet_device, anddev_put()after the processing is done.
Then you also don't need dev_hold(), since that's implied by dev_get_by_index()?
An example in nl80211 would be get_vlan().
johannes
PATCH v11 2/4 mac80211: MBSSID support in interface handling
In reply to Aloka DixitFrom: John Crispin <[email protected]>
Configure multiple BSSID and enhanced multi-BSSID advertisement (EMA) parameters in mac80211 for AP mode.
For each interface, 'mbssid_tx_vif' points to the transmitting interface of the MBSSID set. The pointer is set to NULL if MBSSID is disabled.
Function ieee80211_stop() is modified to always bring down all the non-transmitting interfaces first and the transmitting interface last.
---
v11: Moved dev_close() for non-transmitting interfaces
before locking wiphy->mtx.
Removed interface count, instead mac80211 passes pointer 'mbssid_tx_vif' to the driver for each interface. Removed dev_close() calls from ieee80211_del_iface(). Removed IEEE80211_HW_SUPPORTS_MBSSID_AP and IEEE80211_HW_SUPPORTS_EMA_AP.
Instead of new parameters in struct ieee80211_bss_conf, reused the existing ones which were used for STA mode.
v10: Released wiphy->mtx before dev_close().
New flag for IEEE80211_HW_SUPPORTS_EMA_AP. ieee80211_set_mbssid_options() returns int instead of void.
include/net/mac80211.h | 4 ++++ net/mac80211/cfg.c | 38 ++++++++++++++++++++++++++++++++++++++ net/mac80211/iface.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 70 insertions(+), 1 deletion(-)
include/net/mac80211.h +4 -0
@@ -1711,6 +1711,8 @@ enum ieee80211_offload_flags {* protected by fq->lock. * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see * &enum ieee80211_offload_flags. +* +* @mbssid_tx_vif: Pointer to the transmitting interface if MBSSID is enabled. */ struct ieee80211_vif {enum nl80211_iftype type;
@@ -1739,6 +1741,8 @@ struct ieee80211_vif {bool txqs_stopped[IEEE80211_NUM_ACS ]; +struct ieee80211_vif *mbssid_tx_vif; +/* must be last */ u8 drv_priv[]__aligned(sizeof(void *)) ; };
net/mac80211/cfg.c +38 -0
@@ -111,6 +111,36 @@ static int ieee80211_set_mon_options(struct ieee80211_sub_if_data *sdata,return 0 ; } +static int ieee80211_set_ap_mbssid_options (struct ieee80211_sub_if_data *sdata, +struct cfg80211_mbssid_config params) +{ +struct ieee80211_sub_if_data *tx_sdata; + + sdata->vif.mbssid_tx_vif =NULL ; + sdata->vif.bss_conf.bssid_index =0 ; + sdata->vif.bss_conf.nontransmitted = false; + sdata->vif.bss_conf.ema_ap = false; + +if (sdata->vif.type !=NL80211_IFTYPE_AP || !params.tx_dev) +return -EINVAL ; + + tx_sdata =IEEE80211_WDEV_TO_SUB_IF (params.tx_dev); +if (!tx_sdata) +return -EINVAL ; + +if (tx_sdata == sdata) { + sdata->vif.mbssid_tx_vif = &sdata->vif; + }else { + sdata->vif.mbssid_tx_vif = &tx_sdata->vif; + sdata->vif.bss_conf.nontransmitted = true; + sdata->vif.bss_conf.bssid_index = params.index; + } +if (params.ema) + sdata->vif.bss_conf.ema_ap = true; + +return 0 ; +} + static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, const char *name, unsigned char name_assign_type,
@@ -1078,6 +1108,14 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, changed |=BSS_CHANGED_HE_BSS_COLOR ; } +if (sdata->vif.type ==NL80211_IFTYPE_AP && + params->mbssid_config.tx_dev) { + err =ieee80211_set_ap_mbssid_options (sdata, + params->mbssid_config); +if (err) +return err; + } +mutex_lock (&local->mtx); err =ieee80211_vif_use_channel (sdata, ¶ms->chandef,IEEE80211_CHANCTX_SHARED );
net/mac80211/iface.c +28 -1
@@ -630,17 +630,44 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_doieee80211_add_virtual_monitor (local); } +static void ieee80211_stop_mbssid (struct ieee80211_sub_if_data *sdata) +{ +struct ieee80211_sub_if_data *tx_sdata, *non_tx_sdata, *tmp_sdata; +struct ieee80211_vif *tx_vif = sdata->vif.mbssid_tx_vif; + + tx_sdata =vif_to_sdata (tx_vif); + sdata->vif.mbssid_tx_vif =NULL ; + +list_for_each_entry_safe (non_tx_sdata, tmp_sdata, + &tx_sdata->local->interfaces, list) { +if (non_tx_sdata != sdata && non_tx_sdata != tx_sdata && + non_tx_sdata->vif.mbssid_tx_vif == tx_vif && +ieee80211_sdata_running (non_tx_sdata)) { + non_tx_sdata->vif.mbssid_tx_vif =NULL ; +dev_close (non_tx_sdata->wdev.netdev); + } + } + +if (sdata != tx_sdata &&ieee80211_sdata_running (tx_sdata)) { + tx_sdata->vif.mbssid_tx_vif =NULL ; +dev_close (tx_sdata->wdev.netdev); + } +} +static int ieee80211_stop (struct net_device *dev) {struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); -/* close all dependent VLAN interfaces before locking wiphy */ +/* close dependent VLAN and MBSSID interfaces before locking wiphy */ if (sdata->vif.type ==NL80211_IFTYPE_AP ) {struct ieee80211_sub_if_data *vlan, *tmpsdata;list_for_each_entry_safe (vlan, tmpsdata, &sdata->u.ap.vlans, u.vlan.list)dev_close (vlan->dev); + +if (sdata->vif.mbssid_tx_vif) +ieee80211_stop_mbssid (sdata); }wiphy_lock (sdata->local->hw.wiphy);
Signature · 1 line
2.31.1
PATCH v11 3/4 mac80211: MBSSID and EMA support in beacon handling
In reply to Aloka DixitFrom: John Crispin <[email protected]>
New fields added in struct beacon_data to store all MBSSID elements and the index of the next element to be included in beacon template.
For a non-EMA AP, a single beacon template is generated with all elements. For an EMA AP, multiple beacon templates are generated and each includes a single MBSSID element. EMA profile periodicity equals the count of elements.
This patch also generates and includes multiple BSSID configuration element in each beacon template for both EMA/non-EMA AP when MBSSID is enabled.
New field added in struct ieee80211_mutable_offsets to store offset of the first MBSSID element in beacons. Also the offset for channel switch announcement (CSA) is modified to account for MBSSID length.
Depending on the hardware support and the usecase, drivers should use following functions for beacon generation:
(1) ieee80211_beacon_get_template() - Existing function for legacy beacon generation for non-MBSSID APs. No change in prototype.
(2) ieee80211_beacon_get_template_ema_next() - Generate the next EMA beacon template using the 'ema_index' stored in beacon_data.
(3) ieee80211_beacon_get_template_ema_list() - Generate all EMA templates. Drivers must call ieee80211_beacon_free_ema_list() to free the memory.
This commit also adds a missing free() for sdata->u.ap.next_beacon in ieee80211_set_csa_beacon() and sets the pointer to NULL in case of error.
---
v11: Removed addition of mbssid configuration element,
it should be added by userspace if EMA is enabled.
v10: Added the lock missing in v9 for ieee80211_beacon_get_tim()
include/net/mac80211.h | 89 +++++++++++++++++++ net/mac80211/cfg.c | 117 ++++++++++++++++++++++--- net/mac80211/ieee80211_i.h | 2 + net/mac80211/tx.c | 173 ++++++++++++++++++++++++++++++++----- 4 files changed, 348 insertions(+), 33 deletions(-)
include/net/mac80211.h +89 -0
@@ -4893,12 +4893,14 @@ void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);* @cntdwn_counter_offs: array of IEEE80211_MAX_CNTDWN_COUNTERS_NUM offsets * to countdown counters. This array can contain zero values which * should be ignored. +* @mbssid_offset: position of the multiple bssid element */ struct ieee80211_mutable_offsets {u16 tim_offset;u16 tim_length;u16 cntdwn_counter_offs[IEEE80211_MAX_CNTDWN_COUNTERS_NUM ]; +u16 mbssid_offset; };/**
@@ -4925,6 +4927,93 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_mutable_offsets *offs); +/** +* enum ieee80211_bcn_tmpl_ema - EMA beacon generation type +* +* When enhanced multi-BSSID advertisements (EMA) mode is enabled, the +* non-transmitting profiles from the multiple BSSID set are split into more +* than one multiple BSSID elements if required. Each EMA beacon includes only +* one element to reduce the total size. The number of beacons required to +* cover all profiles is called as the profile periodicity of the set. +* +* In MAC80211, the multiple BSSID elements passed by the application are +* stored in a array and the index of the next element (starting from 0) to be +* included in the beacon template is tracked through the member ema_index of +* struct beacon_data. +* +* @IEEE80211_BCN_EMA_NONE: Used when EMA is disabled. Only one beacon +* template will be generated which includes all multiple BSSID elements. +* @IEEE80211_BCN_EMA_NEXT: Used when EMA is enabled. Includes the next +* multiple BSSID element while generating the beacon template. +* @IEEE80211_BCN_EMA_BASE: Used when EMA is enabled. Beacon template includes +* the multiple MBSSID element at a specified index which should be set +* to a value more than or equal to IEEE80211_BCN_EMA_BASE. +*/ +enum ieee80211_bcn_tmpl_ema { +IEEE80211_BCN_EMA_NONE =-2 , +IEEE80211_BCN_EMA_NEXT =-1 , +IEEE80211_BCN_EMA_BASE =0 , +}; + +/** +* ieee80211_beacon_get_template_ema_next - EMA beacon template generation +* function for drivers using the sw offload path. +* @hw: pointer obtained from ieee80211_alloc_hw(). +* @vif: &struct ieee80211_vif pointer from the add_interface callback. +* @offs: &struct ieee80211_mutable_offsets pointer to struct that will +* receive the offsets that may be updated by the driver. +* +* This function follows the same rules as ieee80211_beacon_get_template() +* but returns a beacon template which includes the next multiple BSSID +* element. +* +* Return: The beacon template. %NULL on error. +*/ +struct sk_buff *ieee80211_beacon_get_template_ema_next (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_mutable_offsets *offs); + +/** +* struct ieee80211_ema_bcn_list - list entry of an EMA beacon +* @list: the list pointer. +* @skb: the skb containing this specific beacon +* @offs: &struct ieee80211_mutable_offsets pointer to struct that will +* receive the offsets that may be updated by the driver. +*/ +struct ieee80211_ema_bcn_list { +struct list_head list; +struct sk_buff *skb; +struct ieee80211_mutable_offsets offs; +}; + +/** +* ieee80211_beacon_get_template_ema_list - EMA beacon template generation +* function for drivers using the hw offload. +* @hw: pointer obtained from ieee80211_alloc_hw(). +* @vif: &struct ieee80211_vif pointer from the add_interface callback. +* @head: linked list head that will get populated with +* &struct ieee80211_ema_bcn_list pointers. +* +* This function follows the same rules as ieee80211_beacon_get_template() +* but returns a linked list of all beacon templates required to cover all +* profiles in the multiple BSSID set. Each template includes only one multiple +* BSSID element. +* +* Return: The nuber of entries in the list or 0 on error. +*/ +int ieee80211_beacon_get_template_ema_list (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct list_head *head); + +/** +* ieee80211_beacon_free_ema_list - free an EMA beacon template list +* @head: linked list head containing &struct ieee80211_ema_bcn_list pointers. +* +* This function will free a list previously acquired by calling +* ieee80211_beacon_get_template_ema_list() +*/ +void ieee80211_beacon_free_ema_list (struct list_head *head); +/** * ieee80211_beacon_get_tim - beacon generation function * @hw: pointer obtained from ieee80211_alloc_hw().
net/mac80211/cfg.c +105 -12
223 lines not on this page · raw message
net/mac80211/ieee80211_i.h +2 -0
@@ -250,6 +250,8 @@ struct beacon_data {struct ieee80211_meshconf_ie *meshconf;u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM ];u8 cntdwn_current_counter; +struct cfg80211_mbssid_elems *mbssid_ies; +u16 ema_index;struct rcu_head rcu_head; };
net/mac80211/tx.c +152 -21
277 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v11 4/4 mac80211: channel switch for non-transmitting interfaces
In reply to Aloka DixitFrom: John Crispin <[email protected]>
Trigger ieee80211_csa_finish() on the non-transmitting interfaces when channel switch concludes on the transmitting interface.
---
v11: Reverted changes from v10.
v10: Used iflist_mtx instead of rcu_read_lock() as most other
accesses to sdata->local->interfaces do so.
net/mac80211/cfg.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
net/mac80211/cfg.c +13 -2
@@ -3244,8 +3244,19 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif) {struct ieee80211_sub_if_data *sdata =vif_to_sdata (vif); -ieee80211_queue_work (&sdata->local->hw, - &sdata->csa_finalize_work); +if (vif->mbssid_tx_vif == vif) { +struct ieee80211_sub_if_data *child, *tmp; + +list_for_each_entry_safe (child, tmp, + &sdata->local->interfaces, list) +if (child != sdata && child->vif.mbssid_tx_vif == vif && +ieee80211_sdata_running (child)) { +ieee80211_queue_work (&child->local->hw, + &child->csa_finalize_work); + } + } + +ieee80211_queue_work (&sdata->local->hw, &sdata->csa_finalize_work); }EXPORT_SYMBOL (ieee80211_csa_finish);
Signature · 1 line
2.31.1
Johannes Berg
maintainerQuoted 3 lines · Aloka Dixit
This patchset adds support for multiple BSSID and enhanced multi-BSSID advertisements for AP mode. Individual patches describe the changes in this version.
How about adding the trivial advertisement to hwsim so we can have some tests in hostapd?
johannes
Quoted 9 lines · Johannes Berg
Quoted 3 lines · Aloka Dixit
This patchset adds support for multiple BSSID and enhanced multi-BSSID advertisements for AP mode. Individual patches describe the changes in this version.
How about adding the trivial advertisement to hwsim so we can have some tests in hostapd?
johannes
Hi Johannes,
Yes, I plan to add hwsim advertisement separately once kernel changes are accepted. Will also add hostapd testcases at the same time.
Thanks.
Johannes Berg
maintainerQuoted 9 lines · Aloka Dixit
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Aloka Dixit
This patchset adds support for multiple BSSID and enhanced multi-BSSID advertisements for AP mode. Individual patches describe the changes in this version.
How about adding the trivial advertisement to hwsim so we can have some tests in hostapd?
Quoted 6 lines
Quoted 1 line
johannes
Hi Johannes,
Yes, I plan to add hwsim advertisement separately once kernel changes are accepted. Will also add hostapd testcases at the same time.
OK, great! But adding it in hwsim is a kernel change, so why not just send that patch together?
johannes
Quoted 17 lines · Johannes Berg
Quoted 9 lines · Aloka Dixit
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Aloka Dixit
This patchset adds support for multiple BSSID and enhanced multi-BSSID advertisements for AP mode. Individual patches describe the changes in this version.
How about adding the trivial advertisement to hwsim so we can have some tests in hostapd?
Quoted 6 lines
Quoted 1 line
johannes
Hi Johannes,
Yes, I plan to add hwsim advertisement separately once kernel changes are accepted. Will also add hostapd testcases at the same time.
Quoted 4 lines
OK, great! But adding it in hwsim is a kernel change, so why not just send that patch together?
johannes
Hi Johannes,
Trivial advertisement will not work because mac80211_hwsim_beacon_tx() does not handle the EMA case which may have more than one beacons transmitted. It will need to be changed to use the newly added ieee80211_beacon_get_template().
Hence I will add a separate change for HWSIM.
Thanks.