Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
mesh.h File Reference
#include <linux/types.h>
#include <linux/jhash.h>
#include "ieee80211_i.h"

Go to the source code of this file.

Data Structures

struct  mesh_path
 
struct  mesh_table
 
struct  rmc_entry
 
struct  mesh_rmc
 

Macros

#define RMC_BUCKETS   256
 
#define RMC_QUEUE_MAX_LEN   4
 
#define RMC_TIMEOUT   (3 * HZ)
 
#define IEEE80211_MESH_PEER_INACTIVITY_LIMIT   (1800 * HZ)
 
#define IEEE80211_MESH_HOUSEKEEPING_INTERVAL   (60 * HZ)
 
#define MESH_DEFAULT_BEACON_INTERVAL   1000 /* in 1024 us units */
 
#define MESH_PATH_EXPIRE   (600 * HZ)
 
#define MESH_MAX_PLINKS   256
 
#define MESH_MAX_MPATHS   1024
 
#define MESH_FRAME_QUEUE_LEN   10
 
#define mesh_allocated   0
 

Enumerations

enum  mesh_config_capab_flags { MESHCONF_CAPAB_ACCEPT_PLINKS = BIT(0), MESHCONF_CAPAB_FORWARDING = BIT(3), MESHCONF_CAPAB_TBTT_ADJUSTING = BIT(5) }
 
enum  mesh_path_flags {
  MESH_PATH_ACTIVE = BIT(0), MESH_PATH_RESOLVING = BIT(1), MESH_PATH_SN_VALID = BIT(2), MESH_PATH_FIXED = BIT(3),
  MESH_PATH_RESOLVED = BIT(4), MESH_PATH_REQ_QUEUED = BIT(5)
}
 
enum  mesh_deferred_task_flags {
  MESH_WORK_HOUSEKEEPING, MESH_WORK_GROW_MPATH_TABLE, MESH_WORK_GROW_MPP_TABLE, MESH_WORK_ROOT,
  MESH_WORK_DRIFT_ADJUST
}
 

Functions

int ieee80211_fill_mesh_addresses (struct ieee80211_hdr *hdr, __le16 *fc, const u8 *da, const u8 *sa)
 
int ieee80211_new_mesh_header (struct ieee80211s_hdr *meshhdr, struct ieee80211_sub_if_data *sdata, char *addr4or5, char *addr6)
 
int mesh_rmc_check (u8 *addr, struct ieee80211s_hdr *mesh_hdr, struct ieee80211_sub_if_data *sdata)
 
bool mesh_matches_local (struct ieee80211_sub_if_data *sdata, struct ieee802_11_elems *ie)
 
void mesh_ids_set_default (struct ieee80211_if_mesh *mesh)
 
