diff options
author | Javier Cardona <javier@cozybit.com> | 2011-08-09 19:45:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 13:59:43 -0400 |
commit | 16dd7267f460739b3e29d984e73f05c5ffe2b142 (patch) | |
tree | 2902dddb8d8ef045ae64bff734eb400bf8a23fb7 /net/wireless | |
parent | 0507e159a2b590666982b53ecf6fb2843a5bb423 (diff) |
{nl,cfg,mac}80211: let userspace make meshif mesh gate
Allow userspace to set NL80211_MESHCONF_GATE_ANNOUNCEMENTS attribute,
which will advertise this mesh node as being a mesh gate.
NL80211_HWMP_ROOTMODE must be set or this will do nothing.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/mesh.c | 1 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index b5a39d4d1dcf..4423e64c7d98 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -51,6 +51,7 @@ const struct mesh_config default_mesh_config = { | |||
51 | .path_refresh_time = MESH_PATH_REFRESH_TIME, | 51 | .path_refresh_time = MESH_PATH_REFRESH_TIME, |
52 | .min_discovery_timeout = MESH_MIN_DISCOVERY_TIMEOUT, | 52 | .min_discovery_timeout = MESH_MIN_DISCOVERY_TIMEOUT, |
53 | .dot11MeshHWMPRannInterval = MESH_RANN_INTERVAL, | 53 | .dot11MeshHWMPRannInterval = MESH_RANN_INTERVAL, |
54 | .dot11MeshGateAnnouncementProtocol = false, | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | const struct mesh_setup default_mesh_setup = { | 57 | const struct mesh_setup default_mesh_setup = { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index bbf3d7384a6b..57ecfa4ad3b8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3037,6 +3037,8 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, | |||
3037 | cur_params.dot11MeshHWMPRootMode); | 3037 | cur_params.dot11MeshHWMPRootMode); |
3038 | NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_RANN_INTERVAL, | 3038 | NLA_PUT_U16(msg, NL80211_MESHCONF_HWMP_RANN_INTERVAL, |
3039 | cur_params.dot11MeshHWMPRannInterval); | 3039 | cur_params.dot11MeshHWMPRannInterval); |
3040 | NLA_PUT_U8(msg, NL80211_MESHCONF_GATE_ANNOUNCEMENTS, | ||
3041 | cur_params.dot11MeshGateAnnouncementProtocol); | ||
3040 | nla_nest_end(msg, pinfoattr); | 3042 | nla_nest_end(msg, pinfoattr); |
3041 | genlmsg_end(msg, hdr); | 3043 | genlmsg_end(msg, hdr); |
3042 | return genlmsg_reply(msg, info); | 3044 | return genlmsg_reply(msg, info); |
@@ -3066,6 +3068,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A | |||
3066 | [NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME] = { .type = NLA_U16 }, | 3068 | [NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME] = { .type = NLA_U16 }, |
3067 | [NL80211_MESHCONF_HWMP_ROOTMODE] = { .type = NLA_U8 }, | 3069 | [NL80211_MESHCONF_HWMP_ROOTMODE] = { .type = NLA_U8 }, |
3068 | [NL80211_MESHCONF_HWMP_RANN_INTERVAL] = { .type = NLA_U16 }, | 3070 | [NL80211_MESHCONF_HWMP_RANN_INTERVAL] = { .type = NLA_U16 }, |
3071 | [NL80211_MESHCONF_GATE_ANNOUNCEMENTS] = { .type = NLA_U8 }, | ||
3069 | }; | 3072 | }; |
3070 | 3073 | ||
3071 | static const struct nla_policy | 3074 | static const struct nla_policy |
@@ -3148,6 +3151,10 @@ do {\ | |||
3148 | dot11MeshHWMPRannInterval, mask, | 3151 | dot11MeshHWMPRannInterval, mask, |
3149 | NL80211_MESHCONF_HWMP_RANN_INTERVAL, | 3152 | NL80211_MESHCONF_HWMP_RANN_INTERVAL, |
3150 | nla_get_u16); | 3153 | nla_get_u16); |
3154 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, | ||
3155 | dot11MeshGateAnnouncementProtocol, mask, | ||
3156 | NL80211_MESHCONF_GATE_ANNOUNCEMENTS, | ||
3157 | nla_get_u8); | ||
3151 | if (mask_out) | 3158 | if (mask_out) |
3152 | *mask_out = mask; | 3159 | *mask_out = mask; |
3153 | 3160 | ||