mac80211: remove max_bandwidth
[pandora-kernel.git] / include / net / cfg80211.h
index 83c2c72..2239134 100644 (file)
@@ -80,7 +80,6 @@ enum ieee80211_channel_flags {
  * with cfg80211.
  *
  * @center_freq: center frequency in MHz
- * @max_bandwidth: maximum allowed bandwidth for this channel, in MHz
  * @hw_value: hardware-specific value for the channel
  * @flags: channel flags from &enum ieee80211_channel_flags.
  * @orig_flags: channel flags at registration time, used by regulatory
@@ -97,7 +96,6 @@ enum ieee80211_channel_flags {
 struct ieee80211_channel {
        enum ieee80211_band band;
        u16 center_freq;
-       u8 max_bandwidth;
        u16 hw_value;
        u32 flags;
        int max_antenna_gain;
@@ -372,6 +370,10 @@ struct rate_info {
  * @txrate: current unicast bitrate to this station
  * @rx_packets: packets received from this station
  * @tx_packets: packets transmitted to this station
+ * @generation: generation number for nl80211 dumps.
+ *     This number should increase every time the list of stations
+ *     changes, i.e. when a station is added or removed, so that
+ *     userspace can tell whether it got a consistent snapshot.
  */
 struct station_info {
        u32 filled;
@@ -385,6 +387,8 @@ struct station_info {
        struct rate_info txrate;
        u32 rx_packets;
        u32 tx_packets;
+
+       int generation;
 };
 
 /**
@@ -444,6 +448,10 @@ enum mpath_info_flags {
  * @flags: mesh path flags
  * @discovery_timeout: total mesh path discovery timeout, in msecs
  * @discovery_retries: mesh path discovery retries
+ * @generation: generation number for nl80211 dumps.
+ *     This number should increase every time the list of mesh paths
+ *     changes, i.e. when a station is added or removed, so that
+ *     userspace can tell whether it got a consistent snapshot.
  */
 struct mpath_info {
        u32 filled;
@@ -454,6 +462,8 @@ struct mpath_info {
        u32 discovery_timeout;
        u8 discovery_retries;
        u8 flags;
+
+       int generation;
 };
 
 /**
@@ -538,24 +548,26 @@ struct cfg80211_ssid {
  * @ssids: SSIDs to scan for (active scan only)
  * @n_ssids: number of SSIDs
  * @channels: channels to scan on.
- * @n_channels: number of channels for each band
+ * @n_channels: total number of channels to scan
  * @ie: optional information element(s) to add into Probe Request or %NULL
  * @ie_len: length of ie in octets
  * @wiphy: the wiphy this was for
- * @ifidx: the interface index
+ * @dev: the interface
  */
 struct cfg80211_scan_request {
        struct cfg80211_ssid *ssids;
        int n_ssids;
-       struct ieee80211_channel **channels;
        u32 n_channels;
        const u8 *ie;
        size_t ie_len;
 
        /* internal */
        struct wiphy *wiphy;
-       int ifidx;
+       struct net_device *dev;
        bool aborted;
+
+       /* keep last */
+       struct ieee80211_channel *channels[0];
 };
 
 /**
@@ -647,12 +659,17 @@ struct cfg80211_crypto_settings {
  * @auth_type: Authentication type (algorithm)
  * @ie: Extra IEs to add to Authentication frame or %NULL
  * @ie_len: Length of ie buffer in octets
+ * @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
  */
 struct cfg80211_auth_request {
        struct cfg80211_bss *bss;
        const u8 *ie;
        size_t ie_len;
        enum nl80211_auth_type auth_type;
+       const u8 *key;
+       u8 key_len, key_idx;
 };
 
 /**
@@ -727,6 +744,8 @@ struct cfg80211_disassoc_request {
  * @ie: information element(s) to include in the beacon
  * @ie_len: length of that
  * @beacon_interval: beacon interval to use
+ * @privacy: this is a protected network, keys will be configured
+ *     after joining
  */
 struct cfg80211_ibss_params {
        u8 *ssid;
@@ -736,6 +755,7 @@ struct cfg80211_ibss_params {
        u8 ssid_len, ie_len;
        u16 beacon_interval;
        bool channel_fixed;
+       bool privacy;
 };
 
 /**
@@ -755,6 +775,9 @@ struct cfg80211_ibss_params {
  * @assoc_ie_len: Length of assoc_ie in octets
  * @privacy: indicates whether privacy-enabled APs should be used
  * @crypto: 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
  */
 struct cfg80211_connect_params {
        struct ieee80211_channel *channel;
@@ -766,6 +789,8 @@ struct cfg80211_connect_params {
        size_t ie_len;
        bool privacy;
        struct cfg80211_crypto_settings crypto;
+       const u8 *key;
+       u8 key_len, key_idx;
 };
 
 /**
@@ -832,7 +857,8 @@ struct cfg80211_bitrate_mask {
  * @resume: wiphy device needs to be resumed
  *
  * @add_virtual_intf: create a new virtual interface with the given name,
- *     must set the struct wireless_dev's iftype.
+ *     must set the struct wireless_dev's iftype. Beware: You must create
+ *     the new netdev in the wiphy's network namespace!
  *
  * @del_virtual_intf: remove the virtual interface determined by ifindex.
  *
@@ -924,7 +950,7 @@ struct cfg80211_ops {
        int     (*add_virtual_intf)(struct wiphy *wiphy, char *name,
                                    enum nl80211_iftype type, u32 *flags,
                                    struct vif_params *params);
-       int     (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
+       int     (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev);
        int     (*change_virtual_intf)(struct wiphy *wiphy,
                                       struct net_device *dev,
                                       enum nl80211_iftype type, u32 *flags,
@@ -1062,6 +1088,10 @@ struct cfg80211_ops {
  *     channels at a later time. This can be used for devices which do not
  *     have calibration information gauranteed for frequencies or settings
  *     outside of its regulatory domain.
+ * @disable_beacon_hints: enable this if your driver needs to ensure that
+ *     passive scan flags and beaconing flags may not be lifted by cfg80211
+ *     due to regulatory beacon hints. For more information on beacon
+ *     hints read the documenation for regulatory_hint_found_beacon()
  * @reg_notifier: the driver's regulatory notification callback
  * @regd: the driver's regulatory domain, if one was requested via
  *     the regulatory_hint() API. This can be used by the driver
@@ -1075,6 +1105,9 @@ struct cfg80211_ops {
  * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
  *     -1 = fragmentation disabled, only odd values >= 256 used
  * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
+ * @net: the network namespace this wiphy currently lives in
+ * @netnsok: if set to false, do not allow changing the netns of this
+ *     wiphy at all
  */
 struct wiphy {
        /* assign these fields before you register the wiphy */
@@ -1087,6 +1120,9 @@ struct wiphy {
 
        bool custom_regulatory;
        bool strict_regulatory;
+       bool disable_beacon_hints;
+
+       bool netnsok;
 
        enum cfg80211_signal_type signal_type;
 
@@ -1126,9 +1162,35 @@ struct wiphy {
        /* dir in debugfs: ieee80211/<wiphyname> */
        struct dentry *debugfsdir;
 
+#ifdef CONFIG_NET_NS
+       /* the network namespace this phy lives in currently */
+       struct net *_net;
+#endif
+
        char priv[0] __attribute__((__aligned__(NETDEV_ALIGN)));
 };
 
+#ifdef CONFIG_NET_NS
+static inline struct net *wiphy_net(struct wiphy *wiphy)
+{
+       return wiphy->_net;
+}
+
+static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
+{
+       wiphy->_net = net;
+}
+#else
+static inline struct net *wiphy_net(struct wiphy *wiphy)
+{
+       return &init_net;
+}
+
+static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
+{
+}
+#endif
+
 /**
  * wiphy_priv - return priv from wiphy
  *
@@ -1223,9 +1285,10 @@ extern void wiphy_unregister(struct wiphy *wiphy);
  */
 extern void wiphy_free(struct wiphy *wiphy);
 
-/* internal struct */
+/* internal structs */
 struct cfg80211_conn;
 struct cfg80211_internal_bss;
+struct cfg80211_cached_keys;
 
 #define MAX_AUTH_BSSES         4
 
@@ -1267,6 +1330,7 @@ struct wireless_dev {
                CFG80211_SME_CONNECTED,
        } sme_state;
        struct cfg80211_conn *conn;
+       struct cfg80211_cached_keys *connect_keys;
 
        struct list_head event_list;
        spinlock_t event_lock;
@@ -1280,12 +1344,13 @@ struct wireless_dev {
        struct {
                struct cfg80211_ibss_params ibss;
                struct cfg80211_connect_params connect;
+               struct cfg80211_cached_keys *keys;
                u8 *ie;
                size_t ie_len;
-               u8 bssid[ETH_ALEN];
+               u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
                u8 ssid[IEEE80211_MAX_SSID_LEN];
                s8 default_key, default_mgmt_key;
-               bool ps;
+               bool ps, prev_bssid_valid;
                int ps_timeout;
        } wext;
 #endif
@@ -1465,20 +1530,6 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
  */
 extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
 
-/**
- * regulatory_hint_11d - hints a country IE as a regulatory domain
- * @wiphy: the wireless device giving the hint (used only for reporting
- *     conflicts)
- * @country_ie: pointer to the country IE
- * @country_ie_len: length of the country IE
- *
- * We will intersect the rd with the what CRDA tells us should apply
- * for the alpha2 this country IE belongs to, this prevents APs from
- * sending us incorrect or outdated information against a country.
- */
-extern void regulatory_hint_11d(struct wiphy *wiphy,
-                               u8 *country_ie,
-                               u8 country_ie_len);
 /**
  * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
  * @wiphy: the wireless device we want to process the regulatory domain on
@@ -1547,43 +1598,6 @@ int cfg80211_wext_siwmlme(struct net_device *dev,
 int cfg80211_wext_giwrange(struct net_device *dev,
                           struct iw_request_info *info,
                           struct iw_point *data, char *extra);
-int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
-                              struct iw_request_info *info,
-                              struct iw_freq *freq, char *extra);
-int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
-                              struct iw_request_info *info,
-                              struct iw_freq *freq, char *extra);
-int cfg80211_ibss_wext_siwessid(struct net_device *dev,
-                               struct iw_request_info *info,
-                               struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_giwessid(struct net_device *dev,
-                               struct iw_request_info *info,
-                               struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_siwap(struct net_device *dev,
-                            struct iw_request_info *info,
-                            struct sockaddr *ap_addr, char *extra);
-int cfg80211_ibss_wext_giwap(struct net_device *dev,
-                            struct iw_request_info *info,
-                            struct sockaddr *ap_addr, char *extra);
-
-int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
-                             struct iw_request_info *info,
-                             struct iw_freq *freq, char *extra);
-int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
-                             struct iw_request_info *info,
-                             struct iw_freq *freq, char *extra);
-int cfg80211_mgd_wext_siwessid(struct net_device *dev,
-                              struct iw_request_info *info,
-                              struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_giwessid(struct net_device *dev,
-                              struct iw_request_info *info,
-                              struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_siwap(struct net_device *dev,
-                           struct iw_request_info *info,
-                           struct sockaddr *ap_addr, char *extra);
-int cfg80211_mgd_wext_giwap(struct net_device *dev,
-                           struct iw_request_info *info,
-                           struct sockaddr *ap_addr, char *extra);
 int cfg80211_wext_siwgenie(struct net_device *dev,
                           struct iw_request_info *info,
                           struct iw_point *data, char *extra);
@@ -1594,9 +1608,18 @@ int cfg80211_wext_giwauth(struct net_device *dev,
                          struct iw_request_info *info,
                          struct iw_param *data, char *extra);
 
-struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
-                                            struct iw_freq *freq);
-
+int cfg80211_wext_siwfreq(struct net_device *dev,
+                         struct iw_request_info *info,
+                         struct iw_freq *freq, char *extra);
+int cfg80211_wext_giwfreq(struct net_device *dev,
+                         struct iw_request_info *info,
+                         struct iw_freq *freq, char *extra);
+int cfg80211_wext_siwessid(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *ssid);
+int cfg80211_wext_giwessid(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *ssid);
 int cfg80211_wext_siwrate(struct net_device *dev,
                          struct iw_request_info *info,
                          struct iw_param *rate, char *extra);
@@ -1646,12 +1669,12 @@ int cfg80211_wext_giwpower(struct net_device *dev,
                           struct iw_request_info *info,
                           struct iw_param *wrq, char *extra);
 
-int cfg80211_wds_wext_siwap(struct net_device *dev,
-                           struct iw_request_info *info,
-                           struct sockaddr *addr, char *extra);
-int cfg80211_wds_wext_giwap(struct net_device *dev,
-                           struct iw_request_info *info,
-                           struct sockaddr *addr, char *extra);
+int cfg80211_wext_siwap(struct net_device *dev,
+                       struct iw_request_info *info,
+                       struct sockaddr *ap_addr, char *extra);
+int cfg80211_wext_giwap(struct net_device *dev,
+                       struct iw_request_info *info,
+                       struct sockaddr *ap_addr, char *extra);
 
 /*
  * callbacks for asynchronous cfg80211 methods, notification