diff options
author | Bob Copeland <me@bobcopeland.com> | 2015-07-14 08:31:57 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-07-17 09:47:02 -0400 |
commit | fa87a6566ca8f17a92ba81980bd47c456262907c (patch) | |
tree | 03653011e3c6d2f2460b1d078651cb1c9d852e97 /net/mac80211 | |
parent | b0485e9f3defbed6effcde595df9b9fdbdb2524e (diff) |
mac80211: reorder mesh_plink to remove forward decl
Move mesh_plink_frame_tx() above the first caller to remove
the forward declaration.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mesh_plink.c | 109 |
1 files changed, 52 insertions, 57 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index ac1029f28133..a5aa0345dd7e 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -53,11 +53,6 @@ static const char * const mplevents[] = { | |||
53 | [CLS_IGNR] = "CLS_IGNR" | 53 | [CLS_IGNR] = "CLS_IGNR" |
54 | }; | 54 | }; |
55 | 55 | ||
56 | static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | ||
57 | enum ieee80211_self_protected_actioncode action, | ||
58 | u8 *da, u16 llid, u16 plid, u16 reason); | ||
59 | |||
60 | |||
61 | /* We only need a valid sta if user configured a minimum rssi_threshold. */ | 56 | /* We only need a valid sta if user configured a minimum rssi_threshold. */ |
62 | static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata, | 57 | static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata, |
63 | struct sta_info *sta) | 58 | struct sta_info *sta) |
@@ -204,58 +199,6 @@ static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata) | |||
204 | return BSS_CHANGED_HT; | 199 | return BSS_CHANGED_HT; |
205 | } | 200 | } |
206 | 201 | ||
207 | /** | ||
208 | * __mesh_plink_deactivate - deactivate mesh peer link | ||
209 | * | ||
210 | * @sta: mesh peer link to deactivate | ||
211 | * | ||
212 | * All mesh paths with this peer as next hop will be flushed | ||
213 | * Returns beacon changed flag if the beacon content changed. | ||
214 | * | ||
215 | * Locking: the caller must hold sta->mesh->plink_lock | ||
216 | */ | ||
217 | static u32 __mesh_plink_deactivate(struct sta_info *sta) | ||
218 | { | ||
219 | struct ieee80211_sub_if_data *sdata = sta->sdata; | ||
220 | u32 changed = 0; | ||
221 | |||
222 | lockdep_assert_held(&sta->mesh->plink_lock); | ||
223 | |||
224 | if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) | ||
225 | changed = mesh_plink_dec_estab_count(sdata); | ||
226 | sta->mesh->plink_state = NL80211_PLINK_BLOCKED; | ||
227 | mesh_path_flush_by_nexthop(sta); | ||
228 | |||
229 | ieee80211_mps_sta_status_update(sta); | ||
230 | changed |= ieee80211_mps_set_sta_local_pm(sta, | ||
231 | NL80211_MESH_POWER_UNKNOWN); | ||
232 | |||
233 | return changed; | ||
234 | } | ||
235 | |||
236 | /** | ||
237 | * mesh_plink_deactivate - deactivate mesh peer link | ||
238 | * | ||
239 | * @sta: mesh peer link to deactivate | ||
240 | * | ||
241 | * All mesh paths with this peer as next hop will be flushed | ||
242 | */ | ||
243 | u32 mesh_plink_deactivate(struct sta_info *sta) | ||
244 | { | ||
245 | struct ieee80211_sub_if_data *sdata = sta->sdata; | ||
246 | u32 changed; | ||
247 | |||
248 | spin_lock_bh(&sta->mesh->plink_lock); | ||
249 | changed = __mesh_plink_deactivate(sta); | ||
250 | sta->mesh->reason = WLAN_REASON_MESH_PEER_CANCELED; | ||
251 | mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, | ||
252 | sta->sta.addr, sta->mesh->llid, sta->mesh->plid, | ||
253 | sta->mesh->reason); | ||
254 | spin_unlock_bh(&sta->mesh->plink_lock); | ||
255 | |||
256 | return changed; | ||
257 | } | ||
258 | |||
259 | static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, | 202 | static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, |
260 | enum ieee80211_self_protected_actioncode action, | 203 | enum ieee80211_self_protected_actioncode action, |
261 | u8 *da, u16 llid, u16 plid, u16 reason) | 204 | u8 *da, u16 llid, u16 plid, u16 reason) |
@@ -375,6 +318,58 @@ free: | |||
375 | return err; | 318 | return err; |
376 | } | 319 | } |
377 | 320 | ||
321 | /** | ||
322 | * __mesh_plink_deactivate - deactivate mesh peer link | ||
323 | * | ||
324 | * @sta: mesh peer link to deactivate | ||
325 | * | ||
326 | * All mesh paths with this peer as next hop will be flushed | ||
327 | * Returns beacon changed flag if the beacon content changed. | ||
328 | * | ||
329 | * Locking: the caller must hold sta->mesh->plink_lock | ||
330 | */ | ||
331 | static u32 __mesh_plink_deactivate(struct sta_info *sta) | ||
332 | { | ||
333 | struct ieee80211_sub_if_data *sdata = sta->sdata; | ||
334 | u32 changed = 0; | ||
335 | |||
336 | lockdep_assert_held(&sta->mesh->plink_lock); | ||
337 | |||
338 | if (sta->mesh->plink_state == NL80211_PLINK_ESTAB) | ||
339 | changed = mesh_plink_dec_estab_count(sdata); | ||
340 | sta->mesh->plink_state = NL80211_PLINK_BLOCKED; | ||
341 | mesh_path_flush_by_nexthop(sta); | ||
342 | |||
343 | ieee80211_mps_sta_status_update(sta); | ||
344 | changed |= ieee80211_mps_set_sta_local_pm(sta, | ||
345 | NL80211_MESH_POWER_UNKNOWN); | ||
346 | |||
347 | return changed; | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * mesh_plink_deactivate - deactivate mesh peer link | ||
352 | * | ||
353 | * @sta: mesh peer link to deactivate | ||
354 | * | ||
355 | * All mesh paths with this peer as next hop will be flushed | ||
356 | */ | ||
357 | u32 mesh_plink_deactivate(struct sta_info *sta) | ||
358 | { | ||
359 | struct ieee80211_sub_if_data *sdata = sta->sdata; | ||
360 | u32 changed; | ||
361 | |||
362 | spin_lock_bh(&sta->mesh->plink_lock); | ||
363 | changed = __mesh_plink_deactivate(sta); | ||
364 | sta->mesh->reason = WLAN_REASON_MESH_PEER_CANCELED; | ||
365 | mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, | ||
366 | sta->sta.addr, sta->mesh->llid, sta->mesh->plid, | ||
367 | sta->mesh->reason); | ||
368 | spin_unlock_bh(&sta->mesh->plink_lock); | ||
369 | |||
370 | return changed; | ||
371 | } | ||
372 | |||
378 | static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, | 373 | static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, |
379 | struct sta_info *sta, | 374 | struct sta_info *sta, |
380 | struct ieee802_11_elems *elems, bool insert) | 375 | struct ieee802_11_elems *elems, bool insert) |