Defines | Enumerations | Functions | Variables
mesh_hwmp.c File Reference
#include <linux/slab.h>
#include "wme.h"
#include "mesh.h"
Include dependency graph for kernel-3.2/mesh_hwmp.c:

Go to the source code of this file.

Defines

#define AE_F   (1<<6)
#define AE_F_SET(x)   (*x & AE_F)
#define ARITH_SHIFT   8
#define default_lifetime(s)   MSEC_TO_TU(s->u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout)
#define disc_timeout_jiff(s)   msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout)
#define MAX_METRIC   0xffffffff
#define MAX_PREQ_QUEUE_LEN   64
#define max_preq_retries(s)   (s->u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries)
#define MESH_FRAME_QUEUE_LEN   10
#define mhwmp_dbg(fmt, args...)   do { (void)(0); } while (0)
#define min_preq_int_jiff(s)   (msecs_to_jiffies(s->u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval))
#define MP_F_DO   0x1
#define MP_F_RCODE   0x02
#define MP_F_RF   0x2
#define MP_F_USN   0x01
#define MSEC_TO_TU(x)   (x*1000/1024)
#define net_traversal_jiffies(s)   msecs_to_jiffies(s->u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime)
#define PERR_IE_TARGET_ADDR(x)   (x + 3)
#define PERR_IE_TARGET_FLAGS(x)   (*(x + 2))
#define PERR_IE_TARGET_RCODE(x)   u16_field_get(x, 13, 0)
#define PERR_IE_TARGET_SN(x)   u32_field_get(x, 9, 0)
#define PERR_IE_TTL(x)   (*(x))
#define PREP_IE_FLAGS(x)   PREQ_IE_FLAGS(x)
#define PREP_IE_HOPCOUNT(x)   PREQ_IE_HOPCOUNT(x)
#define PREP_IE_LIFETIME(x)   u32_field_get(x, 13, AE_F_SET(x))
#define PREP_IE_METRIC(x)   u32_field_get(x, 17, AE_F_SET(x))
#define PREP_IE_ORIG_ADDR(x)   (AE_F_SET(x) ? x + 27 : x + 21)
#define PREP_IE_ORIG_SN(x)   u32_field_get(x, 27, AE_F_SET(x))
#define PREP_IE_TARGET_ADDR(x)   (x + 3)
#define PREP_IE_TARGET_SN(x)   u32_field_get(x, 9, 0)
#define PREP_IE_TTL(x)   PREQ_IE_TTL(x)
#define PREQ_IE_FLAGS(x)   (*(x))
#define PREQ_IE_HOPCOUNT(x)   (*(x + 1))
#define PREQ_IE_LIFETIME(x)   u32_field_get(x, 17, AE_F_SET(x))
#define PREQ_IE_METRIC(x)   u32_field_get(x, 21, AE_F_SET(x))
#define PREQ_IE_ORIG_ADDR(x)   (x + 7)
#define PREQ_IE_ORIG_SN(x)   u32_field_get(x, 13, 0)
#define PREQ_IE_PREQ_ID(x)   u32_field_get(x, 3, 0)
#define PREQ_IE_TARGET_ADDR(x)   (AE_F_SET(x) ? x + 33 : x + 27)
#define PREQ_IE_TARGET_F(x)   (*(AE_F_SET(x) ? x + 32 : x + 26))
#define PREQ_IE_TARGET_SN(x)   u32_field_get(x, 33, AE_F_SET(x))
#define PREQ_IE_TTL(x)   (*(x + 2))
#define SN_GT(x, y)   ((long) (y) - (long) (x) < 0)
#define SN_LT(x, y)   ((long) (x) - (long) (y) < 0)
#define TEST_FRAME_LEN   8192

Enumerations

enum  mpath_frame_type {
  MPATH_PREQ = 0, MPATH_PREP, MPATH_PERR, MPATH_RANN,
  MPATH_PREQ = 0, MPATH_PREP, MPATH_PERR, MPATH_RANN
}

Functions

