mac80211: protect rx-path with spinlock
[linux-2.6-block.git] / net / mac80211 / ieee80211_i.h
index c084c1503c0408ca665d39cde3bd7d0ed436f50e..080cf0942ce7768b0797c33d0de62fa0d26ab428 100644 (file)
@@ -86,23 +86,11 @@ struct ieee80211_fragment_entry {
 
 
 struct ieee80211_bss {
-       /* don't want to look up all the time */
-       size_t ssid_len;
-       u8 ssid[IEEE80211_MAX_SSID_LEN];
-
        u32 device_ts;
 
        bool wmm_used;
        bool uapsd_supported;
 
-       unsigned long last_probe_resp;
-
-#ifdef CONFIG_MAC80211_MESH
-       u8 *mesh_id;
-       size_t mesh_id_len;
-       u8 *mesh_cfg;
-#endif
-
 #define IEEE80211_MAX_SUPP_RATES 32
        u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
        size_t supp_rates_len;
@@ -153,31 +141,6 @@ enum ieee80211_bss_valid_data_flags {
        IEEE80211_BSS_VALID_ERP                 = BIT(3)
 };
 
-static inline u8 *bss_mesh_cfg(struct ieee80211_bss *bss)
-{
-#ifdef CONFIG_MAC80211_MESH
-       return bss->mesh_cfg;
-#endif
-       return NULL;
-}
-
-static inline u8 *bss_mesh_id(struct ieee80211_bss *bss)
-{
-#ifdef CONFIG_MAC80211_MESH
-       return bss->mesh_id;
-#endif
-       return NULL;
-}
-
-static inline u8 bss_mesh_id_len(struct ieee80211_bss *bss)
-{
-#ifdef CONFIG_MAC80211_MESH
-       return bss->mesh_id_len;
-#endif
-       return 0;
-}
-
-
 typedef unsigned __bitwise__ ieee80211_tx_result;
 #define TX_CONTINUE    ((__force ieee80211_tx_result) 0u)
 #define TX_DROP                ((__force ieee80211_tx_result) 1u)
@@ -399,12 +362,13 @@ struct ieee80211_mgd_assoc_data {
        u8 ssid_len;
        u8 supp_rates_len;
        bool wmm, uapsd;
-       bool have_beacon;
-       bool sent_assoc;
+       bool have_beacon, need_beacon;
        bool synced;
 
        u8 ap_ht_param;
 
+       struct ieee80211_vht_cap ap_vht_cap;
+
        size_t ie_len;
        u8 ie[];
 };
@@ -423,6 +387,7 @@ struct ieee80211_if_managed {
        unsigned long probe_timeout;
        int probe_send_count;
        bool nullfunc_failed;
+       bool connection_loss;
 
        struct mutex mtx;
        struct cfg80211_bss *associated;
@@ -447,6 +412,10 @@ struct ieee80211_if_managed {
        bool beacon_crc_valid;
        u32 beacon_crc;
 
+       bool status_acked;
+       bool status_received;
+       __le16 status_fc;
+
        enum {
                IEEE80211_MFP_DISABLED,
                IEEE80211_MFP_OPTIONAL,
@@ -621,6 +590,11 @@ struct ieee80211_if_mesh {
        s64 sync_offset_clockdrift_max;
        spinlock_t sync_offset_lock;
        bool adjusting_tbtt;
+       /* mesh power save */
+       enum nl80211_mesh_power_mode nonpeer_pm;
+       int ps_peers_light_sleep;
+       int ps_peers_deep_sleep;
+       struct ps_data ps;
 };
 
 #ifdef CONFIG_MAC80211_MESH
@@ -745,8 +719,6 @@ struct ieee80211_sub_if_data {
        struct work_struct work;
        struct sk_buff_head skb_queue;
 
-       bool arp_filter_state;
-
        u8 needed_rx_chains;
        enum ieee80211_smps_mode smps_mode;
 
@@ -986,14 +958,7 @@ struct ieee80211_local {
        struct sk_buff_head skb_queue;
        struct sk_buff_head skb_queue_unreliable;
 
-       /*
-        * Internal FIFO queue which is shared between multiple rx path
-        * stages. Its main task is to provide a serialization mechanism,
-        * so all rx handlers can enjoy having exclusive access to their
-        * private data structures.
-        */
-       struct sk_buff_head rx_skb_queue;
-       bool running_rx_handler;        /* protected by rx_skb_queue.lock */
+       spinlock_t rx_path_lock;
 
        /* Station data */
        /*
@@ -1127,6 +1092,7 @@ struct ieee80211_local {
        struct timer_list dynamic_ps_timer;
        struct notifier_block network_latency_notifier;
        struct notifier_block ifa_notifier;
+       struct notifier_block ifa6_notifier;
 
        /*
         * The dynamic ps timeout configured from user space via WEXT -
@@ -1217,6 +1183,7 @@ struct ieee802_11_elems {
        struct ieee80211_meshconf_ie *mesh_config;
        u8 *mesh_id;
        u8 *peering;
+       __le16 *awake_window;
        u8 *preq;
        u8 *prep;
        u8 *perr;
@@ -1317,6 +1284,8 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
 void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
 void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
 void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
+void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
+                                 __le16 fc, bool acked);
 
 /* IBSS code */
 void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
@@ -1366,10 +1335,8 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
 void ieee80211_sched_scan_stopped_work(struct work_struct *work);
 
 /* off-channel helpers */
-void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
-                                   bool offchannel_ps_enable);
-void ieee80211_offchannel_return(struct ieee80211_local *local,
-                                bool offchannel_ps_disable);
+void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
+void ieee80211_offchannel_return(struct ieee80211_local *local);
 void ieee80211_roc_setup(struct ieee80211_local *local);
 void ieee80211_start_next_roc(struct ieee80211_local *local);
 void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata);
@@ -1430,7 +1397,8 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
                                     u16 initiator, u16 reason, bool stop);
 void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
                                    u16 initiator, u16 reason, bool stop);
-void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, bool tx);
+void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
+                                        enum ieee80211_agg_stop_reason reason);
 void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
                             struct sta_info *sta,
                             struct ieee80211_mgmt *mgmt, size_t len);
@@ -1444,11 +1412,9 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
                                     size_t len);
 
 int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
-                                  enum ieee80211_back_parties initiator,
-                                  bool tx);
+                                  enum ieee80211_agg_stop_reason reason);
 int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
-                                   enum ieee80211_back_parties initiator,
-                                   bool tx);
+                                   enum ieee80211_agg_stop_reason reason);
 void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
 void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
 void ieee80211_ba_session_work(struct work_struct *work);
@@ -1580,7 +1546,8 @@ static inline void ieee80211_add_pending_skbs(struct ieee80211_local *local,
 void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
                         u16 transaction, u16 auth_alg, u16 status,
                         u8 *extra, size_t extra_len, const u8 *bssid,
-                        const u8 *da, const u8 *key, u8 key_len, u8 key_idx);
+                        const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
+                        u32 tx_flags);
 void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
                                    const u8 *bssid, u16 stype, u16 reason,
                                    bool send_frame, u8 *frame_buf);
@@ -1597,7 +1564,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
 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,
-                             u32 ratemask, bool directed, bool no_cck,
+                             u32 ratemask, bool directed, u32 tx_flags,
                              struct ieee80211_channel *channel, bool scan);
 
 void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,