Classes | Defines | Functions | Variables
mesh_pathtbl.c File Reference
#include <linux/etherdevice.h>
#include <linux/list.h>
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <net/mac80211.h>
#include "wme.h"
#include "ieee80211_i.h"
#include "mesh.h"
Include dependency graph for kernel-3.5/mesh_pathtbl.c:

Go to the source code of this file.

Classes

struct  mpath_node

Defines

#define for_each_mesh_entry(tbl, p, node, i)
#define INIT_PATHS_SIZE_ORDER   2
#define MEAN_CHAIN_LEN   2
#define mpath_dbg(fmt, args...)   do { (void)(0); } while (0)
#define MPATH_EXPIRED(mpath)

Functions

static void __mesh_path_del (struct mesh_table *tbl, struct mpath_node *node)
static void __mesh_table_free (struct mesh_table *tbl)
static DEFINE_RWLOCK (pathtbl_resize_lock)
static int mesh_gate_del (struct mesh_table *tbl, struct mesh_path *mpath)
int mesh_gate_num (struct ieee80211_sub_if_data *sdata)
void mesh_mpath_table_grow (void)
void mesh_mpp_table_grow (void)
int mesh_path_add (u8 *dst, struct ieee80211_sub_if_data *sdata)
int mesh_path_add_gate (struct mesh_path *mpath)
void mesh_path_assign_nexthop (struct mesh_path *mpath, struct sta_info *sta)
int mesh_path_del (u8 *addr, struct ieee80211_sub_if_data *sdata)
void mesh_path_discard_frame (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
void mesh_path_expire (struct ieee80211_sub_if_data *sdata)
void mesh_path_fix_nexthop (struct mesh_path *mpath, struct sta_info *next_hop)
void mesh_path_flush_by_iface (struct ieee80211_sub_if_data *sdata)
void mesh_path_flush_by_nexthop (struct sta_info *sta)
void mesh_path_flush_pending (struct mesh_path *mpath)
struct mesh_pathmesh_path_lookup (u8 *dst, struct ieee80211_sub_if_data *sdata)
struct mesh_pathmesh_path_lookup_by_idx (int idx, struct ieee80211_sub_if_data *sdata)
static void mesh_path_move_to_queue (struct mesh_path *gate_mpath, struct mesh_path *from_mpath, bool copy)
static int mesh_path_node_copy (struct hlist_node *p, struct mesh_table *newtbl)
static void mesh_path_node_free (struct hlist_node *p, bool free_leafs)
static void mesh_path_node_reclaim (struct rcu_head *rp)
int mesh_path_send_to_gates (struct mesh_path *mpath)
void mesh_path_tx_pending (struct mesh_path *mpath)
int mesh_pathtbl_init (void)
void mesh_pathtbl_unregister (void)
void mesh_plink_broken (struct sta_info *sta)
static struct mesh_tablemesh_table_alloc (int size_order)
static void mesh_table_free (struct mesh_table *tbl, bool free_leafs)
static void mesh_table_free_rcu (struct rcu_head *rcu)
static int mesh_table_grow (struct mesh_table *oldtbl, struct mesh_table *newtbl)
static u32 mesh_table_hash (u8 *addr, struct ieee80211_sub_if_data *sdata, struct mesh_table *tbl)
static struct mesh_pathmpath_lookup (struct mesh_table *tbl, u8 *dst, struct ieee80211_sub_if_data *sdata)
int mpp_path_add (u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
struct mesh_pathmpp_path_lookup (u8 *dst, struct ieee80211_sub_if_data *sdata)
static void prepare_for_gate (struct sk_buff *skb, char *dst_addr, struct mesh_path *gate_mpath)
static struct mesh_tableresize_dereference_mesh_paths (void)
static struct mesh_tableresize_dereference_mpp_paths (void)
static void table_flush_by_iface (struct mesh_table *tbl, struct ieee80211_sub_if_data *sdata)

Variables

static struct mesh_table __rcu * mesh_paths
int mesh_paths_generation
static struct mesh_table __rcu * mpp_paths

Define Documentation

#define for_each_mesh_entry (   tbl,
  p,
  node,
 
)
Value:
for (i = 0; i <= tbl->hash_mask; i++) \
                hlist_for_each_entry_rcu(node, p, &tbl->hash_buckets[i], list)

Definition at line 78 of file kernel-3.5/mesh_pathtbl.c.

#define INIT_PATHS_SIZE_ORDER   2

Definition at line 28 of file kernel-3.5/mesh_pathtbl.c.

#define MEAN_CHAIN_LEN   2

Definition at line 31 of file kernel-3.5/mesh_pathtbl.c.

#define mpath_dbg (   fmt,
  args... 
)    do { (void)(0); } while (0)

Definition at line 24 of file kernel-3.5/mesh_pathtbl.c.

#define MPATH_EXPIRED (   mpath)
Value:
((mpath->flags & MESH_PATH_ACTIVE) && \
                                time_after(jiffies, mpath->exp_time) && \
                                !(mpath->flags & MESH_PATH_FIXED))