static u32 airtime_link_metric_get (struct ieee80211_local *local, struct sta_info *sta)
static void hwmp_perr_frame_process (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, u8 *perr_elem)
static void hwmp_prep_frame_process (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, u8 *prep_elem, u32 metric)
static void hwmp_preq_frame_process (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, u8 *preq_elem, u32 metric)
static void hwmp_rann_frame_process (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, struct ieee80211_rann_ie *rann)
static u32 hwmp_route_info_get (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, u8 *hwmp_ie, enum mpath_frame_type action)
void ieee80211s_update_metric (struct ieee80211_local *local, struct sta_info *stainfo, struct sk_buff *skb)
int mesh_nexthop_lookup (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
int mesh_path_error_tx (u8 ttl, u8 *target, __le32 target_sn, __le16 target_rcode, const u8 *ra, struct ieee80211_sub_if_data *sdata)
static int mesh_path_sel_frame_tx (enum mpath_frame_type action, u8 flags, u8 *orig_addr, __le32 orig_sn, u8 target_flags, u8 *target, __le32 target_sn, const u8 *da, u8 hop_count, u8 ttl, __le32 lifetime, __le32 metric, __le32 preq_id, struct ieee80211_sub_if_data *sdata)
void mesh_path_start_discovery (struct ieee80211_sub_if_data *sdata)
void mesh_path_timer (unsigned long data)
void mesh_path_tx_root_frame (struct ieee80211_sub_if_data *sdata)
static void mesh_queue_preq (struct mesh_path *, u8)
void mesh_rx_path_sel_frame (struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, size_t len)
static struct sta_infonext_hop_deref_protected (struct mesh_path *mpath)
static void prepare_frame_for_deferred_tx (struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
static u32 u16_field_get (u8 *preq_elem, int offset, bool ae)
static u32 u32_field_get (u8 *preq_elem, int offset, bool ae)

Variables

static const u8 broadcast_addr [ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}

Define Documentation

#define AE_F   (1<<6)

Definition at line 55 of file kernel-3.2/mesh_hwmp.c.

#define AE_F_SET (   x)    (*x & AE_F)

Definition at line 56 of file kernel-3.2/mesh_hwmp.c.

#define ARITH_SHIFT   8

Definition at line 23 of file kernel-3.2/mesh_hwmp.c.

#define default_lifetime (   s)    MSEC_TO_TU(s->u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout)

Definition at line 92 of file kernel-3.2/mesh_hwmp.c.

#define disc_timeout_jiff (   s)    msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout)

Definition at line 97 of file kernel-3.2/mesh_hwmp.c.

#define MAX_METRIC   0xffffffff

Definition at line 22 of file kernel-3.2/mesh_hwmp.c.

#define MAX_PREQ_QUEUE_LEN   64

Definition at line 27 of file kernel-3.2/mesh_hwmp.c.

#define max_preq_retries (   s)    (s->u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries)

Definition at line 96 of file kernel-3.2/mesh_hwmp.c.

#define MESH_FRAME_QUEUE_LEN   10

Definition at line 26 of file kernel-3.2/mesh_hwmp.c.

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

Definition at line 18 of file kernel-3.2/mesh_hwmp.c.

#define min_preq_int_jiff (   s)    (msecs_to_jiffies(s->u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval))

Definition at line 94 of file kernel-3.2/mesh_hwmp.c.

#define MP_F_DO   0x1

Definition at line 30 of file kernel-3.2/mesh_hwmp.c.

#define MP_F_RCODE   0x02

Definition at line 36 of file kernel-3.2/mesh_hwmp.c.

#define MP_F_RF   0x2

Definition at line 32 of file kernel-3.2/mesh_hwmp.c.

#define MP_F_USN   0x01

Definition at line 34 of file kernel-3.2/mesh_hwmp.c.

#define MSEC_TO_TU (   x)    (x*1000/1024)

Definition at line 86 of file kernel-3.2/mesh_hwmp.c.

#define net_traversal_jiffies (   s)    msecs_to_jiffies(s->u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime)

Definition at line 90 of file kernel-3.2/mesh_hwmp.c.

#define PERR_IE_TARGET_ADDR (   x)    (x + 3)

Definition at line 82 of file kernel-3.2/mesh_hwmp.c.

#define PERR_IE_TARGET_FLAGS (   x)    (*(x + 2))

Definition at line 81 of file kernel-3.2/mesh_hwmp.c.

#define PERR_IE_TARGET_RCODE (   x)    u16_field_get(x, 13, 0)

Definition at line 84 of file kernel-3.2/mesh_hwmp.c.

#define PERR_IE_TARGET_SN (   x)    u32_field_get(x, 9, 0)

Definition at line 83 of file kernel-3.2/mesh_hwmp.c.

#define PERR_IE_TTL (   x)    (*(x))

Definition at line 80 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_FLAGS (   x)    PREQ_IE_FLAGS(x)

Definition at line 70 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_HOPCOUNT (   x)    PREQ_IE_HOPCOUNT(x)

Definition at line 71 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_LIFETIME (   x)    u32_field_get(x, 13, AE_F_SET(x))

Definition at line 75 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_METRIC (   x)    u32_field_get(x, 17, AE_F_SET(x))

Definition at line 76 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_ORIG_ADDR (   x)    (AE_F_SET(x) ? x + 27 : x + 21)

Definition at line 73 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_ORIG_SN (   x)    u32_field_get(x, 27, AE_F_SET(x))

Definition at line 74 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_TARGET_ADDR (   x)    (x + 3)

Definition at line 77 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_TARGET_SN (   x)    u32_field_get(x, 9, 0)

Definition at line 78 of file kernel-3.2/mesh_hwmp.c.

#define PREP_IE_TTL (   x)    PREQ_IE_TTL(x)

Definition at line 72 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_FLAGS (   x)    (*(x))

Definition at line 57 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_HOPCOUNT (   x)    (*(x + 1))

Definition at line 58 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_LIFETIME (   x)    u32_field_get(x, 17, AE_F_SET(x))

Definition at line 63 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_METRIC (   x)    u32_field_get(x, 21, AE_F_SET(x))

Definition at line 64 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_ORIG_ADDR (   x)    (x + 7)

Definition at line 61 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_ORIG_SN (   x)    u32_field_get(x, 13, 0)

Definition at line 62 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_PREQ_ID (   x)    u32_field_get(x, 3, 0)

Definition at line 60 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_TARGET_ADDR (   x)    (AE_F_SET(x) ? x + 33 : x + 27)

Definition at line 66 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_TARGET_F (   x)    (*(AE_F_SET(x) ? x + 32 : x + 26))

Definition at line 65 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_TARGET_SN (   x)    u32_field_get(x, 33, AE_F_SET(x))

Definition at line 67 of file kernel-3.2/mesh_hwmp.c.

#define PREQ_IE_TTL (   x)    (*(x + 2))

Definition at line 59 of file kernel-3.2/mesh_hwmp.c.

#define SN_GT (   x,
 
)    ((long) (y) - (long) (x) < 0)

Definition at line 87 of file kernel-3.2/mesh_hwmp.c.

#define SN_LT (   x,
 
)    ((long) (x) - (long) (y) < 0)

