]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - net/mac80211/ieee80211_i.h
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[linux-2.6.git] / net / mac80211 / ieee80211_i.h
index 9346a6b0f40008323cfa403bd3e7a6fce362a89b..95cdd2a3f8094c250c36bb304db57cc7507abbab 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/types.h>
 #include <linux/spinlock.h>
 #include <linux/etherdevice.h>
+#include <linux/leds.h>
 #include <net/ieee80211_radiotap.h>
 #include <net/cfg80211.h>
 #include <net/mac80211.h>
@@ -159,13 +160,39 @@ typedef unsigned __bitwise__ ieee80211_rx_result;
 #define RX_DROP_MONITOR                ((__force ieee80211_rx_result) 2u)
 #define RX_QUEUED              ((__force ieee80211_rx_result) 3u)
 
-#define IEEE80211_RX_IN_SCAN           BIT(0)
-/* frame is destined to interface currently processed (incl. multicast frames) */
-#define IEEE80211_RX_RA_MATCH          BIT(1)
-#define IEEE80211_RX_AMSDU             BIT(2)
-#define IEEE80211_RX_FRAGMENTED                BIT(3)
-#define IEEE80211_MALFORMED_ACTION_FRM BIT(4)
-/* only add flags here that do not change with subframes of an aMPDU */
+/**
+ * enum ieee80211_packet_rx_flags - packet RX flags
+ * @IEEE80211_RX_RA_MATCH: frame is destined to interface currently processed
+ *     (incl. multicast frames)
+ * @IEEE80211_RX_IN_SCAN: received while scanning
+ * @IEEE80211_RX_FRAGMENTED: fragmented frame
+ * @IEEE80211_RX_AMSDU: a-MSDU packet
+ * @IEEE80211_RX_MALFORMED_ACTION_FRM: action frame is malformed
+ * @IEEE80211_RX_DEFERRED_RELEASE: frame was subjected to receive reordering
+ *
+ * These are per-frame flags that are attached to a frame in the
+ * @rx_flags field of &struct ieee80211_rx_status.
+ */
+enum ieee80211_packet_rx_flags {
+       IEEE80211_RX_IN_SCAN                    = BIT(0),
+       IEEE80211_RX_RA_MATCH                   = BIT(1),
+       IEEE80211_RX_FRAGMENTED                 = BIT(2),
+       IEEE80211_RX_AMSDU                      = BIT(3),
+       IEEE80211_RX_MALFORMED_ACTION_FRM       = BIT(4),
+       IEEE80211_RX_DEFERRED_RELEASE           = BIT(5),
+};
+
+/**
+ * enum ieee80211_rx_flags - RX data flags
+ *
+ * @IEEE80211_RX_CMNTR: received on cooked monitor already
+ *
+ * These flags are used across handling multiple interfaces
+ * for a single frame.
+ */
+enum ieee80211_rx_flags {
+       IEEE80211_RX_CMNTR              = BIT(0),
+};
 
 struct ieee80211_rx_data {
        struct sk_buff *skb;
@@ -236,6 +263,7 @@ enum ieee80211_work_type {
        IEEE80211_WORK_ASSOC_BEACON_WAIT,
        IEEE80211_WORK_ASSOC,
        IEEE80211_WORK_REMAIN_ON_CHANNEL,
+       IEEE80211_WORK_OFFCHANNEL_TX,
 };
 
 /**
@@ -296,6 +324,10 @@ struct ieee80211_work {
                struct {
                        u32 duration;
                } remain;
+               struct {
+                       struct sk_buff *frame;
+                       u32 wait;
+               } offchan_tx;
        };
 
        int ie_len;
@@ -325,8 +357,10 @@ struct ieee80211_if_managed {
        struct work_struct chswitch_work;
        struct work_struct beacon_connection_loss_work;
 
+       unsigned long beacon_timeout;
        unsigned long probe_timeout;
        int probe_send_count;
+       bool nullfunc_failed;
 
        struct mutex mtx;
        struct cfg80211_bss *associated;
@@ -345,6 +379,7 @@ struct ieee80211_if_managed {
 
        unsigned int flags;
 
+       bool beacon_crc_valid;
        u32 beacon_crc;
 
        enum {
@@ -452,6 +487,8 @@ struct ieee80211_if_mesh {
        struct mesh_config mshcfg;
        u32 mesh_seqnum;
        bool accepting_plinks;
+       const u8 *vendor_ie;
+       u8 vendor_ie_len;
 };
 
 #ifdef CONFIG_MAC80211_MESH
@@ -524,10 +561,8 @@ struct ieee80211_sub_if_data {
        struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX];
        unsigned int fragment_next;
 
-#define NUM_DEFAULT_KEYS 4
-#define NUM_DEFAULT_MGMT_KEYS 2
        struct ieee80211_key *keys[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
-       struct ieee80211_key *default_key;
+       struct ieee80211_key *default_unicast_key, *default_multicast_key;
        struct ieee80211_key *default_mgmt_key;
 
        u16 sequence_number;
@@ -555,16 +590,16 @@ struct ieee80211_sub_if_data {
                struct ieee80211_if_vlan vlan;
                struct ieee80211_if_managed mgd;
                struct ieee80211_if_ibss ibss;
-#ifdef CONFIG_MAC80211_MESH
                struct ieee80211_if_mesh mesh;
-#endif
                u32 mntr_flags;
        } u;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct {
                struct dentry *dir;
-               struct dentry *default_key;
+               struct dentry *subdir_stations;
+               struct dentry *default_unicast_key;
+               struct dentry *default_multicast_key;
                struct dentry *default_mgmt_key;
        } debugfs;
 #endif
@@ -578,19 +613,6 @@ struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
        return container_of(p, struct ieee80211_sub_if_data, vif);
 }
 
-static inline void
-ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata,
-                           u8 mesh_id_len, u8 *mesh_id)
-{
-#ifdef CONFIG_MAC80211_MESH
-       struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
-       ifmsh->mesh_id_len = mesh_id_len;
-       memcpy(ifmsh->mesh_id, mesh_id, mesh_id_len);
-#else
-       WARN_ON(1);
-#endif
-}
-
 enum sdata_queue_type {
        IEEE80211_SDATA_QUEUE_TYPE_FRAME        = 0,
        IEEE80211_SDATA_QUEUE_AGG_START         = 1,
@@ -611,6 +633,20 @@ enum queue_stop_reason {
        IEEE80211_QUEUE_STOP_REASON_SKB_ADD,
 };
 
+#ifdef CONFIG_MAC80211_LEDS
+struct tpt_led_trigger {
+       struct led_trigger trig;
+       char name[32];
+       const struct ieee80211_tpt_blink *blink_table;
+       unsigned int blink_table_len;
+       struct timer_list timer;
+       unsigned long prev_traffic;
+       unsigned long tx_bytes, rx_bytes;
+       unsigned int active, want;
+       bool running;
+};
+#endif
+
 /**
  * mac80211 scan flags - currently active scan mode
  *
@@ -683,7 +719,9 @@ 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, fif_pspoll;
+       int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
+           fif_probe_req;
+       int probe_req_reg;
        unsigned int filter_flags; /* FIF_* */
 
        bool wiphy_ciphers_allocated;
@@ -738,6 +776,15 @@ 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 */
+
        /* Station data */
        /*
         * The mutex only protects the list and counter,
@@ -817,6 +864,7 @@ struct ieee80211_local {
 #ifdef CONFIG_MAC80211_LEDS
        int tx_led_counter, rx_led_counter;
        struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
+       struct tpt_led_trigger *tpt_led_trigger;
        char tx_led_name[32], rx_led_name[32],
             assoc_led_name[32], radio_led_name[32];
 #endif
@@ -899,7 +947,6 @@ struct ieee80211_local {
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct local_debugfsdentries {
                struct dentry *rcdir;
-               struct dentry *stations;
                struct dentry *keys;
        } debugfs;
 #endif
@@ -1108,6 +1155,8 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata);
 void ieee80211_remove_interfaces(struct ieee80211_local *local);
 u32 __ieee80211_recalc_idle(struct ieee80211_local *local);
 void ieee80211_recalc_idle(struct ieee80211_local *local);
+void ieee80211_adjust_monitor_flags(struct ieee80211_sub_if_data *sdata,
+                                   const int offset);
 
 static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata)
 {
@@ -1148,10 +1197,10 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
 void ieee80211_request_smps_work(struct work_struct *work);
 
 void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
-                                    u16 initiator, u16 reason);
+                                    u16 initiator, u16 reason, bool stop);
 void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
-                                   u16 initiator, u16 reason);
-void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta);
+                                   u16 initiator, u16 reason, bool stop);
+void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, bool tx);
 void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
                             struct sta_info *sta,
                             struct ieee80211_mgmt *mgmt, size_t len);
@@ -1165,9 +1214,11 @@ 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);
+                                  enum ieee80211_back_parties initiator,
+                                  bool tx);
 int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
-                                   enum ieee80211_back_parties initiator);
+                                   enum ieee80211_back_parties initiator,
+                                   bool tx);
 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);
@@ -1235,6 +1286,8 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local,
                             int powersave);
 void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
                             struct ieee80211_hdr *hdr);
+void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
+                            struct ieee80211_hdr *hdr, bool ack);
 void ieee80211_beacon_connection_loss_work(struct work_struct *work);
 
 void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
@@ -1249,6 +1302,9 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local,
                               struct sk_buff *skb);
 int ieee80211_add_pending_skbs(struct ieee80211_local *local,
                               struct sk_buff_head *skbs);
+int ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
+                                 struct sk_buff_head *skbs,
+                                 void (*fn)(void *data), void *data);
 
 void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
                         u16 transaction, u16 auth_alg,
@@ -1256,7 +1312,12 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
                         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,
-                            enum ieee80211_band band);
+                            enum ieee80211_band band, u32 rate_mask,
+                            u8 channel);
+struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
+                                         u8 *dst,
+                                         const u8 *ssid, size_t ssid_len,
+                                         const u8 *ie, size_t ie_len);
 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);
@@ -1269,8 +1330,7 @@ u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
                            enum ieee80211_band band);
 int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata,
                             enum ieee80211_smps_mode smps_mode);
-void ieee80211_recalc_smps(struct ieee80211_local *local,
-                          struct ieee80211_sub_if_data *forsdata);
+void ieee80211_recalc_smps(struct ieee80211_local *local);
 
 size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
                          const u8 *ids, int n_ids, size_t offset);