diff options
Diffstat (limited to 'net/mac80211/mesh.h')
| -rw-r--r-- | net/mac80211/mesh.h | 80 |
1 files changed, 50 insertions, 30 deletions
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 7495fbb0d211..e10471c6ba42 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h | |||
| @@ -47,7 +47,7 @@ enum mesh_path_flags { | |||
| 47 | * struct mesh_path - mac80211 mesh path structure | 47 | * struct mesh_path - mac80211 mesh path structure |
| 48 | * | 48 | * |
| 49 | * @dst: mesh path destination mac address | 49 | * @dst: mesh path destination mac address |
| 50 | * @dev: mesh path device | 50 | * @sdata: mesh subif |
| 51 | * @next_hop: mesh neighbor to which frames for this destination will be | 51 | * @next_hop: mesh neighbor to which frames for this destination will be |
| 52 | * forwarded | 52 | * forwarded |
| 53 | * @timer: mesh path discovery timer | 53 | * @timer: mesh path discovery timer |
| @@ -64,14 +64,15 @@ enum mesh_path_flags { | |||
| 64 | * @state_lock: mesh pat state lock | 64 | * @state_lock: mesh pat state lock |
| 65 | * | 65 | * |
| 66 | * | 66 | * |
| 67 | * The combination of dst and dev is unique in the mesh path table. Since the | 67 | * The combination of dst and sdata is unique in the mesh path table. Since the |
| 68 | * next_hop STA is only protected by RCU as well, deleting the STA must also | 68 | * next_hop STA is only protected by RCU as well, deleting the STA must also |
| 69 | * remove/substitute the mesh_path structure and wait until that is no longer | 69 | * remove/substitute the mesh_path structure and wait until that is no longer |
| 70 | * reachable before destroying the STA completely. | 70 | * reachable before destroying the STA completely. |
| 71 | */ | 71 | */ |
| 72 | struct mesh_path { | 72 | struct mesh_path { |
| 73 | u8 dst[ETH_ALEN]; | 73 | u8 dst[ETH_ALEN]; |
| 74 | struct net_device *dev; | 74 | u8 mpp[ETH_ALEN]; /* used for MPP or MAP */ |
| 75 | struct ieee80211_sub_if_data *sdata; | ||
| 75 | struct sta_info *next_hop; | 76 | struct sta_info *next_hop; |
| 76 | struct timer_list timer; | 77 | struct timer_list timer; |
| 77 | struct sk_buff_head frame_queue; | 78 | struct sk_buff_head frame_queue; |
| @@ -203,67 +204,82 @@ int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); | |||
| 203 | int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr, | 204 | int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr, |
| 204 | struct ieee80211_sub_if_data *sdata); | 205 | struct ieee80211_sub_if_data *sdata); |
| 205 | int mesh_rmc_check(u8 *addr, struct ieee80211s_hdr *mesh_hdr, | 206 | int mesh_rmc_check(u8 *addr, struct ieee80211s_hdr *mesh_hdr, |
| 206 | struct net_device *dev); | 207 | struct ieee80211_sub_if_data *sdata); |
| 207 | bool mesh_matches_local(struct ieee802_11_elems *ie, struct net_device *dev); | 208 | bool mesh_matches_local(struct ieee802_11_elems *ie, |
| 208 | void mesh_ids_set_default(struct ieee80211_if_sta *sta); | 209 | struct ieee80211_sub_if_data *sdata); |
| 209 | void mesh_mgmt_ies_add(struct sk_buff *skb, struct net_device *dev); | 210 | void mesh_ids_set_default(struct ieee80211_if_mesh *mesh); |
| 210 | void mesh_rmc_free(struct net_device *dev); | 211 | void mesh_mgmt_ies_add(struct sk_buff *skb, |
| 211 | int mesh_rmc_init(struct net_device *dev); | 212 | struct ieee80211_sub_if_data *sdata); |
| 213 | void mesh_rmc_free(struct ieee80211_sub_if_data *sdata); | ||
| 214 | int mesh_rmc_init(struct ieee80211_sub_if_data *sdata); | ||
| 212 | void ieee80211s_init(void); | 215 | void ieee80211s_init(void); |
| 213 | void ieee80211s_stop(void); | 216 | void ieee80211s_stop(void); |
| 214 | void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata); | 217 | void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata); |
| 218 | ieee80211_rx_result | ||
| 219 | ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, | ||
| 220 | struct ieee80211_rx_status *rx_status); | ||
| 221 | void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata); | ||
| 222 | void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata); | ||
| 215 | 223 | ||
| 216 | /* Mesh paths */ | 224 | /* Mesh paths */ |
| 217 | int mesh_nexthop_lookup(struct sk_buff *skb, struct net_device *dev); | 225 | int mesh_nexthop_lookup(struct sk_buff *skb, |
| 218 | void mesh_path_start_discovery(struct net_device *dev); | 226 | struct ieee80211_sub_if_data *sdata); |
| 219 | struct mesh_path *mesh_path_lookup(u8 *dst, struct net_device *dev); | 227 | void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata); |
| 220 | struct mesh_path *mesh_path_lookup_by_idx(int idx, struct net_device *dev); | 228 | struct mesh_path *mesh_path_lookup(u8 *dst, |
| 229 | struct ieee80211_sub_if_data *sdata); | ||
| 230 | struct mesh_path *mpp_path_lookup(u8 *dst, | ||
| 231 | struct ieee80211_sub_if_data *sdata); | ||
| 232 | int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata); | ||
| 233 | struct mesh_path *mesh_path_lookup_by_idx(int idx, | ||
| 234 | struct ieee80211_sub_if_data *sdata); | ||
| 221 | void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop); | 235 | void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop); |
| 222 | void mesh_path_expire(struct net_device *dev); | 236 | void mesh_path_expire(struct ieee80211_sub_if_data *sdata); |
| 223 | void mesh_path_flush(struct net_device *dev); | 237 | void mesh_path_flush(struct ieee80211_sub_if_data *sdata); |
| 224 | void mesh_rx_path_sel_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | 238 | void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, |
| 225 | size_t len); | 239 | struct ieee80211_mgmt *mgmt, size_t len); |
| 226 | int mesh_path_add(u8 *dst, struct net_device *dev); | 240 | int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata); |
| 227 | /* Mesh plinks */ | 241 | /* Mesh plinks */ |
| 228 | void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct net_device *dev, | 242 | void mesh_neighbour_update(u8 *hw_addr, u64 rates, |
| 229 | bool add); | 243 | struct ieee80211_sub_if_data *sdata, bool add); |
| 230 | bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie, | 244 | bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie); |
| 231 | struct net_device *dev); | ||
| 232 | void mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata); | 245 | void mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata); |
| 233 | void mesh_plink_broken(struct sta_info *sta); | 246 | void mesh_plink_broken(struct sta_info *sta); |
| 234 | void mesh_plink_deactivate(struct sta_info *sta); | 247 | void mesh_plink_deactivate(struct sta_info *sta); |
| 235 | int mesh_plink_open(struct sta_info *sta); | 248 | int mesh_plink_open(struct sta_info *sta); |
| 236 | int mesh_plink_close(struct sta_info *sta); | 249 | int mesh_plink_close(struct sta_info *sta); |
| 237 | void mesh_plink_block(struct sta_info *sta); | 250 | void mesh_plink_block(struct sta_info *sta); |
| 238 | void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | 251 | void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, |
| 239 | size_t len, struct ieee80211_rx_status *rx_status); | 252 | struct ieee80211_mgmt *mgmt, size_t len, |
| 253 | struct ieee80211_rx_status *rx_status); | ||
| 240 | 254 | ||
| 241 | /* Private interfaces */ | 255 | /* Private interfaces */ |
| 242 | /* Mesh tables */ | 256 | /* Mesh tables */ |
| 243 | struct mesh_table *mesh_table_alloc(int size_order); | 257 | struct mesh_table *mesh_table_alloc(int size_order); |
| 244 | void mesh_table_free(struct mesh_table *tbl, bool free_leafs); | 258 | void mesh_table_free(struct mesh_table *tbl, bool free_leafs); |
| 245 | struct mesh_table *mesh_table_grow(struct mesh_table *tbl); | 259 | struct mesh_table *mesh_table_grow(struct mesh_table *tbl); |
| 246 | u32 mesh_table_hash(u8 *addr, struct net_device *dev, struct mesh_table *tbl); | 260 | u32 mesh_table_hash(u8 *addr, struct ieee80211_sub_if_data *sdata, |
| 261 | struct mesh_table *tbl); | ||
| 247 | /* Mesh paths */ | 262 | /* Mesh paths */ |
| 248 | int mesh_path_error_tx(u8 *dest, __le32 dest_dsn, u8 *ra, | 263 | int mesh_path_error_tx(u8 *dest, __le32 dest_dsn, u8 *ra, |
| 249 | struct net_device *dev); | 264 | struct ieee80211_sub_if_data *sdata); |
| 250 | void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta); | 265 | void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta); |
| 251 | void mesh_path_flush_pending(struct mesh_path *mpath); | 266 | void mesh_path_flush_pending(struct mesh_path *mpath); |
| 252 | void mesh_path_tx_pending(struct mesh_path *mpath); | 267 | void mesh_path_tx_pending(struct mesh_path *mpath); |
| 253 | int mesh_pathtbl_init(void); | 268 | int mesh_pathtbl_init(void); |
| 254 | void mesh_pathtbl_unregister(void); | 269 | void mesh_pathtbl_unregister(void); |
| 255 | int mesh_path_del(u8 *addr, struct net_device *dev); | 270 | int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata); |
| 256 | void mesh_path_timer(unsigned long data); | 271 | void mesh_path_timer(unsigned long data); |
| 257 | void mesh_path_flush_by_nexthop(struct sta_info *sta); | 272 | void mesh_path_flush_by_nexthop(struct sta_info *sta); |
| 258 | void mesh_path_discard_frame(struct sk_buff *skb, struct net_device *dev); | 273 | void mesh_path_discard_frame(struct sk_buff *skb, |
| 274 | struct ieee80211_sub_if_data *sdata); | ||
| 259 | 275 | ||
| 260 | #ifdef CONFIG_MAC80211_MESH | 276 | #ifdef CONFIG_MAC80211_MESH |
| 261 | extern int mesh_allocated; | 277 | extern int mesh_allocated; |
| 262 | 278 | ||
| 263 | static inline int mesh_plink_free_count(struct ieee80211_sub_if_data *sdata) | 279 | static inline int mesh_plink_free_count(struct ieee80211_sub_if_data *sdata) |
| 264 | { | 280 | { |
| 265 | return sdata->u.sta.mshcfg.dot11MeshMaxPeerLinks - | 281 | return sdata->u.mesh.mshcfg.dot11MeshMaxPeerLinks - |
| 266 | atomic_read(&sdata->u.sta.mshstats.estab_plinks); | 282 | atomic_read(&sdata->u.mesh.mshstats.estab_plinks); |
| 267 | } | 283 | } |
| 268 | 284 | ||
| 269 | static inline bool mesh_plink_availables(struct ieee80211_sub_if_data *sdata) | 285 | static inline bool mesh_plink_availables(struct ieee80211_sub_if_data *sdata) |
| @@ -281,8 +297,12 @@ static inline void mesh_path_activate(struct mesh_path *mpath) | |||
| 281 | for (i = 0; i <= x->hash_mask; i++) \ | 297 | for (i = 0; i <= x->hash_mask; i++) \ |
| 282 | hlist_for_each_entry_rcu(node, p, &x->hash_buckets[i], list) | 298 | hlist_for_each_entry_rcu(node, p, &x->hash_buckets[i], list) |
| 283 | 299 | ||
| 300 | void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local); | ||
| 301 | |||
| 284 | #else | 302 | #else |
| 285 | #define mesh_allocated 0 | 303 | #define mesh_allocated 0 |
| 304 | static inline void | ||
| 305 | ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) {} | ||
| 286 | #endif | 306 | #endif |
| 287 | 307 | ||
| 288 | #endif /* IEEE80211S_H */ | 308 | #endif /* IEEE80211S_H */ |