Definition at line 88 of file kernel-3.2/mesh_hwmp.c.

#define TEST_FRAME_LEN   8192

Definition at line 21 of file kernel-3.2/mesh_hwmp.c.


Enumeration Type Documentation

Enumerator:
MPATH_PREQ 
MPATH_PREP 
MPATH_PERR 
MPATH_RANN 
MPATH_PREQ 
MPATH_PREP 
MPATH_PERR 
MPATH_RANN 

Definition at line 100 of file kernel-3.2/mesh_hwmp.c.


Function Documentation

static u32 airtime_link_metric_get ( struct ieee80211_local local,
struct sta_info sta 
) [static]

Definition at line 315 of file kernel-3.2/mesh_hwmp.c.

static void hwmp_perr_frame_process ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt *  mgmt,
u8 perr_elem 
) [static]

Definition at line 674 of file kernel-3.2/mesh_hwmp.c.

static void hwmp_prep_frame_process ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt *  mgmt,
u8 prep_elem,
u32  metric 
) [static]

Definition at line 609 of file kernel-3.2/mesh_hwmp.c.

static void hwmp_preq_frame_process ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt *  mgmt,
u8 preq_elem,
u32  metric 
) [static]

Definition at line 506 of file kernel-3.2/mesh_hwmp.c.

