aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h56
1 files changed, 49 insertions, 7 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 49466b6996d1..7394c9b783b8 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -93,9 +93,8 @@ struct ieee80211_sta_bss {
93#ifdef CONFIG_MAC80211_MESH 93#ifdef CONFIG_MAC80211_MESH
94 u8 *mesh_id; 94 u8 *mesh_id;
95 size_t mesh_id_len; 95 size_t mesh_id_len;
96#endif
97 /* mesh_cfg left out the ifdef to reduce clutter on bss handling */
98 u8 *mesh_cfg; 96 u8 *mesh_cfg;
97#endif
99#define IEEE80211_MAX_SUPP_RATES 32 98#define IEEE80211_MAX_SUPP_RATES 32
100 u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; 99 u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
101 size_t supp_rates_len; 100 size_t supp_rates_len;
@@ -113,6 +112,30 @@ struct ieee80211_sta_bss {
113 u8 erp_value; 112 u8 erp_value;
114}; 113};
115 114
115static inline u8 *bss_mesh_cfg(struct ieee80211_sta_bss *bss)
116{
117#ifdef CONFIG_MAC80211_MESH
118 return bss->mesh_cfg;
119#endif
120 return NULL;
121}
122
123static inline u8 *bss_mesh_id(struct ieee80211_sta_bss *bss)
124{
125#ifdef CONFIG_MAC80211_MESH
126 return bss->mesh_id;
127#endif
128 return NULL;
129}
130
131static inline u8 bss_mesh_id_len(struct ieee80211_sta_bss *bss)
132{
133#ifdef CONFIG_MAC80211_MESH
134 return bss->mesh_id_len;
135#endif
136 return 0;
137}
138
116 139
117typedef unsigned __bitwise__ ieee80211_tx_result; 140typedef unsigned __bitwise__ ieee80211_tx_result;
118#define TX_CONTINUE ((__force ieee80211_tx_result) 0u) 141#define TX_CONTINUE ((__force ieee80211_tx_result) 0u)
@@ -233,7 +256,6 @@ struct ieee80211_if_vlan {
233 struct list_head list; 256 struct list_head list;
234}; 257};
235 258
236#ifdef CONFIG_MAC80211_MESH
237struct mesh_stats { 259struct mesh_stats {
238 __u32 fwded_frames; /* Mesh forwarded frames */ 260 __u32 fwded_frames; /* Mesh forwarded frames */
239 __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/ 261 __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/
@@ -249,7 +271,6 @@ struct mesh_preq_queue {
249 u8 flags; 271 u8 flags;
250}; 272};
251 273
252
253struct mesh_config { 274struct mesh_config {
254 /* Timeouts in ms */ 275 /* Timeouts in ms */
255 /* Mesh plink management parameters */ 276 /* Mesh plink management parameters */
@@ -268,7 +289,7 @@ struct mesh_config {
268 u32 path_refresh_time; 289 u32 path_refresh_time;
269 u16 min_discovery_timeout; 290 u16 min_discovery_timeout;
270}; 291};
271#endif 292
272 293
273/* flags used in struct ieee80211_if_sta.flags */ 294/* flags used in struct ieee80211_if_sta.flags */
274#define IEEE80211_STA_SSID_SET BIT(0) 295#define IEEE80211_STA_SSID_SET BIT(0)
@@ -361,6 +382,22 @@ struct ieee80211_if_sta {
361 int num_beacons; /* number of TXed beacon frames by this STA */ 382 int num_beacons; /* number of TXed beacon frames by this STA */
362}; 383};
363 384
385static inline void ieee80211_if_sta_set_mesh_id(struct ieee80211_if_sta *ifsta,
386 u8 mesh_id_len, u8 *mesh_id)
387{
388#ifdef CONFIG_MAC80211_MESH
389 ifsta->mesh_id_len = mesh_id_len;
390 memcpy(ifsta->mesh_id, mesh_id, mesh_id_len);
391#endif
392}
393
394#ifdef CONFIG_MAC80211_MESH
395#define IEEE80211_IFSTA_MESH_CTR_INC(sta, name) \
396 do { (sta)->mshstats.name++; } while (0)
397#else
398#define IEEE80211_IFSTA_MESH_CTR_INC(sta, name) \
399 do { } while (0)
400#endif
364 401
365/* flags used in struct ieee80211_sub_if_data.flags */ 402/* flags used in struct ieee80211_sub_if_data.flags */
366#define IEEE80211_SDATA_ALLMULTI BIT(0) 403#define IEEE80211_SDATA_ALLMULTI BIT(0)
@@ -472,7 +509,7 @@ struct ieee80211_sub_if_data {
472 struct dentry *dropped_frames_ttl; 509 struct dentry *dropped_frames_ttl;
473 struct dentry *dropped_frames_no_route; 510 struct dentry *dropped_frames_no_route;
474 struct dentry *estab_plinks; 511 struct dentry *estab_plinks;
475 struct timer_list mesh_path_timer; 512 struct timer_list mesh_path_timer;
476 } mesh_stats; 513 } mesh_stats;
477 514
478 struct dentry *mesh_config_dir; 515 struct dentry *mesh_config_dir;
@@ -884,12 +921,17 @@ void sta_addba_resp_timer_expired(unsigned long data);
884u64 ieee80211_sta_get_rates(struct ieee80211_local *local, 921u64 ieee80211_sta_get_rates(struct ieee80211_local *local,
885 struct ieee802_11_elems *elems, 922 struct ieee802_11_elems *elems,
886 enum ieee80211_band band); 923 enum ieee80211_band band);
887void ieee80211_start_mesh(struct net_device *dev);
888void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb, 924void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb,
889 int encrypt); 925 int encrypt);
890void ieee802_11_parse_elems(u8 *start, size_t len, 926void ieee802_11_parse_elems(u8 *start, size_t len,
891 struct ieee802_11_elems *elems); 927 struct ieee802_11_elems *elems);
892 928
929#ifdef CONFIG_MAC80211_MESH
930void ieee80211_start_mesh(struct net_device *dev);
931#else
932static inline void ieee80211_start_mesh(struct net_device *dev)
933{}
934#endif
893 935
894/* ieee80211_iface.c */ 936/* ieee80211_iface.c */
895int ieee80211_if_add(struct net_device *dev, const char *name, 937int ieee80211_if_add(struct net_device *dev, const char *name,