aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_plink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r--net/mac80211/mesh_plink.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 8cc8461b48a0..60ef235c9d9b 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -105,15 +105,15 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
105 return sta; 105 return sta;
106} 106}
107 107
108/** mesh_set_ht_prot_mode - set correct HT protection mode 108/*
109 * mesh_set_ht_prot_mode - set correct HT protection mode
109 * 110 *
110 * Section 9.23.3.5 of IEEE 80211s standard describes the protection rules for 111 * Section 9.23.3.5 of IEEE 80211-2012 describes the protection rules for HT
111 * HT mesh STA in a MBSS. Three HT protection modes are supported for now, 112 * mesh STA in a MBSS. Three HT protection modes are supported for now, non-HT
112 * non-HT mixed mode, 20MHz-protection and no-protection mode. non-HT mixed 113 * mixed mode, 20MHz-protection and no-protection mode. non-HT mixed mode is
113 * mode is selected if any non-HT peers are present in our MBSS. 114 * selected if any non-HT peers are present in our MBSS. 20MHz-protection mode
114 * 20MHz-protection mode is selected if all peers in our 20/40MHz MBSS support 115 * is selected if all peers in our 20/40MHz MBSS support HT and atleast one
115 * HT and atleast one HT20 peer is present. Otherwise no-protection mode is 116 * HT20 peer is present. Otherwise no-protection mode is selected.
116 * selected.
117 */ 117 */
118static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) 118static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
119{ 119{
@@ -128,21 +128,22 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
128 128
129 rcu_read_lock(); 129 rcu_read_lock();
130 list_for_each_entry_rcu(sta, &local->sta_list, list) { 130 list_for_each_entry_rcu(sta, &local->sta_list, list) {
131 if (sdata == sta->sdata && 131 if (sdata != sta->sdata ||
132 sta->plink_state == NL80211_PLINK_ESTAB) { 132 sta->plink_state != NL80211_PLINK_ESTAB)
133 switch (sta->ch_type) { 133 continue;
134 case NL80211_CHAN_NO_HT: 134
135 mpl_dbg("mesh_plink %pM: nonHT sta (%pM) is present", 135 switch (sta->ch_type) {
136 sdata->vif.addr, sta->sta.addr); 136 case NL80211_CHAN_NO_HT:
137 non_ht_sta = true; 137 mpl_dbg("mesh_plink %pM: nonHT sta (%pM) is present",
138 goto out; 138 sdata->vif.addr, sta->sta.addr);
139 case NL80211_CHAN_HT20: 139 non_ht_sta = true;
140 mpl_dbg("mesh_plink %pM: HT20 sta (%pM) is present", 140 goto out;
141 sdata->vif.addr, sta->sta.addr); 141 case NL80211_CHAN_HT20:
142 ht20_sta = true; 142 mpl_dbg("mesh_plink %pM: HT20 sta (%pM) is present",
143 default: 143 sdata->vif.addr, sta->sta.addr);
144 break; 144 ht20_sta = true;
145 } 145 default:
146 break;
146 } 147 }
147 } 148 }
148out: 149out:
@@ -346,6 +347,15 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
346 347
347 sta = sta_info_get(sdata, addr); 348 sta = sta_info_get(sdata, addr);
348 if (!sta) { 349 if (!sta) {
350 /* Userspace handles peer allocation when security is enabled */
351 if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
352 cfg80211_notify_new_peer_candidate(sdata->dev, addr,
353 elems->ie_start,
354 elems->total_len,
355 GFP_ATOMIC);
356 return NULL;
357 }
358
349 sta = mesh_plink_alloc(sdata, addr); 359 sta = mesh_plink_alloc(sdata, addr);
350 if (!sta) 360 if (!sta)
351 return NULL; 361 return NULL;
@@ -387,15 +397,6 @@ void mesh_neighbour_update(struct ieee80211_sub_if_data *sdata,
387{ 397{
388 struct sta_info *sta; 398 struct sta_info *sta;
389 399
390 /* Userspace handles peer allocation when security is enabled */
391 if (sdata->u.mesh.security & IEEE80211_MESH_SEC_AUTHED) {
392 cfg80211_notify_new_peer_candidate(sdata->dev, hw_addr,
393 elems->ie_start,
394 elems->total_len,
395 GFP_KERNEL);
396 return;
397 }
398
399 rcu_read_lock(); 400 rcu_read_lock();
400 sta = mesh_peer_init(sdata, hw_addr, elems); 401 sta = mesh_peer_init(sdata, hw_addr, elems);
401 if (!sta) 402 if (!sta)