aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nl80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-05-04 09:37:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-05 14:59:19 -0400
commitff1b6e69ad4f31fb3c9c6da2665655f2e798dd70 (patch)
tree6fc049fd0389ffb382ea401096d7bd665642af5c /include/linux/nl80211.h
parent8f7f3b2fcc4ccbba0be776049df41a2f96c986ac (diff)
nl80211/cfg80211: WoWLAN support
This is based on (but now quite far from) the original work from Luis and Eliad. Add support for configuring WoWLAN triggers, and getting the configuration out again. Changes from the original patchset are too numerous to list, but one important change needs highlighting: the suspend() callback is passed NULL for the trigger configuration if userspace has not configured WoWLAN at all. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/nl80211.h')
-rw-r--r--include/linux/nl80211.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index be8df57b789d..a75dea9c416e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -420,6 +420,14 @@
420 * new station with the AUTHENTICATED flag unset and maybe change it later 420 * new station with the AUTHENTICATED flag unset and maybe change it later
421 * depending on the authentication result. 421 * depending on the authentication result.
422 * 422 *
423 * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
424 * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
425 * Since wireless is more complex than wired ethernet, it supports
426 * various triggers. These triggers can be configured through this
427 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
428 * more background information, see
429 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
430 *
423 * @NL80211_CMD_MAX: highest used command number 431 * @NL80211_CMD_MAX: highest used command number
424 * @__NL80211_CMD_AFTER_LAST: internal use 432 * @__NL80211_CMD_AFTER_LAST: internal use
425 */ 433 */
@@ -534,6 +542,9 @@ enum nl80211_commands {
534 542
535 NL80211_CMD_NEW_PEER_CANDIDATE, 543 NL80211_CMD_NEW_PEER_CANDIDATE,
536 544
545 NL80211_CMD_GET_WOWLAN,
546 NL80211_CMD_SET_WOWLAN,
547
537 /* add new commands above here */ 548 /* add new commands above here */
538 549
539 /* used to define NL80211_CMD_MAX below */ 550 /* used to define NL80211_CMD_MAX below */
@@ -903,6 +914,13 @@ enum nl80211_commands {
903 * allows auth frames in a mesh to be passed to userspace for processing via 914 * allows auth frames in a mesh to be passed to userspace for processing via
904 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. 915 * the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
905 * 916 *
917 * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities,
918 * the supported WoWLAN triggers
919 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
920 * indicate which WoW triggers should be enabled. This is also
921 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
922 * triggers.
923 *
906 * @NL80211_ATTR_MAX: highest attribute number currently defined 924 * @NL80211_ATTR_MAX: highest attribute number currently defined
907 * @__NL80211_ATTR_AFTER_LAST: internal use 925 * @__NL80211_ATTR_AFTER_LAST: internal use
908 */ 926 */
@@ -1092,6 +1110,9 @@ enum nl80211_attrs {
1092 1110
1093 NL80211_ATTR_SUPPORT_MESH_AUTH, 1111 NL80211_ATTR_SUPPORT_MESH_AUTH,
1094 1112
1113 NL80211_ATTR_WOWLAN_TRIGGERS,
1114 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
1115
1095 /* add attributes here, update the policy in nl80211.c */ 1116 /* add attributes here, update the policy in nl80211.c */
1096 1117
1097 __NL80211_ATTR_AFTER_LAST, 1118 __NL80211_ATTR_AFTER_LAST,
@@ -2061,4 +2082,82 @@ enum nl80211_tx_power_setting {
2061 NL80211_TX_POWER_FIXED, 2082 NL80211_TX_POWER_FIXED,
2062}; 2083};
2063 2084
2085/**
2086 * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute
2087 * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute
2088 * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has
2089 * a zero bit are ignored
2090 * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have
2091 * a bit for each byte in the pattern. The lowest-order bit corresponds
2092 * to the first byte of the pattern, but the bytes of the pattern are
2093 * in a little-endian-like format, i.e. the 9th byte of the pattern
2094 * corresponds to the lowest-order bit in the second byte of the mask.
2095 * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
2096 * xx indicates "don't care") would be represented by a pattern of
2097 * twelve zero bytes, and a mask of "0xed,0x07".
2098 * Note that the pattern matching is done as though frames were not
2099 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
2100 * first (including SNAP header unpacking) and then matched.
2101 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
2102 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
2103 */
2104enum nl80211_wowlan_packet_pattern_attr {
2105 __NL80211_WOWLAN_PKTPAT_INVALID,
2106 NL80211_WOWLAN_PKTPAT_MASK,
2107 NL80211_WOWLAN_PKTPAT_PATTERN,
2108
2109 NUM_NL80211_WOWLAN_PKTPAT,
2110 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
2111};
2112
2113/**
2114 * struct nl80211_wowlan_pattern_support - pattern support information
2115 * @max_patterns: maximum number of patterns supported
2116 * @min_pattern_len: minimum length of each pattern
2117 * @max_pattern_len: maximum length of each pattern
2118 *
2119 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
2120 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
2121 * capability information given by the kernel to userspace.
2122 */
2123struct nl80211_wowlan_pattern_support {
2124 __u32 max_patterns;
2125 __u32 min_pattern_len;
2126 __u32 max_pattern_len;
2127} __attribute__((packed));
2128
2129/**
2130 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
2131 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
2132 * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
2133 * the chip into a special state -- works best with chips that have
2134 * support for low-power operation already (flag)
2135 * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
2136 * is detected is implementation-specific (flag)
2137 * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
2138 * by 16 repetitions of MAC addr, anywhere in payload) (flag)
2139 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
2140 * which are passed in an array of nested attributes, each nested attribute
2141 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
2142 * Each pattern defines a wakeup packet. The matching is done on the MSDU,
2143 * i.e. as though the packet was an 802.3 packet, so the pattern matching
2144 * is done after the packet is converted to the MSDU.
2145 *
2146 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2147 * carrying a &struct nl80211_wowlan_pattern_support.
2148 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2149 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
2150 */
2151enum nl80211_wowlan_triggers {
2152 __NL80211_WOWLAN_TRIG_INVALID,
2153 NL80211_WOWLAN_TRIG_ANY,
2154 NL80211_WOWLAN_TRIG_DISCONNECT,
2155 NL80211_WOWLAN_TRIG_MAGIC_PKT,
2156 NL80211_WOWLAN_TRIG_PKT_PATTERN,
2157
2158 /* keep last */
2159 NUM_NL80211_WOWLAN_TRIG,
2160 MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
2161};
2162
2064#endif /* __LINUX_NL80211_H */ 2163#endif /* __LINUX_NL80211_H */