diff options
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 1159bdb4119c..a8bbdeca013a 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -93,7 +93,7 @@ static inline void mesh_plink_fsm_restart(struct sta_info *sta) | |||
93 | * on it in the lifecycle management section! | 93 | * on it in the lifecycle management section! |
94 | */ | 94 | */ |
95 | static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, | 95 | static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, |
96 | u8 *hw_addr, u64 rates) | 96 | u8 *hw_addr, u32 rates) |
97 | { | 97 | { |
98 | struct ieee80211_local *local = sdata->local; | 98 | struct ieee80211_local *local = sdata->local; |
99 | struct sta_info *sta; | 99 | struct sta_info *sta; |
@@ -218,11 +218,11 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | |||
218 | memcpy(pos, &reason, 2); | 218 | memcpy(pos, &reason, 2); |
219 | } | 219 | } |
220 | 220 | ||
221 | ieee80211_tx_skb(sdata, skb, 0); | 221 | ieee80211_tx_skb(sdata, skb, 1); |
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct ieee80211_sub_if_data *sdata, | 225 | void mesh_neighbour_update(u8 *hw_addr, u32 rates, struct ieee80211_sub_if_data *sdata, |
226 | bool peer_accepting_plinks) | 226 | bool peer_accepting_plinks) |
227 | { | 227 | { |
228 | struct ieee80211_local *local = sdata->local; | 228 | struct ieee80211_local *local = sdata->local; |
@@ -361,36 +361,6 @@ void mesh_plink_block(struct sta_info *sta) | |||
361 | spin_unlock_bh(&sta->lock); | 361 | spin_unlock_bh(&sta->lock); |
362 | } | 362 | } |
363 | 363 | ||
364 | int mesh_plink_close(struct sta_info *sta) | ||
365 | { | ||
366 | struct ieee80211_sub_if_data *sdata = sta->sdata; | ||
367 | __le16 llid, plid, reason; | ||
368 | |||
369 | mpl_dbg("Mesh plink: closing link with %pM\n", sta->sta.addr); | ||
370 | spin_lock_bh(&sta->lock); | ||
371 | sta->reason = cpu_to_le16(MESH_LINK_CANCELLED); | ||
372 | reason = sta->reason; | ||
373 | |||
374 | if (sta->plink_state == PLINK_LISTEN || | ||
375 | sta->plink_state == PLINK_BLOCKED) { | ||
376 | mesh_plink_fsm_restart(sta); | ||
377 | spin_unlock_bh(&sta->lock); | ||
378 | return 0; | ||
379 | } else if (sta->plink_state == PLINK_ESTAB) { | ||
380 | __mesh_plink_deactivate(sta); | ||
381 | /* The timer should not be running */ | ||
382 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | ||
383 | } else if (!mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata))) | ||
384 | sta->ignore_plink_timer = true; | ||
385 | |||
386 | sta->plink_state = PLINK_HOLDING; | ||
387 | llid = sta->llid; | ||
388 | plid = sta->plid; | ||
389 | spin_unlock_bh(&sta->lock); | ||
390 | mesh_plink_frame_tx(sta->sdata, PLINK_CLOSE, sta->sta.addr, llid, | ||
391 | plid, reason); | ||
392 | return 0; | ||
393 | } | ||
394 | 364 | ||
395 | void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, | 365 | void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, |
396 | size_t len, struct ieee80211_rx_status *rx_status) | 366 | size_t len, struct ieee80211_rx_status *rx_status) |
@@ -477,7 +447,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
477 | spin_lock_bh(&sta->lock); | 447 | spin_lock_bh(&sta->lock); |
478 | } else if (!sta) { | 448 | } else if (!sta) { |
479 | /* ftype == PLINK_OPEN */ | 449 | /* ftype == PLINK_OPEN */ |
480 | u64 rates; | 450 | u32 rates; |
481 | if (!mesh_plink_free_count(sdata)) { | 451 | if (!mesh_plink_free_count(sdata)) { |
482 | mpl_dbg("Mesh plink error: no more free plinks\n"); | 452 | mpl_dbg("Mesh plink error: no more free plinks\n"); |
483 | rcu_read_unlock(); | 453 | rcu_read_unlock(); |