ipv6: ip6mr: move unres_queue and timer to per-namespace data
[safe/jmp/linux-2.6] / include / net / cfg80211.h
index a3f0a7e..7d10c01 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * 802.11 device and configuration interface
  *
- * Copyright 2006-2009 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -511,6 +511,7 @@ struct mpath_info {
  * @basic_rates: basic rates in IEEE 802.11 format
  *     (or NULL for no change)
  * @basic_rates_len: number of basic rates
+ * @ap_isolate: do not forward packets between connected stations
  */
 struct bss_parameters {
        int use_cts_prot;
@@ -518,6 +519,7 @@ struct bss_parameters {
        int use_short_slot_time;
        u8 *basic_rates;
        u8 basic_rates_len;
+       int ap_isolate;
 };
 
 struct mesh_config {
@@ -704,6 +706,10 @@ struct cfg80211_crypto_settings {
  * @key_len: length of WEP key for shared key authentication
  * @key_idx: index of WEP key for shared key authentication
  * @key: WEP key for shared key authentication
+ * @local_state_change: This is a request for a local state only, i.e., no
+ *     Authentication frame is to be transmitted and authentication state is
+ *     to be changed without having to wait for a response from the peer STA
+ *     (AP).
  */
 struct cfg80211_auth_request {
        struct cfg80211_bss *bss;
@@ -712,6 +718,7 @@ struct cfg80211_auth_request {
        enum nl80211_auth_type auth_type;
        const u8 *key;
        u8 key_len, key_idx;
+       bool local_state_change;
 };
 
 /**
@@ -744,12 +751,15 @@ struct cfg80211_assoc_request {
  * @ie: Extra IEs to add to Deauthentication frame or %NULL
  * @ie_len: Length of ie buffer in octets
  * @reason_code: The reason code for the deauthentication
+ * @local_state_change: This is a request for a local state only, i.e., no
+ *     Deauthentication frame is to be transmitted.
  */
 struct cfg80211_deauth_request {
        struct cfg80211_bss *bss;
        const u8 *ie;
        size_t ie_len;
        u16 reason_code;
+       bool local_state_change;
 };
 
 /**
@@ -762,12 +772,15 @@ struct cfg80211_deauth_request {
  * @ie: Extra IEs to add to Disassociation frame or %NULL
  * @ie_len: Length of ie buffer in octets
  * @reason_code: The reason code for the disassociation
+ * @local_state_change: This is a request for a local state only, i.e., no
+ *     Disassociation frame is to be transmitted.
  */
 struct cfg80211_disassoc_request {
        struct cfg80211_bss *bss;
        const u8 *ie;
        size_t ie_len;
        u16 reason_code;
+       bool local_state_change;
 };
 
 /**
@@ -998,6 +1011,7 @@ struct cfg80211_pmksa {
  * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
  *     This allows the operation to be terminated prior to timeout based on
  *     the duration value.
+ * @action: Transmit an action frame
  *
  * @testmode_cmd: run a test mode command
  *
@@ -1006,6 +1020,9 @@ struct cfg80211_pmksa {
  *     RSN IE. It allows for faster roaming between WPA2 BSSIDs.
  * @del_pmksa: Delete a cached PMKID.
  * @flush_pmksa: Flush all cached PMKIDs.
+ * @set_power_mgmt: Configure WLAN power management. A timeout value of -1
+ *     allows the driver to adjust the dynamic ps timeout value.
+ * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold.
  *
  */
 struct cfg80211_ops {
@@ -1144,9 +1161,17 @@ struct cfg80211_ops {
                                            struct net_device *dev,
                                            u64 cookie);
 
-       /* some temporary stuff to finish wext */
+       int     (*action)(struct wiphy *wiphy, struct net_device *dev,
+                         struct ieee80211_channel *chan,
+                         enum nl80211_channel_type channel_type,
+                         const u8 *buf, size_t len, u64 *cookie);
+
        int     (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
                                  bool enabled, int timeout);
+
+       int     (*set_cqm_rssi_config)(struct wiphy *wiphy,
+                                      struct net_device *dev,
+                                      s32 rssi_thold, u32 rssi_hyst);
 };
 
 /*
@@ -1445,6 +1470,8 @@ struct cfg80211_cached_keys;
  *     set by driver (if supported) on add_interface BEFORE registering the
  *     netdev and may otherwise be used by driver read-only, will be update
  *     by cfg80211 on change_interface
+ * @action_registrations: list of registrations for action frames
+ * @action_registrations_lock: lock for the list
  */
 struct wireless_dev {
        struct wiphy *wiphy;
@@ -1454,6 +1481,9 @@ struct wireless_dev {
        struct list_head list;
        struct net_device *netdev;
 
+       struct list_head action_registrations;
+       spinlock_t action_registrations_lock;
+
        struct mutex mtx;
 
        struct work_struct cleanup_work;
@@ -1478,6 +1508,9 @@ struct wireless_dev {
        struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
        struct cfg80211_internal_bss *current_bss; /* associated / joined */
 
+       bool ps;
+       int ps_timeout;
+
 #ifdef CONFIG_CFG80211_WEXT
        /* wext data */
        struct {
@@ -1489,8 +1522,7 @@ struct wireless_dev {
                u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
                u8 ssid[IEEE80211_MAX_SSID_LEN];
                s8 default_key, default_mgmt_key;
-               bool ps, prev_bssid_valid;
-               int ps_timeout;
+               bool prev_bssid_valid;
        } wext;
 #endif
 };
@@ -1561,37 +1593,82 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
  * Documentation in Documentation/networking/radiotap-headers.txt
  */
 
+struct radiotap_align_size {
+       uint8_t align:4, size:4;
+};
+
+struct ieee80211_radiotap_namespace {
+       const struct radiotap_align_size *align_size;
+       int n_bits;
+       uint32_t oui;
+       uint8_t subns;
+};
+
+struct ieee80211_radiotap_vendor_namespaces {
+       const struct ieee80211_radiotap_namespace *ns;
+       int n_ns;
+};
+
 /**
  * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
- * @rtheader: pointer to the radiotap header we are walking through
- * @max_length: length of radiotap header in cpu byte ordering
- * @this_arg_index: IEEE80211_RADIOTAP_... index of current arg
- * @this_arg: pointer to current radiotap arg
- * @arg_index: internal next argument index
- * @arg: internal next argument pointer
- * @next_bitmap: internal pointer to next present u32
- * @bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
+ * @this_arg_index: index of current arg, valid after each successful call
+ *     to ieee80211_radiotap_iterator_next()
+ * @this_arg: pointer to current radiotap arg; it is valid after each
+ *     call to ieee80211_radiotap_iterator_next() but also after
+ *     ieee80211_radiotap_iterator_init() where it will point to
+ *     the beginning of the actual data portion
+ * @this_arg_size: length of the current arg, for convenience
+ * @current_namespace: pointer to the current namespace definition
+ *     (or internally %NULL if the current namespace is unknown)
+ * @is_radiotap_ns: indicates whether the current namespace is the default
+ *     radiotap namespace or not
+ *
+ * @overrides: override standard radiotap fields
+ * @n_overrides: number of overrides
+ *
+ * @_rtheader: pointer to the radiotap header we are walking through
+ * @_max_length: length of radiotap header in cpu byte ordering
+ * @_arg_index: next argument index
+ * @_arg: next argument pointer
+ * @_next_bitmap: internal pointer to next present u32
+ * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
+ * @_vns: vendor namespace definitions
+ * @_next_ns_data: beginning of the next namespace's data
+ * @_reset_on_ext: internal; reset the arg index to 0 when going to the
+ *     next bitmap word
+ *
+ * Describes the radiotap parser state. Fields prefixed with an underscore
+ * must not be used by users of the parser, only by the parser internally.
  */
 
 struct ieee80211_radiotap_iterator {
-       struct ieee80211_radiotap_header *rtheader;
-       int max_length;
+       struct ieee80211_radiotap_header *_rtheader;
+       const struct ieee80211_radiotap_vendor_namespaces *_vns;
+       const struct ieee80211_radiotap_namespace *current_namespace;
+
+       unsigned char *_arg, *_next_ns_data;
+       __le32 *_next_bitmap;
+
+       unsigned char *this_arg;
        int this_arg_index;
-       u8 *this_arg;
+       int this_arg_size;
+
+       int is_radiotap_ns;
 
-       int arg_index;
-       u8 *arg;
-       __le32 *next_bitmap;
-       u32 bitmap_shifter;
+       int _max_length;
+       int _arg_index;
+       uint32_t _bitmap_shifter;
+       int _reset_on_ext;
 };
 
 extern int ieee80211_radiotap_iterator_init(
-   struct ieee80211_radiotap_iterator *iterator,
-   struct ieee80211_radiotap_header *radiotap_header,
-   int max_length);
+       struct ieee80211_radiotap_iterator *iterator,
+       struct ieee80211_radiotap_header *radiotap_header,
+       int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
 
 extern int ieee80211_radiotap_iterator_next(
-   struct ieee80211_radiotap_iterator *iterator);
+       struct ieee80211_radiotap_iterator *iterator);
+
 
 extern const unsigned char rfc1042_header[6];
 extern const unsigned char bridge_tunnel_header[6];
@@ -2246,4 +2323,52 @@ void cfg80211_remain_on_channel_expired(struct net_device *dev,
 void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
                      struct station_info *sinfo, gfp_t gfp);
 
+/**
+ * cfg80211_rx_action - notification of received, unprocessed Action frame
+ * @dev: network device
+ * @freq: Frequency on which the frame was received in MHz
+ * @buf: Action frame (header + body)
+ * @len: length of the frame data
+ * @gfp: context flags
+ * Returns %true if a user space application is responsible for rejecting the
+ *     unrecognized Action frame; %false if no such application is registered
+ *     (i.e., the driver is responsible for rejecting the unrecognized Action
+ *     frame)
+ *
+ * This function is called whenever an Action frame is received for a station
+ * mode interface, but is not processed in kernel.
+ */
+bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf,
+                       size_t len, gfp_t gfp);
+
+/**
+ * cfg80211_action_tx_status - notification of TX status for Action frame
+ * @dev: network device
+ * @cookie: Cookie returned by cfg80211_ops::action()
+ * @buf: Action frame (header + body)
+ * @len: length of the frame data
+ * @ack: Whether frame was acknowledged
+ * @gfp: context flags
+ *
+ * This function is called whenever an Action frame was requested to be
+ * transmitted with cfg80211_ops::action() to report the TX status of the
+ * transmission attempt.
+ */
+void cfg80211_action_tx_status(struct net_device *dev, u64 cookie,
+                              const u8 *buf, size_t len, bool ack, gfp_t gfp);
+
+
+/**
+ * cfg80211_cqm_rssi_notify - connection quality monitoring rssi event
+ * @dev: network device
+ * @rssi_event: the triggered RSSI event
+ * @gfp: context flags
+ *
+ * This function is called when a configured connection quality monitoring
+ * rssi threshold reached event occurs.
+ */
+void cfg80211_cqm_rssi_notify(struct net_device *dev,
+                             enum nl80211_cqm_rssi_threshold_event rssi_event,
+                             gfp_t gfp);
+
 #endif /* __NET_CFG80211_H */