diff options
author | Bob Copeland <me@bobcopeland.com> | 2018-10-25 17:36:34 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-11-09 05:39:44 -0500 |
commit | 01d66fbd5b18ac9f01a6a2ae1278189d19208ad5 (patch) | |
tree | 190d3a18b159c5136f988cfd4475b53b75812b85 | |
parent | dbdaee7aa6e61f56aac61b71a7807e76f92cc895 (diff) |
{nl,mac}80211: add dot11MeshConnectedToMeshGate to meshconf
When userspace is controlling mesh routing, it may have better
knowledge about whether a mesh STA is connected to a mesh
gate than the kernel mpath table. Add dot11MeshConnectedToMeshGate
to the mesh config so that such applications can explicitly
signal that a mesh STA is connected to a gate, which will then
be advertised in the beacon.
Signed-off-by: Bob Copeland <bobcopeland@fb.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/net/cfg80211.h | 5 | ||||
-rw-r--r-- | include/uapi/linux/nl80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 3 | ||||
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 3 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 8 |
6 files changed, 27 insertions, 3 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 24d2db8e082d..16d595b93ba3 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1562,6 +1562,10 @@ struct bss_parameters { | |||
1562 | * @plink_timeout: If no tx activity is seen from a STA we've established | 1562 | * @plink_timeout: If no tx activity is seen from a STA we've established |
1563 | * peering with for longer than this time (in seconds), then remove it | 1563 | * peering with for longer than this time (in seconds), then remove it |
1564 | * from the STA's list of peers. Default is 30 minutes. | 1564 | * from the STA's list of peers. Default is 30 minutes. |
1565 | * @dot11MeshConnectedToMeshGate: if set to true, advertise that this STA is | ||
1566 | * connected to a mesh gate in mesh formation info. If false, the | ||
1567 | * value in mesh formation is determined by the presence of root paths | ||
1568 | * in the mesh path table | ||
1565 | */ | 1569 | */ |
1566 | struct mesh_config { | 1570 | struct mesh_config { |
1567 | u16 dot11MeshRetryTimeout; | 1571 | u16 dot11MeshRetryTimeout; |
@@ -1581,6 +1585,7 @@ struct mesh_config { | |||
1581 | u16 dot11MeshHWMPperrMinInterval; | 1585 | u16 dot11MeshHWMPperrMinInterval; |
1582 | u16 dot11MeshHWMPnetDiameterTraversalTime; | 1586 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
1583 | u8 dot11MeshHWMPRootMode; | 1587 | u8 dot11MeshHWMPRootMode; |
1588 | bool dot11MeshConnectedToMeshGate; | ||
1584 | u16 dot11MeshHWMPRannInterval; | 1589 | u16 dot11MeshHWMPRannInterval; |
1585 | bool dot11MeshGateAnnouncementProtocol; | 1590 | bool dot11MeshGateAnnouncementProtocol; |
1586 | bool dot11MeshForwarding; | 1591 | bool dot11MeshForwarding; |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index ff6005edf32f..51bd85b7d839 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -3117,7 +3117,7 @@ enum nl80211_sta_bss_param { | |||
3117 | * some packets with an FCS error due to TA corruption. Hence this counter | 3117 | * some packets with an FCS error due to TA corruption. Hence this counter |
3118 | * might not be fully accurate. | 3118 | * might not be fully accurate. |
3119 | * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a | 3119 | * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a |
3120 | * mesh gate | 3120 | * mesh gate (u8, 0 or 1) |
3121 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 3121 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
3122 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 3122 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
3123 | */ | 3123 | */ |
@@ -3940,6 +3940,11 @@ enum nl80211_mesh_power_mode { | |||
3940 | * remove it from the STA's list of peers. You may set this to 0 to disable | 3940 | * remove it from the STA's list of peers. You may set this to 0 to disable |
3941 | * the removal of the STA. Default is 30 minutes. | 3941 | * the removal of the STA. Default is 30 minutes. |
3942 | * | 3942 | * |
3943 | * @NL80211_MESHCONF_CONNECTED_TO_GATE: If set to true then this mesh STA | ||
3944 | * will advertise that it is connected to a gate in the mesh formation | ||
3945 | * field. If left unset then the mesh formation field will only | ||
3946 | * advertise such if there is an active root mesh path. | ||
3947 | * | ||
3943 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 3948 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
3944 | */ | 3949 | */ |
3945 | enum nl80211_meshconf_params { | 3950 | enum nl80211_meshconf_params { |
@@ -3972,6 +3977,7 @@ enum nl80211_meshconf_params { | |||
3972 | NL80211_MESHCONF_POWER_MODE, | 3977 | NL80211_MESHCONF_POWER_MODE, |
3973 | NL80211_MESHCONF_AWAKE_WINDOW, | 3978 | NL80211_MESHCONF_AWAKE_WINDOW, |
3974 | NL80211_MESHCONF_PLINK_TIMEOUT, | 3979 | NL80211_MESHCONF_PLINK_TIMEOUT, |
3980 | NL80211_MESHCONF_CONNECTED_TO_GATE, | ||
3975 | 3981 | ||
3976 | /* keep last */ | 3982 | /* keep last */ |
3977 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 3983 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 2fccccfbbf4d..cf8f946ae724 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -2028,6 +2028,9 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy, | |||
2028 | nconf->dot11MeshAwakeWindowDuration; | 2028 | nconf->dot11MeshAwakeWindowDuration; |
2029 | if (_chg_mesh_attr(NL80211_MESHCONF_PLINK_TIMEOUT, mask)) | 2029 | if (_chg_mesh_attr(NL80211_MESHCONF_PLINK_TIMEOUT, mask)) |
2030 | conf->plink_timeout = nconf->plink_timeout; | 2030 | conf->plink_timeout = nconf->plink_timeout; |
2031 | if (_chg_mesh_attr(NL80211_MESHCONF_CONNECTED_TO_GATE, mask)) | ||
2032 | conf->dot11MeshConnectedToMeshGate = | ||
2033 | nconf->dot11MeshConnectedToMeshGate; | ||
2031 | ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON); | 2034 | ieee80211_mbss_info_change_notify(sdata, BSS_CHANGED_BEACON); |
2032 | return 0; | 2035 | return 0; |
2033 | } | 2036 | } |
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index c813207bb123..cff0fb3578c9 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -641,6 +641,8 @@ IEEE80211_IF_FILE(dot11MeshHWMPconfirmationInterval, | |||
641 | IEEE80211_IF_FILE(power_mode, u.mesh.mshcfg.power_mode, DEC); | 641 | IEEE80211_IF_FILE(power_mode, u.mesh.mshcfg.power_mode, DEC); |
642 | IEEE80211_IF_FILE(dot11MeshAwakeWindowDuration, | 642 | IEEE80211_IF_FILE(dot11MeshAwakeWindowDuration, |
643 | u.mesh.mshcfg.dot11MeshAwakeWindowDuration, DEC); | 643 | u.mesh.mshcfg.dot11MeshAwakeWindowDuration, DEC); |
644 | IEEE80211_IF_FILE(dot11MeshConnectedToMeshGate, | ||
645 | u.mesh.mshcfg.dot11MeshConnectedToMeshGate, DEC); | ||
644 | #endif | 646 | #endif |
645 | 647 | ||
646 | #define DEBUGFS_ADD_MODE(name, mode) \ | 648 | #define DEBUGFS_ADD_MODE(name, mode) \ |
@@ -762,6 +764,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata) | |||
762 | MESHPARAMS_ADD(dot11MeshHWMPconfirmationInterval); | 764 | MESHPARAMS_ADD(dot11MeshHWMPconfirmationInterval); |
763 | MESHPARAMS_ADD(power_mode); | 765 | MESHPARAMS_ADD(power_mode); |
764 | MESHPARAMS_ADD(dot11MeshAwakeWindowDuration); | 766 | MESHPARAMS_ADD(dot11MeshAwakeWindowDuration); |
767 | MESHPARAMS_ADD(dot11MeshConnectedToMeshGate); | ||
765 | #undef MESHPARAMS_ADD | 768 | #undef MESHPARAMS_ADD |
766 | } | 769 | } |
767 | #endif | 770 | #endif |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 19205c821dee..4869280a6413 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -255,7 +255,8 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, | |||
255 | u8 *pos, neighbors; | 255 | u8 *pos, neighbors; |
256 | u8 meshconf_len = sizeof(struct ieee80211_meshconf_ie); | 256 | u8 meshconf_len = sizeof(struct ieee80211_meshconf_ie); |
257 | bool is_connected_to_gate = ifmsh->num_gates > 0 || | 257 | bool is_connected_to_gate = ifmsh->num_gates > 0 || |
258 | ifmsh->mshcfg.dot11MeshGateAnnouncementProtocol; | 258 | ifmsh->mshcfg.dot11MeshGateAnnouncementProtocol || |
259 | ifmsh->mshcfg.dot11MeshConnectedToMeshGate; | ||
259 | 260 | ||
260 | if (skb_tailroom(skb) < 2 + meshconf_len) | 261 | if (skb_tailroom(skb) < 2 + meshconf_len) |
261 | return -ENOMEM; | 262 | return -ENOMEM; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f231059242cc..d5f0ffd076b2 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -6275,7 +6275,9 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, | |||
6275 | nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW, | 6275 | nla_put_u16(msg, NL80211_MESHCONF_AWAKE_WINDOW, |
6276 | cur_params.dot11MeshAwakeWindowDuration) || | 6276 | cur_params.dot11MeshAwakeWindowDuration) || |
6277 | nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT, | 6277 | nla_put_u32(msg, NL80211_MESHCONF_PLINK_TIMEOUT, |
6278 | cur_params.plink_timeout)) | 6278 | cur_params.plink_timeout) || |
6279 | nla_put_u8(msg, NL80211_MESHCONF_CONNECTED_TO_GATE, | ||
6280 | cur_params.dot11MeshConnectedToMeshGate)) | ||
6279 | goto nla_put_failure; | 6281 | goto nla_put_failure; |
6280 | nla_nest_end(msg, pinfoattr); | 6282 | nla_nest_end(msg, pinfoattr); |
6281 | genlmsg_end(msg, hdr); | 6283 | genlmsg_end(msg, hdr); |
@@ -6332,6 +6334,7 @@ nl80211_meshconf_params_policy[NL80211_MESHCONF_ATTR_MAX+1] = { | |||
6332 | NL80211_MESH_POWER_MAX), | 6334 | NL80211_MESH_POWER_MAX), |
6333 | [NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 }, | 6335 | [NL80211_MESHCONF_AWAKE_WINDOW] = { .type = NLA_U16 }, |
6334 | [NL80211_MESHCONF_PLINK_TIMEOUT] = { .type = NLA_U32 }, | 6336 | [NL80211_MESHCONF_PLINK_TIMEOUT] = { .type = NLA_U32 }, |
6337 | [NL80211_MESHCONF_CONNECTED_TO_GATE] = NLA_POLICY_RANGE(NLA_U8, 0, 1), | ||
6335 | }; | 6338 | }; |
6336 | 6339 | ||
6337 | static const struct nla_policy | 6340 | static const struct nla_policy |
@@ -6443,6 +6446,9 @@ do { \ | |||
6443 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, mask, | 6446 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, mask, |
6444 | NL80211_MESHCONF_RSSI_THRESHOLD, | 6447 | NL80211_MESHCONF_RSSI_THRESHOLD, |
6445 | nla_get_s32); | 6448 | nla_get_s32); |
6449 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshConnectedToMeshGate, mask, | ||
6450 | NL80211_MESHCONF_CONNECTED_TO_GATE, | ||
6451 | nla_get_u8); | ||
6446 | /* | 6452 | /* |
6447 | * Check HT operation mode based on | 6453 | * Check HT operation mode based on |
6448 | * IEEE 802.11-2016 9.4.2.57 HT Operation element. | 6454 | * IEEE 802.11-2016 9.4.2.57 HT Operation element. |