diff options
author | Javier Cardona <javier@cozybit.com> | 2011-08-09 19:45:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 13:59:43 -0400 |
commit | 0507e159a2b590666982b53ecf6fb2843a5bb423 (patch) | |
tree | a5c0aefae3ea789fb1b0ef9019372e534b93aecc /net/mac80211 | |
parent | 699403dbd41998a56d1d92d612ac261e5085a99f (diff) |
{nl,cfg,mac}80211: let userspace set RANN interval
Allow userspace to set Root Announcement Interval for our mesh
interface. Also, RANN interval is now in proper units of TUs.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 4 | ||||
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh.h | 1 | ||||
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 8 |
5 files changed, 13 insertions, 6 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index c1fa5775cef2..9995c83c2420 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1137,6 +1137,10 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy, | |||
1137 | conf->dot11MeshHWMPRootMode = nconf->dot11MeshHWMPRootMode; | 1137 | conf->dot11MeshHWMPRootMode = nconf->dot11MeshHWMPRootMode; |
1138 | ieee80211_mesh_root_setup(ifmsh); | 1138 | ieee80211_mesh_root_setup(ifmsh); |
1139 | } | 1139 | } |
1140 | if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask)) { | ||
1141 | conf->dot11MeshHWMPRannInterval = | ||
1142 | nconf->dot11MeshHWMPRannInterval; | ||
1143 | } | ||
1140 | return 0; | 1144 | return 0; |
1141 | } | 1145 | } |
1142 | 1146 | ||
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 75ece3d3b6dd..bac94434a874 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -372,6 +372,8 @@ IEEE80211_IF_FILE(min_discovery_timeout, | |||
372 | u.mesh.mshcfg.min_discovery_timeout, DEC); | 372 | u.mesh.mshcfg.min_discovery_timeout, DEC); |
373 | IEEE80211_IF_FILE(dot11MeshHWMPRootMode, | 373 | IEEE80211_IF_FILE(dot11MeshHWMPRootMode, |
374 | u.mesh.mshcfg.dot11MeshHWMPRootMode, DEC); | 374 | u.mesh.mshcfg.dot11MeshHWMPRootMode, DEC); |
375 | IEEE80211_IF_FILE(dot11MeshHWMPRannInterval, | ||
376 | u.mesh.mshcfg.dot11MeshHWMPRannInterval, DEC); | ||
375 | #endif | 377 | #endif |
376 | 378 | ||
377 | 379 | ||
@@ -486,6 +488,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata) | |||
486 | MESHPARAMS_ADD(path_refresh_time); | 488 | MESHPARAMS_ADD(path_refresh_time); |
487 | MESHPARAMS_ADD(min_discovery_timeout); | 489 | MESHPARAMS_ADD(min_discovery_timeout); |
488 | MESHPARAMS_ADD(dot11MeshHWMPRootMode); | 490 | MESHPARAMS_ADD(dot11MeshHWMPRootMode); |
491 | MESHPARAMS_ADD(dot11MeshHWMPRannInterval); | ||
489 | #undef MESHPARAMS_ADD | 492 | #undef MESHPARAMS_ADD |
490 | } | 493 | } |
491 | #endif | 494 | #endif |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index e120fefb4e40..1c4f53c31ae5 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -537,7 +537,8 @@ static void ieee80211_mesh_rootpath(struct ieee80211_sub_if_data *sdata) | |||
537 | 537 | ||
538 | mesh_path_tx_root_frame(sdata); | 538 | mesh_path_tx_root_frame(sdata); |
539 | mod_timer(&ifmsh->mesh_path_root_timer, | 539 | mod_timer(&ifmsh->mesh_path_root_timer, |
540 | round_jiffies(jiffies + IEEE80211_MESH_RANN_INTERVAL)); | 540 | round_jiffies(jiffies + |
541 | usecs_to_jiffies(ifmsh->mshcfg.dot11MeshHWMPRannInterval * 1024))); | ||
541 | } | 542 | } |
542 | 543 | ||
543 | #ifdef CONFIG_PM | 544 | #ifdef CONFIG_PM |
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 9d9116e1a9ac..20272072171f 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -175,7 +175,6 @@ struct mesh_rmc { | |||
175 | 175 | ||
176 | #define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ) | 176 | #define IEEE80211_MESH_PEER_INACTIVITY_LIMIT (1800 * HZ) |
177 | #define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ) | 177 | #define IEEE80211_MESH_HOUSEKEEPING_INTERVAL (60 * HZ) |
178 | #define IEEE80211_MESH_RANN_INTERVAL (1 * HZ) | ||
179 | 178 | ||
180 | #define MESH_DEFAULT_BEACON_INTERVAL 1000 /* in 1024 us units */ | 179 | #define MESH_DEFAULT_BEACON_INTERVAL 1000 /* in 1024 us units */ |
181 | 180 | ||
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 7b517c46100d..ae3de755fada 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -695,7 +695,7 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, | |||
695 | u8 ttl, flags, hopcount; | 695 | u8 ttl, flags, hopcount; |
696 | u8 *orig_addr; | 696 | u8 *orig_addr; |
697 | u32 orig_sn, metric; | 697 | u32 orig_sn, metric; |
698 | u32 interval = cpu_to_le32(IEEE80211_MESH_RANN_INTERVAL); | 698 | u32 interval = ifmsh->mshcfg.dot11MeshHWMPRannInterval; |
699 | bool root_is_gate; | 699 | bool root_is_gate; |
700 | 700 | ||
701 | ttl = rann->rann_ttl; | 701 | ttl = rann->rann_ttl; |
@@ -743,7 +743,7 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, | |||
743 | mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr, | 743 | mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr, |
744 | cpu_to_le32(orig_sn), | 744 | cpu_to_le32(orig_sn), |
745 | 0, NULL, 0, broadcast_addr, | 745 | 0, NULL, 0, broadcast_addr, |
746 | hopcount, ttl, interval, | 746 | hopcount, ttl, cpu_to_le32(interval), |
747 | cpu_to_le32(metric + mpath->metric), | 747 | cpu_to_le32(metric + mpath->metric), |
748 | 0, sdata); | 748 | 0, sdata); |
749 | mpath->sn = orig_sn; | 749 | mpath->sn = orig_sn; |
@@ -1044,11 +1044,11 @@ void | |||
1044 | mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) | 1044 | mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) |
1045 | { | 1045 | { |
1046 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | 1046 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
1047 | u32 interval = cpu_to_le32(IEEE80211_MESH_RANN_INTERVAL); | 1047 | u32 interval = ifmsh->mshcfg.dot11MeshHWMPRannInterval; |
1048 | 1048 | ||
1049 | mesh_path_sel_frame_tx(MPATH_RANN, 0, sdata->vif.addr, | 1049 | mesh_path_sel_frame_tx(MPATH_RANN, 0, sdata->vif.addr, |
1050 | cpu_to_le32(++ifmsh->sn), | 1050 | cpu_to_le32(++ifmsh->sn), |
1051 | 0, NULL, 0, broadcast_addr, | 1051 | 0, NULL, 0, broadcast_addr, |
1052 | 0, sdata->u.mesh.mshcfg.element_ttl, | 1052 | 0, sdata->u.mesh.mshcfg.element_ttl, |
1053 | interval, 0, 0, sdata); | 1053 | cpu_to_le32(interval), 0, 0, sdata); |
1054 | } | 1054 | } |