Merge branch 'fix/hda' of git://github.com/tiwai/sound
[pandora-kernel.git] / include / net / cfg80211.h
index 396e8fc..401d73b 100644 (file)
@@ -777,6 +777,7 @@ struct cfg80211_ssid {
  * @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
+ * @rates: bitmap of rates to advertise for each band
  * @wiphy: the wiphy this was for
  * @dev: the interface
  * @aborted: (internal) scan request was notified as aborted
@@ -788,6 +789,8 @@ struct cfg80211_scan_request {
        const u8 *ie;
        size_t ie_len;
 
+       u32 rates[IEEE80211_NUM_BANDS];
+
        /* internal */
        struct wiphy *wiphy;
        struct net_device *dev;
@@ -1146,13 +1149,31 @@ struct cfg80211_wowlan_trig_pkt_pattern {
  * @magic_pkt: wake up on receiving magic packet
  * @patterns: wake up on receiving packet matching a pattern
  * @n_patterns: number of patterns
+ * @gtk_rekey_failure: wake up on GTK rekey failure
+ * @eap_identity_req: wake up on EAP identity request packet
+ * @four_way_handshake: wake up on 4-way handshake
+ * @rfkill_release: wake up when rfkill is released
  */
 struct cfg80211_wowlan {
-       bool any, disconnect, magic_pkt;
+       bool any, disconnect, magic_pkt, gtk_rekey_failure,
+            eap_identity_req, four_way_handshake,
+            rfkill_release;
        struct cfg80211_wowlan_trig_pkt_pattern *patterns;
        int n_patterns;
 };
 
+/**
+ * struct cfg80211_gtk_rekey_data - rekey data
+ * @kek: key encryption key
+ * @kck: key confirmation key
+ * @replay_ctr: replay counter
+ */
+struct cfg80211_gtk_rekey_data {
+       u8 kek[NL80211_KEK_LEN];
+       u8 kck[NL80211_KCK_LEN];
+       u8 replay_ctr[NL80211_REPLAY_CTR_LEN];
+};
+
 /**
  * struct cfg80211_ops - backend description for wireless configuration
  *
@@ -1197,6 +1218,8 @@ struct cfg80211_wowlan {
  *
  * @set_default_mgmt_key: set the default management frame key on an interface
  *
+ * @set_rekey_data: give the data necessary for GTK rekeying to the driver
+ *
  * @add_beacon: Add a beacon with given parameters, @head, @interval
  *     and @dtim_period will be valid, @tail is optional.
  * @set_beacon: Change the beacon parameters for an access point mode
@@ -1284,6 +1307,12 @@ struct cfg80211_wowlan {
  *     frame on another channel
  *
  * @testmode_cmd: run a test mode command
+ * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
+ *     used by the function, but 0 and 1 must not be touched. Additionally,
+ *     return error codes other than -ENOBUFS and -ENOENT will terminate the
+ *     dump and return to userspace with an error, so be careful. If any data
+ *     was passed in from userspace then the data/len arguments will be present
+ *     and point to the data contained in %NL80211_ATTR_TESTDATA.
  *
  * @set_bitrate_mask: set the bitrate mask configuration
  *
@@ -1433,6 +1462,9 @@ struct cfg80211_ops {
 
 #ifdef CONFIG_NL80211_TESTMODE
        int     (*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
+       int     (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
+                                struct netlink_callback *cb,
+                                void *data, int len);
 #endif
 
        int     (*set_bitrate_mask)(struct wiphy *wiphy,
@@ -1490,6 +1522,9 @@ struct cfg80211_ops {
                                struct net_device *dev,
                                struct cfg80211_sched_scan_request *request);
        int     (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
+
+       int     (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
+                                 struct cfg80211_gtk_rekey_data *data);
 };
 
 /*
@@ -1647,11 +1682,21 @@ struct ieee80211_txrx_stypes {
  * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet
  *     (see nl80211.h)
  * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect
+ * @WIPHY_WOWLAN_SUPPORTS_GTK_REKEY: supports GTK rekeying while asleep
+ * @WIPHY_WOWLAN_GTK_REKEY_FAILURE: supports wakeup on GTK rekey failure
+ * @WIPHY_WOWLAN_EAP_IDENTITY_REQ: supports wakeup on EAP identity request
+ * @WIPHY_WOWLAN_4WAY_HANDSHAKE: supports wakeup on 4-way handshake failure
+ * @WIPHY_WOWLAN_RFKILL_RELEASE: supports wakeup on RF-kill release
  */
 enum wiphy_wowlan_support_flags {
-       WIPHY_WOWLAN_ANY        = BIT(0),
-       WIPHY_WOWLAN_MAGIC_PKT  = BIT(1),
-       WIPHY_WOWLAN_DISCONNECT = BIT(2),
+       WIPHY_WOWLAN_ANY                = BIT(0),
+       WIPHY_WOWLAN_MAGIC_PKT          = BIT(1),
+       WIPHY_WOWLAN_DISCONNECT         = BIT(2),
+       WIPHY_WOWLAN_SUPPORTS_GTK_REKEY = BIT(3),
+       WIPHY_WOWLAN_GTK_REKEY_FAILURE  = BIT(4),
+       WIPHY_WOWLAN_EAP_IDENTITY_REQ   = BIT(5),
+       WIPHY_WOWLAN_4WAY_HANDSHAKE     = BIT(6),
+       WIPHY_WOWLAN_RFKILL_RELEASE     = BIT(7),
 };
 
 /**
@@ -1699,6 +1744,8 @@ struct wiphy_wowlan_support {
  *     by default for perm_addr. In this case, the mask should be set to
  *     all-zeroes. In this case it is assumed that the device can handle
  *     the same number of arbitrary MAC addresses.
+ * @registered: protects ->resume and ->suspend sysfs callbacks against
+ *     unregister hardware
  * @debugfsdir: debugfs directory used for this wiphy, will be renamed
  *     automatically on wiphy renames
  * @dev: (virtual) struct device for this wiphy
@@ -1716,9 +1763,13 @@ struct wiphy_wowlan_support {
  *     this variable determines its size
  * @max_scan_ssids: maximum number of SSIDs the device can scan for in
  *     any given scan
+ * @max_sched_scan_ssids: maximum number of SSIDs the device can scan
+ *     for in any given scheduled scan
  * @max_scan_ie_len: maximum length of user-controlled IEs device can
  *     add to probe request frames transmitted during a scan, must not
  *     include fixed IEs like supported rates
+ * @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
+ *     scans
  * @coverage_class: current coverage class
  * @fw_version: firmware version for ethtool reporting
  * @hw_version: hardware version for ethtool reporting
@@ -1770,7 +1821,9 @@ struct wiphy {
 
        int bss_priv_size;
        u8 max_scan_ssids;
+       u8 max_sched_scan_ssids;
        u16 max_scan_ie_len;
+       u16 max_sched_scan_ie_len;
 
        int n_cipher_suites;
        const u32 *cipher_suites;
@@ -1814,6 +1867,9 @@ struct wiphy {
         * you need use set_wiphy_dev() (see below) */
        struct device dev;
 
+       /* protects ->resume, ->suspend sysfs callbacks against unregister hw */
+       bool registered;
+
        /* dir in debugfs: ieee80211/<wiphyname> */
        struct dentry *debugfsdir;
 
@@ -2849,8 +2905,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
 void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp);
 
 #define CFG80211_TESTMODE_CMD(cmd)     .testmode_cmd = (cmd),
+#define CFG80211_TESTMODE_DUMP(cmd)    .testmode_dump = (cmd),
 #else
 #define CFG80211_TESTMODE_CMD(cmd)
+#define CFG80211_TESTMODE_DUMP(cmd)
 #endif
 
 /**
@@ -3022,6 +3080,16 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
 void cfg80211_cqm_pktloss_notify(struct net_device *dev,
                                 const u8 *peer, u32 num_packets, gfp_t gfp);
 
+/**
+ * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
+ * @dev: network device
+ * @bssid: BSSID of AP (to avoid races)
+ * @replay_ctr: new replay counter
+ * @gfp: allocation flags
+ */
+void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
+                              const u8 *replay_ctr, gfp_t gfp);
+
 /* Logging, debugging and troubleshooting/diagnostic helpers. */
 
 /* wiphy_printk helpers, similar to dev_printk */