mac80211: add nl80211/cfg80211 handling of the new mesh root mode option.
[safe/jmp/linux-2.6] / net / mac80211 / ieee80211_i.h
index c6b25cb..b63b99f 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/spinlock.h>
 #include <linux/etherdevice.h>
 #include <net/cfg80211.h>
-#include <net/iw_handler.h>
 #include <net/mac80211.h>
 #include "key.h"
 #include "sta_info.h"
@@ -177,7 +176,6 @@ struct ieee80211_rx_data {
        struct ieee80211_rate *rate;
 
        unsigned int flags;
-       int sent_ps_buffered;
        int queue;
        u32 tkip_iv32;
        u16 tkip_iv16;
@@ -210,10 +208,15 @@ struct ieee80211_if_wds {
 
 struct ieee80211_if_vlan {
        struct list_head list;
+
+       /* used for all tx if the VLAN is configured to 4-addr mode */
+       struct sta_info *sta;
 };
 
 struct mesh_stats {
-       __u32 fwded_frames;             /* Mesh forwarded frames */
+       __u32 fwded_mcast;              /* Mesh forwarded multicast frames */
+       __u32 fwded_unicast;            /* Mesh forwarded unicast frames */
+       __u32 fwded_frames;             /* Mesh total forwarded frames */
        __u32 dropped_frames_ttl;       /* Not transmitted since mesh_ttl == 0*/
        __u32 dropped_frames_no_route;  /* Not transmitted, no route found */
        atomic_t estab_plinks;
@@ -281,9 +284,11 @@ struct ieee80211_if_managed {
        struct work_struct beacon_loss_work;
 
        unsigned long probe_timeout;
+       int probe_send_count;
 
        struct mutex mtx;
        struct ieee80211_bss *associated;
+       struct ieee80211_mgd_work *old_associate_work;
        struct list_head work_list;
 
        u8 bssid[ETH_ALEN];
@@ -350,28 +355,33 @@ struct ieee80211_if_mesh {
        struct work_struct work;
        struct timer_list housekeeping_timer;
        struct timer_list mesh_path_timer;
+       struct timer_list mesh_path_root_timer;
        struct sk_buff_head skb_queue;
 
        unsigned long timers_running;
 
-       bool housekeeping;
+       unsigned long wrkq_flags;
 
        u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
        size_t mesh_id_len;
        /* Active Path Selection Protocol Identifier */
-       u8 mesh_pp_id[4];
+       u8 mesh_pp_id;
        /* Active Path Selection Metric Identifier */
-       u8 mesh_pm_id[4];
+       u8 mesh_pm_id;
        /* Congestion Control Mode Identifier */
-       u8 mesh_cc_id[4];
-       /* Local mesh Destination Sequence Number */
-       u32 dsn;
+       u8 mesh_cc_id;
+       /* Synchronization Protocol Identifier */
+       u8 mesh_sp_id;
+       /* Authentication Protocol Identifier */
+       u8 mesh_auth_id;
+       /* Local mesh Sequence Number */
+       u32 sn;
        /* Last used PREQ ID */
        u32 preq_id;
        atomic_t mpaths;
-       /* Timestamp of last DSN update */
-       unsigned long last_dsn_update;
-       /* Timestamp of last DSN sent */
+       /* Timestamp of last SN update */
+       unsigned long last_sn_update;
+       /* Timestamp of last SN sent */
        unsigned long last_preq;
        struct mesh_rmc *rmc;
        spinlock_t mesh_preq_queue_lock;
@@ -451,6 +461,8 @@ struct ieee80211_sub_if_data {
        int force_unicast_rateidx; /* forced TX rateidx for unicast frames */
        int max_ratectrl_rateidx; /* max TX rateidx for rate control */
 
+       bool use_4addr; /* use 4-address frames */
+
        union {
                struct ieee80211_if_ap ap;
                struct ieee80211_if_wds wds;
@@ -464,72 +476,11 @@ struct ieee80211_sub_if_data {
        } u;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-       struct dentry *debugfsdir;
-       union {
-               struct {
-                       struct dentry *drop_unencrypted;
-                       struct dentry *bssid;
-                       struct dentry *aid;
-                       struct dentry *capab;
-                       struct dentry *force_unicast_rateidx;
-                       struct dentry *max_ratectrl_rateidx;
-               } sta;
-               struct {
-                       struct dentry *drop_unencrypted;
-                       struct dentry *num_sta_ps;
-                       struct dentry *dtim_count;
-                       struct dentry *force_unicast_rateidx;
-                       struct dentry *max_ratectrl_rateidx;
-                       struct dentry *num_buffered_multicast;
-               } ap;
-               struct {
-                       struct dentry *drop_unencrypted;
-                       struct dentry *peer;
-                       struct dentry *force_unicast_rateidx;
-                       struct dentry *max_ratectrl_rateidx;
-               } wds;
-               struct {
-                       struct dentry *drop_unencrypted;
-                       struct dentry *force_unicast_rateidx;
-                       struct dentry *max_ratectrl_rateidx;
-               } vlan;
-               struct {
-                       struct dentry *mode;
-               } monitor;
-       } debugfs;
        struct {
+               struct dentry *dir;
                struct dentry *default_key;
                struct dentry *default_mgmt_key;
-       } common_debugfs;
-
-#ifdef CONFIG_MAC80211_MESH
-       struct dentry *mesh_stats_dir;
-       struct {
-               struct dentry *fwded_frames;
-               struct dentry *dropped_frames_ttl;
-               struct dentry *dropped_frames_no_route;
-               struct dentry *estab_plinks;
-               struct timer_list mesh_path_timer;
-       } mesh_stats;
-
-       struct dentry *mesh_config_dir;
-       struct {
-               struct dentry *dot11MeshRetryTimeout;
-               struct dentry *dot11MeshConfirmTimeout;
-               struct dentry *dot11MeshHoldingTimeout;
-               struct dentry *dot11MeshMaxRetries;
-               struct dentry *dot11MeshTTL;
-               struct dentry *auto_open_plinks;
-               struct dentry *dot11MeshMaxPeerLinks;
-               struct dentry *dot11MeshHWMPactivePathTimeout;
-               struct dentry *dot11MeshHWMPpreqMinInterval;
-               struct dentry *dot11MeshHWMPnetDiameterTraversalTime;
-               struct dentry *dot11MeshHWMPmaxPREQretries;
-               struct dentry *path_refresh_time;
-               struct dentry *min_discovery_timeout;
-       } mesh_config;
-#endif
-
+       } debugfs;
 #endif
        /* must be last, dynamically sized area in this! */
        struct ieee80211_vif vif;
@@ -615,6 +566,12 @@ struct ieee80211_local {
 
        const struct ieee80211_ops *ops;
 
+       /*
+        * private workqueue to mac80211. mac80211 makes this accessible
+        * via ieee80211_queue_work()
+        */
+       struct workqueue_struct *workqueue;
+
        unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
        /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
        spinlock_t queue_stop_reason_lock;
@@ -622,13 +579,16 @@ struct ieee80211_local {
        int open_count;
        int monitors, cooked_mntrs;
        /* number of interfaces with corresponding FIF_ flags */
-       int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss;
+       int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll;
        unsigned int filter_flags; /* FIF_* */
        struct iw_statistics wstats;
 
        /* protects the aggregated multicast list and filter calls */
        spinlock_t filter_lock;
 
+       /* used for uploading changed mc list */
+       struct work_struct reconfig_filter;
+
        /* aggregated multicast list */
        struct dev_addr_list *mc_list;
        int mc_count;
@@ -649,6 +609,9 @@ struct ieee80211_local {
         */
        bool quiescing;
 
+       /* device is started */
+       bool started;
+
        int tx_headroom; /* required headroom for hardware/radiotap */
 
        /* Tasklet and skb queue to process calls from IRQ mode. All frames
@@ -671,6 +634,7 @@ struct ieee80211_local {
        struct list_head sta_list;
        struct sta_info *sta_hash[STA_HASH_SIZE];
        struct timer_list sta_cleanup;
+       int sta_generation;
 
        struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
        struct tasklet_struct tx_pending_tasklet;
@@ -707,11 +671,10 @@ struct ieee80211_local {
        struct mutex scan_mtx;
        unsigned long scanning;
        struct cfg80211_ssid scan_ssid;
-       struct cfg80211_scan_request int_scan_req;
-       struct cfg80211_scan_request *scan_req;
+       struct cfg80211_scan_request *int_scan_req;
+       struct cfg80211_scan_request *scan_req, *hw_scan_req;
        struct ieee80211_channel *scan_channel;
-       const u8 *orig_ies;
-       int orig_ies_len;
+       enum ieee80211_band hw_scan_band;
        int scan_channel_idx;
        int scan_ies_len;
 
@@ -796,53 +759,6 @@ struct ieee80211_local {
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct local_debugfsdentries {
                struct dentry *rcdir;
-               struct dentry *rcname;
-               struct dentry *frequency;
-               struct dentry *total_ps_buffered;
-               struct dentry *wep_iv;
-               struct dentry *tsf;
-               struct dentry *queues;
-               struct dentry *reset;
-               struct dentry *noack;
-               struct dentry *statistics;
-               struct local_debugfsdentries_statsdentries {
-                       struct dentry *transmitted_fragment_count;
-                       struct dentry *multicast_transmitted_frame_count;
-                       struct dentry *failed_count;
-                       struct dentry *retry_count;
-                       struct dentry *multiple_retry_count;
-                       struct dentry *frame_duplicate_count;
-                       struct dentry *received_fragment_count;
-                       struct dentry *multicast_received_frame_count;
-                       struct dentry *transmitted_frame_count;
-                       struct dentry *wep_undecryptable_count;
-                       struct dentry *num_scans;
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
-                       struct dentry *tx_handlers_drop;
-                       struct dentry *tx_handlers_queued;
-                       struct dentry *tx_handlers_drop_unencrypted;
-                       struct dentry *tx_handlers_drop_fragment;
-                       struct dentry *tx_handlers_drop_wep;
-                       struct dentry *tx_handlers_drop_not_assoc;
-                       struct dentry *tx_handlers_drop_unauth_port;
-                       struct dentry *rx_handlers_drop;
-                       struct dentry *rx_handlers_queued;
-                       struct dentry *rx_handlers_drop_nullfunc;
-                       struct dentry *rx_handlers_drop_defrag;
-                       struct dentry *rx_handlers_drop_short;
-                       struct dentry *rx_handlers_drop_passive_scan;
-                       struct dentry *tx_expand_skb_head;
-                       struct dentry *tx_expand_skb_head_cloned;
-                       struct dentry *rx_expand_skb_head;
-                       struct dentry *rx_expand_skb_head2;
-                       struct dentry *rx_handlers_fragments;
-                       struct dentry *tx_status_drop;
-#endif
-                       struct dentry *dot11ACKFailureCount;
-                       struct dentry *dot11RTSFailureCount;
-                       struct dentry *dot11FCSErrorCount;
-                       struct dentry *dot11RTSSuccessCount;
-               } stats;
                struct dentry *stations;
                struct dentry *keys;
        } debugfs;
@@ -889,6 +805,7 @@ struct ieee802_11_elems {
        u8 *preq;
        u8 *prep;
        u8 *perr;
+       struct ieee80211_rann_ie *rann;
        u8 *ch_switch_elem;
        u8 *country_elem;
        u8 *pwr_constr_elem;
@@ -951,9 +868,6 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 void ieee80211_configure_filter(struct ieee80211_local *local);
 u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
 
-/* wireless extensions */
-extern const struct iw_handler_def ieee80211_iw_handler_def;
-
 /* STA code */
 void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
 int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
@@ -1031,8 +945,10 @@ void ieee80211_recalc_idle(struct ieee80211_local *local);
 /* tx handling */
 void ieee80211_clear_tx_pending(struct ieee80211_local *local);
 void ieee80211_tx_pending(unsigned long data);
-int ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev);
-int ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev);
+netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
+                                        struct net_device *dev);
+netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
+                                      struct net_device *dev);
 
 /* HT */
 void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
@@ -1070,6 +986,7 @@ void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
 
 /* Suspend/resume and hw reconfiguration */
 int ieee80211_reconfig(struct ieee80211_local *local);
+void ieee80211_stop_device(struct ieee80211_local *local);
 
 #ifdef CONFIG_PM
 int __ieee80211_suspend(struct ieee80211_hw *hw);
@@ -1138,7 +1055,8 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
                         u8 *extra, size_t extra_len, const u8 *bssid,
                         const u8 *key, u8 key_len, u8 key_idx);
 int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
-                            const u8 *ie, size_t ie_len);
+                            const u8 *ie, size_t ie_len,
+                            enum ieee80211_band band);
 void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
                              const u8 *ssid, size_t ssid_len,
                              const u8 *ie, size_t ie_len);