Definition at line 33 of file kernel-3.5/mesh_pathtbl.c.


Function Documentation

static void __mesh_path_del ( struct mesh_table tbl,
struct mpath_node node 
) [static]

Definition at line 771 of file kernel-3.5/mesh_pathtbl.c.

static void __mesh_table_free ( struct mesh_table tbl) [static]

Definition at line 120 of file kernel-3.5/mesh_pathtbl.c.

static DEFINE_RWLOCK ( pathtbl_resize_lock  ) [static]
static int mesh_gate_del ( struct mesh_table tbl,
struct mesh_path mpath 
) [static]

mesh_gate_del - remove a mesh gate from the list of known gates : table which holds our list of known gates : gate mpath

Returns: 0 on success

Locking: must be called inside rcu_read_lock() section

Definition at line 467 of file kernel-3.5/mesh_pathtbl.c.

int mesh_gate_num ( struct ieee80211_sub_if_data sdata)

mesh_gate_num - number of gates known to this interface : subif data

Definition at line 493 of file kernel-3.5/mesh_pathtbl.c.

void mesh_mpath_table_grow ( void  )

Definition at line 601 of file kernel-3.5/mesh_pathtbl.c.

void mesh_mpp_table_grow ( void  )

Definition at line 622 of file kernel-3.5/mesh_pathtbl.c.

int mesh_path_add ( u8 dst,
struct ieee80211_sub_if_data sdata 
)

mesh_path_add - allocate and add a new path to the mesh path table : destination address of the path (ETH_ALEN length) : local subif

Returns: 0 on success

State: the initial state of the new path is set to 0

Definition at line 507 of file kernel-3.5/mesh_pathtbl.c.

int mesh_path_add_gate ( struct mesh_path mpath)

mesh_path_add_gate - add the given mpath to a mesh gate to our path table : gate path to add to table

Definition at line 420 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_assign_nexthop ( struct mesh_path mpath,
struct sta_info sta 
)

mesh_path_assign_nexthop - update mesh path next hop

: mesh path to update : next hop to assign

Locking: mpath->state_lock must be held when calling this function

Definition at line 208 of file kernel-3.5/mesh_pathtbl.c.

int mesh_path_del ( u8 addr,
struct ieee80211_sub_if_data sdata 
)

mesh_path_del - delete a mesh path from the table

: dst address (ETH_ALEN length) : local subif

Returns: 0 if successful

Definition at line 868 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_discard_frame ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

mesh_path_discard_frame - discard a frame whose path could not be resolved

: frame to discard : network subif the frame was to be sent through

Locking: the function must me called within a rcu_read_lock region

Definition at line 976 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_expire ( struct ieee80211_sub_if_data sdata)

Definition at line 1099 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_fix_nexthop ( struct mesh_path mpath,
struct sta_info next_hop 
)

mesh_path_fix_nexthop - force a specific next hop for a mesh path

: the mesh path to modify : the next hop to force

Locking: this function must be called holding mpath->state_lock

Definition at line 1006 of file kernel-3.5/mesh_pathtbl.c.

mesh_path_flush_by_iface - Deletes all mesh paths associated with a given iface

This function deletes both mesh paths as well as mesh portal paths.

- interface data to match

Definition at line 846 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_flush_by_nexthop ( struct sta_info sta)

mesh_path_flush_by_nexthop - Deletes mesh paths if their next hop matches

- mesh peer to match

RCU notes: this function is called when a mesh plink transitions from PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that allows path creation. This will happen before the sta can be freed (because sta_info_destroy() calls this) so any reader in a rcu read block will be protected against the plink disappearing.

Definition at line 796 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_flush_pending ( struct mesh_path mpath)

mesh_path_flush_pending - free the pending queue of a mesh path

: mesh path whose queue has to be freed

Locking: the function must me called within a rcu_read_lock region

Definition at line 990 of file kernel-3.5/mesh_pathtbl.c.

struct mesh_path* mesh_path_lookup ( u8 dst,
struct ieee80211_sub_if_data sdata 
) [read]

mesh_path_lookup - look up a path in the mesh path table : hardware address (ETH_ALEN length) of destination : local subif

Returns: pointer to the mesh path structure, or NULL if not found

Locking: must be called within a read rcu section.

Definition at line 372 of file kernel-3.5/mesh_pathtbl.c.

struct mesh_path* mesh_path_lookup_by_idx ( int  idx,
struct ieee80211_sub_if_data sdata 
) [read]

mesh_path_lookup_by_idx - look up a path in the mesh path table by its index : index : local subif, or NULL for all entries

Returns: pointer to the mesh path structure, or NULL if not found.

Locking: must be called within a read rcu section.

Definition at line 392 of file kernel-3.5/mesh_pathtbl.c.

static void mesh_path_move_to_queue ( struct mesh_path gate_mpath,
struct mesh_path from_mpath,
bool  copy 
) [static]

mesh_path_move_to_queue - Move or copy frames from one mpath queue to another

