aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh.h
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2011-08-09 19:45:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 13:59:42 -0400
commit5ee68e5b39de5cefecf147c58711f8ab01c21231 (patch)
tree59a39c4dc5a38497aa786689552136d95c690ecf /net/mac80211/mesh.h
parent00e3f25c8556384bfec2a168c41e885fa6a7748c (diff)
mac80211: mesh gate implementation
In this implementation, a mesh gate is a root node with a certain bit set in its RANN flags. The mpath to this root node is marked as a path to a gate, and added to our list of known gates for this if_mesh. Once a path discovery process fails, we forward the unresolved frames to a known gate. Thanks to Luis Rodriguez for refactoring and bug fix help. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh.h')
-rw-r--r--net/mac80211/mesh.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 3c7d0f8b376a..9d9116e1a9ac 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -81,6 +81,7 @@ enum mesh_deferred_task_flags {
81 * @discovery_retries: number of discovery retries 81 * @discovery_retries: number of discovery retries
82 * @flags: mesh path flags, as specified on &enum mesh_path_flags 82 * @flags: mesh path flags, as specified on &enum mesh_path_flags
83 * @state_lock: mesh path state lock 83 * @state_lock: mesh path state lock
84 * @is_gate: the destination station of this path is a mesh gate
84 * 85 *
85 * 86 *
86 * The combination of dst and sdata is unique in the mesh path table. Since the 87 * The combination of dst and sdata is unique in the mesh path table. Since the
@@ -104,6 +105,7 @@ struct mesh_path {
104 u8 discovery_retries; 105 u8 discovery_retries;
105 enum mesh_path_flags flags; 106 enum mesh_path_flags flags;
106 spinlock_t state_lock; 107 spinlock_t state_lock;
108 bool is_gate;
107}; 109};
108 110
109/** 111/**
@@ -120,6 +122,9 @@ struct mesh_path {
120 * buckets 122 * buckets
121 * @mean_chain_len: maximum average length for the hash buckets' list, if it is 123 * @mean_chain_len: maximum average length for the hash buckets' list, if it is
122 * reached, the table will grow 124 * reached, the table will grow
125 * @known_gates: list of known mesh gates and their mpaths by the station. The
126 * gate's mpath may or may not be resolved and active.
127 *
123 * rcu_head: RCU head to free the table 128 * rcu_head: RCU head to free the table
124 */ 129 */
125struct mesh_table { 130struct mesh_table {
@@ -133,6 +138,8 @@ struct mesh_table {
133 int (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl); 138 int (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl);
134 int size_order; 139 int size_order;
135 int mean_chain_len; 140 int mean_chain_len;
141 struct hlist_head *known_gates;
142 spinlock_t gates_lock;
136 143
137 struct rcu_head rcu_head; 144 struct rcu_head rcu_head;
138}; 145};
@@ -236,6 +243,10 @@ void mesh_path_flush(struct ieee80211_sub_if_data *sdata);
236void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, 243void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata,
237 struct ieee80211_mgmt *mgmt, size_t len); 244 struct ieee80211_mgmt *mgmt, size_t len);
238int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata); 245int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata);
246
247int mesh_path_add_gate(struct mesh_path *mpath);
248int mesh_path_send_to_gates(struct mesh_path *mpath);
249int mesh_gate_num(struct ieee80211_sub_if_data *sdata);
239/* Mesh plinks */ 250/* Mesh plinks */
240void mesh_neighbour_update(u8 *hw_addr, u32 rates, 251void mesh_neighbour_update(u8 *hw_addr, u32 rates,
241 struct ieee80211_sub_if_data *sdata, 252 struct ieee80211_sub_if_data *sdata,