void mesh_mgmt_ies_add (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_meshconf_ie (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_meshid_ie (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_rsn_ie (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_vendor_ies (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_ds_params_ie (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_ht_cap_ie (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_add_ht_oper_ie (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
void mesh_rmc_free (struct ieee80211_sub_if_data *sdata)
 
int mesh_rmc_init (struct ieee80211_sub_if_data *sdata)
 
void ieee80211s_init (void)
 
void ieee80211s_update_metric (struct ieee80211_local *local, struct sta_info *sta, struct sk_buff *skb)
 
void ieee80211s_stop (void)
 
void ieee80211_mesh_init_sdata (struct ieee80211_sub_if_data *sdata)
 
void ieee80211_start_mesh (struct ieee80211_sub_if_data *sdata)
 
void ieee80211_stop_mesh (struct ieee80211_sub_if_data *sdata)
 
void ieee80211_mesh_root_setup (struct ieee80211_if_mesh *ifmsh)
 
struct ieee80211_mesh_sync_opsieee80211_mesh_sync_ops_get (u8 method)
 
int mesh_nexthop_lookup (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
int mesh_nexthop_resolve (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_start_discovery (struct ieee80211_sub_if_data *sdata)
 
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)
 
int mpp_path_add (u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
 
struct mesh_pathmesh_path_lookup_by_idx (int idx, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_fix_nexthop (struct mesh_path *mpath, struct sta_info *next_hop)
 
void mesh_path_expire (struct ieee80211_sub_if_data *sdata)
 
void mesh_rx_path_sel_frame (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, size_t len)
 
int mesh_path_add (u8 *dst, struct ieee80211_sub_if_data *sdata)
 
int mesh_path_add_gate (struct mesh_path *mpath)
 
int mesh_path_send_to_gates (struct mesh_path *mpath)
 
int mesh_gate_num (struct ieee80211_sub_if_data *sdata)
 
void mesh_neighbour_update (struct ieee80211_sub_if_data *sdata, u8 *hw_addr, struct ieee802_11_elems *ie)
 
bool mesh_peer_accepts_plinks (struct ieee802_11_elems *ie)
 
u32 mesh_accept_plinks_update (struct ieee80211_sub_if_data *sdata)
 
void mesh_plink_broken (struct sta_info *sta)
 
void mesh_plink_deactivate (struct sta_info *sta)
 
int mesh_plink_open (struct sta_info *sta)
 
void mesh_plink_block (struct sta_info *sta)
 
void mesh_rx_plink_frame (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, size_t len, struct ieee80211_rx_status *rx_status)
 
void mesh_mpath_table_grow (void)
 
void mesh_mpp_table_grow (void)
 
int mesh_path_error_tx (u8 ttl, u8 *target, __le32 target_sn, __le16 target_rcode, const u8 *ra, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_assign_nexthop (struct mesh_path *mpath, struct sta_info *sta)
 
void mesh_path_flush_pending (struct mesh_path *mpath)
 
void mesh_path_tx_pending (struct mesh_path *mpath)
 
int mesh_pathtbl_init (void)
 
void mesh_pathtbl_unregister (void)
 
int mesh_path_del (u8 *addr, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_timer (unsigned long data)
 
void mesh_path_flush_by_nexthop (struct sta_info *sta)
 
void mesh_path_discard_frame (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 
void mesh_path_quiesce (struct ieee80211_sub_if_data *sdata)
 
void mesh_path_restart (struct ieee80211_sub_if_data *sdata)
 
void mesh_path_tx_root_frame (struct ieee80211_sub_if_data *sdata)
 
bool mesh_action_is_path_sel (struct ieee80211_mgmt *mgmt)
 

Variables

int mesh_paths_generation
 

Macro Definition Documentation

#define IEEE80211_MESH_HOUSEKEEPING_INTERVAL   (60 * HZ)

Definition at line 206 of file mesh.h.

#define IEEE80211_MESH_PEER_INACTIVITY_LIMIT   (1800 * HZ)

Definition at line 205 of file mesh.h.

#define mesh_allocated   0

Definition at line 355 of file mesh.h.

#define MESH_DEFAULT_BEACON_INTERVAL   1000 /* in 1024 us units */

Definition at line 208 of file mesh.h.

#define MESH_FRAME_QUEUE_LEN   10

Definition at line 219 of file mesh.h.

#define MESH_MAX_MPATHS   1024

Definition at line 216 of file mesh.h.

#define MESH_MAX_PLINKS   256

Definition at line 213 of file mesh.h.

#define MESH_PATH_EXPIRE   (600 * HZ)

Definition at line 210 of file mesh.h.

#define RMC_BUCKETS   256

Definition at line 178 of file mesh.h.

#define RMC_QUEUE_MAX_LEN   4

Definition at line 179 of file mesh.h.

#define RMC_TIMEOUT   (3 * HZ)

Definition at line 180 of file mesh.h.

Enumeration Type Documentation

enum mesh_config_capab_flags - mesh config IE capability flags

: STA is willing to establish additional mesh peerings with other mesh STAs : the STA forwards MSDUs : TBTT adjustment procedure is ongoing

Enumerator:
MESHCONF_CAPAB_ACCEPT_PLINKS 
MESHCONF_CAPAB_FORWARDING 
MESHCONF_CAPAB_TBTT_ADJUSTING 

Definition at line 29 of file mesh.h.

enum mesh_deferred_task_flags - mac80211 mesh deferred tasks

: run the periodic mesh housekeeping tasks : the mesh path table is full and needs to grow. : the mesh portals table is full and needs to grow : the mesh root station needs to send a frame : time to compensate for clock drift relative to other mesh nodes

Enumerator:
MESH_WORK_HOUSEKEEPING 
MESH_WORK_GROW_MPATH_TABLE 
MESH_WORK_GROW_MPP_TABLE 
MESH_WORK_ROOT 
MESH_WORK_DRIFT_ADJUST 

Definition at line 76 of file mesh.h.

enum mesh_path_flags - mac80211 mesh path flags

: the mesh path can be used for forwarding : the discovery process is running for this mesh path : the mesh path contains a valid destination sequence number : the mesh path has been manually set and should not be modified : the mesh path can has been resolved : there is an unsent path request for this destination already queued up, waiting for the discovery process to start.

MESH_PATH_RESOLVED is used by the mesh path timer to decide when to stop or cancel the mesh path discovery.

Enumerator:
MESH_PATH_ACTIVE 
MESH_PATH_RESOLVING 
MESH_PATH_SN_VALID 
MESH_PATH_FIXED 
MESH_PATH_RESOLVED 
MESH_PATH_REQ_QUEUED 

Definition at line 53 of file mesh.h.

Function Documentation

int ieee80211_fill_mesh_addresses ( struct ieee80211_hdr hdr,
__le16 fc,
const u8 meshda,
const u8 meshsa 
)

ieee80211_fill_mesh_addresses - fill addresses of a locally originated mesh frame : 802.11 frame header : frame control field : destination address in the mesh : source address address in the mesh. Same as TA, as frame is locally originated.

Return the length of the 802.11 (does not include a mesh control header)

Definition at line 473 of file mesh.c.

void ieee80211_mesh_init_sdata ( struct ieee80211_sub_if_data sdata)

Definition at line 787 of file mesh.c.

void ieee80211_mesh_root_setup ( struct ieee80211_if_mesh ifmsh)

Definition at line 452 of file mesh.c.

struct ieee80211_mesh_sync_ops* ieee80211_mesh_sync_ops_get ( u8  method)
read

Definition at line 296 of file mesh_sync.c.

int ieee80211_new_mesh_header ( struct ieee80211s_hdr meshhdr,
struct ieee80211_sub_if_data sdata,
char addr4or5,
char addr6 
)

ieee80211_new_mesh_header - create a new mesh header : uninitialized mesh header : mesh interface to be used : 1st address in the ae header, which may correspond to address 4 (if addr6 is NULL) or address 5 (if addr6 is present). It may be NULL. : 2nd address in the ae header, which corresponds to addr6 of the mesh frame

Return the header length.

Definition at line 506 of file mesh.c.

void ieee80211_start_mesh ( struct ieee80211_sub_if_data sdata)

Definition at line 589 of file mesh.c.

void ieee80211_stop_mesh ( struct ieee80211_sub_if_data sdata)

Definition at line 623 of file mesh.c.

void ieee80211s_init ( void  )

Definition at line 34 of file mesh.c.

void ieee80211s_stop ( void  )

Definition at line 42 of file mesh.c.

void ieee80211s_update_metric ( struct ieee80211_local local,
struct sta_info sta,
struct sk_buff skb 
)

Definition at line 298 of file mesh_hwmp.c.

u32 mesh_accept_plinks_update ( struct ieee80211_sub_if_data sdata)

mesh_accept_plinks_update - update accepting_plink in local mesh beacons

: mesh interface in which mesh beacons are going to be updated

Returns: beacon changed flag if the beacon content changed.

Definition at line 142 of file mesh.c.

bool mesh_action_is_path_sel ( struct ieee80211_mgmt mgmt)

Definition at line 30 of file mesh.c.

int mesh_add_ds_params_ie ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 353 of file mesh.c.

int mesh_add_ht_cap_ie ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 375 of file mesh.c.

int mesh_add_ht_oper_ie ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 396 of file mesh.c.

int mesh_add_meshconf_ie ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 243 of file mesh.c.

int mesh_add_meshid_ie ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 283 of file mesh.c.

int mesh_add_rsn_ie ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 325 of file mesh.c.

int mesh_add_vendor_ies ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

Definition at line 301 of file mesh.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 482 of file mesh_pathtbl.c.

void mesh_ids_set_default ( struct ieee80211_if_mesh mesh)
bool mesh_matches_local ( struct ieee80211_sub_if_data sdata,
struct ieee802_11_elems ie 
)

mesh_matches_local - check if the config of a mesh point matches ours

: local mesh subif : information elements of a management frame from the mesh peer

This function checks if the mesh configuration of a mesh point matches the local mesh configuration, i.e. if both nodes belong to the same mesh network.

Definition at line 73 of file mesh.c.

void mesh_mgmt_ies_add ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)
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.

void mesh_neighbour_update ( struct ieee80211_sub_if_data sdata,
u8 hw_addr,
struct ieee802_11_elems ie 
)

Definition at line 406 of file mesh_plink.c.

int mesh_nexthop_lookup ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

mesh_nexthop_lookup - put the appropriate next hop on a mesh frame. Calling this function is considered "using" the associated mpath, so preempt a path refresh if this mpath expires soon.

: 802.11 frame to be sent : network subif the frame will be sent through

Returns: 0 if the next hop was found. Nonzero otherwise.

Definition at line 1121 of file mesh_hwmp.c.

int mesh_nexthop_resolve ( struct sk_buff skb,
struct ieee80211_sub_if_data sdata 
)

mesh_nexthop_resolve - lookup next hop; conditionally start path discovery

: 802.11 frame to be sent : network subif the frame will be sent through

Lookup next hop for given skb and start path discovery if no forwarding information is found.

Returns: 0 if the next hop was found and -ENOENT if the frame was queued. skb is freeed here if no mpath could be allocated.

Definition at line 1067 of file mesh_hwmp.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.

int mesh_path_error_tx ( u8  ttl,
u8 target,
__le32  target_sn,
__le16  target_rcode,
const u8 ra,
struct ieee80211_sub_if_data sdata 
)

mesh_send_path error - Sends a PERR mesh management frame

: broken destination : SN of the broken destination : reason code for this PERR : node this frame is addressed to

Note: This function may be called with driver locks taken that the driver also acquires in the TX path. To avoid a deadlock we don't transmit the frame directly but add it to the pending queue instead.

Definition at line 233 of file mesh_hwmp.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_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.

void mesh_path_quiesce ( struct ieee80211_sub_if_data sdata)
void mesh_path_restart ( struct ieee80211_sub_if_data sdata)
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_start_discovery ( struct ieee80211_sub_if_data sdata)

mesh_path_start_discovery - launch a path discovery from the PREQ queue

: local mesh subif

Definition at line 973 of file mesh_hwmp.c.

void mesh_path_timer ( unsigned long  data)

Definition at line 1156 of file mesh_hwmp.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.

void mesh_path_tx_root_frame ( struct ieee80211_sub_if_data sdata)

Definition at line 1190 of file mesh_hwmp.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.

bool mesh_peer_accepts_plinks ( struct ieee802_11_elems ie)

mesh_peer_accepts_plinks - check if an mp is willing to establish peer links

: information elements of a management frame from the mesh peer

Definition at line 129 of file mesh.c.

void mesh_plink_block ( struct sta_info sta)

Definition at line 556 of file mesh_plink.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.

void mesh_plink_deactivate ( struct sta_info sta)

mesh_plink_deactivate - deactivate mesh peer link

: mesh peer link to deactivate

All mesh paths with this peer as next hop will be flushed

Definition at line 198 of file mesh_plink.c.

int mesh_plink_open ( struct sta_info sta)

Definition at line 529 of file mesh_plink.c.

int mesh_rmc_check ( u8 sa,
struct ieee80211s_hdr mesh_hdr,
struct ieee80211_sub_if_data sdata 
)

mesh_rmc_check - Check frame in recent multicast cache and add if absent.

See Also
: source address : mesh_header

Returns: 0 if the frame is not in the cache, nonzero otherwise.

Checks using the source address and the mesh sequence number if we have received this frame lately. If the frame is not in the cache, it is added to it.

Definition at line 207 of file mesh.c.

void mesh_rmc_free ( struct ieee80211_sub_if_data sdata)

Definition at line 176 of file mesh.c.

int mesh_rmc_init ( struct ieee80211_sub_if_data sdata)

Definition at line 163 of file mesh.c.

void mesh_rx_path_sel_frame ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt mgmt,
size_t  len 
)

Definition at line 851 of file mesh_hwmp.c.

void mesh_rx_plink_frame ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt mgmt,
size_t  len,
struct ieee80211_rx_status rx_status 
)

Definition at line 570 of file mesh_plink.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.