nl80211/cfg80211: WoWLAN support
[pandora-kernel.git] / include / linux / nl80211.h
index ecf6b68..a75dea9 100644 (file)
  *     notification. This event is used to indicate that an unprotected
  *     disassociation frame was dropped when MFP is in use.
  *
+ * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
+ *      beacon or probe response from a compatible mesh peer.  This is only
+ *      sent while no station information (sta_info) exists for the new peer
+ *      candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set.  On
+ *      reception of this notification, userspace may decide to create a new
+ *      station (@NL80211_CMD_NEW_STATION).  To stop this notification from
+ *      reoccurring, the userspace authentication daemon may want to create the
+ *      new station with the AUTHENTICATED flag unset and maybe change it later
+ *      depending on the authentication result.
+ *
+ * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
+ * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
+ *     Since wireless is more complex than wired ethernet, it supports
+ *     various triggers. These triggers can be configured through this
+ *     command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
+ *     more background information, see
+ *     http://wireless.kernel.org/en/users/Documentation/WoWLAN.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -522,6 +540,11 @@ enum nl80211_commands {
        NL80211_CMD_UNPROT_DEAUTHENTICATE,
        NL80211_CMD_UNPROT_DISASSOCIATE,
 
+       NL80211_CMD_NEW_PEER_CANDIDATE,
+
+       NL80211_CMD_GET_WOWLAN,
+       NL80211_CMD_SET_WOWLAN,
+
        /* add new commands above here */
 
        /* used to define NL80211_CMD_MAX below */
@@ -887,6 +910,16 @@ enum nl80211_commands {
  *     changed once the mesh is active.
  * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
  *     containing attributes from &enum nl80211_meshconf_params.
+ * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
+ *     allows auth frames in a mesh to be passed to userspace for processing via
+ *     the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
+ *
+ * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities,
+ *     the supported WoWLAN triggers
+ * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
+ *     indicate which WoW triggers should be enabled. This is also
+ *     used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
+ *     triggers.
  *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1075,6 +1108,11 @@ enum nl80211_attrs {
        NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
        NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
 
+       NL80211_ATTR_SUPPORT_MESH_AUTH,
+
+       NL80211_ATTR_WOWLAN_TRIGGERS,
+       NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
@@ -1169,6 +1207,7 @@ enum nl80211_iftype {
  *     with short barker preamble
  * @NL80211_STA_FLAG_WME: station is WME/QoS capable
  * @NL80211_STA_FLAG_MFP: station uses management frame protection
+ * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
  * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
  * @__NL80211_STA_FLAG_AFTER_LAST: internal use
  */
@@ -1178,6 +1217,7 @@ enum nl80211_sta_flags {
        NL80211_STA_FLAG_SHORT_PREAMBLE,
        NL80211_STA_FLAG_WME,
        NL80211_STA_FLAG_MFP,
+       NL80211_STA_FLAG_AUTHENTICATED,
 
        /* keep last */
        __NL80211_STA_FLAG_AFTER_LAST,
@@ -1278,6 +1318,7 @@ enum nl80211_sta_bss_param {
  *     attribute, like NL80211_STA_INFO_TX_BITRATE.
  * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
  *     containing info as possible, see &enum nl80211_sta_bss_param
+ * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
  */
@@ -1298,6 +1339,7 @@ enum nl80211_sta_info {
        NL80211_STA_INFO_SIGNAL_AVG,
        NL80211_STA_INFO_RX_BITRATE,
        NL80211_STA_INFO_BSS_PARAM,
+       NL80211_STA_INFO_CONNECTED_TIME,
 
        /* keep last */
        __NL80211_STA_INFO_AFTER_LAST,
@@ -1724,6 +1766,9 @@ enum nl80211_meshconf_params {
  * robust security network ie, or a vendor specific information element that
  * vendors will use to identify the path selection methods and metrics in use.
  *
+ * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
+ * daemon will be authenticating mesh candidates.
+ *
  * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
  * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
  */
@@ -1732,6 +1777,7 @@ enum nl80211_mesh_setup_params {
        NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
        NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
        NL80211_MESH_SETUP_IE,
+       NL80211_MESH_SETUP_USERSPACE_AUTH,
 
        /* keep last */
        __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
@@ -2036,4 +2082,82 @@ enum nl80211_tx_power_setting {
        NL80211_TX_POWER_FIXED,
 };
 
+/**
+ * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute
+ * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute
+ * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has
+ *     a zero bit are ignored
+ * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have
+ *     a bit for each byte in the pattern. The lowest-order bit corresponds
+ *     to the first byte of the pattern, but the bytes of the pattern are
+ *     in a little-endian-like format, i.e. the 9th byte of the pattern
+ *     corresponds to the lowest-order bit in the second byte of the mask.
+ *     For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
+ *     xx indicates "don't care") would be represented by a pattern of
+ *     twelve zero bytes, and a mask of "0xed,0x07".
+ *     Note that the pattern matching is done as though frames were not
+ *     802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
+ *     first (including SNAP header unpacking) and then matched.
+ * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
+ * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
+ */
+enum nl80211_wowlan_packet_pattern_attr {
+       __NL80211_WOWLAN_PKTPAT_INVALID,
+       NL80211_WOWLAN_PKTPAT_MASK,
+       NL80211_WOWLAN_PKTPAT_PATTERN,
+
+       NUM_NL80211_WOWLAN_PKTPAT,
+       MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
+};
+
+/**
+ * struct nl80211_wowlan_pattern_support - pattern support information
+ * @max_patterns: maximum number of patterns supported
+ * @min_pattern_len: minimum length of each pattern
+ * @max_pattern_len: maximum length of each pattern
+ *
+ * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
+ * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
+ * capability information given by the kernel to userspace.
+ */
+struct nl80211_wowlan_pattern_support {
+       __u32 max_patterns;
+       __u32 min_pattern_len;
+       __u32 max_pattern_len;
+} __attribute__((packed));
+
+/**
+ * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
+ * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
+ * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
+ *     the chip into a special state -- works best with chips that have
+ *     support for low-power operation already (flag)
+ * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
+ *     is detected is implementation-specific (flag)
+ * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
+ *     by 16 repetitions of MAC addr, anywhere in payload) (flag)
+ * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
+ *     which are passed in an array of nested attributes, each nested attribute
+ *     defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
+ *     Each pattern defines a wakeup packet. The matching is done on the MSDU,
+ *     i.e. as though the packet was an 802.3 packet, so the pattern matching
+ *     is done after the packet is converted to the MSDU.
+ *
+ *     In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
+ *     carrying a &struct nl80211_wowlan_pattern_support.
+ * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
+ * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
+ */
+enum nl80211_wowlan_triggers {
+       __NL80211_WOWLAN_TRIG_INVALID,
+       NL80211_WOWLAN_TRIG_ANY,
+       NL80211_WOWLAN_TRIG_DISCONNECT,
+       NL80211_WOWLAN_TRIG_MAGIC_PKT,
+       NL80211_WOWLAN_TRIG_PKT_PATTERN,
+
+       /* keep last */
+       NUM_NL80211_WOWLAN_TRIG,
+       MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
+};
+
 #endif /* __LINUX_NL80211_H */