aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-02-15 13:59:53 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-02-15 13:59:53 -0500
commitded652a67464b1fa66616954bc608ead9ec02fb6 (patch)
tree7b4bf1ab3723ed6a906393a5c9f129381cf8e592 /include
parentb56e681b6210a635af4e4eb93ce81b4654851033 (diff)
parent93c78c5debeb9c7101ecc73347d4730c26a98c05 (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h42
-rw-r--r--include/net/cfg80211.h136
-rw-r--r--include/net/mac80211.h52
-rw-r--r--include/uapi/linux/nl80211.h239
4 files changed, 461 insertions, 8 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 7e8a498efe6d..7e24fe0cfbcd 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -714,6 +714,30 @@ enum ieee80211_ht_chanwidth_values {
714 IEEE80211_HT_CHANWIDTH_ANY = 1, 714 IEEE80211_HT_CHANWIDTH_ANY = 1,
715}; 715};
716 716
717/**
718 * enum ieee80211_opmode_bits - VHT operating mode field bits
719 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK: channel width mask
720 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ: 20 MHz channel width
721 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ: 40 MHz channel width
722 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ: 80 MHz channel width
723 * @IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ: 160 MHz or 80+80 MHz channel width
724 * @IEEE80211_OPMODE_NOTIF_RX_NSS_MASK: number of spatial streams mask
725 * (the NSS value is the value of this field + 1)
726 * @IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT: number of spatial streams shift
727 * @IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF: indicates streams in SU-MIMO PPDU
728 * using a beamforming steering matrix
729 */
730enum ieee80211_vht_opmode_bits {
731 IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK = 3,
732 IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ = 0,
733 IEEE80211_OPMODE_NOTIF_CHANWIDTH_40MHZ = 1,
734 IEEE80211_OPMODE_NOTIF_CHANWIDTH_80MHZ = 2,
735 IEEE80211_OPMODE_NOTIF_CHANWIDTH_160MHZ = 3,
736 IEEE80211_OPMODE_NOTIF_RX_NSS_MASK = 0x70,
737 IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT = 4,
738 IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF = 0x80,
739};
740
717#define WLAN_SA_QUERY_TR_ID_LEN 2 741#define WLAN_SA_QUERY_TR_ID_LEN 2
718 742
719struct ieee80211_mgmt { 743struct ieee80211_mgmt {
@@ -844,6 +868,10 @@ struct ieee80211_mgmt {
844 __le16 capability; 868 __le16 capability;
845 u8 variable[0]; 869 u8 variable[0];
846 } __packed tdls_discover_resp; 870 } __packed tdls_discover_resp;
871 struct {
872 u8 action_code;
873 u8 operating_mode;
874 } __packed vht_opmode_notif;
847 } u; 875 } u;
848 } __packed action; 876 } __packed action;
849 } u; 877 } u;
@@ -1273,6 +1301,7 @@ struct ieee80211_vht_operation {
1273#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1301#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1274#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1302#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1275#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1303#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1304#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000C
1276#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1305#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1277#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1306#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1278#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1307#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
@@ -1598,6 +1627,7 @@ enum ieee80211_eid {
1598 1627
1599 WLAN_EID_VHT_CAPABILITY = 191, 1628 WLAN_EID_VHT_CAPABILITY = 191,
1600 WLAN_EID_VHT_OPERATION = 192, 1629 WLAN_EID_VHT_OPERATION = 192,
1630 WLAN_EID_OPMODE_NOTIF = 199,
1601 1631
1602 /* 802.11ad */ 1632 /* 802.11ad */
1603 WLAN_EID_NON_TX_BSSID_CAP = 83, 1633 WLAN_EID_NON_TX_BSSID_CAP = 83,
@@ -1652,6 +1682,7 @@ enum ieee80211_category {
1652 WLAN_CATEGORY_WMM = 17, 1682 WLAN_CATEGORY_WMM = 17,
1653 WLAN_CATEGORY_FST = 18, 1683 WLAN_CATEGORY_FST = 18,
1654 WLAN_CATEGORY_UNPROT_DMG = 20, 1684 WLAN_CATEGORY_UNPROT_DMG = 20,
1685 WLAN_CATEGORY_VHT = 21,
1655 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1686 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1656 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1687 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1657}; 1688};
@@ -1677,6 +1708,13 @@ enum ieee80211_ht_actioncode {
1677 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, 1708 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1678}; 1709};
1679 1710
1711/* VHT action codes */
1712enum ieee80211_vht_actioncode {
1713 WLAN_VHT_ACTION_COMPRESSED_BF = 0,
1714 WLAN_VHT_ACTION_GROUPID_MGMT = 1,
1715 WLAN_VHT_ACTION_OPMODE_NOTIF = 2,
1716};
1717
1680/* Self Protected Action codes */ 1718/* Self Protected Action codes */
1681enum ieee80211_self_protected_actioncode { 1719enum ieee80211_self_protected_actioncode {
1682 WLAN_SP_RESERVED = 0, 1720 WLAN_SP_RESERVED = 0,
@@ -1738,6 +1776,8 @@ enum ieee80211_tdls_actioncode {
1738#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5) 1776#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5)
1739#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) 1777#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1740 1778
1779#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
1780
1741/* TDLS specific payload type in the LLC/SNAP header */ 1781/* TDLS specific payload type in the LLC/SNAP header */
1742#define WLAN_TDLS_SNAP_RFTYPE 0x2 1782#define WLAN_TDLS_SNAP_RFTYPE 0x2
1743 1783
@@ -2114,7 +2154,7 @@ static inline unsigned long ieee80211_tu_to_usec(unsigned long tu)
2114 * @tim_len: length of the TIM IE 2154 * @tim_len: length of the TIM IE
2115 * @aid: the AID to look for 2155 * @aid: the AID to look for
2116 */ 2156 */
2117static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim, 2157static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2118 u8 tim_len, u16 aid) 2158 u8 tim_len, u16 aid)
2119{ 2159{
2120 u8 mask; 2160 u8 mask;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 77686ca28948..fa2612952c19 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/**
@@ -99,6 +100,16 @@ enum ieee80211_band {
99 * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel 100 * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
100 * is not permitted. 101 * is not permitted.
101 * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel. 102 * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel.
103 * @IEEE80211_CHAN_NO_80MHZ: If the driver supports 80 MHz on the band,
104 * this flag indicates that an 80 MHz channel cannot use this
105 * channel as the control or any of the secondary channels.
106 * This may be due to the driver or due to regulatory bandwidth
107 * restrictions.
108 * @IEEE80211_CHAN_NO_160MHZ: If the driver supports 160 MHz on the band,
109 * this flag indicates that an 160 MHz channel cannot use this
110 * channel as the control or any of the secondary channels.
111 * This may be due to the driver or due to regulatory bandwidth
112 * restrictions.
102 */ 113 */
103enum ieee80211_channel_flags { 114enum ieee80211_channel_flags {
104 IEEE80211_CHAN_DISABLED = 1<<0, 115 IEEE80211_CHAN_DISABLED = 1<<0,
@@ -108,11 +119,16 @@ enum ieee80211_channel_flags {
108 IEEE80211_CHAN_NO_HT40PLUS = 1<<4, 119 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
109 IEEE80211_CHAN_NO_HT40MINUS = 1<<5, 120 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
110 IEEE80211_CHAN_NO_OFDM = 1<<6, 121 IEEE80211_CHAN_NO_OFDM = 1<<6,
122 IEEE80211_CHAN_NO_80MHZ = 1<<7,
123 IEEE80211_CHAN_NO_160MHZ = 1<<8,
111}; 124};
112 125
113#define IEEE80211_CHAN_NO_HT40 \ 126#define IEEE80211_CHAN_NO_HT40 \
114 (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS) 127 (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS)
115 128
129#define IEEE80211_DFS_MIN_CAC_TIME_MS 60000
130#define IEEE80211_DFS_MIN_NOP_TIME_MS (30 * 60 * 1000)
131
116/** 132/**
117 * struct ieee80211_channel - channel definition 133 * struct ieee80211_channel - channel definition
118 * 134 *
@@ -133,6 +149,9 @@ enum ieee80211_channel_flags {
133 * to enable this, this is useful only on 5 GHz band. 149 * to enable this, this is useful only on 5 GHz band.
134 * @orig_mag: internal use 150 * @orig_mag: internal use
135 * @orig_mpwr: internal use 151 * @orig_mpwr: internal use
152 * @dfs_state: current state of this channel. Only relevant if radar is required
153 * on this channel.
154 * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
136 */ 155 */
137struct ieee80211_channel { 156struct ieee80211_channel {
138 enum ieee80211_band band; 157 enum ieee80211_band band;
@@ -145,6 +164,8 @@ struct ieee80211_channel {
145 bool beacon_found; 164 bool beacon_found;
146 u32 orig_flags; 165 u32 orig_flags;
147 int orig_mag, orig_mpwr; 166 int orig_mag, orig_mpwr;
167 enum nl80211_dfs_state dfs_state;
168 unsigned long dfs_state_entered;
148}; 169};
149 170
150/** 171/**
@@ -568,6 +589,7 @@ struct cfg80211_acl_data {
568 * @p2p_opp_ps: P2P opportunistic PS 589 * @p2p_opp_ps: P2P opportunistic PS
569 * @acl: ACL configuration used by the drivers which has support for 590 * @acl: ACL configuration used by the drivers which has support for
570 * MAC address based access control 591 * MAC address based access control
592 * @radar_required: set if radar detection is required
571 */ 593 */
572struct cfg80211_ap_settings { 594struct cfg80211_ap_settings {
573 struct cfg80211_chan_def chandef; 595 struct cfg80211_chan_def chandef;
@@ -585,6 +607,7 @@ struct cfg80211_ap_settings {
585 u8 p2p_ctwindow; 607 u8 p2p_ctwindow;
586 bool p2p_opp_ps; 608 bool p2p_opp_ps;
587 const struct cfg80211_acl_data *acl; 609 const struct cfg80211_acl_data *acl;
610 bool radar_required;
588}; 611};
589 612
590/** 613/**
@@ -603,12 +626,14 @@ enum plink_actions {
603/** 626/**
604 * enum station_parameters_apply_mask - station parameter values to apply 627 * enum station_parameters_apply_mask - station parameter values to apply
605 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 628 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
629 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
606 * 630 *
607 * Not all station parameters have in-band "no change" signalling, 631 * Not all station parameters have in-band "no change" signalling,
608 * for those that don't these flags will are used. 632 * for those that don't these flags will are used.
609 */ 633 */
610enum station_parameters_apply_mask { 634enum station_parameters_apply_mask {
611 STATION_PARAM_APPLY_UAPSD = BIT(0), 635 STATION_PARAM_APPLY_UAPSD = BIT(0),
636 STATION_PARAM_APPLY_CAPABILITY = BIT(1),
612}; 637};
613 638
614/** 639/**
@@ -639,6 +664,9 @@ enum station_parameters_apply_mask {
639 * see &enum station_parameters_apply_mask 664 * see &enum station_parameters_apply_mask
640 * @local_pm: local link-specific mesh power save mode (no change when set 665 * @local_pm: local link-specific mesh power save mode (no change when set
641 * to unknown) 666 * to unknown)
667 * @capability: station capability
668 * @ext_capab: extended capabilities of the station
669 * @ext_capab_len: number of extended capabilities
642 */ 670 */
643struct station_parameters { 671struct station_parameters {
644 u8 *supported_rates; 672 u8 *supported_rates;
@@ -655,6 +683,9 @@ struct station_parameters {
655 u8 uapsd_queues; 683 u8 uapsd_queues;
656 u8 max_sp; 684 u8 max_sp;
657 enum nl80211_mesh_power_mode local_pm; 685 enum nl80211_mesh_power_mode local_pm;
686 u16 capability;
687 u8 *ext_capab;
688 u8 ext_capab_len;
658}; 689};
659 690
660/** 691/**
@@ -1576,6 +1607,7 @@ struct cfg80211_pmksa {
1576 * one bit per byte, in same format as nl80211 1607 * one bit per byte, in same format as nl80211
1577 * @pattern: bytes to match where bitmask is 1 1608 * @pattern: bytes to match where bitmask is 1
1578 * @pattern_len: length of pattern (in bytes) 1609 * @pattern_len: length of pattern (in bytes)
1610 * @pkt_offset: packet offset (in bytes)
1579 * 1611 *
1580 * Internal note: @mask and @pattern are allocated in one chunk of 1612 * Internal note: @mask and @pattern are allocated in one chunk of
1581 * memory, free @mask only! 1613 * memory, free @mask only!
@@ -1583,6 +1615,42 @@ struct cfg80211_pmksa {
1583struct cfg80211_wowlan_trig_pkt_pattern { 1615struct cfg80211_wowlan_trig_pkt_pattern {
1584 u8 *mask, *pattern; 1616 u8 *mask, *pattern;
1585 int pattern_len; 1617 int pattern_len;
1618 int pkt_offset;
1619};
1620
1621/**
1622 * struct cfg80211_wowlan_tcp - TCP connection parameters
1623 *
1624 * @sock: (internal) socket for source port allocation
1625 * @src: source IP address
1626 * @dst: destination IP address
1627 * @dst_mac: destination MAC address
1628 * @src_port: source port
1629 * @dst_port: destination port
1630 * @payload_len: data payload length
1631 * @payload: data payload buffer
1632 * @payload_seq: payload sequence stamping configuration
1633 * @data_interval: interval at which to send data packets
1634 * @wake_len: wakeup payload match length
1635 * @wake_data: wakeup payload match data
1636 * @wake_mask: wakeup payload match mask
1637 * @tokens_size: length of the tokens buffer
1638 * @payload_tok: payload token usage configuration
1639 */
1640struct cfg80211_wowlan_tcp {
1641 struct socket *sock;
1642 __be32 src, dst;
1643 u16 src_port, dst_port;
1644 u8 dst_mac[ETH_ALEN];
1645 int payload_len;
1646 const u8 *payload;
1647 struct nl80211_wowlan_tcp_data_seq payload_seq;
1648 u32 data_interval;
1649 u32 wake_len;
1650 const u8 *wake_data, *wake_mask;
1651 u32 tokens_size;
1652 /* must be last, variable member */
1653 struct nl80211_wowlan_tcp_data_token payload_tok;
1586}; 1654};
1587 1655
1588/** 1656/**
@@ -1599,12 +1667,15 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1599 * @eap_identity_req: wake up on EAP identity request packet 1667 * @eap_identity_req: wake up on EAP identity request packet
1600 * @four_way_handshake: wake up on 4-way handshake 1668 * @four_way_handshake: wake up on 4-way handshake
1601 * @rfkill_release: wake up when rfkill is released 1669 * @rfkill_release: wake up when rfkill is released
1670 * @tcp: TCP connection establishment/wakeup parameters, see nl80211.h.
1671 * NULL if not configured.
1602 */ 1672 */
1603struct cfg80211_wowlan { 1673struct cfg80211_wowlan {
1604 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1674 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1605 eap_identity_req, four_way_handshake, 1675 eap_identity_req, four_way_handshake,
1606 rfkill_release; 1676 rfkill_release;
1607 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1677 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1678 struct cfg80211_wowlan_tcp *tcp;
1608 int n_patterns; 1679 int n_patterns;
1609}; 1680};
1610 1681
@@ -1624,11 +1695,15 @@ struct cfg80211_wowlan {
1624 * frame triggers an 802.3 frame should be reported, for 1695 * frame triggers an 802.3 frame should be reported, for
1625 * disconnect due to deauth 802.11 frame. This indicates which 1696 * disconnect due to deauth 802.11 frame. This indicates which
1626 * it is. 1697 * it is.
1698 * @tcp_match: TCP wakeup packet received
1699 * @tcp_connlost: TCP connection lost or failed to establish
1700 * @tcp_nomoretokens: TCP data ran out of tokens
1627 */ 1701 */
1628struct cfg80211_wowlan_wakeup { 1702struct cfg80211_wowlan_wakeup {
1629 bool disconnect, magic_pkt, gtk_rekey_failure, 1703 bool disconnect, magic_pkt, gtk_rekey_failure,
1630 eap_identity_req, four_way_handshake, 1704 eap_identity_req, four_way_handshake,
1631 rfkill_release, packet_80211; 1705 rfkill_release, packet_80211,
1706 tcp_match, tcp_connlost, tcp_nomoretokens;
1632 s32 pattern_idx; 1707 s32 pattern_idx;
1633 u32 packet_present_len, packet_len; 1708 u32 packet_present_len, packet_len;
1634 const void *packet; 1709 const void *packet;
@@ -1864,6 +1939,8 @@ struct cfg80211_gtk_rekey_data {
1864 * this new list replaces the existing one. Driver has to clear its ACL 1939 * this new list replaces the existing one. Driver has to clear its ACL
1865 * when number of MAC addresses entries is passed as 0. Drivers which 1940 * when number of MAC addresses entries is passed as 0. Drivers which
1866 * advertise the support for MAC based ACL have to implement this callback. 1941 * advertise the support for MAC based ACL have to implement this callback.
1942 *
1943 * @start_radar_detection: Start radar detection in the driver.
1867 */ 1944 */
1868struct cfg80211_ops { 1945struct cfg80211_ops {
1869 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1946 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2087,6 +2164,10 @@ struct cfg80211_ops {
2087 2164
2088 int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev, 2165 int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev,
2089 const struct cfg80211_acl_data *params); 2166 const struct cfg80211_acl_data *params);
2167
2168 int (*start_radar_detection)(struct wiphy *wiphy,
2169 struct net_device *dev,
2170 struct cfg80211_chan_def *chandef);
2090}; 2171};
2091 2172
2092/* 2173/*
@@ -2283,6 +2364,14 @@ enum wiphy_wowlan_support_flags {
2283 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7), 2364 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
2284}; 2365};
2285 2366
2367struct wiphy_wowlan_tcp_support {
2368 const struct nl80211_wowlan_tcp_data_token_feature *tok;
2369 u32 data_payload_max;
2370 u32 data_interval_max;
2371 u32 wake_payload_max;
2372 bool seq;
2373};
2374
2286/** 2375/**
2287 * struct wiphy_wowlan_support - WoWLAN support data 2376 * struct wiphy_wowlan_support - WoWLAN support data
2288 * @flags: see &enum wiphy_wowlan_support_flags 2377 * @flags: see &enum wiphy_wowlan_support_flags
@@ -2290,12 +2379,16 @@ enum wiphy_wowlan_support_flags {
2290 * (see nl80211.h for the pattern definition) 2379 * (see nl80211.h for the pattern definition)
2291 * @pattern_max_len: maximum length of each pattern 2380 * @pattern_max_len: maximum length of each pattern
2292 * @pattern_min_len: minimum length of each pattern 2381 * @pattern_min_len: minimum length of each pattern
2382 * @max_pkt_offset: maximum Rx packet offset
2383 * @tcp: TCP wakeup support information
2293 */ 2384 */
2294struct wiphy_wowlan_support { 2385struct wiphy_wowlan_support {
2295 u32 flags; 2386 u32 flags;
2296 int n_patterns; 2387 int n_patterns;
2297 int pattern_max_len; 2388 int pattern_max_len;
2298 int pattern_min_len; 2389 int pattern_min_len;
2390 int max_pkt_offset;
2391 const struct wiphy_wowlan_tcp_support *tcp;
2299}; 2392};
2300 2393
2301/** 2394/**
@@ -2395,6 +2488,14 @@ struct wiphy_wowlan_support {
2395 * 2488 *
2396 * @max_acl_mac_addrs: Maximum number of MAC addresses that the device 2489 * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
2397 * supports for ACL. 2490 * supports for ACL.
2491 *
2492 * @extended_capabilities: extended capabilities supported by the driver,
2493 * additional capabilities might be supported by userspace; these are
2494 * the 802.11 extended capabilities ("Extended Capabilities element")
2495 * and are in the same format as in the information element. See
2496 * 802.11-2012 8.4.2.29 for the defined fields.
2497 * @extended_capabilities_mask: mask of the valid values
2498 * @extended_capabilities_len: length of the extended capabilities
2398 */ 2499 */
2399struct wiphy { 2500struct wiphy {
2400 /* assign these fields before you register the wiphy */ 2501 /* assign these fields before you register the wiphy */
@@ -2461,6 +2562,9 @@ struct wiphy {
2461 */ 2562 */
2462 u32 probe_resp_offload; 2563 u32 probe_resp_offload;
2463 2564
2565 const u8 *extended_capabilities, *extended_capabilities_mask;
2566 u8 extended_capabilities_len;
2567
2464 /* If multiple wiphys are registered and you're handed e.g. 2568 /* If multiple wiphys are registered and you're handed e.g.
2465 * a regular netdev with assigned ieee80211_ptr, you won't 2569 * a regular netdev with assigned ieee80211_ptr, you won't
2466 * know whether it points to a wiphy your driver has registered 2570 * know whether it points to a wiphy your driver has registered
@@ -2658,6 +2762,8 @@ struct cfg80211_cached_keys;
2658 * beacons, 0 when not valid 2762 * beacons, 0 when not valid
2659 * @address: The address for this device, valid only if @netdev is %NULL 2763 * @address: The address for this device, valid only if @netdev is %NULL
2660 * @p2p_started: true if this is a P2P Device that has been started 2764 * @p2p_started: true if this is a P2P Device that has been started
2765 * @cac_started: true if DFS channel availability check has been started
2766 * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
2661 */ 2767 */
2662struct wireless_dev { 2768struct wireless_dev {
2663 struct wiphy *wiphy; 2769 struct wiphy *wiphy;
@@ -2709,6 +2815,9 @@ struct wireless_dev {
2709 2815
2710 u32 ap_unexpected_nlportid; 2816 u32 ap_unexpected_nlportid;
2711 2817
2818 bool cac_started;
2819 unsigned long cac_start_time;
2820
2712#ifdef CONFIG_CFG80211_WEXT 2821#ifdef CONFIG_CFG80211_WEXT
2713 /* wext data */ 2822 /* wext data */
2714 struct { 2823 struct {
@@ -3698,6 +3807,31 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
3698 gfp_t gfp); 3807 gfp_t gfp);
3699 3808
3700/** 3809/**
3810 * cfg80211_radar_event - radar detection event
3811 * @wiphy: the wiphy
3812 * @chandef: chandef for the current channel
3813 * @gfp: context flags
3814 *
3815 * This function is called when a radar is detected on the current chanenl.
3816 */
3817void cfg80211_radar_event(struct wiphy *wiphy,
3818 struct cfg80211_chan_def *chandef, gfp_t gfp);
3819
3820/**
3821 * cfg80211_cac_event - Channel availability check (CAC) event
3822 * @netdev: network device
3823 * @event: type of event
3824 * @gfp: context flags
3825 *
3826 * This function is called when a Channel availability check (CAC) is finished
3827 * or aborted. This must be called to notify the completion of a CAC process,
3828 * also by full-MAC drivers.
3829 */
3830void cfg80211_cac_event(struct net_device *netdev,
3831 enum nl80211_radar_event event, gfp_t gfp);
3832
3833
3834/**
3701 * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer 3835 * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer
3702 * @dev: network device 3836 * @dev: network device
3703 * @peer: peer's MAC address 3837 * @peer: peer's MAC address
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0eaa9092364b..f7eba1300d82 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -147,10 +147,12 @@ struct ieee80211_low_level_stats {
147 * enum ieee80211_chanctx_change - change flag for channel context 147 * enum ieee80211_chanctx_change - change flag for channel context
148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
150 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
150 */ 151 */
151enum ieee80211_chanctx_change { 152enum ieee80211_chanctx_change {
152 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 153 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
153 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 154 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
155 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
154}; 156};
155 157
156/** 158/**
@@ -165,6 +167,7 @@ enum ieee80211_chanctx_change {
165 * @rx_chains_dynamic: The number of RX chains that must be enabled 167 * @rx_chains_dynamic: The number of RX chains that must be enabled
166 * after RTS/CTS handshake to receive SMPS MIMO transmissions; 168 * after RTS/CTS handshake to receive SMPS MIMO transmissions;
167 * this will always be >= @rx_chains_static. 169 * this will always be >= @rx_chains_static.
170 * @radar_enabled: whether radar detection is enabled on this channel.
168 * @drv_priv: data area for driver use, will always be aligned to 171 * @drv_priv: data area for driver use, will always be aligned to
169 * sizeof(void *), size is determined in hw information. 172 * sizeof(void *), size is determined in hw information.
170 */ 173 */
@@ -173,6 +176,8 @@ struct ieee80211_chanctx_conf {
173 176
174 u8 rx_chains_static, rx_chains_dynamic; 177 u8 rx_chains_static, rx_chains_dynamic;
175 178
179 bool radar_enabled;
180
176 u8 drv_priv[0] __aligned(sizeof(void *)); 181 u8 drv_priv[0] __aligned(sizeof(void *));
177}; 182};
178 183
@@ -210,6 +215,9 @@ struct ieee80211_chanctx_conf {
210 * changed (currently only in P2P client mode, GO mode will be later) 215 * changed (currently only in P2P client mode, GO mode will be later)
211 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when 216 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when
212 * it becomes valid, managed mode only) 217 * it becomes valid, managed mode only)
218 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,
219 * note that this is only called when it changes after the channel
220 * context had been assigned.
213 */ 221 */
214enum ieee80211_bss_change { 222enum ieee80211_bss_change {
215 BSS_CHANGED_ASSOC = 1<<0, 223 BSS_CHANGED_ASSOC = 1<<0,
@@ -233,6 +241,7 @@ enum ieee80211_bss_change {
233 BSS_CHANGED_TXPOWER = 1<<18, 241 BSS_CHANGED_TXPOWER = 1<<18,
234 BSS_CHANGED_P2P_PS = 1<<19, 242 BSS_CHANGED_P2P_PS = 1<<19,
235 BSS_CHANGED_DTIM_PERIOD = 1<<20, 243 BSS_CHANGED_DTIM_PERIOD = 1<<20,
244 BSS_CHANGED_BANDWIDTH = 1<<21,
236 245
237 /* when adding here, make sure to change ieee80211_reconfig */ 246 /* when adding here, make sure to change ieee80211_reconfig */
238}; 247};
@@ -967,6 +976,7 @@ enum ieee80211_smps_mode {
967 * 976 *
968 * @channel: the channel to tune to 977 * @channel: the channel to tune to
969 * @channel_type: the channel (HT) type 978 * @channel_type: the channel (HT) type
979 * @radar_enabled: whether radar detection is enabled
970 * 980 *
971 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 981 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
972 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 982 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
@@ -993,6 +1003,7 @@ struct ieee80211_conf {
993 1003
994 struct ieee80211_channel *channel; 1004 struct ieee80211_channel *channel;
995 enum nl80211_channel_type channel_type; 1005 enum nl80211_channel_type channel_type;
1006 bool radar_enabled;
996 enum ieee80211_smps_mode smps_mode; 1007 enum ieee80211_smps_mode smps_mode;
997}; 1008};
998 1009
@@ -1190,6 +1201,24 @@ enum ieee80211_sta_state {
1190}; 1201};
1191 1202
1192/** 1203/**
1204 * enum ieee80211_sta_rx_bandwidth - station RX bandwidth
1205 * @IEEE80211_STA_RX_BW_20: station can only receive 20 MHz
1206 * @IEEE80211_STA_RX_BW_40: station can receive up to 40 MHz
1207 * @IEEE80211_STA_RX_BW_80: station can receive up to 80 MHz
1208 * @IEEE80211_STA_RX_BW_160: station can receive up to 160 MHz
1209 * (including 80+80 MHz)
1210 *
1211 * Implementation note: 20 must be zero to be initialized
1212 * correctly, the values must be sorted.
1213 */
1214enum ieee80211_sta_rx_bandwidth {
1215 IEEE80211_STA_RX_BW_20 = 0,
1216 IEEE80211_STA_RX_BW_40,
1217 IEEE80211_STA_RX_BW_80,
1218 IEEE80211_STA_RX_BW_160,
1219};
1220
1221/**
1193 * struct ieee80211_sta - station table entry 1222 * struct ieee80211_sta - station table entry
1194 * 1223 *
1195 * A station table entry represents a station we are possibly 1224 * A station table entry represents a station we are possibly
@@ -1211,6 +1240,12 @@ enum ieee80211_sta_state {
1211 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid 1240 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
1212 * if wme is supported. 1241 * if wme is supported.
1213 * @max_sp: max Service Period. Only valid if wme is supported. 1242 * @max_sp: max Service Period. Only valid if wme is supported.
1243 * @bandwidth: current bandwidth the station can receive with
1244 * @rx_nss: in HT/VHT, the maximum number of spatial streams the
1245 * station can receive at the moment, changed by operating mode
1246 * notifications and capabilities. The value is only valid after
1247 * the station moves to associated state.
1248 * @smps_mode: current SMPS mode (off, static or dynamic)
1214 */ 1249 */
1215struct ieee80211_sta { 1250struct ieee80211_sta {
1216 u32 supp_rates[IEEE80211_NUM_BANDS]; 1251 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1221,6 +1256,9 @@ struct ieee80211_sta {
1221 bool wme; 1256 bool wme;
1222 u8 uapsd_queues; 1257 u8 uapsd_queues;
1223 u8 max_sp; 1258 u8 max_sp;
1259 u8 rx_nss;
1260 enum ieee80211_sta_rx_bandwidth bandwidth;
1261 enum ieee80211_smps_mode smps_mode;
1224 1262
1225 /* must be last */ 1263 /* must be last */
1226 u8 drv_priv[0] __aligned(sizeof(void *)); 1264 u8 drv_priv[0] __aligned(sizeof(void *));
@@ -2079,16 +2117,21 @@ enum ieee80211_frame_release_type {
2079 * enum ieee80211_rate_control_changed - flags to indicate what changed 2117 * enum ieee80211_rate_control_changed - flags to indicate what changed
2080 * 2118 *
2081 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit 2119 * @IEEE80211_RC_BW_CHANGED: The bandwidth that can be used to transmit
2082 * to this station changed. 2120 * to this station changed. The actual bandwidth is in the station
2121 * information -- for HT20/40 the IEEE80211_HT_CAP_SUP_WIDTH_20_40
2122 * flag changes, for HT and VHT the bandwidth field changes.
2083 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. 2123 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed.
2084 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer 2124 * @IEEE80211_RC_SUPP_RATES_CHANGED: The supported rate set of this peer
2085 * changed (in IBSS mode) due to discovering more information about 2125 * changed (in IBSS mode) due to discovering more information about
2086 * the peer. 2126 * the peer.
2127 * @IEEE80211_RC_NSS_CHANGED: N_SS (number of spatial streams) was changed
2128 * by the peer
2087 */ 2129 */
2088enum ieee80211_rate_control_changed { 2130enum ieee80211_rate_control_changed {
2089 IEEE80211_RC_BW_CHANGED = BIT(0), 2131 IEEE80211_RC_BW_CHANGED = BIT(0),
2090 IEEE80211_RC_SMPS_CHANGED = BIT(1), 2132 IEEE80211_RC_SMPS_CHANGED = BIT(1),
2091 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), 2133 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2),
2134 IEEE80211_RC_NSS_CHANGED = BIT(3),
2092}; 2135};
2093 2136
2094/** 2137/**
@@ -3945,6 +3988,13 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
3945 gfp_t gfp); 3988 gfp_t gfp);
3946 3989
3947/** 3990/**
3991 * ieee80211_radar_detected - inform that a radar was detected
3992 *
3993 * @hw: pointer as obtained from ieee80211_alloc_hw()
3994 */
3995void ieee80211_radar_detected(struct ieee80211_hw *hw);
3996
3997/**
3948 * ieee80211_chswitch_done - Complete channel switch process 3998 * ieee80211_chswitch_done - Complete channel switch process
3949 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3999 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3950 * @success: make the channel switch successful or not 4000 * @success: make the channel switch successful or not
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 9a2ecdc4136c..c46bb016f4e4 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -603,6 +603,14 @@
603 * command is used in AP/P2P GO mode. Driver has to make sure to clear its 603 * command is used in AP/P2P GO mode. Driver has to make sure to clear its
604 * ACL list during %NL80211_CMD_STOP_AP. 604 * ACL list during %NL80211_CMD_STOP_AP.
605 * 605 *
606 * @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
607 * a radar is detected or the channel availability scan (CAC) has finished
608 * or was aborted, or a radar was detected, usermode will be notified with
609 * this event. This command is also used to notify userspace about radars
610 * while operating on this channel.
611 * %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
612 * event.
613 *
606 * @NL80211_CMD_MAX: highest used command number 614 * @NL80211_CMD_MAX: highest used command number
607 * @__NL80211_CMD_AFTER_LAST: internal use 615 * @__NL80211_CMD_AFTER_LAST: internal use
608 */ 616 */
@@ -755,6 +763,8 @@ enum nl80211_commands {
755 763
756 NL80211_CMD_SET_MAC_ACL, 764 NL80211_CMD_SET_MAC_ACL,
757 765
766 NL80211_CMD_RADAR_DETECT,
767
758 /* add new commands above here */ 768 /* add new commands above here */
759 769
760 /* used to define NL80211_CMD_MAX below */ 770 /* used to define NL80211_CMD_MAX below */
@@ -1342,6 +1352,22 @@ enum nl80211_commands {
1342 * number of MAC addresses that a device can support for MAC 1352 * number of MAC addresses that a device can support for MAC
1343 * ACL. 1353 * ACL.
1344 * 1354 *
1355 * @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
1356 * contains a value of enum nl80211_radar_event (u32).
1357 *
1358 * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
1359 * has and handles. The format is the same as the IE contents. See
1360 * 802.11-2012 8.4.2.29 for more information.
1361 * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
1362 * has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
1363 *
1364 * @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to
1365 * the driver, e.g., to enable TDLS power save (PU-APSD).
1366 *
1367 * @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are
1368 * advertised to the driver, e.g., to enable TDLS off channel operations
1369 * and PU-APSD.
1370 *
1345 * @NL80211_ATTR_MAX: highest attribute number currently defined 1371 * @NL80211_ATTR_MAX: highest attribute number currently defined
1346 * @__NL80211_ATTR_AFTER_LAST: internal use 1372 * @__NL80211_ATTR_AFTER_LAST: internal use
1347 */ 1373 */
@@ -1620,6 +1646,14 @@ enum nl80211_attrs {
1620 1646
1621 NL80211_ATTR_MAC_ACL_MAX, 1647 NL80211_ATTR_MAC_ACL_MAX,
1622 1648
1649 NL80211_ATTR_RADAR_EVENT,
1650
1651 NL80211_ATTR_EXT_CAPA,
1652 NL80211_ATTR_EXT_CAPA_MASK,
1653
1654 NL80211_ATTR_STA_CAPABILITY,
1655 NL80211_ATTR_STA_EXT_CAPABILITY,
1656
1623 /* add attributes here, update the policy in nl80211.c */ 1657 /* add attributes here, update the policy in nl80211.c */
1624 1658
1625 __NL80211_ATTR_AFTER_LAST, 1659 __NL80211_ATTR_AFTER_LAST,
@@ -2022,6 +2056,20 @@ enum nl80211_band_attr {
2022 * on this channel in current regulatory domain. 2056 * on this channel in current regulatory domain.
2023 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 2057 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
2024 * (100 * dBm). 2058 * (100 * dBm).
2059 * @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
2060 * (enum nl80211_dfs_state)
2061 * @NL80211_FREQUENCY_ATTR_DFS_TIME: time in miliseconds for how long
2062 * this channel is in this DFS state.
2063 * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
2064 * channel as the control channel
2065 * @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this
2066 * channel as the control channel
2067 * @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel
2068 * as the primary or any of the secondary channels isn't possible,
2069 * this includes 80+80 channels
2070 * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
2071 * using this channel as the primary or any of the secondary channels
2072 * isn't possible
2025 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number 2073 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
2026 * currently defined 2074 * currently defined
2027 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use 2075 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -2034,6 +2082,12 @@ enum nl80211_frequency_attr {
2034 NL80211_FREQUENCY_ATTR_NO_IBSS, 2082 NL80211_FREQUENCY_ATTR_NO_IBSS,
2035 NL80211_FREQUENCY_ATTR_RADAR, 2083 NL80211_FREQUENCY_ATTR_RADAR,
2036 NL80211_FREQUENCY_ATTR_MAX_TX_POWER, 2084 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
2085 NL80211_FREQUENCY_ATTR_DFS_STATE,
2086 NL80211_FREQUENCY_ATTR_DFS_TIME,
2087 NL80211_FREQUENCY_ATTR_NO_HT40_MINUS,
2088 NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
2089 NL80211_FREQUENCY_ATTR_NO_80MHZ,
2090 NL80211_FREQUENCY_ATTR_NO_160MHZ,
2037 2091
2038 /* keep last */ 2092 /* keep last */
2039 __NL80211_FREQUENCY_ATTR_AFTER_LAST, 2093 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -2906,10 +2960,12 @@ enum nl80211_tx_power_setting {
2906 * corresponds to the lowest-order bit in the second byte of the mask. 2960 * corresponds to the lowest-order bit in the second byte of the mask.
2907 * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where 2961 * For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
2908 * xx indicates "don't care") would be represented by a pattern of 2962 * xx indicates "don't care") would be represented by a pattern of
2909 * twelve zero bytes, and a mask of "0xed,0x07". 2963 * twelve zero bytes, and a mask of "0xed,0x01".
2910 * Note that the pattern matching is done as though frames were not 2964 * Note that the pattern matching is done as though frames were not
2911 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked 2965 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
2912 * first (including SNAP header unpacking) and then matched. 2966 * first (including SNAP header unpacking) and then matched.
2967 * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after
2968 * these fixed number of bytes of received packet
2913 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes 2969 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
2914 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number 2970 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
2915 */ 2971 */
@@ -2917,6 +2973,7 @@ enum nl80211_wowlan_packet_pattern_attr {
2917 __NL80211_WOWLAN_PKTPAT_INVALID, 2973 __NL80211_WOWLAN_PKTPAT_INVALID,
2918 NL80211_WOWLAN_PKTPAT_MASK, 2974 NL80211_WOWLAN_PKTPAT_MASK,
2919 NL80211_WOWLAN_PKTPAT_PATTERN, 2975 NL80211_WOWLAN_PKTPAT_PATTERN,
2976 NL80211_WOWLAN_PKTPAT_OFFSET,
2920 2977
2921 NUM_NL80211_WOWLAN_PKTPAT, 2978 NUM_NL80211_WOWLAN_PKTPAT,
2922 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, 2979 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
@@ -2927,6 +2984,7 @@ enum nl80211_wowlan_packet_pattern_attr {
2927 * @max_patterns: maximum number of patterns supported 2984 * @max_patterns: maximum number of patterns supported
2928 * @min_pattern_len: minimum length of each pattern 2985 * @min_pattern_len: minimum length of each pattern
2929 * @max_pattern_len: maximum length of each pattern 2986 * @max_pattern_len: maximum length of each pattern
2987 * @max_pkt_offset: maximum Rx packet offset
2930 * 2988 *
2931 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 2989 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
2932 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 2990 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
@@ -2936,6 +2994,7 @@ struct nl80211_wowlan_pattern_support {
2936 __u32 max_patterns; 2994 __u32 max_patterns;
2937 __u32 min_pattern_len; 2995 __u32 min_pattern_len;
2938 __u32 max_pattern_len; 2996 __u32 max_pattern_len;
2997 __u32 max_pkt_offset;
2939} __attribute__((packed)); 2998} __attribute__((packed));
2940 2999
2941/** 3000/**
@@ -2951,9 +3010,10 @@ struct nl80211_wowlan_pattern_support {
2951 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns 3010 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
2952 * which are passed in an array of nested attributes, each nested attribute 3011 * which are passed in an array of nested attributes, each nested attribute
2953 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. 3012 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
2954 * Each pattern defines a wakeup packet. The matching is done on the MSDU, 3013 * Each pattern defines a wakeup packet. Packet offset is associated with
2955 * i.e. as though the packet was an 802.3 packet, so the pattern matching 3014 * each pattern which is used while matching the pattern. The matching is
2956 * is done after the packet is converted to the MSDU. 3015 * done on the MSDU, i.e. as though the packet was an 802.3 packet, so the
3016 * pattern matching is done after the packet is converted to the MSDU.
2957 * 3017 *
2958 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 3018 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2959 * carrying a &struct nl80211_wowlan_pattern_support. 3019 * carrying a &struct nl80211_wowlan_pattern_support.
@@ -2985,6 +3045,17 @@ struct nl80211_wowlan_pattern_support {
2985 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3 3045 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
2986 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 3046 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
2987 * attribute if the packet was truncated somewhere. 3047 * attribute if the packet was truncated somewhere.
3048 * @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section
3049 * "TCP connection wakeup" for more details. This is a nested attribute
3050 * containing the exact information for establishing and keeping alive
3051 * the TCP connection.
3052 * @NL80211_WOWLAN_TRIG_TCP_WAKEUP_MATCH: For wakeup reporting only, the
3053 * wakeup packet was received on the TCP connection
3054 * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
3055 * TCP connection was lost or failed to be established
3056 * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
3057 * the TCP connection ran out of tokens to use for data to send to the
3058 * service
2988 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers 3059 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2989 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number 3060 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
2990 * 3061 *
@@ -3006,6 +3077,10 @@ enum nl80211_wowlan_triggers {
3006 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN, 3077 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
3007 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023, 3078 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
3008 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN, 3079 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
3080 NL80211_WOWLAN_TRIG_TCP_CONNECTION,
3081 NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
3082 NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
3083 NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
3009 3084
3010 /* keep last */ 3085 /* keep last */
3011 NUM_NL80211_WOWLAN_TRIG, 3086 NUM_NL80211_WOWLAN_TRIG,
@@ -3013,6 +3088,116 @@ enum nl80211_wowlan_triggers {
3013}; 3088};
3014 3089
3015/** 3090/**
3091 * DOC: TCP connection wakeup
3092 *
3093 * Some devices can establish a TCP connection in order to be woken up by a
3094 * packet coming in from outside their network segment, or behind NAT. If
3095 * configured, the device will establish a TCP connection to the given
3096 * service, and periodically send data to that service. The first data
3097 * packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK.
3098 * The data packets can optionally include a (little endian) sequence
3099 * number (in the TCP payload!) that is generated by the device, and, also
3100 * optionally, a token from a list of tokens. This serves as a keep-alive
3101 * with the service, and for NATed connections, etc.
3102 *
3103 * During this keep-alive period, the server doesn't send any data to the
3104 * client. When receiving data, it is compared against the wakeup pattern
3105 * (and mask) and if it matches, the host is woken up. Similarly, if the
3106 * connection breaks or cannot be established to start with, the host is
3107 * also woken up.
3108 *
3109 * Developer's note: ARP offload is required for this, otherwise TCP
3110 * response packets might not go through correctly.
3111 */
3112
3113/**
3114 * struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence
3115 * @start: starting value
3116 * @offset: offset of sequence number in packet
3117 * @len: length of the sequence value to write, 1 through 4
3118 *
3119 * Note: don't confuse with the TCP sequence number(s), this is for the
3120 * keepalive packet payload. The actual value is written into the packet
3121 * in little endian.
3122 */
3123struct nl80211_wowlan_tcp_data_seq {
3124 __u32 start, offset, len;
3125};
3126
3127/**
3128 * struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config
3129 * @offset: offset of token in packet
3130 * @len: length of each token
3131 * @token_stream: stream of data to be used for the tokens, the length must
3132 * be a multiple of @len for this to make sense
3133 */
3134struct nl80211_wowlan_tcp_data_token {
3135 __u32 offset, len;
3136 __u8 token_stream[];
3137};
3138
3139/**
3140 * struct nl80211_wowlan_tcp_data_token_feature - data token features
3141 * @min_len: minimum token length
3142 * @max_len: maximum token length
3143 * @bufsize: total available token buffer size (max size of @token_stream)
3144 */
3145struct nl80211_wowlan_tcp_data_token_feature {
3146 __u32 min_len, max_len, bufsize;
3147};
3148
3149/**
3150 * enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters
3151 * @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes
3152 * @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order)
3153 * @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address
3154 * (in network byte order)
3155 * @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because
3156 * route lookup when configured might be invalid by the time we suspend,
3157 * and doing a route lookup when suspending is no longer possible as it
3158 * might require ARP querying.
3159 * @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a
3160 * socket and port will be allocated
3161 * @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16)
3162 * @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte.
3163 * For feature advertising, a u32 attribute holding the maximum length
3164 * of the data payload.
3165 * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration
3166 * (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature
3167 * advertising it is just a flag
3168 * @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration,
3169 * see &struct nl80211_wowlan_tcp_data_token and for advertising see
3170 * &struct nl80211_wowlan_tcp_data_token_feature.
3171 * @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum
3172 * interval in feature advertising (u32)
3173 * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
3174 * u32 attribute holding the maximum length
3175 * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
3176 * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK
3177 * but on the TCP payload only.
3178 * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
3179 * @MAX_NL80211_WOWLAN_TCP: highest attribute number
3180 */
3181enum nl80211_wowlan_tcp_attrs {
3182 __NL80211_WOWLAN_TCP_INVALID,
3183 NL80211_WOWLAN_TCP_SRC_IPV4,
3184 NL80211_WOWLAN_TCP_DST_IPV4,
3185 NL80211_WOWLAN_TCP_DST_MAC,
3186 NL80211_WOWLAN_TCP_SRC_PORT,
3187 NL80211_WOWLAN_TCP_DST_PORT,
3188 NL80211_WOWLAN_TCP_DATA_PAYLOAD,
3189 NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
3190 NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
3191 NL80211_WOWLAN_TCP_DATA_INTERVAL,
3192 NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
3193 NL80211_WOWLAN_TCP_WAKE_MASK,
3194
3195 /* keep last */
3196 NUM_NL80211_WOWLAN_TCP,
3197 MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
3198};
3199
3200/**
3016 * enum nl80211_iface_limit_attrs - limit attributes 3201 * enum nl80211_iface_limit_attrs - limit attributes
3017 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 3202 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
3018 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 3203 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
@@ -3269,6 +3454,8 @@ enum nl80211_ap_sme_features {
3269 * Note that even for drivers that support this, the default is to add 3454 * Note that even for drivers that support this, the default is to add
3270 * stations in authenticated/associated state, so to add unauthenticated 3455 * stations in authenticated/associated state, so to add unauthenticated
3271 * stations the authenticated/associated bits have to be set in the mask. 3456 * stations the authenticated/associated bits have to be set in the mask.
3457 * @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
3458 * (HT40, VHT 80/160 MHz) if this flag is set
3272 */ 3459 */
3273enum nl80211_feature_flags { 3460enum nl80211_feature_flags {
3274 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3461 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3284,7 +3471,9 @@ enum nl80211_feature_flags {
3284 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, 3471 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
3285 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, 3472 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
3286 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, 3473 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
3287 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 13, 3474 /* bit 13 is reserved */
3475 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
3476 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3288}; 3477};
3289 3478
3290/** 3479/**
@@ -3358,4 +3547,44 @@ enum nl80211_acl_policy {
3358 NL80211_ACL_POLICY_DENY_UNLESS_LISTED, 3547 NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
3359}; 3548};
3360 3549
3550/**
3551 * enum nl80211_radar_event - type of radar event for DFS operation
3552 *
3553 * Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
3554 * about detected radars or success of the channel available check (CAC)
3555 *
3556 * @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
3557 * now unusable.
3558 * @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
3559 * the channel is now available.
3560 * @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
3561 * change to the channel status.
3562 * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
3563 * over, channel becomes usable.
3564 */
3565enum nl80211_radar_event {
3566 NL80211_RADAR_DETECTED,
3567 NL80211_RADAR_CAC_FINISHED,
3568 NL80211_RADAR_CAC_ABORTED,
3569 NL80211_RADAR_NOP_FINISHED,
3570};
3571
3572/**
3573 * enum nl80211_dfs_state - DFS states for channels
3574 *
3575 * Channel states used by the DFS code.
3576 *
3577 * @IEEE80211_DFS_USABLE: The channel can be used, but channel availability
3578 * check (CAC) must be performed before using it for AP or IBSS.
3579 * @IEEE80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
3580 * is therefore marked as not available.
3581 * @IEEE80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
3582 */
3583
3584enum nl80211_dfs_state {
3585 NL80211_DFS_USABLE,
3586 NL80211_DFS_UNAVAILABLE,
3587 NL80211_DFS_AVAILABLE,
3588};
3589
3361#endif /* __LINUX_NL80211_H */ 3590#endif /* __LINUX_NL80211_H */