aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c30
-rw-r--r--net/mac80211/sta_info.h23
-rw-r--r--net/wireless/nl80211.c6
3 files changed, 27 insertions, 32 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 18c2555e04e6..51f775772d9e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -734,15 +734,27 @@ static void sta_apply_parameters(struct ieee80211_local *local,
734 params->ht_capa, 734 params->ht_capa,
735 &sta->sta.ht_cap); 735 &sta->sta.ht_cap);
736 736
737 if (ieee80211_vif_is_mesh(&sdata->vif) && params->plink_action) { 737 if (ieee80211_vif_is_mesh(&sdata->vif)) {
738 switch (params->plink_action) { 738 if (sdata->u.mesh.security & IEEE80211_MESH_SEC_SECURED)
739 case PLINK_ACTION_OPEN: 739 switch (params->plink_state) {
740 mesh_plink_open(sta); 740 case PLINK_LISTEN:
741 break; 741 case PLINK_ESTAB:
742 case PLINK_ACTION_BLOCK: 742 case PLINK_BLOCKED:
743 mesh_plink_block(sta); 743 sta->plink_state = params->plink_state;
744 break; 744 break;
745 } 745 default:
746 /* nothing */
747 break;
748 }
749 else
750 switch (params->plink_action) {
751 case PLINK_ACTION_OPEN:
752 mesh_plink_open(sta);
753 break;
754 case PLINK_ACTION_BLOCK:
755 mesh_plink_block(sta);
756 break;
757 }
746 } 758 }
747} 759}
748 760
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index af1a7f8c8675..f00b4dcb49d7 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -174,29 +174,6 @@ struct sta_ampdu_mlme {
174 174
175 175
176/** 176/**
177 * enum plink_state - state of a mesh peer link finite state machine
178 *
179 * @PLINK_LISTEN: initial state, considered the implicit state of non existant
180 * mesh peer links
181 * @PLINK_OPN_SNT: mesh plink open frame has been sent to this mesh peer
182 * @PLINK_OPN_RCVD: mesh plink open frame has been received from this mesh peer
183 * @PLINK_CNF_RCVD: mesh plink confirm frame has been received from this mesh
184 * peer
185 * @PLINK_ESTAB: mesh peer link is established
186 * @PLINK_HOLDING: mesh peer link is being closed or cancelled
187 * @PLINK_BLOCKED: all frames transmitted from this mesh plink are discarded
188 */
189enum plink_state {
190 PLINK_LISTEN,
191 PLINK_OPN_SNT,
192 PLINK_OPN_RCVD,
193 PLINK_CNF_RCVD,
194 PLINK_ESTAB,
195 PLINK_HOLDING,
196 PLINK_BLOCKED
197};
198
199/**
200 * struct sta_info - STA information 177 * struct sta_info - STA information
201 * 178 *
202 * This structure collects information about a station that 179 * This structure collects information about a station that
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 64efc2d7a7ad..f698c1d116e4 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -174,6 +174,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
174 [NL80211_ATTR_OFFCHANNEL_TX_OK] = { .type = NLA_FLAG }, 174 [NL80211_ATTR_OFFCHANNEL_TX_OK] = { .type = NLA_FLAG },
175 [NL80211_ATTR_KEY_DEFAULT_TYPES] = { .type = NLA_NESTED }, 175 [NL80211_ATTR_KEY_DEFAULT_TYPES] = { .type = NLA_NESTED },
176 [NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED }, 176 [NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED },
177 [NL80211_ATTR_STA_PLINK_STATE] = { .type = NLA_U8 },
177}; 178};
178 179
179/* policy for the key attributes */ 180/* policy for the key attributes */
@@ -2247,6 +2248,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
2247 memset(&params, 0, sizeof(params)); 2248 memset(&params, 0, sizeof(params));
2248 2249
2249 params.listen_interval = -1; 2250 params.listen_interval = -1;
2251 params.plink_state = PLINK_INVALID;
2250 2252
2251 if (info->attrs[NL80211_ATTR_STA_AID]) 2253 if (info->attrs[NL80211_ATTR_STA_AID])
2252 return -EINVAL; 2254 return -EINVAL;
@@ -2278,6 +2280,10 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
2278 params.plink_action = 2280 params.plink_action =
2279 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]); 2281 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_ACTION]);
2280 2282
2283 if (info->attrs[NL80211_ATTR_STA_PLINK_STATE])
2284 params.plink_state =
2285 nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_STATE]);
2286
2281 err = get_vlan(info, rdev, &params.vlan); 2287 err = get_vlan(info, rdev, &params.vlan);
2282 if (err) 2288 if (err)
2283 goto out; 2289 goto out;