mac80211: add multiple bssid / EMA
v3 cover mac80211: add multiple bssid / EMA
This series addss multiple bssid and EMA beacons.
The V3 series has a lot of changes to V2. The biggest being the added support for EMA. As we might have HW that can offload this we need to pass the multiple bssid elements to the kernel. This gives us a lot of flexibility for supporting different hardware.
John Crispin (9):
nl80211: add basic multiple bssid support
mac80211: add multiple bssid support to interface handling
mac80211: add multiple bssid support to beacon handling
mac80211: add multiple bssid/ema support to bcn templating
ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up
ath11k: add the multiple bssid WMI commands
ath11k: add multiple bssid support to device creation
ath11k: add EMA beacon support
ath11k: set the multiple bssid hw flags and capabilities
drivers/net/wireless/ath/ath11k/mac.c | 83 ++++++++++++++++--- drivers/net/wireless/ath/ath11k/wmi.c | 20 +++-- drivers/net/wireless/ath/ath11k/wmi.h | 22 ++++- include/net/cfg80211.h | 35 ++++++++ include/net/mac80211.h | 42 +++++++++- include/uapi/linux/nl80211.h | 22 +++++ net/mac80211/cfg.c | 113 +++++++++++++++++++++++++- net/mac80211/debugfs.c | 1 + net/mac80211/ieee80211_i.h | 2 + net/mac80211/iface.c | 7 ++ net/mac80211/tx.c | 49 ++++++++++- net/wireless/nl80211.c | 40 +++++++++ 12 files changed, 408 insertions(+), 28 deletions(-)
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 1/9 nl80211: add basic multiple bssid support
This patch adds support for passing the multiple bssid config to the kernel when adding an interface. If the BSS is non-transmitting it needs to be indicated. A non-transmitting BSSID will have a parent interface, which needs to be transmitting. The multiple bssid elements are passed as an array.
--- include/net/cfg80211.h | 35 +++++++++++++++++++++++++++++++ include/uapi/linux/nl80211.h | 22 ++++++++++++++++++++ net/wireless/nl80211.c | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+)
include/net/cfg80211.h +35 -0
@@ -470,6 +470,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: a non-transmitted bssid has a transmitted parent +* @non_transmitted: Is this a non-transmitted bssid +*/ +struct ieee80211_multiple_bssid { +u8 index; +u8 count; +u32 parent; +bool non_transmitted; +}; +/** * ieee80211_get_sband_iftype_data - return sband data for a given iftype * @sband: the sband to search for the STA on
@@ -614,6 +629,7 @@ static inline void wiphy_read_of_freq_limits(struct wiphy *wiphy)* belonging to that MU-MIMO groupID; %NULL if not changed * @vht_mumimo_follow_addr: MU-MIMO follow address, used for monitoring * MU-MIMO packets going to the specified station; %NULL if not changed +* @multiple_bssid: AP settings for multiple bssid */ struct vif_params {u32 flags;
@@ -621,6 +637,7 @@ struct vif_params {u8 macaddr[ETH_ALEN ];const u8 *vht_mumimo_groups;const u8 *vht_mumimo_follow_addr; +struct ieee80211_multiple_bssid multiple_bssid; };/**
@@ -998,6 +1015,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)
@@ -1024,6 +1054,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;
@@ -1042,6 +1073,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 {
@@ -1111,6 +1144,7 @@ enum cfg80211_ap_settings_flags {* @he_obss_pd: OBSS Packet Detection settings * @he_bss_color: BSS Color settings * @he_oper: HE operation IE (or %NULL if HE isn't enabled) +* @multiple_bssid: AP settings for multiple bssid */ struct cfg80211_ap_settings {struct cfg80211_chan_def chandef;
@@ -1141,6 +1175,7 @@ struct cfg80211_ap_settings {u32 flags;struct ieee80211_he_obss_pd he_obss_pd;struct cfg80211_he_bss_color he_bss_color; +struct ieee80211_multiple_bssid multiple_bssid; };/**
include/uapi/linux/nl80211.h +22 -0
@@ -2551,6 +2551,20 @@ enum nl80211_commands {* @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_C_OFF_PRESP: An array of offsets (u16) to the color * switch counters in the probe response (%NL80211_ATTR_PROBE_RESP). * +* @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this +* BSSIDs beacon. +* +* @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. +* * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3039,6 +3053,12 @@ enum nl80211_attrs {NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR ,NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES , +NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING , +NL80211_ATTR_MULTIPLE_BSSID_PARENT , +NL80211_ATTR_MULTIPLE_BSSID_INDEX , +NL80211_ATTR_MULTIPLE_BSSID_COUNT , +NL80211_ATTR_MULTIPLE_BSSID_IES , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
@@ -3102,6 +3122,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 +40 -0
@@ -662,6 +662,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT] = { .type = NLA_U8 }, [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR] = { .type = NLA_U8 }, [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES] = NLA_POLICY_NESTED(nl80211_policy), + [NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING] = { .type = NLA_FLAG }, + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_IES] = { .type = NLA_NESTED }, };/* policy for the key attributes */
@@ -3758,6 +3763,14 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)return err; } +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING ]) + params.multiple_bssid.non_transmitted = +nla_get_flag (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING ]); + +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]) + params.multiple_bssid.parent = +nla_get_u8 (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]); +if (!cfg80211_iftype_allowed (&rdev->wiphy, type, params.use_4addr,0 ))return -EOPNOTSUPP ;
@@ -4670,6 +4683,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 ; }
@@ -5032,6 +5060,18 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) goto out; } +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 ]); + +if (params.multiple_bssid.non_transmitted && + !info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]) +return -EOPNOTSUPP ; +nl80211_calculate_ap_params (¶ms);if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT ])
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V3 1/9] nl80211: add basic multiple bssid support
Quoted 188 lines · John Crispin
This patch adds support for passing the multiple bssid config to the kernel when adding an interface. If the BSS is non-transmitting it needs to be indicated. A non-transmitting BSSID will have a parent interface, which needs to be transmitting. The multiple bssid elements are passed as an array.
Signed-off-by John Crispin <[email protected]>--- include/net/cfg80211.h | 35 +++++++++++++++++++++++++++++++ include/uapi/linux/nl80211.h | 22 ++++++++++++++++++++ net/wireless/nl80211.c | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+)include/net/cfg80211.h +15
-0@@ -470,6 +470,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: a non-transmitted bssid has a transmitted parent +* @non_transmitted: Is this a non-transmitted bssid +*/ +struct ieee80211_multiple_bssid { +u8 index; +u8 count; +u32 parent; +bool non_transmitted; +}; +/** * ieee80211_get_sband_iftype_data - return sband data for a given iftype
* @sband: the sband to search for the STA oninclude/net/cfg80211.h +0
-0@@ -614,6 +629,7 @@ static inline void wiphy_read_of_freq_limits(struct wiphy *wiphy) * belonging to that MU-MIMO groupID; %NULL if not changed * @vht_mumimo_follow_addr: MU-MIMO follow address, used formonitoring
* MU-MIMO packets going to the specified station; %NULL if not
changed
+ * @multiple_bssid: AP settings for multiple bssid */
structvif_params{include/net/cfg80211.h +4
-0u32 flags;@@ -621,6 +637,7 @@ struct vif_params {u8 macaddr[ETH_ALEN ];const u8 *vht_mumimo_groups;const u8 *vht_mumimo_follow_addr; +struct ieee80211_multiple_bssid multiple_bssid; };/** @@ -998,6 +1015,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
+ */include/net/cfg80211.h +11
-0+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) @@ -1024,6 +1054,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;@@ -1042,6 +1073,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 {@@ -1111,6 +1144,7 @@ enum cfg80211_ap_settings_flags {* @he_obss_pd: OBSS Packet Detection settings * @he_bss_color: BSS Color settings * @he_oper: HE operation IE (or %NULL if HE isn't enabled) +* @multiple_bssid: AP settings for multiple bssid */ struct cfg80211_ap_settings {struct cfg80211_chan_def chandef;@@ -1141,6 +1175,7 @@ struct cfg80211_ap_settings {u32 flags;struct ieee80211_he_obss_pd he_obss_pd;struct cfg80211_he_bss_color he_bss_color; +struct ieee80211_multiple_bssid multiple_bssid; };/** include/uapi/linux/nl80211.h +0
-0@@ -2551,6 +2551,20 @@ enum nl80211_commands {* @NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_C_OFF_PRESP: An array of offsets (u16) to the color
* switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
*
+ * @NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING: Set the Non-Transmitted flag for this
+ * BSSIDs beacon.
+ *
+ * @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.
+ *
* @NUM_NL80211_ATTR: total number ofnl80211_attrsavailable
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal useinclude/uapi/linux/nl80211.h +8
-0@@ -3039,6 +3053,12 @@ enum nl80211_attrs {NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR ,NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES , +NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING , +NL80211_ATTR_MULTIPLE_BSSID_PARENT , +NL80211_ATTR_MULTIPLE_BSSID_INDEX , +NL80211_ATTR_MULTIPLE_BSSID_COUNT , +NL80211_ATTR_MULTIPLE_BSSID_IES , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,@@ -3102,6 +3122,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 +5
-0@@ -662,6 +662,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT] = { .type = NLA_U8 }, [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR] = { .type = NLA_U8 }, [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES ] = NLA_POLICY_NESTED(nl80211_policy), + [NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING] = { .type = NLA_FLAG }, + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_IES] = { .type = NLA_NESTED },};
/* policy for the key attributes */
net/wireless/nl80211.c +0
-0@@ -3758,6 +3763,14 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
net/wireless/nl80211.c static int nl80211_new_interface(struct sk_buff · line 3773
Quoted 10 lines
net/wireless/nl80211.c +7
-0return err; } +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING ]) + params.multiple_bssid.non_transmitted = +nla_get_flag (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING ]); + +if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]) + params.multiple_bssid.parent = +nla_get_u8 (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]);
This should be nla_get_u32() as per the policy
Quoted 49 lines
net/wireless/nl80211.c +1
-0+if (!cfg80211_iftype_allowed (&rdev->wiphy, type, params.use_4addr,0 ))net/wireless/nl80211.c +15
-0return -EOPNOTSUPP ;@@ -4670,6 +4683,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 ;}
net/wireless/nl80211.c +12
-0@@ -5032,6 +5060,18 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) goto out; } +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 ]); + +if (params.multiple_bssid.non_transmitted && + !info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]) +return -EOPNOTSUPP ; +nl80211_calculate_ap_params (¶ms);if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V3 1/9] nl80211: add basic multiple bssid support
Quoted 2 lines · Aloka Dixit
Quoted 1 line
+
nla_get_u8(info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT]);This should be
nla_get_u32()as per the policy
weird, that is fixed in my local tree, must have sent the series before folding that fix. Johannes said he will review early next week so there will be a new series shortly
John
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Johannes Berg
maintainerRe: [PATCH V3 1/9] nl80211: add basic multiple bssid support
In reply to John CrispinQuoted 18 lines · John Crispin
This patch adds support for passing the multiple bssid config to the kernel when adding an interface. If the BSS is non-transmitting it needs to be indicated. A non-transmitting BSSID will have a parent interface, which needs to be transmitting. The multiple bssid elements are passed as an array.
Signed-off-by John Crispin <[email protected]>--- include/net/cfg80211.h | 35 +++++++++++++++++++++++++++++++ include/uapi/linux/nl80211.h | 22 ++++++++++++++++++++ net/wireless/nl80211.c | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+)include/net/cfg80211.h +0
-0
include/net/cfg80211.h struct ieee80211_supported_band { · line 478
Quoted 9 lines
include/net/cfg80211.h +6
-0@@ -470,6 +470,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: a non-transmitted bssid has a transmitted parent
It obviously has a parent, but what does this u32 value mean?
include/net/cfg80211.h struct cfg80211_crypto_settings { · line 1027
Quoted 10 lines
include/net/cfg80211.h +10
-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 ];
This is all pretty much dynamic - why have the hard-coded limitation? Wouldn't it be only marginally harder to do
struct ... {
int cnt;
struct {
const u8 *ies;
size_t len;
} data[];
};and size it dynamically?
And have the driver advertise some kind of limit, I guess.
In fact, even with the patch as is, what if a driver only can do 4 not 8... Or what if your driver can do 8, but the next driver comes along and has to bump it to 16, then your current driver will be a mess.
include/net/cfg80211.h struct ieee80211_supported_band { · line 490
Quoted 2 lines
include/net/cfg80211.h +2
-0+* @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define +* the parent (transmitting) interface.
By what? interface index?
include/net/cfg80211.h static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · line 669
Quoted 9 lines
include/net/cfg80211.h +5
-0@@ -662,6 +662,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COUNT] = { .type = NLA_U8 }, [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR] = { .type = NLA_U8 }, [NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES] = NLA_POLICY_NESTED(nl80211_policy), + [NL80211_ATTR_MULTIPLE_BSSID_NON_TRANSMITTING] = { .type = NLA_FLAG }, + [NL80211_ATTR_MULTIPLE_BSSID_PARENT] = { .type = NLA_U32 }, + [NL80211_ATTR_MULTIPLE_BSSID_INDEX] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_COUNT] = { .type = NLA_U8 }, + [NL80211_ATTR_MULTIPLE_BSSID_IES] = { .type = NLA_NESTED },
Maybe those should all go into a single top-level attribute with their own nested policy? Or maybe not, I'm certainly willing to entertain arguments eitherway.
What's the point of BSSID_COUNT by the way, you can count based on the number of elements in the BSSID_IES array, no?
Actually, I don't understand this API at all. This is being set on a single virtual interface. Clearly, you need a new interface for every BSSID, transmitting or not. So why can you have many things set on a single interface? And why do you need a count, if you know the number of interfaces you have?
include/net/cfg80211.h static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · line 672
Quoted 3 lines
include/net/cfg80211.h +3
-0+if (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]) + params.multiple_bssid.parent = +nla_get_u8 (info->attrs[NL80211_ATTR_MULTIPLE_BSSID_PARENT ]);
As Aloka also pointed out, this must be nla_get_u32().
But I don't really like passing that down - if it's an interface index then resolve it here and pass a pointer.
If it's something else, please document it clearly.
Thanks,
johannes
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 2/9 mac80211: add multiple bssid support to interface handling
In reply to John CrispinWhen bringing up multi bssid APs we need to track the parent-child relation of non-transmitting and transmitting VAPs. This patch checks the above by using a linked list to track the relations. The patch also ensures that when a non-transmitting interface is closed the transmitting one is also closed.
--- include/net/mac80211.h | 13 +++++++++- net/mac80211/cfg.c | 54 ++++++++++++++++++++++++++++++++++++++++++ net/mac80211/debugfs.c | 1 + net/mac80211/iface.c | 7 ++++++ 4 files changed, 74 insertions(+), 1 deletion(-)
include/net/mac80211.h +12 -1
@@ -1649,6 +1649,9 @@ enum ieee80211_vif_flags {* write-protected by sdata_lock and local->mtx so holding either is fine * for read access. * @cca_color: the color that we will have after the change. +* @multiple_bssid.parent: a non-transmitted bssid has a transmitted parent. +* @multiple_bssid.list: linked list for tracking parent - child relations. +* @multiple_bssid.non_transmitted: Is this a non-transmitted bssi */ struct ieee80211_vif {enum nl80211_iftype type;
@@ -1675,6 +1678,11 @@ struct ieee80211_vif {bool rx_mcast_action_reg;bool txqs_stopped[IEEE80211_NUM_ACS ]; +struct { +struct ieee80211_vif *parent; +struct list_head list; +bool non_transmitted; + } multiple_bssid;bool cca_active;u8 cca_color;
@@ -2326,7 +2334,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.
@@ -2335,6 +2343,8 @@ struct ieee80211_txq {* aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx * A-MPDU sessions active while rekeying with Extended Key ID. * +* @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 {
@@ -2387,6 +2397,7 @@ enum ieee80211_hw_flags {IEEE80211_HW_SUPPORTS_MULTI_BSSID ,IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID ,IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT , +IEEE80211_HW_SUPPORTS_MULTI_BSSID_AP ,/* keep last, obviously */ NUM_IEEE80211_HW_FLAGS
net/mac80211/cfg.c +54 -0
71 lines not on this page · raw message
net/mac80211/debugfs.c +1 -0
@@ -408,6 +408,7 @@ static const char *hw_flag_names[] = {FLAG (SUPPORTS_MULTI_BSSID ),FLAG (SUPPORTS_ONLY_HE_MULTI_BSSID ),FLAG (AMPDU_KEYBORDER_SUPPORT ), +FLAG (SUPPORTS_MULTI_BSSID_AP ), #undef FLAG };
net/mac80211/iface.c +7 -0
@@ -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); +clear_bit (SDATA_STATE_RUNNING , &sdata->state); cancel_scan =rcu_access_pointer (local->scan_sdata) == sdata;
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Johannes Berg
maintainerRe: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
include/net/mac80211.h struct ieee80211_vif { · line 1683
Quoted 4 lines
include/net/mac80211.h +3
-0+struct { +struct ieee80211_vif *parent; +struct list_head list;
Is there a lot of value in having a separate list, vs. iterating all interfaces and checking the parent pointer?
And exposing the list to the driver seems like a bad idea anyway, they can't really get locking right.
(to be continued, mail client is acting up)
johannes
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Johannes Berg
maintainerRe: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
In reply to John Crispininclude/net/mac80211.h struct ieee80211_vif { · line 1685
Quoted 6 lines
include/net/mac80211.h +5
-0+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.
net/mac80211/cfg.c static int ieee80211_set_mon_options(struct ieee80211_sub_if_data *sdata, · line 123
Quoted 10 lines
net/mac80211/cfg.c +10
-0+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.
net/mac80211/iface.c static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, · line 820
Quoted 13 lines
+++
b/net/mac80211/iface.cnet/mac80211/iface.c +7
-0@@ -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_nontxwlan_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
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
In reply to John Crispinnet/mac80211/cfg.c static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy, · line 186
Quoted 9 lines
static int ieee80211_del_iface(struct wiphy *wiphy, struct
wireless_dev*wdev)
{net/mac80211/cfg.c +5
-0+struct ieee80211_sub_if_data *sdata; +struct ieee80211_vif *child, *tmp; + + sdata =IEEE80211_WDEV_TO_SUB_IF (wdev); +if (sdata->vif.type ==NL80211_IFTYPE_AP ) {
Hi John, Observed a NULL ptr dereference error here..
Thanks
Pradeep
Re: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
Quoted 8 lines · Pradeep Kumar Chitrapu
Quoted 8 lines
static int
ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev){
+ structieee80211_sub_if_data*sdata;
+ structieee80211_vif*child, *tmp;
+
+ sdata =IEEE80211_WDEV_TO_SUB_IF(wdev);
+ if (sdata->vif.type==NL80211_IFTYPE_AP) {
Quoted 4 lines
Hi John, Observed a NULL ptr dereference error here..
Thanks
Pradeep
how did you trigger it ?
John
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
Quoted 11 lines · John Crispin
Quoted 10 lines · Pradeep Kumar Chitrapu
Quoted 8 lines
static int
ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev){
+ structieee80211_sub_if_data*sdata;
+ structieee80211_vif*child, *tmp;
+
+ sdata =IEEE80211_WDEV_TO_SUB_IF(wdev);
+ if (sdata->vif.type==NL80211_IFTYPE_AP) {Hi John, Observed a NULL ptr dereference error here..
Quoted 7 lines
Quoted 2 lines
Thanks
Pradeephow did you trigger it ?
John
Hi
Deleted the interface and did rmmod and insmod of cfg80211/mac80211/ath modules.
[ 883.565933] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 883.565970] pgd = b311c000 [ 883.573357] [00000000] *pgd=00000000 [ 883.579021] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 883.848257] task: bd1ac600 ti: b027a000 task.ti: b027a000 [ 883.852904] PC is at ieee80211_del_iface+0x34/0x90 [mac80211] [ 883.858333] LR is at extack_doit+0x20/0x6c [compat] [ 884.092936] [<c751fbd8>] (ieee80211_del_iface [mac80211]) from [<7f56181c>] (extack_doit+0x20/0x6c [compat]) [ 884.100991] [<7f56181c>] (extack_doit [compat]) from [<8076a340>] (genl_rcv_msg+0x27c/0x300) [ 884.110854] [<8076a340>] (genl_rcv_msg) from [<807696c0>] (netlink_rcv_skb+0x58/0xb4)
Thanks
Pradeep
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V3 2/9] mac80211: add multiple bssid support to interface handling
Quoted 34 lines · Pradeep Kumar Chitrapu
Quoted 11 lines · John Crispin
Quoted 10 lines · Pradeep Kumar Chitrapu
Quoted 8 lines
static int
ieee80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev){
+ structieee80211_sub_if_data*sdata;
+ structieee80211_vif*child, *tmp;
+
+ sdata =IEEE80211_WDEV_TO_SUB_IF(wdev);
+ if (sdata->vif.type==NL80211_IFTYPE_AP) {Hi John, Observed a NULL ptr dereference error here..
Quoted 7 lines
Quoted 2 lines
Thanks
Pradeephow did you trigger it ?
John
Hi
Deleted the interface and did rmmod and insmod of cfg80211/mac80211/ath modules.
[ 883.565933] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 883.565970] pgd =b311c000
[ 883.573357] [00000000] *pgd=00000000
[ 883.579021] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[ 883.848257] task:bd1ac600ti:b027a000task.ti:b027a000
[ 883.852904] PC is atieee80211_del_iface+0x34/0x90[mac80211]
[ 883.858333] LR is atextack_doit+0x20/0x6c[compat]
[ 884.092936] [<c751fbd8>] (ieee80211_del_iface[mac80211]) from [<7f56181c>] (extack_doit+0x20/0x6c[compat]) [ 884.100991] [<7f56181c>] (extack_doit[compat]) from [<8076a340>] (genl_rcv_msg+0x27c/0x300) [ 884.110854] [<8076a340>] (genl_rcv_msg) from [<807696c0>] (netlink_rcv_skb+0x58/0xb4)
Quoted 3 lines
Thanks
Pradeep
last I tested rmmod/insmod will always crash the kernel when using ath11k
however i'll ass !NULL guard in the next series
John
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 3/9 mac80211: add multiple bssid 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.
--- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 59 ++++++++++++++++++++++++++++++++++++-- net/mac80211/ieee80211_i.h | 1 + 3 files changed, 59 insertions(+), 3 deletions(-)
include/net/mac80211.h +2 -0
@@ -607,6 +607,7 @@ struct ieee80211_ftm_responder_params {* @he_oper: HE operation information of the AP we are connected to * @he_obss_pd: OBSS Packet Detection parameters. * @he_bss_color: BSS coloring settings, if BSS supports HE +* @multiple_bssid: the multiple bssid settings of the AP. */ struct ieee80211_bss_conf {const u8 *bssid;
@@ -674,6 +675,7 @@ struct ieee80211_bss_conf { } he_oper;struct ieee80211_he_obss_pd he_obss_pd;struct cfg80211_he_bss_color he_bss_color; +struct ieee80211_multiple_bssid multiple_bssid; };/**
net/mac80211/cfg.c +56 -3
101 lines not on this page · raw message
net/mac80211/ieee80211_i.h +1 -0
@@ -268,6 +268,7 @@ 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;struct rcu_head rcu_head; };
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 4/9 mac80211: add multiple bssid/ema support to bcn templating
In reply to John CrispinExtend ieee80211_beacon_get_template() to allow generation of EMA beacons. Drivers for hardware that does not support ema offloading can use this function to update their becaons after they receive beacon completion events from the hardware.
--- include/net/mac80211.h | 27 +++++++++++++++++++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/tx.c | 49 ++++++++++++++++++++++++++++++++++---- 3 files changed, 73 insertions(+), 4 deletions(-)
include/net/mac80211.h +27 -0
@@ -4792,12 +4792,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; };/**
@@ -4824,6 +4829,28 @@ ieee80211_beacon_get_template(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_mutable_offsets *offs); +/** +* ieee80211_beacon_get_template - beacon template generation function +* @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. +* +* 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 (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_mutable_offsets *offs); +/** * ieee80211_beacon_get_tim - beacon generation function * @hw: pointer obtained from ieee80211_alloc_hw().
net/mac80211/ieee80211_i.h +1 -0
@@ -269,6 +269,7 @@ struct beacon_data {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 +45 -4
97 lines not on this page · raw message
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Johannes Berg
maintainerRe: [PATCH V3 4/9] mac80211: add multiple bssid/ema support to bcn templating
Quoted 5 lines · John Crispin
Extend
ieee80211_beacon_get_template()to allow generation of EMA beacons. Drivers for hardware that does not support ema offloading can use this function to update their becaons after they receive beacon completion events from the hardware.
This all seems really quite simple when you have the software fallbacks, so is there any chance you could add it to hwsim, in particular for hostap tests? I'm sure Jouni would also appreciate tests for this on the hostap side.
johannes
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Re: [PATCH V3 4/9] mac80211: add multiple bssid/ema support to bcn templating
In reply to John CrispinQuoted 5 lines
(quoted diff) +2
-0+static void +ieee80211_beacon_add_multiple_bssid_config(struct ieee80211_vif *vif,struct
sk_buff*skb,net/mac80211/tx.c +2
-0+ struct cfg80211_multiple_bssid_data *config) +{
net/mac80211/tx.c static int ieee80211_beacon_protect(struct sk_buff *skb, · line 4751
Quoted 10 lines
net/mac80211/tx.c +10
-0+u8 *pos =skb_put (skb,6 ); + + *pos++ =WLAN_EID_EXTENSION ; + *pos++ =4 ; + *pos++ =WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION ; + *pos++ =2 ; + *pos++ = vif->bss_conf.multiple_bssid.count; + *pos++ = config->cnt; +} +
Hi John,
Which field in the IE is this line for : '*pos++ = 2;' ? This IE should be total 5 bytes with length=3.
Signature · 3 lines
ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 5/9 ath11k: add a struct to pass parameters into ath11k_wmi_vdev_up
In reply to John CrispinWhen setting up a multiple bssid we need to pass additional parameters to the FW. Doing this as individual parameters would make the call signature very long. Use an intermediate struct instead and adjust all callees to make use of it.
--- drivers/net/wireless/ath/ath11k/mac.c | 37 ++++++++++++++++++++++----- drivers/net/wireless/ath/ath11k/wmi.c | 17 +++++++----- drivers/net/wireless/ath/ath11k/wmi.h | 12 +++++++-- 3 files changed, 52 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +31 -6
@@ -739,9 +739,13 @@ void ath11k_mac_peer_cleanup_all(struct ath11k *ar)static int ath11k_monitor_vdev_up (struct ath11k *ar,int vdev_id) { +struct vdev_up_params params = { + .vdev_id = vdev_id, + .bssid = ar->mac_addr, + };int ret =0 ; - ret =ath11k_wmi_vdev_up (ar, vdev_id,0 , ar->mac_addr); + ret =ath11k_wmi_vdev_up (ar, ¶ms);if (ret) {ath11k_warn (ar->ab,"failed to put up monitor vdev %i: %d\n" , vdev_id, ret);
@@ -835,6 +839,12 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, struct ieee80211_bss_conf *info) {struct ath11k *ar = arvif->ar; +struct vdev_up_params params = { + .vdev_id = arvif->vdev_id, + .bssid = arvif->bssid, + .profile_num = info->multiple_bssid.count, + .profile_idx = info->multiple_bssid.index, + };int ret =0 ;lockdep_assert_held (&arvif->ar->conf_mutex);
@@ -862,9 +872,15 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, arvif->aid =0 ;ether_addr_copy (arvif->bssid, info->bssid); +if (arvif->vif->multiple_bssid.parent) { +struct ath11k_vif *pvif; - ret =ath11k_wmi_vdev_up (arvif->ar, arvif->vdev_id, arvif->aid, - arvif->bssid); + pvif = (struct ath11k_vif *)arvif->vif->multiple_bssid.parent->drv_priv; + + params.trans_bssid = pvif->bssid; + } + + ret =ath11k_wmi_vdev_up (arvif->ar, ¶ms);if (ret) {ath11k_warn (ar->ab,"failed to bring up vdev %d: %i\n" , arvif->vdev_id, ret);
@@ -1687,6 +1703,11 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,struct ath11k *ar = hw->priv;struct ath11k_vif *arvif = (void *)vif->drv_priv;struct peer_assoc_params peer_arg; +struct vdev_up_params params = { + .vdev_id = arvif->vdev_id, + .bssid = bss_conf->bssid, + .aid = bss_conf->aid, + };struct ieee80211_sta *ap_sta;int ret;
@@ -1735,7 +1756,7 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw, arvif->aid = bss_conf->aid;ether_addr_copy (arvif->bssid, bss_conf->bssid); - ret =ath11k_wmi_vdev_up (ar, arvif->vdev_id, arvif->aid, arvif->bssid); + ret =ath11k_wmi_vdev_up (ar, ¶ms);if (ret) {ath11k_warn (ar->ab,"failed to set vdev %d up: %d\n" , arvif->vdev_id, ret);
@@ -5059,6 +5080,8 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,/* TODO: Update ar->rx_channel */ for (i =0 ; i < n_vifs; i++) { +struct vdev_up_params params; + arvif = (void *)vifs[i].vif->drv_priv;if (WARN_ON (!arvif->is_started))
@@ -5079,8 +5102,10 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,continue ; } - ret =ath11k_wmi_vdev_up (arvif->ar, arvif->vdev_id, arvif->aid, - arvif->bssid); + params.vdev_id = arvif->vdev_id, + params.bssid = arvif->bssid, + params.aid = arvif->aid, + ret =ath11k_wmi_vdev_up (arvif->ar, ¶ms);if (ret) {ath11k_warn (ab,"failed to bring vdev up %d: %d\n" , arvif->vdev_id, ret);
drivers/net/wireless/ath/ath11k/wmi.c +11 -6
@@ -898,7 +898,7 @@ int ath11k_wmi_vdev_start(struct ath11k *ar, struct wmi_vdev_start_req_arg *arg,return ret; } -int ath11k_wmi_vdev_up (struct ath11k *ar,u32 vdev_id,u32 aid,const u8 *bssid) +int ath11k_wmi_vdev_up (struct ath11k *ar,struct vdev_up_params *params) {struct ath11k_pdev_wmi *wmi = ar->wmi;struct wmi_vdev_up_cmd *cmd;
@@ -913,10 +913,14 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) cmd->tlv_header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_VDEV_UP_CMD ) |FIELD_PREP (WMI_TLV_LEN ,sizeof (*cmd) -TLV_HDR_SIZE ); - cmd->vdev_id = vdev_id; - cmd->vdev_assoc_id = aid; + cmd->vdev_id = params->vdev_id; + cmd->vdev_assoc_id = params->aid; + cmd->profile_idx = params->profile_idx; + cmd->profile_num = params->profile_num; -ether_addr_copy (cmd->vdev_bssid.addr, bssid); +if (params->trans_bssid) +ether_addr_copy (cmd->trans_bssid.addr, params->trans_bssid); +ether_addr_copy (cmd->vdev_bssid.addr, params->bssid); ret =ath11k_wmi_cmd_send (wmi, skb,WMI_VDEV_UP_CMDID );if (ret) {
@@ -925,8 +929,9 @@ int ath11k_wmi_vdev_up(struct ath11k *ar, u32 vdev_id, u32 aid, const u8 *bssid) }ath11k_dbg (ar->ab,ATH11K_DBG_WMI , -"WMI mgmt vdev up id 0x%x assoc id %d bssid %pM\n" , - vdev_id, aid, bssid); +"WMI mgmt vdev up id 0x%x assoc id %d idx %d num %d bssid %pM trans_bssid %pM\n" , + params->vdev_id, params->aid, params->profile_idx, params->profile_num, + params->bssid, params->trans_bssid);return ret; }
drivers/net/wireless/ath/ath11k/wmi.h +10 -2
@@ -2480,6 +2480,15 @@ struct wmi_vdev_delete_cmd {u32 vdev_id; } __packed; +struct vdev_up_params { +u32 vdev_id; +u16 aid; +u32 profile_idx; +u32 profile_num; +const u8 *bssid; +u8 *trans_bssid; +}; +struct wmi_vdev_up_cmd {u32 tlv_header;u32 vdev_id;
@@ -5023,8 +5032,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id,struct ieee80211_mutable_offsets *offs, struct sk_buff *bcn);int ath11k_wmi_vdev_down (struct ath11k *ar,u8 vdev_id); -int ath11k_wmi_vdev_up (struct ath11k *ar,u32 vdev_id,u32 aid, -const u8 *bssid); +int ath11k_wmi_vdev_up (struct ath11k *ar,struct vdev_up_params *params);int ath11k_wmi_vdev_stop (struct ath11k *ar,u8 vdev_id);int ath11k_wmi_vdev_start (struct ath11k *ar,struct wmi_vdev_start_req_arg *arg,bool restart);
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 6/9 ath11k: add the multiple bssid WMI commands
In reply to John CrispinAdd the code to pass the BSS specific multiple bssid info to the FW.
--- drivers/net/wireless/ath/ath11k/wmi.c | 3 +++ drivers/net/wireless/ath/ath11k/wmi.h | 10 ++++++++++ 2 files changed, 13 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +3 -0
@@ -641,6 +641,8 @@ int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr, cmd->vdev_subtype = param->subtype; cmd->num_cfg_txrx_streams =WMI_NUM_SUPPORTED_BAND_MAX ; cmd->pdev_id = param->pdev_id; + cmd->flags = param->flags; + cmd->vdevid_trans = param->vdevid_trans;ether_addr_copy (cmd->vdev_macaddr.addr, macaddr); ptr = skb->data +sizeof (*cmd);
@@ -1603,6 +1605,7 @@ int ath11k_wmi_bcn_tmpl(struct ath11k *ar, u32 vdev_id, cmd->csa_switch_count_offset = offs->cntdwn_counter_offs[0 ]; cmd->ext_csa_switch_count_offset = offs->cntdwn_counter_offs[1 ]; cmd->buf_len = bcn->len; + cmd->mbssid_ie_offset = offs->multiple_bssid_offset; ptr = skb->data +sizeof (*cmd);
drivers/net/wireless/ath/ath11k/wmi.h +10 -0
@@ -119,6 +119,12 @@ enum { WMI_HOST_WLAN_2G_5G_CAP = 0x3, }; +enum { +WMI_HOST_VDEV_FLAGS_NON_MBSSID_AP =1 , +WMI_HOST_VDEV_FLAGS_TRANSMIT_AP =2 , +WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP =4 , +}; +/* * wmi command groups. */
@@ -2456,6 +2462,8 @@ struct vdev_create_params {u8 rx; } chains[NUM_NL80211_BANDS ];u32 pdev_id; +u32 flags; +u32 vdevid_trans; };struct wmi_vdev_create_cmd {
@@ -2466,6 +2474,8 @@ struct wmi_vdev_create_cmd {struct wmi_mac_addr vdev_macaddr;u32 num_cfg_txrx_streams;u32 pdev_id; +u32 flags; +u32 vdevid_trans; } __packed;struct wmi_vdev_txrx_streams {
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 7/9 ath11k: add multiple bssid support to device creation
In reply to John CrispinWe need to pass info such as parent device, bssid count/index and (non-)transmit mode information to the FW when we create a new vdev.
--- drivers/net/wireless/ath/ath11k/mac.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +20 -2
@@ -4269,17 +4269,30 @@ static void ath11k_mac_op_stop(struct ieee80211_hw *hw)atomic_set (&ar->num_pending_mgmt_tx,0 ); } -static void +static int ath11k_mac_setup_vdev_create_params (struct ath11k_vif *arvif,struct vdev_create_params *params) {struct ath11k *ar = arvif->ar; +struct ieee80211_vif *parent;struct ath11k_pdev *pdev = ar->pdev; params->if_id = arvif->vdev_id; params->type = arvif->vdev_type; params->subtype = arvif->vdev_subtype; params->pdev_id = pdev->pdev_id; + params->vdevid_trans =0 ; +if (arvif->vif->multiple_bssid.non_transmitted) { + params->flags =WMI_HOST_VDEV_FLAGS_NON_TRANSMIT_AP ; + parent = arvif->vif->multiple_bssid.parent; +if (!parent) +return -ENOENT ; +if (ar->hw->wiphy !=ieee80211_vif_to_wdev (parent)->wiphy) +return -EINVAL ; + params->vdevid_trans =ath11k_vif_to_arvif (parent)->vdev_id; + }else { + params->flags =WMI_HOST_VDEV_FLAGS_TRANSMIT_AP ; + }if (pdev->cap.supported_bands &WMI_HOST_WLAN_2G_CAP ) { params->chains[NL80211_BAND_2GHZ ].tx = ar->num_tx_chains;
@@ -4294,6 +4307,7 @@ ath11k_mac_setup_vdev_create_params(struct ath11k_vif *arvif, params->chains[NL80211_BAND_6GHZ ].tx = ar->num_tx_chains; params->chains[NL80211_BAND_6GHZ ].rx = ar->num_rx_chains; } +return 0 ; } static u32
@@ -4443,7 +4457,11 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,for (i =0 ; i <ARRAY_SIZE (vif->hw_queue); i++) vif->hw_queue[i] = i % (ATH11K_HW_MAX_QUEUES -1 ); -ath11k_mac_setup_vdev_create_params (arvif, &vdev_param); + ret =ath11k_mac_setup_vdev_create_params (arvif, &vdev_param); +if (ret) { +ath11k_warn (ab,"failed to prepare vdev %d\n" , ret); + goto err; + } ret =ath11k_wmi_vdev_create (ar, vif->addr, &vdev_param);if (ret) {
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 8/9 ath11k: add EMA beacon support
In reply to John CrispinWe need to update the beacon in multiple bssid mode after each completion event to get the next EMA beacon.
--- drivers/net/wireless/ath/ath11k/mac.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +14 -4
@@ -791,7 +791,10 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)if (arvif->vdev_type !=WMI_VDEV_TYPE_AP )return 0 ; - bcn =ieee80211_beacon_get_template (hw, vif, &offs); +if (arvif->vif->multiple_bssid.non_transmitted) +return 0 ; + + bcn =ieee80211_beacon_get_template_ema (hw, vif, &offs);if (!bcn) {ath11k_warn (ab,"failed to get beacon template from mac80211\n" );return -EPERM ;
@@ -822,16 +825,23 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)void ath11k_mac_bcn_tx_event (struct ath11k_vif *arvif) {struct ieee80211_vif *vif = arvif->vif; +int multiple_bssid =0 ; -if (!vif->cca_active) +if (!vif->multiple_bssid.non_transmitted && + !list_empty (&vif->multiple_bssid.list)) + multiple_bssid =1 ; + +if (!multiple_bssid && !vif->cca_active)return ; -if (ieee80211_beacon_cntdwn_is_complete (vif)) { +if (vif->cca_active &&ieee80211_beacon_cntdwn_is_complete (vif)) {ieee80211_cca_finish (vif);return ; } -ieee80211_beacon_update_cntdwn (vif); +if (vif->cca_active) +ieee80211_beacon_update_cntdwn (vif); +ath11k_mac_setup_bcn_tmpl (arvif); }
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH v3 9/9 ath11k: set the multiple bssid hw flags and capabilities
In reply to John CrispinThis wraps up the support for multiple bssid and actually makes the feature available.
--- drivers/net/wireless/ath/ath11k/mac.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +6 -0
@@ -5999,19 +5999,23 @@ static int ath11k_mac_setup_channels_rates(struct ath11k *ar,static const u8 ath11k_if_types_ext_capa[] = { [0 ] =WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING , + [2 ] =WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT , [7 ] =WLAN_EXT_CAPA8_OPMODE_NOTIF , };static const u8 ath11k_if_types_ext_capa_sta[] = { [0 ] =WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING , + [2 ] =WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT , [7 ] =WLAN_EXT_CAPA8_OPMODE_NOTIF , [9 ] =WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT , };static const u8 ath11k_if_types_ext_capa_ap[] = { [0 ] =WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING , + [2 ] =WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT , [7 ] =WLAN_EXT_CAPA8_OPMODE_NOTIF , [9 ] =WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT , + [11 ] =WLAN_EXT_CAPA11_EMA_SUPPORT , };static const struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = {
@@ -6121,6 +6125,8 @@ static int __ath11k_mac_register(struct ath11k *ar)ieee80211_hw_set (ar->hw,QUEUE_CONTROL );ieee80211_hw_set (ar->hw,SUPPORTS_TX_FRAG );ieee80211_hw_set (ar->hw,REPORTS_LOW_ACK ); +ieee80211_hw_set (ar->hw,SUPPORTS_MULTI_BSSID ); +ieee80211_hw_set (ar->hw,SUPPORTS_MULTI_BSSID_AP );if (ht_cap &WMI_HT_CAP_ENABLED ) {ieee80211_hw_set (ar->hw,AMPDU_AGGREGATION );ieee80211_hw_set (ar->hw,TX_AMPDU_SETUP_IN_HW );
Signature · 7 lines
2.25.1 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k