diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-01-23 16:57:40 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-13 08:33:42 -0500 |
commit | 2a0e047ed62f20664005881b8e7f9328f910316a (patch) | |
tree | 166497ddbe4dea57a2d816d4fb928b3f8558b3aa /include/uapi/linux/nl80211.h | |
parent | a0497f9f57478c5a37c5628eb32833dd9729a821 (diff) |
cfg80211: configuration for WoWLAN over TCP
Intel Wireless devices are able to make a TCP connection
after suspending, sending some data and waking up when
the connection receives wakeup data (or breaks). Add the
WoWLAN configuration and feature advertising API for it.
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/uapi/linux/nl80211.h')
-rw-r--r-- | include/uapi/linux/nl80211.h | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index eb7b32247ec5..5309b34930ea 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -2991,6 +2991,17 @@ struct nl80211_wowlan_pattern_support { | |||
2991 | * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3 | 2991 | * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3 |
2992 | * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 | 2992 | * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 |
2993 | * attribute if the packet was truncated somewhere. | 2993 | * attribute if the packet was truncated somewhere. |
2994 | * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section | ||
2995 | * "TCP connection wakeup" for more details. This is a nested attribute | ||
2996 | * containing the exact information for establishing and keeping alive | ||
2997 | * the TCP connection. | ||
2998 | * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the | ||
2999 | * wakeup packet was received on the TCP connection | ||
3000 | * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the | ||
3001 | * TCP connection was lost or failed to be established | ||
3002 | * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only, | ||
3003 | * the TCP connection ran out of tokens to use for data to send to the | ||
3004 | * service | ||
2994 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers | 3005 | * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers |
2995 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number | 3006 | * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number |
2996 | * | 3007 | * |
@@ -3012,6 +3023,10 @@ enum nl80211_wowlan_triggers { | |||
3012 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN, | 3023 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN, |
3013 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023, | 3024 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023, |
3014 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN, | 3025 | NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN, |
3026 | NL80211_WOWLAN_TRIG_TCP_CONNECTION, | ||
3027 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH, | ||
3028 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST, | ||
3029 | NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS, | ||
3015 | 3030 | ||
3016 | /* keep last */ | 3031 | /* keep last */ |
3017 | NUM_NL80211_WOWLAN_TRIG, | 3032 | NUM_NL80211_WOWLAN_TRIG, |
@@ -3019,6 +3034,116 @@ enum nl80211_wowlan_triggers { | |||
3019 | }; | 3034 | }; |
3020 | 3035 | ||
3021 | /** | 3036 | /** |
3037 | * DOC: TCP connection wakeup | ||
3038 | * | ||
3039 | * Some devices can establish a TCP connection in order to be woken up by a | ||
3040 | * packet coming in from outside their network segment, or behind NAT. If | ||
3041 | * configured, the device will establish a TCP connection to the given | ||
3042 | * service, and periodically send data to that service. The first data | ||
3043 | * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK. | ||
3044 | * The data packets can optionally include a (little endian) sequence | ||
3045 | * number (in the TCP payload!) that is generated by the device, and, also | ||
3046 | * optionally, a token from a list of tokens. This serves as a keep-alive | ||
3047 | * with the service, and for NATed connections, etc. | ||
3048 | * | ||
3049 | * During this keep-alive period, the server doesn't send any data to the | ||
3050 | * client. When receiving data, it is compared against the wakeup pattern | ||
3051 | * (and mask) and if it matches, the host is woken up. Similarly, if the | ||
3052 | * connection breaks or cannot be established to start with, the host is | ||
3053 | * also woken up. | ||
3054 | * | ||
3055 | * Developer's note: ARP offload is required for this, otherwise TCP | ||
3056 | * response packets might not go through correctly. | ||
3057 | */ | ||
3058 | |||
3059 | /** | ||
3060 | * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence | ||
3061 | * @start: starting value | ||
3062 | * @offset: offset of sequence number in packet | ||
3063 | * @len: length of the sequence value to write, 1 through 4 | ||
3064 | * | ||
3065 | * Note: don't confuse with the TCP sequence number(s), this is for the | ||
3066 | * keepalive packet payload. The actual value is written into the packet | ||
3067 | * in little endian. | ||
3068 | */ | ||
3069 | struct nl80211_wowlan_tcp_data_seq { | ||
3070 | __u32 start, offset, len; | ||
3071 | }; | ||
3072 | |||
3073 | /** | ||
3074 | * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config | ||
3075 | * @offset: offset of token in packet | ||
3076 | * @len: length of each token | ||
3077 | * @token_stream: stream of data to be used for the tokens, the length must | ||
3078 | * be a multiple of @len for this to make sense | ||
3079 | */ | ||
3080 | struct nl80211_wowlan_tcp_data_token { | ||
3081 | __u32 offset, len; | ||
3082 | __u8 token_stream[]; | ||
3083 | }; | ||
3084 | |||
3085 | /** | ||
3086 | * struct nl80211_wowlan_tcp_data_token_feature - data token features | ||
3087 | * @min_len: minimum token length | ||
3088 | * @max_len: maximum token length | ||
3089 | * @bufsize: total available token buffer size (max size of @token_stream) | ||
3090 | */ | ||
3091 | struct nl80211_wowlan_tcp_data_token_feature { | ||
3092 | __u32 min_len, max_len, bufsize; | ||
3093 | }; | ||
3094 | |||
3095 | /** | ||
3096 | * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters | ||
3097 | * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes | ||
3098 | * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order) | ||
3099 | * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address | ||
3100 | * (in network byte order) | ||
3101 | * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because | ||
3102 | * route lookup when configured might be invalid by the time we suspend, | ||
3103 | * and doing a route lookup when suspending is no longer possible as it | ||
3104 | * might require ARP querying. | ||
3105 | * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a | ||
3106 | * socket and port will be allocated | ||
3107 | * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16) | ||
3108 | * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte. | ||
3109 | * For feature advertising, a u32 attribute holding the maximum length | ||
3110 | * of the data payload. | ||
3111 | * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration | ||
3112 | * (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature | ||
3113 | * advertising it is just a flag | ||
3114 | * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration, | ||
3115 | * see &struct nl80211_wowlan_tcp_data_token and for advertising see | ||
3116 | * &struct nl80211_wowlan_tcp_data_token_feature. | ||
3117 | * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum | ||
3118 | * interval in feature advertising (u32) | ||
3119 | * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a | ||
3120 | * u32 attribute holding the maximum length | ||
3121 | * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for | ||
3122 | * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK | ||
3123 | * but on the TCP payload only. | ||
3124 | * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes | ||
3125 | * @MAX_NL80211_WOWLAN_TCP: highest attribute number | ||
3126 | */ | ||
3127 | enum nl80211_wowlan_tcp_attrs { | ||
3128 | __NL80211_WOWLAN_TCP_INVALID, | ||
3129 | NL80211_WOWLAN_TCP_SRC_IPV4, | ||
3130 | NL80211_WOWLAN_TCP_DST_IPV4, | ||
3131 | NL80211_WOWLAN_TCP_DST_MAC, | ||
3132 | NL80211_WOWLAN_TCP_SRC_PORT, | ||
3133 | NL80211_WOWLAN_TCP_DST_PORT, | ||
3134 | NL80211_WOWLAN_TCP_DATA_PAYLOAD, | ||
3135 | NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ, | ||
3136 | NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN, | ||
3137 | NL80211_WOWLAN_TCP_DATA_INTERVAL, | ||
3138 | NL80211_WOWLAN_TCP_WAKE_PAYLOAD, | ||
3139 | NL80211_WOWLAN_TCP_WAKE_MASK, | ||
3140 | |||
3141 | /* keep last */ | ||
3142 | NUM_NL80211_WOWLAN_TCP, | ||
3143 | MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1 | ||
3144 | }; | ||
3145 | |||
3146 | /** | ||
3022 | * enum nl80211_iface_limit_attrs - limit attributes | 3147 | * enum nl80211_iface_limit_attrs - limit attributes |
3023 | * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) | 3148 | * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) |
3024 | * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that | 3149 | * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that |