This function is used to transfer or copy frames from an unresolved mpath to a gate mpath. The function also adds the Address Extension field and updates the next hop.

If a frame already has an Address Extension field, only the next hop and destination addresses are updated.

The gate mpath must be an active mpath with a valid mpath->next_hop.

: An active mpath the frames will be sent to (i.e. the gate) : The failed mpath : When true, copy all the frames to the new mpath queue. When false, move them.

Definition at line 290 of file kernel-3.5/mesh_pathtbl.c.

static int mesh_path_node_copy ( struct hlist_node *  p,
struct mesh_table newtbl 
) [static]

Definition at line 1033 of file kernel-3.5/mesh_pathtbl.c.

static void mesh_path_node_free ( struct hlist_node *  p,
bool  free_leafs 
) [static]

Definition at line 1020 of file kernel-3.5/mesh_pathtbl.c.

static void mesh_path_node_reclaim ( struct rcu_head *  rp) [static]

Definition at line 759 of file kernel-3.5/mesh_pathtbl.c.

int mesh_path_send_to_gates ( struct mesh_path mpath)

mesh_path_send_to_gates - sends pending frames to all known mesh gates

: mesh path whose queue will be emptied

If there is only one gate, the frames are transferred from the failed mpath queue to that gate's queue. If there are more than one gates, the frames are copied from each gate to the next. After frames are copied, the mpath queues are emptied onto the transmission queue.

Definition at line 926 of file kernel-3.5/mesh_pathtbl.c.

void mesh_path_tx_pending ( struct mesh_path mpath)

mesh_path_tx_pending - sends pending frames in a mesh path queue

: mesh path to activate

Locking: the state_lock of the mpath structure must NOT be held when calling this function.

Definition at line 909 of file kernel-3.5/mesh_pathtbl.c.

int mesh_pathtbl_init ( void  )

Definition at line 1052 of file kernel-3.5/mesh_pathtbl.c.

void mesh_pathtbl_unregister ( void  )

Definition at line 1121 of file kernel-3.5/mesh_pathtbl.c.

void mesh_plink_broken ( struct sta_info sta)

mesh_plink_broken - deactivates paths and sends perr when a link breaks

: broken peer link

This function must be called from the rate control algorithm if enough delivery errors suggest that a peer link is no longer usable.

Definition at line 729 of file kernel-3.5/mesh_pathtbl.c.

static struct mesh_table* mesh_table_alloc ( int  size_order) [static, read]

Definition at line 83 of file kernel-3.5/mesh_pathtbl.c.

static void mesh_table_free ( struct mesh_table tbl,
bool  free_leafs 
) [static]

Definition at line 127 of file kernel-3.5/mesh_pathtbl.c.

static void mesh_table_free_rcu ( struct rcu_head *  rcu) [static]

Definition at line 594 of file kernel-3.5/mesh_pathtbl.c.

static int mesh_table_grow ( struct mesh_table oldtbl,
struct mesh_table newtbl 
) [static]

Definition at line 157 of file kernel-3.5/mesh_pathtbl.c.

static u32 mesh_table_hash ( u8 addr,
struct ieee80211_sub_if_data sdata,
struct mesh_table tbl 
) [static]

Definition at line 190 of file kernel-3.5/mesh_pathtbl.c.

static struct mesh_path* mpath_lookup ( struct mesh_table tbl,
u8 dst,
struct ieee80211_sub_if_data sdata 
) [static, read]

Definition at line 339 of file kernel-3.5/mesh_pathtbl.c.

int mpp_path_add ( u8 dst,
u8 mpp,
struct ieee80211_sub_if_data sdata 
)

Definition at line 642 of file kernel-3.5/mesh_pathtbl.c.

struct mesh_path* mpp_path_lookup ( u8 dst,
struct ieee80211_sub_if_data sdata 
) [read]

Definition at line 377 of file kernel-3.5/mesh_pathtbl.c.

static void prepare_for_gate ( struct sk_buff skb,
char *  dst_addr,
struct mesh_path gate_mpath 
) [static]

Definition at line 232 of file kernel-3.5/mesh_pathtbl.c.

static struct mesh_table* resize_dereference_mesh_paths ( void  ) [static, read]

Definition at line 60 of file kernel-3.5/mesh_pathtbl.c.

static struct mesh_table* resize_dereference_mpp_paths ( void  ) [static, read]

Definition at line 66 of file kernel-3.5/mesh_pathtbl.c.

static void table_flush_by_iface ( struct mesh_table tbl,
struct ieee80211_sub_if_data sdata 
) [static]

Definition at line 819 of file kernel-3.5/mesh_pathtbl.c.


Variable Documentation

struct mesh_table __rcu* mesh_paths [static]

Definition at line 46 of file kernel-3.5/mesh_pathtbl.c.

Definition at line 49 of file kernel-3.5/mesh_pathtbl.c.

struct mesh_table __rcu* mpp_paths [static]

Definition at line 47 of file kernel-3.5/mesh_pathtbl.c.



ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:13