mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-21 03:13:17 +00:00
159 lines
5.5 KiB
Diff
159 lines
5.5 KiB
Diff
From f8e7ec408c357d6438abd980f700353a7efcac7e Mon Sep 17 00:00:00 2001
|
|
From: Maharaja Kennadyrajan <mkenna@codeaurora.org>
|
|
Date: Tue, 12 Jan 2021 18:11:33 +0530
|
|
Subject: [PATCH] mac80211: Add support for beacon tx mode
|
|
|
|
User can configure the beacon tx mode while bring-up the
|
|
AP via hostapd configuration.
|
|
|
|
Use the below configuration in the hostapd to configure
|
|
the beacon tx mode.
|
|
|
|
"beacon_tx_mode=N", where N = 0 for STAGGERED beacon mode
|
|
and N = 1 for BURST beacon mode.
|
|
|
|
Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
|
|
---
|
|
include/net/cfg80211.h | 2 +-
|
|
include/net/mac80211.h | 1 +
|
|
include/uapi/linux/nl80211.h | 2 ++
|
|
net/mac80211/cfg.c | 1 +
|
|
net/wireless/nl80211.c | 7 ++++++-
|
|
5 files changed, 11 insertions(+), 2 deletions(-)
|
|
|
|
--- a/include/net/cfg80211.h
|
|
+++ b/include/net/cfg80211.h
|
|
@@ -1329,6 +1329,7 @@ struct cfg80211_unsol_bcast_probe_resp {
|
|
* @fils_discovery: FILS discovery transmission parameters
|
|
* @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
|
|
* @mbssid_config: AP settings for multiple bssid
|
|
+ * @beacon_tx_mode: Beacon Tx Mode setting
|
|
*/
|
|
struct cfg80211_ap_settings {
|
|
struct cfg80211_chan_def chandef;
|
|
@@ -1363,6 +1364,7 @@ struct cfg80211_ap_settings {
|
|
struct cfg80211_fils_discovery fils_discovery;
|
|
struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
|
|
struct cfg80211_mbssid_config mbssid_config;
|
|
+ enum nl80211_beacon_tx_mode beacon_tx_mode;
|
|
};
|
|
|
|
/**
|
|
@@ -2279,6 +2281,7 @@ struct mesh_config {
|
|
* to operate on DFS channels.
|
|
* @control_port_over_nl80211: TRUE if userspace expects to exchange control
|
|
* port frames over NL80211 instead of the network interface.
|
|
+ * @beacon_tx_mode: Beacon Tx Mode setting.
|
|
*
|
|
* These parameters are fixed when the mesh is created.
|
|
*/
|
|
@@ -2302,6 +2305,7 @@ struct mesh_setup {
|
|
struct cfg80211_bitrate_mask beacon_rate;
|
|
bool userspace_handles_dfs;
|
|
bool control_port_over_nl80211;
|
|
+ enum nl80211_beacon_tx_mode beacon_tx_mode;
|
|
};
|
|
|
|
/**
|
|
--- a/include/net/mac80211.h
|
|
+++ b/include/net/mac80211.h
|
|
@@ -666,6 +666,7 @@ struct ieee80211_fils_discovery {
|
|
* for read access.
|
|
* @color_change_color: the bss color that will be used after the change.
|
|
* @nss_ap_isolate: Used for notifying the NSS host about AP isolate feature
|
|
+ * @beacon_tx_mode: Beacon Tx Mode setting.
|
|
*/
|
|
struct ieee80211_bss_conf {
|
|
const u8 *bssid;
|
|
@@ -742,6 +743,7 @@ struct ieee80211_bss_conf {
|
|
u8 color_change_color;
|
|
|
|
bool nss_ap_isolate;
|
|
+ enum nl80211_beacon_tx_mode beacon_tx_mode;
|
|
};
|
|
|
|
/**
|
|
--- a/include/uapi/linux/nl80211.h
|
|
+++ b/include/uapi/linux/nl80211.h
|
|
@@ -2749,6 +2749,9 @@ enum nl80211_commands {
|
|
* the incoming frame RX timestamp.
|
|
* @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the
|
|
* %NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command.
|
|
+ * @NL80211_ATTR_BEACON_TX_MODE: used to configure the beacon tx mode as
|
|
+ * staggered mode = 1 or burst mode = 2 in %NL80211_CMD_START_AP or
|
|
+ * %NL80211_CMD_JOIN_MESH from user-space.
|
|
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
|
|
* @NL80211_ATTR_MAX: highest attribute number currently defined
|
|
* @__NL80211_ATTR_AFTER_LAST: internal use
|
|
@@ -3279,6 +3282,8 @@ enum nl80211_attrs {
|
|
|
|
NL80211_ATTR_HE_MUEDCA_PARAMS,
|
|
|
|
+ NL80211_ATTR_BEACON_TX_MODE,
|
|
+
|
|
/* add attributes here, update the policy in nl80211.c */
|
|
|
|
__NL80211_ATTR_AFTER_LAST,
|
|
@@ -7720,4 +7725,12 @@ enum nl80211_ap_settings_flags {
|
|
NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,
|
|
};
|
|
|
|
+/**
|
|
+ * enum nl80211_beacon_tx_mode - Beacon Tx Mode enum.
|
|
+ * Used to configure beacon staggered mode or beacon burst mode.
|
|
+ */
|
|
+enum nl80211_beacon_tx_mode {
|
|
+ NL80211_BEACON_STAGGERED_MODE = 1,
|
|
+ NL80211_BEACON_BURST_MODE = 2,
|
|
+};
|
|
#endif /* __LINUX_NL80211_H */
|
|
--- a/net/mac80211/cfg.c
|
|
+++ b/net/mac80211/cfg.c
|
|
@@ -1199,6 +1199,7 @@ static int ieee80211_start_ap(struct wip
|
|
|
|
prev_beacon_int = link_conf->beacon_int;
|
|
link_conf->beacon_int = params->beacon_interval;
|
|
+ link_conf->beacon_tx_mode = params->beacon_tx_mode;
|
|
|
|
if (params->he_cap && params->he_oper) {
|
|
link_conf->he_support = true;
|
|
@@ -2317,6 +2318,7 @@ static int copy_mesh_setup(struct ieee80
|
|
|
|
sdata->vif.bss_conf.beacon_int = setup->beacon_interval;
|
|
sdata->vif.bss_conf.dtim_period = setup->dtim_period;
|
|
+ sdata->vif.bss_conf.beacon_tx_mode = setup->beacon_tx_mode;
|
|
|
|
sdata->beacon_rate_set = false;
|
|
if (wiphy_ext_feature_isset(sdata->local->hw.wiphy,
|
|
--- a/net/wireless/nl80211.c
|
|
+++ b/net/wireless/nl80211.c
|
|
@@ -830,6 +830,7 @@ static const struct nla_policy nl80211_p
|
|
[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
|
|
[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
|
|
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
|
|
+ [NL80211_ATTR_BEACON_TX_MODE] = NLA_POLICY_RANGE(NLA_U32, 1, 2),
|
|
};
|
|
|
|
/* policy for the key attributes */
|
|
@@ -5750,6 +5751,9 @@ static int nl80211_start_ap(struct sk_bu
|
|
nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]);
|
|
params->dtim_period =
|
|
nla_get_u32(info->attrs[NL80211_ATTR_DTIM_PERIOD]);
|
|
+ if (info->attrs[NL80211_ATTR_BEACON_TX_MODE])
|
|
+ params->beacon_tx_mode =
|
|
+ nla_get_u32(info->attrs[NL80211_ATTR_BEACON_TX_MODE]);
|
|
|
|
err = cfg80211_validate_beacon_int(rdev, dev->ieee80211_ptr->iftype,
|
|
params->beacon_interval);
|
|
@@ -12771,6 +12775,10 @@ static int nl80211_join_mesh(struct sk_b
|
|
return -EINVAL;
|
|
}
|
|
|
|
+ if (info->attrs[NL80211_ATTR_BEACON_TX_MODE])
|
|
+ setup.beacon_tx_mode =
|
|
+ nla_get_u32(info->attrs[NL80211_ATTR_BEACON_TX_MODE]);
|
|
+
|
|
if (info->attrs[NL80211_ATTR_MESH_SETUP]) {
|
|
/* parse additional setup parameters if given */
|
|
err = nl80211_parse_mesh_setup(info, &setup);
|