aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-01-23 16:57:40 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-13 08:33:42 -0500
commit2a0e047ed62f20664005881b8e7f9328f910316a (patch)
tree166497ddbe4dea57a2d816d4fb928b3f8558b3aa /include/net/cfg80211.h
parenta0497f9f57478c5a37c5628eb32833dd9729a821 (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/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h55
1 files changed, 54 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d3a73818e44c..7e6569e1f16f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -19,6 +19,7 @@
19#include <linux/nl80211.h> 19#include <linux/nl80211.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <linux/ieee80211.h> 21#include <linux/ieee80211.h>
22#include <linux/net.h>
22#include <net/regulatory.h> 23#include <net/regulatory.h>
23 24
24/** 25/**
@@ -1588,6 +1589,41 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1588}; 1589};
1589 1590
1590/** 1591/**
1592 * struct cfg80211_wowlan_tcp - TCP connection parameters
1593 *
1594 * @sock: (internal) socket for source port allocation
1595 * @src: source IP address
1596 * @dst: destination IP address
1597 * @dst_mac: destination MAC address
1598 * @src_port: source port
1599 * @dst_port: destination port
1600 * @payload_len: data payload length
1601 * @payload: data payload buffer
1602 * @payload_seq: payload sequence stamping configuration
1603 * @data_interval: interval at which to send data packets
1604 * @wake_len: wakeup payload match length
1605 * @wake_data: wakeup payload match data
1606 * @wake_mask: wakeup payload match mask
1607 * @tokens_size: length of the tokens buffer
1608 * @payload_tok: payload token usage configuration
1609 */
1610struct cfg80211_wowlan_tcp {
1611 struct socket *sock;
1612 __be32 src, dst;
1613 u16 src_port, dst_port;
1614 u8 dst_mac[ETH_ALEN];
1615 int payload_len;
1616 const u8 *payload;
1617 struct nl80211_wowlan_tcp_data_seq payload_seq;
1618 u32 data_interval;
1619 u32 wake_len;
1620 const u8 *wake_data, *wake_mask;
1621 u32 tokens_size;
1622 /* must be last, variable member */
1623 struct nl80211_wowlan_tcp_data_token payload_tok;
1624};
1625
1626/**
1591 * struct cfg80211_wowlan - Wake on Wireless-LAN support info 1627 * struct cfg80211_wowlan - Wake on Wireless-LAN support info
1592 * 1628 *
1593 * This structure defines the enabled WoWLAN triggers for the device. 1629 * This structure defines the enabled WoWLAN triggers for the device.
@@ -1601,12 +1637,15 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1601 * @eap_identity_req: wake up on EAP identity request packet 1637 * @eap_identity_req: wake up on EAP identity request packet
1602 * @four_way_handshake: wake up on 4-way handshake 1638 * @four_way_handshake: wake up on 4-way handshake
1603 * @rfkill_release: wake up when rfkill is released 1639 * @rfkill_release: wake up when rfkill is released
1640 * @tcp: TCP connection establishment/wakeup parameters, see nl80211.h.
1641 * NULL if not configured.
1604 */ 1642 */
1605struct cfg80211_wowlan { 1643struct cfg80211_wowlan {
1606 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1644 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1607 eap_identity_req, four_way_handshake, 1645 eap_identity_req, four_way_handshake,
1608 rfkill_release; 1646 rfkill_release;
1609 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1647 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1648 struct cfg80211_wowlan_tcp *tcp;
1610 int n_patterns; 1649 int n_patterns;
1611}; 1650};
1612 1651
@@ -1626,11 +1665,15 @@ struct cfg80211_wowlan {
1626 * frame triggers an 802.3 frame should be reported, for 1665 * frame triggers an 802.3 frame should be reported, for
1627 * disconnect due to deauth 802.11 frame. This indicates which 1666 * disconnect due to deauth 802.11 frame. This indicates which
1628 * it is. 1667 * it is.
1668 * @tcp_match: TCP wakeup packet received
1669 * @tcp_connlost: TCP connection lost or failed to establish
1670 * @tcp_nomoretokens: TCP data ran out of tokens
1629 */ 1671 */
1630struct cfg80211_wowlan_wakeup { 1672struct cfg80211_wowlan_wakeup {
1631 bool disconnect, magic_pkt, gtk_rekey_failure, 1673 bool disconnect, magic_pkt, gtk_rekey_failure,
1632 eap_identity_req, four_way_handshake, 1674 eap_identity_req, four_way_handshake,
1633 rfkill_release, packet_80211; 1675 rfkill_release, packet_80211,
1676 tcp_match, tcp_connlost, tcp_nomoretokens;
1634 s32 pattern_idx; 1677 s32 pattern_idx;
1635 u32 packet_present_len, packet_len; 1678 u32 packet_present_len, packet_len;
1636 const void *packet; 1679 const void *packet;
@@ -2285,6 +2328,14 @@ enum wiphy_wowlan_support_flags {
2285 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7), 2328 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
2286}; 2329};
2287 2330
2331struct wiphy_wowlan_tcp_support {
2332 const struct nl80211_wowlan_tcp_data_token_feature *tok;
2333 u32 data_payload_max;
2334 u32 data_interval_max;
2335 u32 wake_payload_max;
2336 bool seq;
2337};
2338
2288/** 2339/**
2289 * struct wiphy_wowlan_support - WoWLAN support data 2340 * struct wiphy_wowlan_support - WoWLAN support data
2290 * @flags: see &enum wiphy_wowlan_support_flags 2341 * @flags: see &enum wiphy_wowlan_support_flags
@@ -2293,6 +2344,7 @@ enum wiphy_wowlan_support_flags {
2293 * @pattern_max_len: maximum length of each pattern 2344 * @pattern_max_len: maximum length of each pattern
2294 * @pattern_min_len: minimum length of each pattern 2345 * @pattern_min_len: minimum length of each pattern
2295 * @max_pkt_offset: maximum Rx packet offset 2346 * @max_pkt_offset: maximum Rx packet offset
2347 * @tcp: TCP wakeup support information
2296 */ 2348 */
2297struct wiphy_wowlan_support { 2349struct wiphy_wowlan_support {
2298 u32 flags; 2350 u32 flags;
@@ -2300,6 +2352,7 @@ struct wiphy_wowlan_support {
2300 int pattern_max_len; 2352 int pattern_max_len;
2301 int pattern_min_len; 2353 int pattern_min_len;
2302 int max_pkt_offset; 2354 int max_pkt_offset;
2355 const struct wiphy_wowlan_tcp_support *tcp;
2303}; 2356};
2304 2357
2305/** 2358/**