Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | 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"

Go to the source code of this file.

Data Structures

struct  mpath_node
 

Macros

#define INIT_PATHS_SIZE_ORDER   2
 
#define MEAN_CHAIN_LEN   2
 
#define MPATH_EXPIRED(mpath)
 
#define for_each_mesh_entry(tbl, p, node, i)
 

Functions

void mesh_path_assign_nexthop (struct mesh_path *mpath, struct sta_info *sta)
 
struct mesh_pathmesh_path_lookup (u8 *dst, struct ieee80211_sub_if_data *sdata)
 
struct mesh_pathmpp_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)
 
int mesh_path_add_gate (struct mesh_path *mpath)
 
int mesh_gate_num (struct ieee80211_sub_if_data *sdata)
 
int mesh_path_add (u8 *dst, struct ieee80211_sub_if_data *sdata)
 
void mesh_mpath_table_grow (void)
 
void mesh_mpp_table_grow (void)
 
int mpp_path_add (u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
 
void mesh_plink_broken (struct sta_info *sta)
 
void mesh_path_flush_by_nexthop (struct sta_info *sta)
 
void mesh_path_flush_by_iface (struct ieee80211_sub_if_data *sdata)
 
int mesh_path_del (u8 *addr, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_tx_pending (struct mesh_path *mpath)
 
int mesh_path_send_to_gates (struct mesh_path *mpath)
 
void mesh_path_discard_frame (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_flush_pending (struct mesh_path *mpath)
 
void mesh_path_fix_nexthop (struct mesh_path *mpath, struct sta_info *next_hop)
 
int mesh_pathtbl_init (void)
 
void mesh_path_expire (struct ieee80211_sub_if_data *sdata)
 
void mesh_pathtbl_unregister (void)
 

Variables

int mesh_paths_generation
 

Macro Definition Documentation

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

Definition at line 72 of file mesh_pathtbl.c.

#define INIT_PATHS_SIZE_ORDER   2

Definition at line 22 of file mesh_pathtbl.c.

#define MEAN_CHAIN_LEN   2

Definition at line 25 of file 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 27 of file mesh_pathtbl.c.

Function Documentation

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 482 of file mesh_pathtbl.c.

void mesh_mpath_table_grow ( void  )

Definition at line 590 of file mesh_pathtbl.c.

void mesh_mpp_table_grow ( void  )

Definition at line 611 of file 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 496 of file 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 409 of file 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 202 of file 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 857 of file 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 966 of file mesh_pathtbl.c.

void mesh_path_expire ( struct ieee80211_sub_if_data sdata)

Definition at line 1089 of file 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 996 of file mesh_pathtbl.c.

void mesh_path_flush_by_iface ( struct ieee80211_sub_if_data sdata)

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 835 of file 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 785 of file 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 980 of file 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 361 of file 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 381 of file 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 915 of file 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 898 of file mesh_pathtbl.c.

int mesh_pathtbl_init ( void  )

Definition at line 1042 of file mesh_pathtbl.c.

void mesh_pathtbl_unregister ( void  )

Definition at line 1111 of file 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 718 of file mesh_pathtbl.c.

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

Definition at line 631 of file mesh_pathtbl.c.

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

Definition at line 366 of file mesh_pathtbl.c.

Variable Documentation

int mesh_paths_generation

Definition at line 43 of file mesh_pathtbl.c.