mac80211: add multiple bssid support
Subsystems (2)
v5 cover mac80211: add multiple bssid support
This series adds support for multiple bssid beacon/EMA support for AP mode.
Changes in V5
* rebase on current next tree
* minor code cleanups
John Crispin (4):
nl80211: add basic multiple bssid support
mac80211: add multiple bssid support to interface handling
mac80211: add multiple bssid/EMA support to beacon handling
mac80211: don't allow CSA on non-transmitting interfaces
include/net/cfg80211.h | 33 ++++++++ include/net/mac80211.h | 118 +++++++++++++++++++++++++- include/uapi/linux/nl80211.h | 21 +++++ net/mac80211/cfg.c | 113 ++++++++++++++++++++++++- net/mac80211/debugfs.c | 1 + net/mac80211/ieee80211_i.h | 2 + net/mac80211/iface.c | 6 ++ net/mac80211/tx.c | 156 +++++++++++++++++++++++++++++++---- net/wireless/nl80211.c | 34 ++++++++ 9 files changed, 463 insertions(+), 21 deletions(-)
Signature · 1 line
2.25.1
PATCH v5 1/4 nl80211: add basic multiple bssid support
This patch adds support for passing the multiple bssid config to the kernel when an AP gets started. If the BSS is non-transmitting we need to pass
* the ifidx of the transmitting parent
* the BSS index in the set
* the BSS count of the set
* flag indicating if we want to do EMA
* the multiple bssid elements as an array inside the beacon data
This allows use to generate multiple bssid beacons aswell as EMA ones.
--- include/net/cfg80211.h | 33 +++++++++++++++++++++++++++++++++ include/uapi/linux/nl80211.h | 21 +++++++++++++++++++++ net/wireless/nl80211.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+)
include/net/cfg80211.h +33 -0
@@ -497,6 +497,21 @@ struct ieee80211_supported_band {const struct ieee80211_sband_iftype_data *iftype_data; }; +/** +* struct ieee80211_multiple_bssid - AP settings for multi bssid +* +* @index: the index of this AP in the multi bssid group. +* @count: the total number of multi bssid peer APs. +* @parent: non-transmitted BSSs transmitted parents index +* @ema: Shall the beacons be sent out in EMA mode. +*/ +struct ieee80211_multiple_bssid { +u8 index; +u8 count; +u32 parent; +bool ema; +}; +/** * ieee80211_get_sband_iftype_data - return sband data for a given iftype * @sband: the sband to search for the STA on
@@ -1028,6 +1043,19 @@ struct cfg80211_crypto_settings {u8 sae_pwd_len; }; +/** +* struct cfg80211_multiple_bssid_data - multiple_bssid data +* @ies: array of extra information element(s) to add into Beacon frames for multiple +* bssid or %NULL +* @len: array of lengths of multiple_bssid.ies in octets +* @cnt: number of entries in multiple_bssid.ies +*/ +struct cfg80211_multiple_bssid_data { +u8 *ies[NL80211_MULTIPLE_BSSID_IES_MAX ]; +size_t len[NL80211_MULTIPLE_BSSID_IES_MAX ]; +int cnt; +}; +/** * struct cfg80211_beacon_data - beacon data * @head: head portion of beacon (before TIM IE)
@@ -1054,6 +1082,7 @@ struct cfg80211_crypto_settings {* Token (measurement type 11) * @lci_len: LCI data length * @civicloc_len: Civic location data length +* @multiple_bssid: multiple_bssid data */ struct cfg80211_beacon_data {const u8 *head, *tail;
@@ -1072,6 +1101,8 @@ struct cfg80211_beacon_data {size_t probe_resp_len;size_t lci_len;size_t civicloc_len; + +struct cfg80211_multiple_bssid_data multiple_bssid; };struct mac_address {
@@ -1176,6 +1207,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 +* @multiple_bssid: AP settings for multiple bssid */ struct cfg80211_ap_settings {struct cfg80211_chan_def chandef;
@@ -1208,6 +1240,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 ieee80211_multiple_bssid multiple_bssid; };/**
include/uapi/linux/nl80211.h +21 -0
@@ -2527,6 +2527,19 @@ enum nl80211_commands {* override mask. Used with NL80211_ATTR_S1G_CAPABILITY in * NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT. * +* @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define +* the parent (transmitting) interface. +* +* @NL80211_ATTR_MULTIPLE_BSSID_INDEX: The index of this BSS inside the multi bssid +* element. +* +* @NL80211_ATTR_MULTIPLE_BSSID_COUNT: The number of BSSs inside the multi bssid element. +* +* @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. +* these get passed separately as the kernel might need to split them up for EMA VAP. +* +* @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode. +* * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3016,6 +3029,12 @@ enum nl80211_attrs {NL80211_ATTR_S1G_CAPABILITY ,NL80211_ATTR_S1G_CAPABILITY_MASK , +NL80211_ATTR_MULTIPLE_BSSID_PARENT , +NL80211_ATTR_MULTIPLE_BSSID_INDEX , +NL80211_ATTR_MULTIPLE_BSSID_COUNT , +NL80211_ATTR_MULTIPLE_BSSID_IES , +NL80211_ATTR_MULTIPLE_BSSID_EMA , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
@@ -3079,6 +3098,8 @@ enum nl80211_attrs {#define NL80211_CQM_TXE_MAX_INTVL 1800 +#define NL80211_MULTIPLE_BSSID_IES_MAX 8 +/** * enum nl80211_iftype - (virtual) interface types *
net/wireless/nl80211.c +34 -0
@@ -715,6 +715,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), [NL80211_ATTR_S1G_CAPABILITY_MASK ] = NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = NLA_POLICY_RANGE(NLA_U8, 1, 16), + [NL80211_ATTR_MULTIPLE_BSSID_IES] = { .type = NLA_NESTED }, + [NL80211_ATTR_MULTIPLE_BSSID_EMA] = { .type = NLA_FLAG }, };/* policy for the key attributes */
@@ -4867,6 +4872,21 @@ static int nl80211_parse_beacon(struct cfg80211_registered_device *rdev, bcn->ftm_responder =-1 ; } +if (attrs[NL80211_ATTR_MULTIPLE_BSSID_IES ]) { +struct nlattr *nl_ie; +int rem_ie; + +nla_for_each_nested (nl_ie, attrs[NL80211_ATTR_MULTIPLE_BSSID_IES ], rem_ie) { +if (bcn->multiple_bssid.cnt >NL80211_MULTIPLE_BSSID_IES_MAX ) +return -EINVAL ; +if (nla_type (nl_ie) != bcn->multiple_bssid.cnt +1 ) +return -EINVAL ; + bcn->multiple_bssid.ies[bcn->multiple_bssid.cnt] =nla_data (nl_ie); + bcn->multiple_bssid.len[bcn->multiple_bssid.cnt] =nla_len (nl_ie); + bcn->multiple_bssid.cnt++; + } + } +return 0 ; }
@@ -5321,6 +5341,20 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)return err; } +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]) + params.multiple_bssid.parent = +nla_get_u32 (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]); + +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_INDEX ]) + params.multiple_bssid.index =nla_get_u8 ( + info->attrs[NL80211_ATTR_MULTIPLE_BSSID_INDEX ]); + +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_COUNT ]) + params.multiple_bssid.count =nla_get_u8 ( + info->attrs[NL80211_ATTR_MULTIPLE_BSSID_COUNT ]); + params.multiple_bssid.ema = +nla_get_flag (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_EMA ]); +nl80211_calculate_ap_params (¶ms);if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT ])
Signature · 1 line
2.25.1
Johannes Berg
maintainerRe: [PATCH V5 1/4] nl80211: add basic multiple bssid support
Quoted 5 lines · John Crispin
include/net/cfg80211.h +5
-0+/** +* struct ieee80211_multiple_bssid - AP settings for multi bssid +* +* @index: the index of this AP in the multi bssid group. +* @count: the total number of multi bssid peer APs.
include/net/cfg80211.h struct ieee80211_supported_band { · line 514
Quoted 10 lines
include/net/cfg80211.h +10
-0+* @parent: non-transmitted BSSs transmitted parents index +* @ema: Shall the beacons be sent out in EMA mode. +*/ +struct ieee80211_multiple_bssid { +u8 index; +u8 count; +u32 parent; +bool ema; +}; +
Why is that ieee80211_ rather than cfg80211_? We've often (mostly?) reserved that for spec structs.
include/net/cfg80211.h struct cfg80211_crypto_settings { · line 1057
Quoted 12 lines
include/net/cfg80211.h +12
-0+/** +* struct cfg80211_multiple_bssid_data - multiple_bssid data +* @ies: array of extra information element(s) to add into Beacon frames for multiple +* bssid or %NULL +* @len: array of lengths of multiple_bssid.ies in octets +* @cnt: number of entries in multiple_bssid.ies +*/ +struct cfg80211_multiple_bssid_data { +u8 *ies[NL80211_MULTIPLE_BSSID_IES_MAX ]; +size_t len[NL80211_MULTIPLE_BSSID_IES_MAX ]; +int cnt; +};
Not sure if this is dynamically allocated but if now we could, and then we can make that
struct ... {
unsigned int cnt;
struct {
const u8 *data;
size_t len;
} elems[];
};and get rid of NL80211_MULTIPLE_BSSID_IES_MAX.
include/net/cfg80211.h struct cfg80211_beacon_data { · line 1105
Quoted 6 lines
include/net/cfg80211.h +2
-0@@ -1072,6 +1101,8 @@ struct cfg80211_beacon_data {size_t probe_resp_len;size_t lci_len;size_t civicloc_len; + +struct cfg80211_multiple_bssid_data multiple_bssid;
OK, so it's not (right now), but could even be embedded as the dynamically sized struct here at the end ...
Or maybe keep some for the common case? But I don't think there's any general limit of 8, so I'm not convinced it makes sense to have such a (somewhat artificial) limit in nl80211.
include/uapi/linux/nl80211.h enum nl80211_commands { · line 2531
Quoted 2 lines
include/uapi/linux/nl80211.h +2
-0+* @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define +* the parent (transmitting) interface.
by what, interface index? wdev id?
include/uapi/linux/nl80211.h enum nl80211_commands { · line 2538
Quoted 6 lines
include/uapi/linux/nl80211.h +6
-0+* @NL80211_ATTR_MULTIPLE_BSSID_INDEX: The index of this BSS inside the multi bssid +* element. +* +* @NL80211_ATTR_MULTIPLE_BSSID_COUNT: The number of BSSs inside the multi bssid element. +* +* @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group.
Might be better called "ELEMS" or something now, since "IE" is no longer used in the spec.
Quoted 3 lines
+ * these get passed separately as the kernel might need to split them up for EMA VAP.
+ *
+ * @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode.
Probably should describe the formats a bit - U32, nested with..., flag, etc.
net/wireless/nl80211.c static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · line 720
Quoted 8 lines
+++
b/net/wireless/nl80211.cnet/wireless/nl80211.c +3
-0@@ -715,6 +715,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), [NL80211_ATTR_S1G_CAPABILITY_MASK ] = NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = NLA_POLICY_RANGE(NLA_U8, 1, 16),
Where does the 16 come from?
johannes
Johannes Berg
maintainerRe: [PATCH V5 1/4] nl80211: add basic multiple bssid support
Quoted 2 lines · Johannes Berg
and get rid of
NL80211_MULTIPLE_BSSID_IES_MAX.
Oh, and the fact that this today has a value of 8 _probably_ means you hardcoded the limits of your specific device that you were thinking of now, and we really should have the device advertising the maximum possible value or so?
And then I guess we can still hard-code the maximum possible value in cfg80211.h somewhere, use it for array sizes etc., but limit the userspace API to the driver-advertised value (and check in wiphy registration that the cfg80211 limit is >= the driver value).
Or is this some fundamental (spec) limit?
johannes
PATCH v5 2/4 mac80211: add multiple bssid support to interface handling
In reply to John CrispinAdd a new helper ieee80211_set_multiple_bssid_options() takes propagating the cfg80211 data down the stack.
The patch also makes sure that all members of the bss set will get closed when either of them is shutdown.
--- include/net/mac80211.h | 28 +++++++++++++++++++++- net/mac80211/cfg.c | 53 ++++++++++++++++++++++++++++++++++++++++++ net/mac80211/debugfs.c | 1 + net/mac80211/iface.c | 6 +++++ 4 files changed, 87 insertions(+), 1 deletion(-)
include/net/mac80211.h +27 -1
@@ -630,6 +630,7 @@ struct ieee80211_fils_discovery {* @s1g: BSS is S1G BSS (affects Association Request format). * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed * to driver when rate control is offloaded to firmware. +* @multiple_bssid: the multiple bssid settings of the AP. */ struct ieee80211_bss_conf {const u8 *bssid;
@@ -701,6 +702,7 @@ struct ieee80211_bss_conf {u32 unsol_bcast_probe_resp_interval;bool s1g;struct cfg80211_bitrate_mask beacon_tx_rate; +struct ieee80211_multiple_bssid multiple_bssid; };/**
@@ -1653,6 +1655,20 @@ enum ieee80211_offload_flags { IEEE80211_OFFLOAD_ENCAP_4ADDR = BIT(1), }; +/** +* enum ieee80211_vif_multiple_bssid_flags - virtual interface multiple bssid flags +* +* @IEEE80211_VIF_MBSS_TRANSMITTING: this BSS is transmitting beacons +* @IEEE80211_VIF_MBSS_NON_TRANSMITTING: this BSS is not transmitting beacons +* @IEEE80211_VIF_MBSS_EMA_BEACON: beacons should be send out in EMA mode +*/ + +enum ieee80211_vif_multiple_bssid_flags { +IEEE80211_VIF_MBSS_TRANSMITTING =BIT (1 ), +IEEE80211_VIF_MBSS_NON_TRANSMITTING =BIT (2 ), +IEEE80211_VIF_MBSS_EMA_BEACON =BIT (3 ), +}; +/** * struct ieee80211_vif - per-interface data *
@@ -1699,6 +1715,9 @@ enum ieee80211_offload_flags {* protected by fq->lock. * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see * &enum ieee80211_offload_flags. +* @multiple_bssid.parent: a non-transmitted bssid has a transmitted parent. +* @multiple_bssid.flags: multiple bssid flags, see +* &enum ieee80211_vif_multiple_bssid_flags */ struct ieee80211_vif {enum nl80211_iftype type;
@@ -1726,6 +1745,10 @@ struct ieee80211_vif {bool rx_mcast_action_reg;bool txqs_stopped[IEEE80211_NUM_ACS ]; +struct { +struct ieee80211_vif *parent; +u32 flags; + } multiple_bssid;/* must be last */ u8 drv_priv[]__aligned(sizeof(void *)) ;
@@ -2374,7 +2397,7 @@ struct ieee80211_txq {* @IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN: Driver does not report accurate A-MPDU * length in tx status information * -* @IEEE80211_HW_SUPPORTS_MULTI_BSSID: Hardware supports multi BSSID +* @IEEE80211_HW_SUPPORTS_MULTI_BSSID: Hardware supports multi BSSID in STA mode * * @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID * only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set.
@@ -2386,6 +2409,8 @@ struct ieee80211_txq {* @IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD: Hardware supports tx encapsulation * offload * +* @IEEE80211_HW_SUPPORTS_MULTI_BSSID_AP: Hardware supports multi BSSID in AP mode +* * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags {
@@ -2439,6 +2464,7 @@ enum ieee80211_hw_flags {IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID ,IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT ,IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD , +IEEE80211_HW_SUPPORTS_MULTI_BSSID_AP ,/* keep last, obviously */ NUM_IEEE80211_HW_FLAGS
net/mac80211/cfg.c +53 -0
71 lines not on this page · raw message
net/mac80211/debugfs.c +1 -0
@@ -409,6 +409,7 @@ static const char *hw_flag_names[] = {FLAG (SUPPORTS_ONLY_HE_MULTI_BSSID ),FLAG (AMPDU_KEYBORDER_SUPPORT ),FLAG (SUPPORTS_TX_ENCAP_OFFLOAD ), +FLAG (SUPPORTS_MULTI_BSSID_AP ), #undef FLAG };
net/mac80211/iface.c +6 -0
@@ -377,6 +377,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,bool cancel_scan;struct cfg80211_nan_func *func; +/* make sure the parent is already down */ +if (sdata->vif.type ==NL80211_IFTYPE_AP && + 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); +clear_bit (SDATA_STATE_RUNNING , &sdata->state); cancel_scan =rcu_access_pointer (local->scan_sdata) == sdata;
Signature · 1 line
2.25.1
PATCH v5 3/4 mac80211: add multiple bssid/EMA support to beacon handling
In reply to John CrispinWith beacon_data now holding the additional information about the multiple bssid elements, we need to honour these in the various beacon handling code paths.
Extend ieee80211_beacon_get_template() to allow generation of multiple bssid/EMA beacons. The API provides support for HW that can offload the EMA beaconing aswell as HW that will require periodic updates of the beacon template upon completion events.
In case the HW can do full EMA offload, functions are provided that allow the driver to get a list of the periodicity number of beacons and their matching mutable offsets.
--- include/net/mac80211.h | 90 +++++++++++++++++++++ net/mac80211/cfg.c | 57 +++++++++++++- net/mac80211/ieee80211_i.h | 2 + net/mac80211/tx.c | 156 +++++++++++++++++++++++++++++++++---- 4 files changed, 285 insertions(+), 20 deletions(-)
include/net/mac80211.h +90 -0
@@ -4865,12 +4865,17 @@ 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. +* @multiple_bssid_offset: position of the multiple bssid element +* @multiple_bssid_length: size 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 multiple_bssid_offset; +u16 multiple_bssid_length; };/**
@@ -4897,6 +4902,91 @@ 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 +* @IEEE80211_BCN_EMA_NONE: don't generate an EMA beacon. +* @IEEE80211_BCN_EMA_NEXT: generate the next periodicity beacon. +* @IEEE80211_BCN_EMA_INDEX: generate beacon by periodicity index +* if the value is >= this enum value. +*/ +enum ieee80211_bcn_tmpl_ema { +IEEE80211_BCN_EMA_NONE =-2 , +IEEE80211_BCN_EMA_NEXT =-1 , +IEEE80211_BCN_EMA_INDEX =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 differs from ieee80211_beacon_get_template in the sense that +* it generates EMA VAP templates. When we use multiple_bssid, the beacons can +* get very large costing a lot of airtime. To work around this, we iterate +* over the multiple bssid elements and only send one inside the beacon for +* 1..n. Calling this function will auto-increment the periodicity counter. +* +* This function needs to follow the same rules as ieee80211_beacon_get_template +* +* 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 differs from ieee80211_beacon_get_template in the sense that +* it generates EMA VAP templates. When we use multiple_bssid, the beacons can +* get very large costing a lot of airtime. To work around this, we iterate +* over the multiple bssid elements and only send one inside the beacon for +* 1..n. This function will populate a linked list that the driver can pass +* to the HW. +* +* This function needs to follow the same rules as ieee80211_beacon_get_template +* +* 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 +54 -3
92 lines not on this page · raw message
net/mac80211/ieee80211_i.h +2 -0
@@ -261,6 +261,8 @@ struct beacon_data {struct ieee80211_meshconf_ie *meshconf;u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM ];u8 cntdwn_current_counter; +struct cfg80211_multiple_bssid_data multiple_bssid; +u16 ema_index;struct rcu_head rcu_head; };
net/mac80211/tx.c +139 -17
257 lines not on this page · raw message
Signature · 1 line
2.25.1
Johannes Berg
maintainerRe: [PATCH V5 3/4] mac80211: add multiple bssid/EMA support to beacon handling
include/net/mac80211.h ieee80211_beacon_get_template(struct ieee80211_hw *hw, · line 4916
Quoted 12 lines · John Crispin
include/net/mac80211.h +12
-0+/** +* enum ieee80211_bcn_tmpl_ema - EMA beacon generation type +* @IEEE80211_BCN_EMA_NONE: don't generate an EMA beacon. +* @IEEE80211_BCN_EMA_NEXT: generate the next periodicity beacon. +* @IEEE80211_BCN_EMA_INDEX: generate beacon by periodicity index +* if the value is >= this enum value. +*/ +enum ieee80211_bcn_tmpl_ema { +IEEE80211_BCN_EMA_NONE =-2 , +IEEE80211_BCN_EMA_NEXT =-1 , +IEEE80211_BCN_EMA_INDEX =0 , +};
I don't see this used in the new API below?
Quoted 1 line
+/** struct
ieee80211_ema_bcn_list- list entry of an EMA beacon
missing newline
include/net/mac80211.h ieee80211_beacon_get_template(struct ieee80211_hw *hw, · line 4975
Quoted 5 lines
+ * Return: The nuber of entries in the list or 0 on error.
+ */include/net/mac80211.h +3
-0+ +int +ieee80211_beacon_get_template_ema_list(struct ieee80211_hw *hw,
could remove that newline and put the int on the same line, I guess?
include/net/mac80211.h ieee80211_beacon_get_template(struct ieee80211_hw *hw, · line 4988
Quoted 13 lines
include/net/mac80211.h +13
-0+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);
certainly here void fits on the line.
johannes
PATCH v5 4/4 mac80211: don't allow CSA on non-transmitting interfaces
In reply to John CrispinAs a non-transmitting interface does not broadcast a beacon, we do not want to allow channel switch announcements. They need to be triggered on the transmitting interface.
--- net/mac80211/cfg.c | 3 +++ 1 file changed, 3 insertions(+)
net/mac80211/cfg.c +3 -0
@@ -3508,6 +3508,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,if (sdata->vif.csa_active)return -EBUSY ; +if (sdata->vif.multiple_bssid.flags &IEEE80211_VIF_MBSS_NON_TRANSMITTING ) +return -EINVAL ; +mutex_lock (&local->chanctx_mtx); conf =rcu_dereference_protected (sdata->vif.chanctx_conf,lockdep_is_held (&local->chanctx_mtx));
Signature · 1 line
2.25.1