2 * Copyright (c) 2008, 2009 open80211s Ltd.
3 * Author: Luis Carlos Cobo <luisca@cozybit.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
10 #include <linux/etherdevice.h>
11 #include <linux/list.h>
12 #include <linux/random.h>
13 #include <linux/slab.h>
14 #include <linux/spinlock.h>
15 #include <linux/string.h>
16 #include <net/mac80211.h>
18 #include "ieee80211_i.h"
21 static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath);
23 static u32 mesh_table_hash(const void *addr, u32 len, u32 seed)
25 /* Use last four bytes of hw addr as hash index */
26 return jhash_1word(__get_unaligned_cpu32((u8 *)addr + 2), seed);
29 static const struct rhashtable_params mesh_rht_params = {
31 .automatic_shrinking = true,
33 .key_offset = offsetof(struct mesh_path, dst),
34 .head_offset = offsetof(struct mesh_path, rhash),
35 .hashfn = mesh_table_hash,
38 static inline bool mpath_expired(struct mesh_path *mpath)
40 return (mpath->flags & MESH_PATH_ACTIVE) &&
41 time_after(jiffies, mpath->exp_time) &&
42 !(mpath->flags & MESH_PATH_FIXED);
45 static void mesh_path_rht_free(void *ptr, void *tblptr)
47 struct mesh_path *mpath = ptr;
48 struct mesh_table *tbl = tblptr;
50 mesh_path_free_rcu(tbl, mpath);
53 static struct mesh_table *mesh_table_alloc(void)
55 struct mesh_table *newtbl;
57 newtbl = kmalloc(sizeof(struct mesh_table), GFP_ATOMIC);
61 INIT_HLIST_HEAD(&newtbl->known_gates);
62 INIT_HLIST_HEAD(&newtbl->walk_head);
63 atomic_set(&newtbl->entries, 0);
64 spin_lock_init(&newtbl->gates_lock);
65 spin_lock_init(&newtbl->walk_lock);
66 rhashtable_init(&newtbl->rhead, &mesh_rht_params);
71 static void mesh_table_free(struct mesh_table *tbl)
73 rhashtable_free_and_destroy(&tbl->rhead,
74 mesh_path_rht_free, tbl);
80 * mesh_path_assign_nexthop - update mesh path next hop
82 * @mpath: mesh path to update
83 * @sta: next hop to assign
85 * Locking: mpath->state_lock must be held when calling this function
87 void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
90 struct ieee80211_hdr *hdr;
93 rcu_assign_pointer(mpath->next_hop, sta);
95 spin_lock_irqsave(&mpath->frame_queue.lock, flags);
96 skb_queue_walk(&mpath->frame_queue, skb) {
97 hdr = (struct ieee80211_hdr *) skb->data;
98 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
99 memcpy(hdr->addr2, mpath->sdata->vif.addr, ETH_ALEN);
100 ieee80211_mps_set_frame_flags(sta->sdata, sta, hdr);
103 spin_unlock_irqrestore(&mpath->frame_queue.lock, flags);
106 static void prepare_for_gate(struct sk_buff *skb, char *dst_addr,
107 struct mesh_path *gate_mpath)
109 struct ieee80211_hdr *hdr;
110 struct ieee80211s_hdr *mshdr;
111 int mesh_hdrlen, hdrlen;
114 hdr = (struct ieee80211_hdr *) skb->data;
115 hdrlen = ieee80211_hdrlen(hdr->frame_control);
116 mshdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
118 if (!(mshdr->flags & MESH_FLAGS_AE)) {
119 /* size of the fixed part of the mesh header */
122 /* make room for the two extended addresses */
123 skb_push(skb, 2 * ETH_ALEN);
124 memmove(skb->data, hdr, hdrlen + mesh_hdrlen);
126 hdr = (struct ieee80211_hdr *) skb->data;
128 /* we preserve the previous mesh header and only add
129 * the new addreses */
130 mshdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
131 mshdr->flags = MESH_FLAGS_AE_A5_A6;
132 memcpy(mshdr->eaddr1, hdr->addr3, ETH_ALEN);
133 memcpy(mshdr->eaddr2, hdr->addr4, ETH_ALEN);
136 /* update next hop */
137 hdr = (struct ieee80211_hdr *) skb->data;
139 next_hop = rcu_dereference(gate_mpath->next_hop)->sta.addr;
140 memcpy(hdr->addr1, next_hop, ETH_ALEN);
142 memcpy(hdr->addr2, gate_mpath->sdata->vif.addr, ETH_ALEN);
143 memcpy(hdr->addr3, dst_addr, ETH_ALEN);
148 * mesh_path_move_to_queue - Move or copy frames from one mpath queue to another
150 * This function is used to transfer or copy frames from an unresolved mpath to
151 * a gate mpath. The function also adds the Address Extension field and
152 * updates the next hop.
154 * If a frame already has an Address Extension field, only the next hop and
155 * destination addresses are updated.
157 * The gate mpath must be an active mpath with a valid mpath->next_hop.
159 * @mpath: An active mpath the frames will be sent to (i.e. the gate)
160 * @from_mpath: The failed mpath
161 * @copy: When true, copy all the frames to the new mpath queue. When false,
164 static void mesh_path_move_to_queue(struct mesh_path *gate_mpath,
165 struct mesh_path *from_mpath,
168 struct sk_buff *skb, *fskb, *tmp;
169 struct sk_buff_head failq;
172 if (WARN_ON(gate_mpath == from_mpath))
174 if (WARN_ON(!gate_mpath->next_hop))
177 __skb_queue_head_init(&failq);
179 spin_lock_irqsave(&from_mpath->frame_queue.lock, flags);
180 skb_queue_splice_init(&from_mpath->frame_queue, &failq);
181 spin_unlock_irqrestore(&from_mpath->frame_queue.lock, flags);
183 skb_queue_walk_safe(&failq, fskb, tmp) {
184 if (skb_queue_len(&gate_mpath->frame_queue) >=
185 MESH_FRAME_QUEUE_LEN) {
186 mpath_dbg(gate_mpath->sdata, "mpath queue full!\n");
190 skb = skb_copy(fskb, GFP_ATOMIC);
194 prepare_for_gate(skb, gate_mpath->dst, gate_mpath);
195 skb_queue_tail(&gate_mpath->frame_queue, skb);
200 __skb_unlink(fskb, &failq);
204 mpath_dbg(gate_mpath->sdata, "Mpath queue for gate %pM has %d frames\n",
205 gate_mpath->dst, skb_queue_len(&gate_mpath->frame_queue));
210 spin_lock_irqsave(&from_mpath->frame_queue.lock, flags);
211 skb_queue_splice(&failq, &from_mpath->frame_queue);
212 spin_unlock_irqrestore(&from_mpath->frame_queue.lock, flags);
216 static struct mesh_path *mpath_lookup(struct mesh_table *tbl, const u8 *dst,
217 struct ieee80211_sub_if_data *sdata)
219 struct mesh_path *mpath;
221 mpath = rhashtable_lookup_fast(&tbl->rhead, dst, mesh_rht_params);
223 if (mpath && mpath_expired(mpath)) {
224 spin_lock_bh(&mpath->state_lock);
225 mpath->flags &= ~MESH_PATH_ACTIVE;
226 spin_unlock_bh(&mpath->state_lock);
232 * mesh_path_lookup - look up a path in the mesh path table
233 * @sdata: local subif
234 * @dst: hardware address (ETH_ALEN length) of destination
236 * Returns: pointer to the mesh path structure, or NULL if not found
238 * Locking: must be called within a read rcu section.
241 mesh_path_lookup(struct ieee80211_sub_if_data *sdata, const u8 *dst)
243 return mpath_lookup(sdata->u.mesh.mesh_paths, dst, sdata);
247 mpp_path_lookup(struct ieee80211_sub_if_data *sdata, const u8 *dst)
249 return mpath_lookup(sdata->u.mesh.mpp_paths, dst, sdata);
252 static struct mesh_path *
253 __mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx)
256 struct mesh_path *mpath;
258 hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) {
266 if (mpath_expired(mpath)) {
267 spin_lock_bh(&mpath->state_lock);
268 mpath->flags &= ~MESH_PATH_ACTIVE;
269 spin_unlock_bh(&mpath->state_lock);
275 * mesh_path_lookup_by_idx - look up a path in the mesh path table by its index
277 * @sdata: local subif, or NULL for all entries
279 * Returns: pointer to the mesh path structure, or NULL if not found.
281 * Locking: must be called within a read rcu section.
284 mesh_path_lookup_by_idx(struct ieee80211_sub_if_data *sdata, int idx)
286 return __mesh_path_lookup_by_idx(sdata->u.mesh.mesh_paths, idx);
290 * mpp_path_lookup_by_idx - look up a path in the proxy path table by its index
292 * @sdata: local subif, or NULL for all entries
294 * Returns: pointer to the proxy path structure, or NULL if not found.
296 * Locking: must be called within a read rcu section.
299 mpp_path_lookup_by_idx(struct ieee80211_sub_if_data *sdata, int idx)
301 return __mesh_path_lookup_by_idx(sdata->u.mesh.mpp_paths, idx);
305 * mesh_path_add_gate - add the given mpath to a mesh gate to our path table
306 * @mpath: gate path to add to table
308 int mesh_path_add_gate(struct mesh_path *mpath)
310 struct mesh_table *tbl;
314 tbl = mpath->sdata->u.mesh.mesh_paths;
316 spin_lock_bh(&mpath->state_lock);
317 if (mpath->is_gate) {
319 spin_unlock_bh(&mpath->state_lock);
322 mpath->is_gate = true;
323 mpath->sdata->u.mesh.num_gates++;
325 spin_lock(&tbl->gates_lock);
326 hlist_add_head_rcu(&mpath->gate_list, &tbl->known_gates);
327 spin_unlock(&tbl->gates_lock);
329 spin_unlock_bh(&mpath->state_lock);
331 mpath_dbg(mpath->sdata,
332 "Mesh path: Recorded new gate: %pM. %d known gates\n",
333 mpath->dst, mpath->sdata->u.mesh.num_gates);
341 * mesh_gate_del - remove a mesh gate from the list of known gates
342 * @tbl: table which holds our list of known gates
345 static void mesh_gate_del(struct mesh_table *tbl, struct mesh_path *mpath)
347 lockdep_assert_held(&mpath->state_lock);
351 mpath->is_gate = false;
352 spin_lock_bh(&tbl->gates_lock);
353 hlist_del_rcu(&mpath->gate_list);
354 mpath->sdata->u.mesh.num_gates--;
355 spin_unlock_bh(&tbl->gates_lock);
357 mpath_dbg(mpath->sdata,
358 "Mesh path: Deleted gate: %pM. %d known gates\n",
359 mpath->dst, mpath->sdata->u.mesh.num_gates);
363 * mesh_gate_num - number of gates known to this interface
366 int mesh_gate_num(struct ieee80211_sub_if_data *sdata)
368 return sdata->u.mesh.num_gates;
372 struct mesh_path *mesh_path_new(struct ieee80211_sub_if_data *sdata,
373 const u8 *dst, gfp_t gfp_flags)
375 struct mesh_path *new_mpath;
377 new_mpath = kzalloc(sizeof(struct mesh_path), gfp_flags);
381 memcpy(new_mpath->dst, dst, ETH_ALEN);
382 eth_broadcast_addr(new_mpath->rann_snd_addr);
383 new_mpath->is_root = false;
384 new_mpath->sdata = sdata;
385 new_mpath->flags = 0;
386 skb_queue_head_init(&new_mpath->frame_queue);
387 new_mpath->exp_time = jiffies;
388 spin_lock_init(&new_mpath->state_lock);
389 timer_setup(&new_mpath->timer, mesh_path_timer, 0);
395 * mesh_path_add - allocate and add a new path to the mesh path table
396 * @dst: destination address of the path (ETH_ALEN length)
397 * @sdata: local subif
399 * Returns: 0 on success
401 * State: the initial state of the new path is set to 0
403 struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata,
406 struct mesh_table *tbl;
407 struct mesh_path *mpath, *new_mpath;
410 if (ether_addr_equal(dst, sdata->vif.addr))
411 /* never add ourselves as neighbours */
412 return ERR_PTR(-ENOTSUPP);
414 if (is_multicast_ether_addr(dst))
415 return ERR_PTR(-ENOTSUPP);
417 if (atomic_add_unless(&sdata->u.mesh.mpaths, 1, MESH_MAX_MPATHS) == 0)
418 return ERR_PTR(-ENOSPC);
420 new_mpath = mesh_path_new(sdata, dst, GFP_ATOMIC);
422 return ERR_PTR(-ENOMEM);
424 tbl = sdata->u.mesh.mesh_paths;
425 spin_lock_bh(&tbl->walk_lock);
427 ret = rhashtable_lookup_insert_fast(&tbl->rhead,
432 mpath = rhashtable_lookup_fast(&tbl->rhead,
436 hlist_add_head(&new_mpath->walk_list, &tbl->walk_head);
437 } while (unlikely(ret == -EEXIST && !mpath));
438 spin_unlock_bh(&tbl->walk_lock);
449 sdata->u.mesh.mesh_paths_generation++;
453 int mpp_path_add(struct ieee80211_sub_if_data *sdata,
454 const u8 *dst, const u8 *mpp)
456 struct mesh_table *tbl;
457 struct mesh_path *new_mpath;
460 if (ether_addr_equal(dst, sdata->vif.addr))
461 /* never add ourselves as neighbours */
464 if (is_multicast_ether_addr(dst))
467 new_mpath = mesh_path_new(sdata, dst, GFP_ATOMIC);
472 memcpy(new_mpath->mpp, mpp, ETH_ALEN);
473 tbl = sdata->u.mesh.mpp_paths;
475 spin_lock_bh(&tbl->walk_lock);
476 ret = rhashtable_lookup_insert_fast(&tbl->rhead,
480 hlist_add_head_rcu(&new_mpath->walk_list, &tbl->walk_head);
481 spin_unlock_bh(&tbl->walk_lock);
486 sdata->u.mesh.mpp_paths_generation++;
492 * mesh_plink_broken - deactivates paths and sends perr when a link breaks
494 * @sta: broken peer link
496 * This function must be called from the rate control algorithm if enough
497 * delivery errors suggest that a peer link is no longer usable.
499 void mesh_plink_broken(struct sta_info *sta)
501 struct ieee80211_sub_if_data *sdata = sta->sdata;
502 struct mesh_table *tbl = sdata->u.mesh.mesh_paths;
503 static const u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
504 struct mesh_path *mpath;
507 hlist_for_each_entry_rcu(mpath, &tbl->walk_head, walk_list) {
508 if (rcu_access_pointer(mpath->next_hop) == sta &&
509 mpath->flags & MESH_PATH_ACTIVE &&
510 !(mpath->flags & MESH_PATH_FIXED)) {
511 spin_lock_bh(&mpath->state_lock);
512 mpath->flags &= ~MESH_PATH_ACTIVE;
514 spin_unlock_bh(&mpath->state_lock);
515 mesh_path_error_tx(sdata,
516 sdata->u.mesh.mshcfg.element_ttl,
517 mpath->dst, mpath->sn,
518 WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast);
524 static void mesh_path_free_rcu(struct mesh_table *tbl,
525 struct mesh_path *mpath)
527 struct ieee80211_sub_if_data *sdata = mpath->sdata;
529 spin_lock_bh(&mpath->state_lock);
530 mpath->flags |= MESH_PATH_RESOLVING | MESH_PATH_DELETED;
531 mesh_gate_del(tbl, mpath);
532 spin_unlock_bh(&mpath->state_lock);
533 del_timer_sync(&mpath->timer);
534 atomic_dec(&sdata->u.mesh.mpaths);
535 atomic_dec(&tbl->entries);
536 mesh_path_flush_pending(mpath);
537 kfree_rcu(mpath, rcu);
540 static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath)
542 hlist_del_rcu(&mpath->walk_list);
543 rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params);
544 mesh_path_free_rcu(tbl, mpath);
548 * mesh_path_flush_by_nexthop - Deletes mesh paths if their next hop matches
550 * @sta: mesh peer to match
552 * RCU notes: this function is called when a mesh plink transitions from
553 * PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that
554 * allows path creation. This will happen before the sta can be freed (because
555 * sta_info_destroy() calls this) so any reader in a rcu read block will be
556 * protected against the plink disappearing.
558 void mesh_path_flush_by_nexthop(struct sta_info *sta)
560 struct ieee80211_sub_if_data *sdata = sta->sdata;
561 struct mesh_table *tbl = sdata->u.mesh.mesh_paths;
562 struct mesh_path *mpath;
563 struct hlist_node *n;
565 spin_lock_bh(&tbl->walk_lock);
566 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {
567 if (rcu_access_pointer(mpath->next_hop) == sta)
568 __mesh_path_del(tbl, mpath);
570 spin_unlock_bh(&tbl->walk_lock);
573 static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata,
576 struct mesh_table *tbl = sdata->u.mesh.mpp_paths;
577 struct mesh_path *mpath;
578 struct hlist_node *n;
580 spin_lock_bh(&tbl->walk_lock);
581 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {
582 if (ether_addr_equal(mpath->mpp, proxy))
583 __mesh_path_del(tbl, mpath);
585 spin_unlock_bh(&tbl->walk_lock);
588 static void table_flush_by_iface(struct mesh_table *tbl)
590 struct mesh_path *mpath;
591 struct hlist_node *n;
593 spin_lock_bh(&tbl->walk_lock);
594 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {
595 __mesh_path_del(tbl, mpath);
597 spin_unlock_bh(&tbl->walk_lock);
601 * mesh_path_flush_by_iface - Deletes all mesh paths associated with a given iface
603 * This function deletes both mesh paths as well as mesh portal paths.
605 * @sdata: interface data to match
608 void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)
610 table_flush_by_iface(sdata->u.mesh.mesh_paths);
611 table_flush_by_iface(sdata->u.mesh.mpp_paths);
615 * table_path_del - delete a path from the mesh or mpp table
617 * @tbl: mesh or mpp path table
618 * @sdata: local subif
619 * @addr: dst address (ETH_ALEN length)
621 * Returns: 0 if successful
623 static int table_path_del(struct mesh_table *tbl,
624 struct ieee80211_sub_if_data *sdata,
627 struct mesh_path *mpath;
629 spin_lock_bh(&tbl->walk_lock);
630 mpath = rhashtable_lookup_fast(&tbl->rhead, addr, mesh_rht_params);
632 spin_unlock_bh(&tbl->walk_lock);
636 __mesh_path_del(tbl, mpath);
637 spin_unlock_bh(&tbl->walk_lock);
643 * mesh_path_del - delete a mesh path from the table
645 * @addr: dst address (ETH_ALEN length)
646 * @sdata: local subif
648 * Returns: 0 if successful
650 int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr)
654 /* flush relevant mpp entries first */
655 mpp_flush_by_proxy(sdata, addr);
657 err = table_path_del(sdata->u.mesh.mesh_paths, sdata, addr);
658 sdata->u.mesh.mesh_paths_generation++;
663 * mesh_path_tx_pending - sends pending frames in a mesh path queue
665 * @mpath: mesh path to activate
667 * Locking: the state_lock of the mpath structure must NOT be held when calling
670 void mesh_path_tx_pending(struct mesh_path *mpath)
672 if (mpath->flags & MESH_PATH_ACTIVE)
673 ieee80211_add_pending_skbs(mpath->sdata->local,
674 &mpath->frame_queue);
678 * mesh_path_send_to_gates - sends pending frames to all known mesh gates
680 * @mpath: mesh path whose queue will be emptied
682 * If there is only one gate, the frames are transferred from the failed mpath
683 * queue to that gate's queue. If there are more than one gates, the frames
684 * are copied from each gate to the next. After frames are copied, the
685 * mpath queues are emptied onto the transmission queue.
687 int mesh_path_send_to_gates(struct mesh_path *mpath)
689 struct ieee80211_sub_if_data *sdata = mpath->sdata;
690 struct mesh_table *tbl;
691 struct mesh_path *from_mpath = mpath;
692 struct mesh_path *gate;
695 tbl = sdata->u.mesh.mesh_paths;
698 hlist_for_each_entry_rcu(gate, &tbl->known_gates, gate_list) {
699 if (gate->flags & MESH_PATH_ACTIVE) {
700 mpath_dbg(sdata, "Forwarding to %pM\n", gate->dst);
701 mesh_path_move_to_queue(gate, from_mpath, copy);
706 "Not forwarding to %pM (flags %#x)\n",
707 gate->dst, gate->flags);
711 hlist_for_each_entry_rcu(gate, &tbl->known_gates, gate_list) {
712 mpath_dbg(sdata, "Sending to %pM\n", gate->dst);
713 mesh_path_tx_pending(gate);
717 return (from_mpath == mpath) ? -EHOSTUNREACH : 0;
721 * mesh_path_discard_frame - discard a frame whose path could not be resolved
723 * @skb: frame to discard
724 * @sdata: network subif the frame was to be sent through
726 * Locking: the function must me called within a rcu_read_lock region
728 void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata,
732 sdata->u.mesh.mshstats.dropped_frames_no_route++;
736 * mesh_path_flush_pending - free the pending queue of a mesh path
738 * @mpath: mesh path whose queue has to be freed
740 * Locking: the function must me called within a rcu_read_lock region
742 void mesh_path_flush_pending(struct mesh_path *mpath)
746 while ((skb = skb_dequeue(&mpath->frame_queue)) != NULL)
747 mesh_path_discard_frame(mpath->sdata, skb);
751 * mesh_path_fix_nexthop - force a specific next hop for a mesh path
753 * @mpath: the mesh path to modify
754 * @next_hop: the next hop to force
756 * Locking: this function must be called holding mpath->state_lock
758 void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop)
760 spin_lock_bh(&mpath->state_lock);
761 mesh_path_assign_nexthop(mpath, next_hop);
764 mpath->hop_count = 0;
766 mpath->flags = MESH_PATH_FIXED | MESH_PATH_SN_VALID;
767 mesh_path_activate(mpath);
768 spin_unlock_bh(&mpath->state_lock);
769 ewma_mesh_fail_avg_init(&next_hop->mesh->fail_avg);
770 /* init it at a low value - 0 start is tricky */
771 ewma_mesh_fail_avg_add(&next_hop->mesh->fail_avg, 1);
772 mesh_path_tx_pending(mpath);
775 int mesh_pathtbl_init(struct ieee80211_sub_if_data *sdata)
777 struct mesh_table *tbl_path, *tbl_mpp;
780 tbl_path = mesh_table_alloc();
784 tbl_mpp = mesh_table_alloc();
790 sdata->u.mesh.mesh_paths = tbl_path;
791 sdata->u.mesh.mpp_paths = tbl_mpp;
796 mesh_table_free(tbl_path);
801 void mesh_path_tbl_expire(struct ieee80211_sub_if_data *sdata,
802 struct mesh_table *tbl)
804 struct mesh_path *mpath;
805 struct hlist_node *n;
807 spin_lock_bh(&tbl->walk_lock);
808 hlist_for_each_entry_safe(mpath, n, &tbl->walk_head, walk_list) {
809 if ((!(mpath->flags & MESH_PATH_RESOLVING)) &&
810 (!(mpath->flags & MESH_PATH_FIXED)) &&
811 time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE))
812 __mesh_path_del(tbl, mpath);
814 spin_unlock_bh(&tbl->walk_lock);
817 void mesh_path_expire(struct ieee80211_sub_if_data *sdata)
819 mesh_path_tbl_expire(sdata, sdata->u.mesh.mesh_paths);
820 mesh_path_tbl_expire(sdata, sdata->u.mesh.mpp_paths);
823 void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata)
825 mesh_table_free(sdata->u.mesh.mesh_paths);
826 mesh_table_free(sdata->u.mesh.mpp_paths);