static void hwmp_rann_frame_process ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt *  mgmt,
struct ieee80211_rann_ie *  rann 
) [static]

Definition at line 716 of file kernel-3.2/mesh_hwmp.c.

static u32 hwmp_route_info_get ( struct ieee80211_sub_if_data sdata,
struct ieee80211_mgmt *  mgmt,
u8 hwmp_ie,
enum mpath_frame_type  action 
) [static]

hwmp_route_info_get - Update routing info to originator and transmitter

: local mesh subif : mesh management frame : hwmp information element (PREP or PREQ)

This function updates the path routing information to the originator and the transmitter of a HWMP PREQ or PREP frame.

Returns: metric to frame originator or 0 if the frame should not be further processed

Notes: this function is the only place (besides user-provided info) where path routing information is updated.

Definition at line 363 of file kernel-3.2/mesh_hwmp.c.

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

Definition at line 297 of file kernel-3.2/mesh_hwmp.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

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

Returns: 0 if the next hop was found. Nonzero otherwise. If no next hop is found, the function will start a path discovery and queue the frame so it is sent when the path is resolved. This means the caller must not free the skb in this case.

Definition at line 986 of file kernel-3.2/mesh_hwmp.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 238 of file kernel-3.2/mesh_hwmp.c.

static int mesh_path_sel_frame_tx ( enum mpath_frame_type  action,
u8  flags,
u8 orig_addr,
__le32  orig_sn,
u8  target_flags,
u8 target,
__le32  target_sn,
const u8 da,
u8  hop_count,
u8  ttl,
__le32  lifetime,
__le32  metric,
__le32  preq_id,
struct ieee80211_sub_if_data sdata 
) [static]

Definition at line 109 of file kernel-3.2/mesh_hwmp.c.

mesh_path_start_discovery - launch a path discovery from the PREQ queue

: local mesh subif

Definition at line 896 of file kernel-3.2/mesh_hwmp.c.

void mesh_path_timer ( unsigned long  data)

Definition at line 1047 of file kernel-3.2/mesh_hwmp.c.

Definition at line 1080 of file kernel-3.2/mesh_hwmp.c.

static void mesh_queue_preq ( struct mesh_path mpath,
u8  flags 
) [static]

mesh_queue_preq - queue a PREQ to a given destination

: mesh path to discover : special attributes of the PREQ to be sent

Locking: the function must be called from within a rcu read lock block.

Definition at line 849 of file kernel-3.2/mesh_hwmp.c.

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

Definition at line 785 of file kernel-3.2/mesh_hwmp.c.

static struct sta_info* next_hop_deref_protected ( struct mesh_path mpath) [static, read]

Definition at line 602 of file kernel-3.2/mesh_hwmp.c.

static void prepare_frame_for_deferred_tx ( struct ieee80211_sub_if_data sdata,
struct sk_buff skb 
) [static]

Definition at line 209 of file kernel-3.2/mesh_hwmp.c.

static u32 u16_field_get ( u8 preq_elem,
int  offset,
bool  ae 
) [inline, static]

Definition at line 47 of file kernel-3.2/mesh_hwmp.c.

static u32 u32_field_get ( u8 preq_elem,
int  offset,
bool  ae 
) [inline, static]

Definition at line 40 of file kernel-3.2/mesh_hwmp.c.


Variable Documentation

const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} [static]

Definition at line 107 of file kernel-3.2/mesh_hwmp.c.



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