aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorLuis Carlos Cobo <luisca@cozybit.com>2008-02-23 09:17:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-06 15:30:41 -0500
commitee3858551ae6d044578f598f8001db5f1a9fd52e (patch)
tree5a9b61aecccb65210e29850c34801f3cfe6259a9 /net/mac80211/ieee80211_i.h
parent33b64eb2b1b1759cbdafbe5c59df652f1e7c746e (diff)
mac80211: mesh data structures and first mesh changes
Includes integration in struct sta_info of mesh peer link elements, previously on their own mesh peer link table. Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h170
1 files changed, 168 insertions, 2 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b07b3cbfd039..49466b6996d1 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -90,6 +90,12 @@ struct ieee80211_sta_bss {
90 size_t wmm_ie_len; 90 size_t wmm_ie_len;
91 u8 *ht_ie; 91 u8 *ht_ie;
92 size_t ht_ie_len; 92 size_t ht_ie_len;
93#ifdef CONFIG_MAC80211_MESH
94 u8 *mesh_id;
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;
93#define IEEE80211_MAX_SUPP_RATES 32 99#define IEEE80211_MAX_SUPP_RATES 32
94 u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; 100 u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
95 size_t supp_rates_len; 101 size_t supp_rates_len;
@@ -227,6 +233,43 @@ struct ieee80211_if_vlan {
227 struct list_head list; 233 struct list_head list;
228}; 234};
229 235
236#ifdef CONFIG_MAC80211_MESH
237struct mesh_stats {
238 __u32 fwded_frames; /* Mesh forwarded frames */
239 __u32 dropped_frames_ttl; /* Not transmitted since mesh_ttl == 0*/
240 __u32 dropped_frames_no_route; /* Not transmitted, no route found */
241 atomic_t estab_plinks;
242};
243
244#define PREQ_Q_F_START 0x1
245#define PREQ_Q_F_REFRESH 0x2
246struct mesh_preq_queue {
247 struct list_head list;
248 u8 dst[ETH_ALEN];
249 u8 flags;
250};
251
252
253struct mesh_config {
254 /* Timeouts in ms */
255 /* Mesh plink management parameters */
256 u16 dot11MeshRetryTimeout;
257 u16 dot11MeshConfirmTimeout;
258 u16 dot11MeshHoldingTimeout;
259 u16 dot11MeshMaxPeerLinks;
260 u8 dot11MeshMaxRetries;
261 u8 dot11MeshTTL;
262 bool auto_open_plinks;
263 /* HWMP parameters */
264 u32 dot11MeshHWMPactivePathTimeout;
265 u16 dot11MeshHWMPpreqMinInterval;
266 u16 dot11MeshHWMPnetDiameterTraversalTime;
267 u8 dot11MeshHWMPmaxPREQretries;
268 u32 path_refresh_time;
269 u16 min_discovery_timeout;
270};
271#endif
272
230/* flags used in struct ieee80211_if_sta.flags */ 273/* flags used in struct ieee80211_if_sta.flags */
231#define IEEE80211_STA_SSID_SET BIT(0) 274#define IEEE80211_STA_SSID_SET BIT(0)
232#define IEEE80211_STA_BSSID_SET BIT(1) 275#define IEEE80211_STA_BSSID_SET BIT(1)
@@ -245,7 +288,8 @@ struct ieee80211_if_sta {
245 enum { 288 enum {
246 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, 289 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
247 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED, 290 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED,
248 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED 291 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED,
292 IEEE80211_MESH_UP
249 } state; 293 } state;
250 struct timer_list timer; 294 struct timer_list timer;
251 struct work_struct work; 295 struct work_struct work;
@@ -254,6 +298,34 @@ struct ieee80211_if_sta {
254 size_t ssid_len; 298 size_t ssid_len;
255 u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; 299 u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
256 size_t scan_ssid_len; 300 size_t scan_ssid_len;
301#ifdef CONFIG_MAC80211_MESH
302 struct timer_list mesh_path_timer;
303 u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
304 bool accepting_plinks;
305 size_t mesh_id_len;
306 /* Active Path Selection Protocol Identifier */
307 u8 mesh_pp_id[4];
308 /* Active Path Selection Metric Identifier */
309 u8 mesh_pm_id[4];
310 /* Congestion Control Mode Identifier */
311 u8 mesh_cc_id[4];
312 /* Local mesh Destination Sequence Number */
313 u32 dsn;
314 /* Last used PREQ ID */
315 u32 preq_id;
316 atomic_t mpaths;
317 /* Timestamp of last DSN update */
318 unsigned long last_dsn_update;
319 /* Timestamp of last DSN sent */
320 unsigned long last_preq;
321 struct mesh_rmc *rmc;
322 spinlock_t mesh_preq_queue_lock;
323 struct mesh_preq_queue preq_queue;
324 int preq_queue_len;
325 struct mesh_stats mshstats;
326 struct mesh_config mshcfg;
327 u8 mesh_seqnum[3];
328#endif
257 u16 aid; 329 u16 aid;
258 u16 ap_capab, capab; 330 u16 ap_capab, capab;
259 u8 *extra_ie; /* to be added to the end of AssocReq */ 331 u8 *extra_ie; /* to be added to the end of AssocReq */
@@ -286,6 +358,7 @@ struct ieee80211_if_sta {
286 u32 supp_rates_bits[IEEE80211_NUM_BANDS]; 358 u32 supp_rates_bits[IEEE80211_NUM_BANDS];
287 359
288 int wmm_last_param_set; 360 int wmm_last_param_set;
361 int num_beacons; /* number of TXed beacon frames by this STA */
289}; 362};
290 363
291 364
@@ -365,6 +438,7 @@ struct ieee80211_sub_if_data {
365 struct dentry *auth_alg; 438 struct dentry *auth_alg;
366 struct dentry *auth_transaction; 439 struct dentry *auth_transaction;
367 struct dentry *flags; 440 struct dentry *flags;
441 struct dentry *num_beacons_sta;
368 } sta; 442 } sta;
369 struct { 443 struct {
370 struct dentry *channel_use; 444 struct dentry *channel_use;
@@ -390,6 +464,35 @@ struct ieee80211_sub_if_data {
390 } monitor; 464 } monitor;
391 struct dentry *default_key; 465 struct dentry *default_key;
392 } debugfs; 466 } debugfs;
467
468#ifdef CONFIG_MAC80211_MESH
469 struct dentry *mesh_stats_dir;
470 struct {
471 struct dentry *fwded_frames;
472 struct dentry *dropped_frames_ttl;
473 struct dentry *dropped_frames_no_route;
474 struct dentry *estab_plinks;
475 struct timer_list mesh_path_timer;
476 } mesh_stats;
477
478 struct dentry *mesh_config_dir;
479 struct {
480 struct dentry *dot11MeshRetryTimeout;
481 struct dentry *dot11MeshConfirmTimeout;
482 struct dentry *dot11MeshHoldingTimeout;
483 struct dentry *dot11MeshMaxRetries;
484 struct dentry *dot11MeshTTL;
485 struct dentry *auto_open_plinks;
486 struct dentry *dot11MeshMaxPeerLinks;
487 struct dentry *dot11MeshHWMPactivePathTimeout;
488 struct dentry *dot11MeshHWMPpreqMinInterval;
489 struct dentry *dot11MeshHWMPnetDiameterTraversalTime;
490 struct dentry *dot11MeshHWMPmaxPREQretries;
491 struct dentry *path_refresh_time;
492 struct dentry *min_discovery_timeout;
493 } mesh_config;
494#endif
495
393#endif 496#endif
394 /* must be last, dynamically sized area in this! */ 497 /* must be last, dynamically sized area in this! */
395 struct ieee80211_vif vif; 498 struct ieee80211_vif vif;
@@ -617,6 +720,57 @@ struct ieee80211_ra_tid {
617 u16 tid; 720 u16 tid;
618}; 721};
619 722
723/* Parsed Information Elements */
724struct ieee802_11_elems {
725 /* pointers to IEs */
726 u8 *ssid;
727 u8 *supp_rates;
728 u8 *fh_params;
729 u8 *ds_params;
730 u8 *cf_params;
731 u8 *tim;
732 u8 *ibss_params;
733 u8 *challenge;
734 u8 *wpa;
735 u8 *rsn;
736 u8 *erp_info;
737 u8 *ext_supp_rates;
738 u8 *wmm_info;
739 u8 *wmm_param;
740 u8 *ht_cap_elem;
741 u8 *ht_info_elem;
742 u8 *mesh_config;
743 u8 *mesh_id;
744 u8 *peer_link;
745 u8 *preq;
746 u8 *prep;
747 u8 *perr;
748
749 /* length of them, respectively */
750 u8 ssid_len;
751 u8 supp_rates_len;
752 u8 fh_params_len;
753 u8 ds_params_len;
754 u8 cf_params_len;
755 u8 tim_len;
756 u8 ibss_params_len;
757 u8 challenge_len;
758 u8 wpa_len;
759 u8 rsn_len;
760 u8 erp_info_len;
761 u8 ext_supp_rates_len;
762 u8 wmm_info_len;
763 u8 wmm_param_len;
764 u8 ht_cap_elem_len;
765 u8 ht_info_elem_len;
766 u8 mesh_config_len;
767 u8 mesh_id_len;
768 u8 peer_link_len;
769 u8 preq_len;
770 u8 prep_len;
771 u8 perr_len;
772};
773
620static inline struct ieee80211_local *hw_to_local( 774static inline struct ieee80211_local *hw_to_local(
621 struct ieee80211_hw *hw) 775 struct ieee80211_hw *hw)
622{ 776{
@@ -686,6 +840,7 @@ int ieee80211_set_compression(struct ieee80211_local *local,
686 struct net_device *dev, struct sta_info *sta); 840 struct net_device *dev, struct sta_info *sta);
687int ieee80211_set_freq(struct ieee80211_local *local, int freq); 841int ieee80211_set_freq(struct ieee80211_local *local, int freq);
688/* ieee80211_sta.c */ 842/* ieee80211_sta.c */
843#define IEEE80211_FC(type, stype) cpu_to_le16(type | stype)
689void ieee80211_sta_timer(unsigned long data); 844void ieee80211_sta_timer(unsigned long data);
690void ieee80211_sta_work(struct work_struct *work); 845void ieee80211_sta_work(struct work_struct *work);
691void ieee80211_sta_scan_work(struct work_struct *work); 846void ieee80211_sta_scan_work(struct work_struct *work);
@@ -726,9 +881,20 @@ void ieee80211_sta_stop_rx_ba_session(struct net_device *dev, u8 *da,
726 u16 tid, u16 initiator, u16 reason); 881 u16 tid, u16 initiator, u16 reason);
727void sta_rx_agg_session_timer_expired(unsigned long data); 882void sta_rx_agg_session_timer_expired(unsigned long data);
728void sta_addba_resp_timer_expired(unsigned long data); 883void sta_addba_resp_timer_expired(unsigned long data);
884u64 ieee80211_sta_get_rates(struct ieee80211_local *local,
885 struct ieee802_11_elems *elems,
886 enum ieee80211_band band);
887void ieee80211_start_mesh(struct net_device *dev);
888void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb,
889 int encrypt);
890void ieee802_11_parse_elems(u8 *start, size_t len,
891 struct ieee802_11_elems *elems);
892
893
729/* ieee80211_iface.c */ 894/* ieee80211_iface.c */
730int ieee80211_if_add(struct net_device *dev, const char *name, 895int ieee80211_if_add(struct net_device *dev, const char *name,
731 struct net_device **new_dev, int type); 896 struct net_device **new_dev, int type,
897 struct vif_params *params);
732void ieee80211_if_set_type(struct net_device *dev, int type); 898void ieee80211_if_set_type(struct net_device *dev, int type);
733void ieee80211_if_reinit(struct net_device *dev); 899void ieee80211_if_reinit(struct net_device *dev);
734void __ieee80211_if_del(struct ieee80211_local *local, 900void __ieee80211_if_del(struct ieee80211_local *local,