diff options
-rw-r--r-- | include/net/cfg80211.h | 4 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 1 | ||||
-rw-r--r-- | net/mac80211/mesh.h | 2 | ||||
-rw-r--r-- | net/wireless/mesh.c | 5 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 15 |
6 files changed, 27 insertions, 3 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3d8717a0d3b2..516aded3697f 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1036,6 +1036,8 @@ struct mesh_config { | |||
1036 | * @ie_len: length of vendor information elements | 1036 | * @ie_len: length of vendor information elements |
1037 | * @is_authenticated: this mesh requires authentication | 1037 | * @is_authenticated: this mesh requires authentication |
1038 | * @is_secure: this mesh uses security | 1038 | * @is_secure: this mesh uses security |
1039 | * @dtim_period: DTIM period to use | ||
1040 | * @beacon_interval: beacon interval to use | ||
1039 | * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] | 1041 | * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] |
1040 | * | 1042 | * |
1041 | * These parameters are fixed when the mesh is created. | 1043 | * These parameters are fixed when the mesh is created. |
@@ -1051,6 +1053,8 @@ struct mesh_setup { | |||
1051 | u8 ie_len; | 1053 | u8 ie_len; |
1052 | bool is_authenticated; | 1054 | bool is_authenticated; |
1053 | bool is_secure; | 1055 | bool is_secure; |
1056 | u8 dtim_period; | ||
1057 | u16 beacon_interval; | ||
1054 | int mcast_rate[IEEE80211_NUM_BANDS]; | 1058 | int mcast_rate[IEEE80211_NUM_BANDS]; |
1055 | }; | 1059 | }; |
1056 | 1060 | ||
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8a91dd22d571..36aa65f495ff 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1666,6 +1666,9 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, | |||
1666 | memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate, | 1666 | memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate, |
1667 | sizeof(setup->mcast_rate)); | 1667 | sizeof(setup->mcast_rate)); |
1668 | 1668 | ||
1669 | sdata->vif.bss_conf.beacon_int = setup->beacon_interval; | ||
1670 | sdata->vif.bss_conf.dtim_period = setup->dtim_period; | ||
1671 | |||
1669 | return 0; | 1672 | return 0; |
1670 | } | 1673 | } |
1671 | 1674 | ||
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 245885841c8d..694e27376afa 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -625,7 +625,6 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) | |||
625 | ieee80211_queue_work(&local->hw, &sdata->work); | 625 | ieee80211_queue_work(&local->hw, &sdata->work); |
626 | sdata->vif.bss_conf.ht_operation_mode = | 626 | sdata->vif.bss_conf.ht_operation_mode = |
627 | ifmsh->mshcfg.ht_opmode; | 627 | ifmsh->mshcfg.ht_opmode; |
628 | sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL; | ||
629 | sdata->vif.bss_conf.enable_beacon = true; | 628 | sdata->vif.bss_conf.enable_beacon = true; |
630 | sdata->vif.bss_conf.basic_rates = | 629 | sdata->vif.bss_conf.basic_rates = |
631 | ieee80211_mandatory_rates(local, band); | 630 | ieee80211_mandatory_rates(local, band); |
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index c07f6fc63dc6..aff301544c7f 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -191,8 +191,6 @@ struct mesh_rmc { | |||
191 | #define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ) | 191 | #define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ) |
192 | #define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ) | 192 | #define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ) |
193 | 193 | ||
194 | #define MESH_DEFAULT_BEACON_INTERVAL 1000 /* in 1024 us units */ | ||
195 | |||
196 | #define MESH_PATH_EXPIRE (600 * HZ) | 194 | #define MESH_PATH_EXPIRE (600 * HZ) |
197 | 195 | ||
198 | /* Default maximum number of plinks per interface */ | 196 | /* Default maximum number of plinks per interface */ |
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index f9d6ce5cfabb..0fe8ceb5444e 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -44,6 +44,9 @@ | |||
44 | 44 | ||
45 | #define MESH_SYNC_NEIGHBOR_OFFSET_MAX 50 | 45 | #define MESH_SYNC_NEIGHBOR_OFFSET_MAX 50 |
46 | 46 | ||
47 | #define MESH_DEFAULT_BEACON_INTERVAL 1000 /* in 1024 us units (=TUs) */ | ||
48 | #define MESH_DEFAULT_DTIM_PERIOD 2 | ||
49 | |||
47 | const struct mesh_config default_mesh_config = { | 50 | const struct mesh_config default_mesh_config = { |
48 | .dot11MeshRetryTimeout = MESH_RET_T, | 51 | .dot11MeshRetryTimeout = MESH_RET_T, |
49 | .dot11MeshConfirmTimeout = MESH_CONF_T, | 52 | .dot11MeshConfirmTimeout = MESH_CONF_T, |
@@ -79,6 +82,8 @@ const struct mesh_setup default_mesh_setup = { | |||
79 | .ie = NULL, | 82 | .ie = NULL, |
80 | .ie_len = 0, | 83 | .ie_len = 0, |
81 | .is_secure = false, | 84 | .is_secure = false, |
85 | .beacon_interval = MESH_DEFAULT_BEACON_INTERVAL, | ||
86 | .dtim_period = MESH_DEFAULT_DTIM_PERIOD, | ||
82 | }; | 87 | }; |
83 | 88 | ||
84 | int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | 89 | int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index ceb27fda9ec5..d5842eb35aec 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -6669,6 +6669,21 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info) | |||
6669 | nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]))) | 6669 | nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE]))) |
6670 | return -EINVAL; | 6670 | return -EINVAL; |
6671 | 6671 | ||
6672 | if (info->attrs[NL80211_ATTR_BEACON_INTERVAL]) { | ||
6673 | setup.beacon_interval = | ||
6674 | nla_get_u32(info->attrs[NL80211_ATTR_BEACON_INTERVAL]); | ||
6675 | if (setup.beacon_interval < 10 || | ||
6676 | setup.beacon_interval > 10000) | ||
6677 | return -EINVAL; | ||
6678 | } | ||
6679 | |||
6680 | if (info->attrs[NL80211_ATTR_DTIM_PERIOD]) { | ||
6681 | setup.dtim_period = | ||
6682 | nla_get_u32(info->attrs[NL80211_ATTR_DTIM_PERIOD]); | ||
6683 | if (setup.dtim_period < 1 || setup.dtim_period > 100) | ||
6684 | return -EINVAL; | ||
6685 | } | ||
6686 | |||
6672 | if (info->attrs[NL80211_ATTR_MESH_SETUP]) { | 6687 | if (info->attrs[NL80211_ATTR_MESH_SETUP]) { |
6673 | /* parse additional setup parameters if given */ | 6688 | /* parse additional setup parameters if given */ |
6674 | err = nl80211_parse_mesh_setup(info, &setup); | 6689 | err = nl80211_parse_mesh_setup(info, &setup); |