diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/mac80211/mesh.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'net/mac80211/mesh.h')
-rw-r--r-- | net/mac80211/mesh.h | 61 |
1 files changed, 15 insertions, 46 deletions
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index ebd3f1d9d889..249e733362e7 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
@@ -92,7 +92,7 @@ struct mesh_path { | |||
92 | u8 dst[ETH_ALEN]; | 92 | u8 dst[ETH_ALEN]; |
93 | u8 mpp[ETH_ALEN]; /* used for MPP or MAP */ | 93 | u8 mpp[ETH_ALEN]; /* used for MPP or MAP */ |
94 | struct ieee80211_sub_if_data *sdata; | 94 | struct ieee80211_sub_if_data *sdata; |
95 | struct sta_info *next_hop; | 95 | struct sta_info __rcu *next_hop; |
96 | struct timer_list timer; | 96 | struct timer_list timer; |
97 | struct sk_buff_head frame_queue; | 97 | struct sk_buff_head frame_queue; |
98 | struct rcu_head rcu; | 98 | struct rcu_head rcu; |
@@ -115,11 +115,12 @@ struct mesh_path { | |||
115 | * @hash_rnd: random value used for hash computations | 115 | * @hash_rnd: random value used for hash computations |
116 | * @entries: number of entries in the table | 116 | * @entries: number of entries in the table |
117 | * @free_node: function to free nodes of the table | 117 | * @free_node: function to free nodes of the table |
118 | * @copy_node: fuction to copy nodes of the table | 118 | * @copy_node: function to copy nodes of the table |
119 | * @size_order: determines size of the table, there will be 2^size_order hash | 119 | * @size_order: determines size of the table, there will be 2^size_order hash |
120 | * buckets | 120 | * buckets |
121 | * @mean_chain_len: maximum average length for the hash buckets' list, if it is | 121 | * @mean_chain_len: maximum average length for the hash buckets' list, if it is |
122 | * reached, the table will grow | 122 | * reached, the table will grow |
123 | * rcu_head: RCU head to free the table | ||
123 | */ | 124 | */ |
124 | struct mesh_table { | 125 | struct mesh_table { |
125 | /* Number of buckets will be 2^N */ | 126 | /* Number of buckets will be 2^N */ |
@@ -132,6 +133,8 @@ struct mesh_table { | |||
132 | int (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl); | 133 | int (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl); |
133 | int size_order; | 134 | int size_order; |
134 | int mean_chain_len; | 135 | int mean_chain_len; |
136 | |||
137 | struct rcu_head rcu_head; | ||
135 | }; | 138 | }; |
136 | 139 | ||
137 | /* Recent multicast cache */ | 140 | /* Recent multicast cache */ |
@@ -164,44 +167,10 @@ struct mesh_rmc { | |||
164 | }; | 167 | }; |
165 | 168 | ||
166 | 169 | ||
167 | /* | ||
168 | * MESH_CFG_COMP_LEN Includes: | ||
169 | * - Active path selection protocol ID. | ||
170 | * - Active path selection metric ID. | ||
171 | * - Congestion control mode identifier. | ||
172 | * - Channel precedence. | ||
173 | * Does not include mesh capabilities, which may vary across nodes in the same | ||
174 | * mesh | ||
175 | */ | ||
176 | #define MESH_CFG_CMP_LEN (IEEE80211_MESH_CONFIG_LEN - 2) | ||
177 | |||
178 | /* Default values, timeouts in ms */ | ||
179 | #define MESH_TTL 31 | ||
180 | #define MESH_MAX_RETR 3 | ||
181 | #define MESH_RET_T 100 | ||
182 | #define MESH_CONF_T 100 | ||
183 | #define MESH_HOLD_T 100 | ||
184 | |||
185 | #define MESH_PATH_TIMEOUT 5000 | ||
186 | /* Minimum interval between two consecutive PREQs originated by the same | ||
187 | * interface | ||
188 | */ | ||
189 | #define MESH_PREQ_MIN_INT 10 | ||
190 | #define MESH_DIAM_TRAVERSAL_TIME 50 | ||
191 | /* A path will be refreshed if it is used PATH_REFRESH_TIME milliseconds before | ||
192 | * timing out. This way it will remain ACTIVE and no data frames will be | ||
193 | * unnecesarily held in the pending queue. | ||
194 | */ | ||
195 | #define MESH_PATH_REFRESH_TIME 1000 | ||
196 | #define MESH_MIN_DISCOVERY_TIMEOUT (2 * MESH_DIAM_TRAVERSAL_TIME) | ||
197 | #define MESH_DEFAULT_BEACON_INTERVAL 1000 /* in 1024 us units */ | 170 | #define MESH_DEFAULT_BEACON_INTERVAL 1000 /* in 1024 us units */ |
198 | 171 | ||
199 | #define MESH_MAX_PREQ_RETRIES 4 | ||
200 | #define MESH_PATH_EXPIRE (600 * HZ) | 172 | #define MESH_PATH_EXPIRE (600 * HZ) |
201 | 173 | ||
202 | /* Default maximum number of established plinks per interface */ | ||
203 | #define MESH_MAX_ESTAB_PLINKS 32 | ||
204 | |||
205 | /* Default maximum number of plinks per interface */ | 174 | /* Default maximum number of plinks per interface */ |
206 | #define MESH_MAX_PLINKS 256 | 175 | #define MESH_MAX_PLINKS 256 |
207 | 176 | ||
@@ -221,8 +190,8 @@ struct mesh_rmc { | |||
221 | int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc, | 190 | int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc, |
222 | const u8 *da, const u8 *sa); | 191 | const u8 *da, const u8 *sa); |
223 | int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr, | 192 | int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr, |
224 | struct ieee80211_sub_if_data *sdata, char *addr4, | 193 | struct ieee80211_sub_if_data *sdata, char *addr4or5, |
225 | char *addr5, char *addr6); | 194 | char *addr6); |
226 | int mesh_rmc_check(u8 *addr, struct ieee80211s_hdr *mesh_hdr, | 195 | int mesh_rmc_check(u8 *addr, struct ieee80211s_hdr *mesh_hdr, |
227 | struct ieee80211_sub_if_data *sdata); | 196 | struct ieee80211_sub_if_data *sdata); |
228 | bool mesh_matches_local(struct ieee802_11_elems *ie, | 197 | bool mesh_matches_local(struct ieee802_11_elems *ie, |
@@ -260,7 +229,8 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, | |||
260 | int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata); | 229 | int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata); |
261 | /* Mesh plinks */ | 230 | /* Mesh plinks */ |
262 | void mesh_neighbour_update(u8 *hw_addr, u32 rates, | 231 | void mesh_neighbour_update(u8 *hw_addr, u32 rates, |
263 | struct ieee80211_sub_if_data *sdata, bool add); | 232 | struct ieee80211_sub_if_data *sdata, |
233 | struct ieee802_11_elems *ie); | ||
264 | bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie); | 234 | bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie); |
265 | void mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata); | 235 | void mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata); |
266 | void mesh_plink_broken(struct sta_info *sta); | 236 | void mesh_plink_broken(struct sta_info *sta); |
@@ -273,12 +243,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, | |||
273 | 243 | ||
274 | /* Private interfaces */ | 244 | /* Private interfaces */ |
275 | /* Mesh tables */ | 245 | /* Mesh tables */ |
276 | struct mesh_table *mesh_table_alloc(int size_order); | ||
277 | void mesh_table_free(struct mesh_table *tbl, bool free_leafs); | ||
278 | void mesh_mpath_table_grow(void); | 246 | void mesh_mpath_table_grow(void); |
279 | void mesh_mpp_table_grow(void); | 247 | void mesh_mpp_table_grow(void); |
280 | u32 mesh_table_hash(u8 *addr, struct ieee80211_sub_if_data *sdata, | ||
281 | struct mesh_table *tbl); | ||
282 | /* Mesh paths */ | 248 | /* Mesh paths */ |
283 | int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn, __le16 target_rcode, | 249 | int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn, __le16 target_rcode, |
284 | const u8 *ra, struct ieee80211_sub_if_data *sdata); | 250 | const u8 *ra, struct ieee80211_sub_if_data *sdata); |
@@ -318,9 +284,10 @@ static inline void mesh_path_activate(struct mesh_path *mpath) | |||
318 | mpath->flags |= MESH_PATH_ACTIVE | MESH_PATH_RESOLVED; | 284 | mpath->flags |= MESH_PATH_ACTIVE | MESH_PATH_RESOLVED; |
319 | } | 285 | } |
320 | 286 | ||
321 | #define for_each_mesh_entry(x, p, node, i) \ | 287 | static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata) |
322 | for (i = 0; i <= x->hash_mask; i++) \ | 288 | { |
323 | hlist_for_each_entry_rcu(node, p, &x->hash_buckets[i], list) | 289 | return sdata->u.mesh.mesh_pp_id == IEEE80211_PATH_PROTOCOL_HWMP; |
290 | } | ||
324 | 291 | ||
325 | void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local); | 292 | void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local); |
326 | 293 | ||
@@ -338,6 +305,8 @@ static inline void ieee80211_mesh_restart(struct ieee80211_sub_if_data *sdata) | |||
338 | {} | 305 | {} |
339 | static inline void mesh_plink_quiesce(struct sta_info *sta) {} | 306 | static inline void mesh_plink_quiesce(struct sta_info *sta) {} |
340 | static inline void mesh_plink_restart(struct sta_info *sta) {} | 307 | static inline void mesh_plink_restart(struct sta_info *sta) {} |
308 | static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata) | ||
309 | { return false; } | ||
341 | #endif | 310 | #endif |
342 | 311 | ||
343 | #endif /* IEEE80211S_H */ | 312 | #endif /* IEEE80211S_H */ |