#include <linux/slab.h>
#include <linux/etherdevice.h>
#include <asm/unaligned.h>
#include "wme.h"
#include "mesh.h"
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) ((s32)(y - x) < 0) |
#define | SN_LT(x, y) ((s32)(x - 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_nexthop_resolve (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_info * | next_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 AE_F (1<<6) |
Definition at line 57 of file kernel-3.5/mesh_hwmp.c.
Definition at line 58 of file kernel-3.5/mesh_hwmp.c.
#define ARITH_SHIFT 8 |
Definition at line 25 of file kernel-3.5/mesh_hwmp.c.
#define default_lifetime | ( | s | ) | MSEC_TO_TU(s->u.mesh.mshcfg.dot11MeshHWMPactivePathTimeout) |
Definition at line 94 of file kernel-3.5/mesh_hwmp.c.
#define disc_timeout_jiff | ( | s | ) | msecs_to_jiffies(sdata->u.mesh.mshcfg.min_discovery_timeout) |
Definition at line 99 of file kernel-3.5/mesh_hwmp.c.
#define MAX_METRIC 0xffffffff |
Definition at line 24 of file kernel-3.5/mesh_hwmp.c.
#define MAX_PREQ_QUEUE_LEN 64 |
Definition at line 29 of file kernel-3.5/mesh_hwmp.c.
#define max_preq_retries | ( | s | ) | (s->u.mesh.mshcfg.dot11MeshHWMPmaxPREQretries) |
Definition at line 98 of file kernel-3.5/mesh_hwmp.c.
#define MESH_FRAME_QUEUE_LEN 10 |
Definition at line 28 of file kernel-3.5/mesh_hwmp.c.
Definition at line 20 of file kernel-3.5/mesh_hwmp.c.
#define min_preq_int_jiff | ( | s | ) | (msecs_to_jiffies(s->u.mesh.mshcfg.dot11MeshHWMPpreqMinInterval)) |
Definition at line 96 of file kernel-3.5/mesh_hwmp.c.
#define MP_F_DO 0x1 |
Definition at line 32 of file kernel-3.5/mesh_hwmp.c.
#define MP_F_RCODE 0x02 |
Definition at line 38 of file kernel-3.5/mesh_hwmp.c.
#define MP_F_RF 0x2 |
Definition at line 34 of file kernel-3.5/mesh_hwmp.c.
#define MP_F_USN 0x01 |
Definition at line 36 of file kernel-3.5/mesh_hwmp.c.
#define MSEC_TO_TU | ( | x | ) | (x*1000/1024) |
Definition at line 88 of file kernel-3.5/mesh_hwmp.c.
#define net_traversal_jiffies | ( | s | ) | msecs_to_jiffies(s->u.mesh.mshcfg.dot11MeshHWMPnetDiameterTraversalTime) |
Definition at line 92 of file kernel-3.5/mesh_hwmp.c.
#define PERR_IE_TARGET_ADDR | ( | x | ) | (x + 3) |
Definition at line 84 of file kernel-3.5/mesh_hwmp.c.
#define PERR_IE_TARGET_FLAGS | ( | x | ) | (*(x + 2)) |
Definition at line 83 of file kernel-3.5/mesh_hwmp.c.
#define PERR_IE_TARGET_RCODE | ( | x | ) | u16_field_get(x, 13, 0) |
Definition at line 86 of file kernel-3.5/mesh_hwmp.c.
#define PERR_IE_TARGET_SN | ( | x | ) | u32_field_get(x, 9, 0) |
Definition at line 85 of file kernel-3.5/mesh_hwmp.c.
#define PERR_IE_TTL | ( | x | ) | (*(x)) |
Definition at line 82 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_FLAGS | ( | x | ) | PREQ_IE_FLAGS(x) |
Definition at line 72 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_HOPCOUNT | ( | x | ) | PREQ_IE_HOPCOUNT(x) |
Definition at line 73 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_LIFETIME | ( | x | ) | u32_field_get(x, 13, AE_F_SET(x)) |
Definition at line 77 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_METRIC | ( | x | ) | u32_field_get(x, 17, AE_F_SET(x)) |
Definition at line 78 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_ORIG_ADDR | ( | x | ) | (AE_F_SET(x) ? x + 27 : x + 21) |
Definition at line 75 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_ORIG_SN | ( | x | ) | u32_field_get(x, 27, AE_F_SET(x)) |
Definition at line 76 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_TARGET_ADDR | ( | x | ) | (x + 3) |
Definition at line 79 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_TARGET_SN | ( | x | ) | u32_field_get(x, 9, 0) |
Definition at line 80 of file kernel-3.5/mesh_hwmp.c.
#define PREP_IE_TTL | ( | x | ) | PREQ_IE_TTL(x) |
Definition at line 74 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_FLAGS | ( | x | ) | (*(x)) |
Definition at line 59 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_HOPCOUNT | ( | x | ) | (*(x + 1)) |
Definition at line 60 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_LIFETIME | ( | x | ) | u32_field_get(x, 17, AE_F_SET(x)) |
Definition at line 65 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_METRIC | ( | x | ) | u32_field_get(x, 21, AE_F_SET(x)) |
Definition at line 66 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_ORIG_ADDR | ( | x | ) | (x + 7) |
Definition at line 63 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_ORIG_SN | ( | x | ) | u32_field_get(x, 13, 0) |
Definition at line 64 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_PREQ_ID | ( | x | ) | u32_field_get(x, 3, 0) |
Definition at line 62 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_TARGET_ADDR | ( | x | ) | (AE_F_SET(x) ? x + 33 : x + 27) |
Definition at line 68 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_TARGET_F | ( | x | ) | (*(AE_F_SET(x) ? x + 32 : x + 26)) |
Definition at line 67 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_TARGET_SN | ( | x | ) | u32_field_get(x, 33, AE_F_SET(x)) |
Definition at line 69 of file kernel-3.5/mesh_hwmp.c.
#define PREQ_IE_TTL | ( | x | ) | (*(x + 2)) |
Definition at line 61 of file kernel-3.5/mesh_hwmp.c.
Definition at line 89 of file kernel-3.5/mesh_hwmp.c.
Definition at line 90 of file kernel-3.5/mesh_hwmp.c.
#define TEST_FRAME_LEN 8192 |
Definition at line 23 of file kernel-3.5/mesh_hwmp.c.
enum mpath_frame_type |
Definition at line 102 of file kernel-3.5/mesh_hwmp.c.
static u32 airtime_link_metric_get | ( | struct ieee80211_local * | local, |
struct sta_info * | sta | ||
) | [static] |
Definition at line 323 of file kernel-3.5/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 686 of file kernel-3.5/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 623 of file kernel-3.5/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 514 of file kernel-3.5/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 733 of file kernel-3.5/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 373 of file kernel-3.5/mesh_hwmp.c.
void ieee80211s_update_metric | ( | struct ieee80211_local * | local, |
struct sta_info * | stainfo, | ||
struct sk_buff * | skb | ||
) |
Definition at line 305 of file kernel-3.5/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. 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 1087 of file kernel-3.5/mesh_hwmp.c.
int mesh_nexthop_resolve | ( | struct sk_buff * | skb, |
struct ieee80211_sub_if_data * | sdata | ||
) |
Definition at line 1033 of file kernel-3.5/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 240 of file kernel-3.5/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 111 of file kernel-3.5/mesh_hwmp.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 942 of file kernel-3.5/mesh_hwmp.c.
void mesh_path_timer | ( | unsigned long | data | ) |
Definition at line 1122 of file kernel-3.5/mesh_hwmp.c.
void mesh_path_tx_root_frame | ( | struct ieee80211_sub_if_data * | sdata | ) |
Definition at line 1156 of file kernel-3.5/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 884 of file kernel-3.5/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 820 of file kernel-3.5/mesh_hwmp.c.
static struct sta_info* next_hop_deref_protected | ( | struct mesh_path * | mpath | ) | [static, read] |
Definition at line 616 of file kernel-3.5/mesh_hwmp.c.
static void prepare_frame_for_deferred_tx | ( | struct ieee80211_sub_if_data * | sdata, |
struct sk_buff * | skb | ||
) | [static] |
Definition at line 211 of file kernel-3.5/mesh_hwmp.c.
static u32 u16_field_get | ( | u8 * | preq_elem, |
int | offset, | ||
bool | ae | ||
) | [inline, static] |
Definition at line 49 of file kernel-3.5/mesh_hwmp.c.
static u32 u32_field_get | ( | u8 * | preq_elem, |
int | offset, | ||
bool | ae | ||
) | [inline, static] |
Definition at line 42 of file kernel-3.5/mesh_hwmp.c.
const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} [static] |
Definition at line 109 of file kernel-3.5/mesh_hwmp.c.