aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-02-18 13:47:13 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-02-18 13:47:13 -0500
commit98d5fac2330779e6eea6431a90b44c7476260dcc (patch)
tree99870656d835fc6c12093bc67517956cc7b3d6ec /include
parent4153577a8d318ae02b3791341e10e78416de402f (diff)
parent9e97d14b4923da524d202f2e005d5d30b70db9d6 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: drivers/net/wireless/iwlwifi/dvm/tx.c drivers/net/wireless/ti/wlcore/sdio.c drivers/net/wireless/ti/wlcore/spi.c
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h50
-rw-r--r--include/linux/platform_data/microread.h35
-rw-r--r--include/linux/wl12xx.h16
-rw-r--r--include/net/cfg80211.h226
-rw-r--r--include/net/mac80211.h170
-rw-r--r--include/uapi/linux/nl80211.h274
6 files changed, 681 insertions, 90 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 11c8bc87fdcb..7e24fe0cfbcd 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -151,6 +151,11 @@
151/* Mesh Control 802.11s */ 151/* Mesh Control 802.11s */
152#define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 152#define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100
153 153
154/* Mesh Power Save Level */
155#define IEEE80211_QOS_CTL_MESH_PS_LEVEL 0x0200
156/* Mesh Receiver Service Period Initiated */
157#define IEEE80211_QOS_CTL_RSPI 0x0400
158
154/* U-APSD queue for WMM IEs sent by AP */ 159/* U-APSD queue for WMM IEs sent by AP */
155#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) 160#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
156#define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f 161#define IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK 0x0f
@@ -675,11 +680,14 @@ struct ieee80211_meshconf_ie {
675 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs 680 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs
676 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure 681 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure
677 * is ongoing 682 * is ongoing
683 * @IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL: STA is in deep sleep mode or has
684 * neighbors in deep sleep mode
678 */ 685 */
679enum mesh_config_capab_flags { 686enum mesh_config_capab_flags {
680 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01, 687 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01,
681 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08, 688 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08,
682 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20, 689 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20,
690 IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL = 0x40,
683}; 691};
684 692
685/** 693/**
@@ -706,6 +714,30 @@ enum ieee80211_ht_chanwidth_values {
706 IEEE80211_HT_CHANWIDTH_ANY = 1, 714 IEEE80211_HT_CHANWIDTH_ANY = 1,
707}; 715};
708 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
709#define WLAN_SA_QUERY_TR_ID_LEN 2 741#define WLAN_SA_QUERY_TR_ID_LEN 2
710 742
711struct ieee80211_mgmt { 743struct ieee80211_mgmt {
@@ -836,6 +868,10 @@ struct ieee80211_mgmt {
836 __le16 capability; 868 __le16 capability;
837 u8 variable[0]; 869 u8 variable[0];
838 } __packed tdls_discover_resp; 870 } __packed tdls_discover_resp;
871 struct {
872 u8 action_code;
873 u8 operating_mode;
874 } __packed vht_opmode_notif;
839 } u; 875 } u;
840 } __packed action; 876 } __packed action;
841 } u; 877 } u;
@@ -1265,6 +1301,7 @@ struct ieee80211_vht_operation {
1265#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1301#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1266#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1302#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1267#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
1268#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1305#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1269#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1306#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1270#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1307#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
@@ -1590,6 +1627,7 @@ enum ieee80211_eid {
1590 1627
1591 WLAN_EID_VHT_CAPABILITY = 191, 1628 WLAN_EID_VHT_CAPABILITY = 191,
1592 WLAN_EID_VHT_OPERATION = 192, 1629 WLAN_EID_VHT_OPERATION = 192,
1630 WLAN_EID_OPMODE_NOTIF = 199,
1593 1631
1594 /* 802.11ad */ 1632 /* 802.11ad */
1595 WLAN_EID_NON_TX_BSSID_CAP = 83, 1633 WLAN_EID_NON_TX_BSSID_CAP = 83,
@@ -1644,6 +1682,7 @@ enum ieee80211_category {
1644 WLAN_CATEGORY_WMM = 17, 1682 WLAN_CATEGORY_WMM = 17,
1645 WLAN_CATEGORY_FST = 18, 1683 WLAN_CATEGORY_FST = 18,
1646 WLAN_CATEGORY_UNPROT_DMG = 20, 1684 WLAN_CATEGORY_UNPROT_DMG = 20,
1685 WLAN_CATEGORY_VHT = 21,
1647 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1686 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1648 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1687 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1649}; 1688};
@@ -1669,6 +1708,13 @@ enum ieee80211_ht_actioncode {
1669 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, 1708 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1670}; 1709};
1671 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
1672/* Self Protected Action codes */ 1718/* Self Protected Action codes */
1673enum ieee80211_self_protected_actioncode { 1719enum ieee80211_self_protected_actioncode {
1674 WLAN_SP_RESERVED = 0, 1720 WLAN_SP_RESERVED = 0,
@@ -1730,6 +1776,8 @@ enum ieee80211_tdls_actioncode {
1730#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5) 1776#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5)
1731#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) 1777#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1732 1778
1779#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
1780
1733/* TDLS specific payload type in the LLC/SNAP header */ 1781/* TDLS specific payload type in the LLC/SNAP header */
1734#define WLAN_TDLS_SNAP_RFTYPE 0x2 1782#define WLAN_TDLS_SNAP_RFTYPE 0x2
1735 1783
@@ -2106,7 +2154,7 @@ static inline unsigned long ieee80211_tu_to_usec(unsigned long tu)
2106 * @tim_len: length of the TIM IE 2154 * @tim_len: length of the TIM IE
2107 * @aid: the AID to look for 2155 * @aid: the AID to look for
2108 */ 2156 */
2109static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim, 2157static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2110 u8 tim_len, u16 aid) 2158 u8 tim_len, u16 aid)
2111{ 2159{
2112 u8 mask; 2160 u8 mask;
diff --git a/include/linux/platform_data/microread.h b/include/linux/platform_data/microread.h
new file mode 100644
index 000000000000..cfda59b226ee
--- /dev/null
+++ b/include/linux/platform_data/microread.h
@@ -0,0 +1,35 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) 2011 Tieto Poland
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _MICROREAD_H
22#define _MICROREAD_H
23
24#include <linux/i2c.h>
25
26#define MICROREAD_DRIVER_NAME "microread"
27
28/* board config platform data for microread */
29struct microread_nfc_platform_data {
30 unsigned int rst_gpio;
31 unsigned int irq_gpio;
32 unsigned int ioh_gpio;
33};
34
35#endif /* _MICROREAD_H */
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 0d6373195d32..a54fe82e704b 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -24,6 +24,8 @@
24#ifndef _LINUX_WL12XX_H 24#ifndef _LINUX_WL12XX_H
25#define _LINUX_WL12XX_H 25#define _LINUX_WL12XX_H
26 26
27#include <linux/err.h>
28
27/* Reference clock values */ 29/* Reference clock values */
28enum { 30enum {
29 WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */ 31 WL12XX_REFCLOCK_19 = 0, /* 19.2 MHz */
@@ -55,17 +57,17 @@ struct wl12xx_platform_data {
55 int board_tcxo_clock; 57 int board_tcxo_clock;
56 unsigned long platform_quirks; 58 unsigned long platform_quirks;
57 bool pwr_in_suspend; 59 bool pwr_in_suspend;
58
59 struct wl1271_if_operations *ops;
60}; 60};
61 61
62/* Platform does not support level trigger interrupts */ 62/* Platform does not support level trigger interrupts */
63#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0) 63#define WL12XX_PLATFORM_QUIRK_EDGE_IRQ BIT(0)
64 64
65#ifdef CONFIG_WL12XX_PLATFORM_DATA 65#ifdef CONFIG_WILINK_PLATFORM_DATA
66 66
67int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); 67int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
68 68
69struct wl12xx_platform_data *wl12xx_get_platform_data(void);
70
69#else 71#else
70 72
71static inline 73static inline
@@ -74,8 +76,12 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
74 return -ENOSYS; 76 return -ENOSYS;
75} 77}
76 78
77#endif 79static inline
80struct wl12xx_platform_data *wl12xx_get_platform_data(void)
81{
82 return ERR_PTR(-ENODATA);
83}
78 84
79struct wl12xx_platform_data *wl12xx_get_platform_data(void); 85#endif
80 86
81#endif 87#endif
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f9df20028bbd..d581c6de5d64 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/**
@@ -535,7 +556,7 @@ struct mac_address {
535 * struct cfg80211_acl_data - Access control list data 556 * struct cfg80211_acl_data - Access control list data
536 * 557 *
537 * @acl_policy: ACL policy to be applied on the station's 558 * @acl_policy: ACL policy to be applied on the station's
538 entry specified by mac_addr 559 * entry specified by mac_addr
539 * @n_acl_entries: Number of MAC address entries passed 560 * @n_acl_entries: Number of MAC address entries passed
540 * @mac_addrs: List of MAC addresses of stations to be used for ACL 561 * @mac_addrs: List of MAC addresses of stations to be used for ACL
541 */ 562 */
@@ -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/**
@@ -666,14 +697,16 @@ struct station_parameters {
666 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled 697 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled
667 * @STATION_INFO_RX_BYTES: @rx_bytes filled 698 * @STATION_INFO_RX_BYTES: @rx_bytes filled
668 * @STATION_INFO_TX_BYTES: @tx_bytes filled 699 * @STATION_INFO_TX_BYTES: @tx_bytes filled
700 * @STATION_INFO_RX_BYTES64: @rx_bytes filled with 64-bit value
701 * @STATION_INFO_TX_BYTES64: @tx_bytes filled with 64-bit value
669 * @STATION_INFO_LLID: @llid filled 702 * @STATION_INFO_LLID: @llid filled
670 * @STATION_INFO_PLID: @plid filled 703 * @STATION_INFO_PLID: @plid filled
671 * @STATION_INFO_PLINK_STATE: @plink_state filled 704 * @STATION_INFO_PLINK_STATE: @plink_state filled
672 * @STATION_INFO_SIGNAL: @signal filled 705 * @STATION_INFO_SIGNAL: @signal filled
673 * @STATION_INFO_TX_BITRATE: @txrate fields are filled 706 * @STATION_INFO_TX_BITRATE: @txrate fields are filled
674 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) 707 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
675 * @STATION_INFO_RX_PACKETS: @rx_packets filled 708 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
676 * @STATION_INFO_TX_PACKETS: @tx_packets filled 709 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
677 * @STATION_INFO_TX_RETRIES: @tx_retries filled 710 * @STATION_INFO_TX_RETRIES: @tx_retries filled
678 * @STATION_INFO_TX_FAILED: @tx_failed filled 711 * @STATION_INFO_TX_FAILED: @tx_failed filled
679 * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled 712 * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled
@@ -714,6 +747,8 @@ enum station_info_flags {
714 STATION_INFO_LOCAL_PM = 1<<21, 747 STATION_INFO_LOCAL_PM = 1<<21,
715 STATION_INFO_PEER_PM = 1<<22, 748 STATION_INFO_PEER_PM = 1<<22,
716 STATION_INFO_NONPEER_PM = 1<<23, 749 STATION_INFO_NONPEER_PM = 1<<23,
750 STATION_INFO_RX_BYTES64 = 1<<24,
751 STATION_INFO_TX_BYTES64 = 1<<25,
717}; 752};
718 753
719/** 754/**
@@ -835,8 +870,8 @@ struct station_info {
835 u32 filled; 870 u32 filled;
836 u32 connected_time; 871 u32 connected_time;
837 u32 inactive_time; 872 u32 inactive_time;
838 u32 rx_bytes; 873 u64 rx_bytes;
839 u32 tx_bytes; 874 u64 tx_bytes;
840 u16 llid; 875 u16 llid;
841 u16 plid; 876 u16 plid;
842 u8 plink_state; 877 u8 plink_state;
@@ -1222,6 +1257,7 @@ struct cfg80211_match_set {
1222 * @n_match_sets: number of match sets 1257 * @n_match_sets: number of match sets
1223 * @wiphy: the wiphy this was for 1258 * @wiphy: the wiphy this was for
1224 * @dev: the interface 1259 * @dev: the interface
1260 * @scan_start: start time of the scheduled scan
1225 * @channels: channels to scan 1261 * @channels: channels to scan
1226 * @rssi_thold: don't report scan results below this threshold (in s32 dBm) 1262 * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
1227 */ 1263 */
@@ -1261,11 +1297,13 @@ enum cfg80211_signal_type {
1261 1297
1262/** 1298/**
1263 * struct cfg80211_bss_ie_data - BSS entry IE data 1299 * struct cfg80211_bss_ie_data - BSS entry IE data
1300 * @tsf: TSF contained in the frame that carried these IEs
1264 * @rcu_head: internal use, for freeing 1301 * @rcu_head: internal use, for freeing
1265 * @len: length of the IEs 1302 * @len: length of the IEs
1266 * @data: IE data 1303 * @data: IE data
1267 */ 1304 */
1268struct cfg80211_bss_ies { 1305struct cfg80211_bss_ies {
1306 u64 tsf;
1269 struct rcu_head rcu_head; 1307 struct rcu_head rcu_head;
1270 int len; 1308 int len;
1271 u8 data[]; 1309 u8 data[];
@@ -1279,29 +1317,32 @@ struct cfg80211_bss_ies {
1279 * 1317 *
1280 * @channel: channel this BSS is on 1318 * @channel: channel this BSS is on
1281 * @bssid: BSSID of the BSS 1319 * @bssid: BSSID of the BSS
1282 * @tsf: timestamp of last received update
1283 * @beacon_interval: the beacon interval as from the frame 1320 * @beacon_interval: the beacon interval as from the frame
1284 * @capability: the capability field in host byte order 1321 * @capability: the capability field in host byte order
1285 * @ies: the information elements (Note that there 1322 * @ies: the information elements (Note that there is no guarantee that these
1286 * is no guarantee that these are well-formed!); this is a pointer to 1323 * are well-formed!); this is a pointer to either the beacon_ies or
1287 * either the beacon_ies or proberesp_ies depending on whether Probe 1324 * proberesp_ies depending on whether Probe Response frame has been
1288 * Response frame has been received 1325 * received. It is always non-%NULL.
1289 * @beacon_ies: the information elements from the last Beacon frame 1326 * @beacon_ies: the information elements from the last Beacon frame
1327 * (implementation note: if @hidden_beacon_bss is set this struct doesn't
1328 * own the beacon_ies, but they're just pointers to the ones from the
1329 * @hidden_beacon_bss struct)
1290 * @proberesp_ies: the information elements from the last Probe Response frame 1330 * @proberesp_ies: the information elements from the last Probe Response frame
1331 * @hidden_beacon_bss: in case this BSS struct represents a probe response from
1332 * a BSS that hides the SSID in its beacon, this points to the BSS struct
1333 * that holds the beacon data. @beacon_ies is still valid, of course, and
1334 * points to the same data as hidden_beacon_bss->beacon_ies in that case.
1291 * @signal: signal strength value (type depends on the wiphy's signal_type) 1335 * @signal: signal strength value (type depends on the wiphy's signal_type)
1292 * @free_priv: function pointer to free private data
1293 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 1336 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
1294 */ 1337 */
1295struct cfg80211_bss { 1338struct cfg80211_bss {
1296 u64 tsf;
1297
1298 struct ieee80211_channel *channel; 1339 struct ieee80211_channel *channel;
1299 1340
1300 const struct cfg80211_bss_ies __rcu *ies; 1341 const struct cfg80211_bss_ies __rcu *ies;
1301 const struct cfg80211_bss_ies __rcu *beacon_ies; 1342 const struct cfg80211_bss_ies __rcu *beacon_ies;
1302 const struct cfg80211_bss_ies __rcu *proberesp_ies; 1343 const struct cfg80211_bss_ies __rcu *proberesp_ies;
1303 1344
1304 void (*free_priv)(struct cfg80211_bss *bss); 1345 struct cfg80211_bss *hidden_beacon_bss;
1305 1346
1306 s32 signal; 1347 s32 signal;
1307 1348
@@ -1403,6 +1444,8 @@ struct cfg80211_assoc_request {
1403 * @ie: Extra IEs to add to Deauthentication frame or %NULL 1444 * @ie: Extra IEs to add to Deauthentication frame or %NULL
1404 * @ie_len: Length of ie buffer in octets 1445 * @ie_len: Length of ie buffer in octets
1405 * @reason_code: The reason code for the deauthentication 1446 * @reason_code: The reason code for the deauthentication
1447 * @local_state_change: if set, change local state only and
1448 * do not set a deauth frame
1406 */ 1449 */
1407struct cfg80211_deauth_request { 1450struct cfg80211_deauth_request {
1408 const u8 *bssid; 1451 const u8 *bssid;
@@ -1564,6 +1607,7 @@ struct cfg80211_pmksa {
1564 * one bit per byte, in same format as nl80211 1607 * one bit per byte, in same format as nl80211
1565 * @pattern: bytes to match where bitmask is 1 1608 * @pattern: bytes to match where bitmask is 1
1566 * @pattern_len: length of pattern (in bytes) 1609 * @pattern_len: length of pattern (in bytes)
1610 * @pkt_offset: packet offset (in bytes)
1567 * 1611 *
1568 * Internal note: @mask and @pattern are allocated in one chunk of 1612 * Internal note: @mask and @pattern are allocated in one chunk of
1569 * memory, free @mask only! 1613 * memory, free @mask only!
@@ -1571,6 +1615,42 @@ struct cfg80211_pmksa {
1571struct cfg80211_wowlan_trig_pkt_pattern { 1615struct cfg80211_wowlan_trig_pkt_pattern {
1572 u8 *mask, *pattern; 1616 u8 *mask, *pattern;
1573 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;
1574}; 1654};
1575 1655
1576/** 1656/**
@@ -1587,16 +1667,49 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1587 * @eap_identity_req: wake up on EAP identity request packet 1667 * @eap_identity_req: wake up on EAP identity request packet
1588 * @four_way_handshake: wake up on 4-way handshake 1668 * @four_way_handshake: wake up on 4-way handshake
1589 * @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.
1590 */ 1672 */
1591struct cfg80211_wowlan { 1673struct cfg80211_wowlan {
1592 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1674 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1593 eap_identity_req, four_way_handshake, 1675 eap_identity_req, four_way_handshake,
1594 rfkill_release; 1676 rfkill_release;
1595 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1677 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1678 struct cfg80211_wowlan_tcp *tcp;
1596 int n_patterns; 1679 int n_patterns;
1597}; 1680};
1598 1681
1599/** 1682/**
1683 * struct cfg80211_wowlan_wakeup - wakeup report
1684 * @disconnect: woke up by getting disconnected
1685 * @magic_pkt: woke up by receiving magic packet
1686 * @gtk_rekey_failure: woke up by GTK rekey failure
1687 * @eap_identity_req: woke up by EAP identity request packet
1688 * @four_way_handshake: woke up by 4-way handshake
1689 * @rfkill_release: woke up by rfkill being released
1690 * @pattern_idx: pattern that caused wakeup, -1 if not due to pattern
1691 * @packet_present_len: copied wakeup packet data
1692 * @packet_len: original wakeup packet length
1693 * @packet: The packet causing the wakeup, if any.
1694 * @packet_80211: For pattern match, magic packet and other data
1695 * frame triggers an 802.3 frame should be reported, for
1696 * disconnect due to deauth 802.11 frame. This indicates which
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
1701 */
1702struct cfg80211_wowlan_wakeup {
1703 bool disconnect, magic_pkt, gtk_rekey_failure,
1704 eap_identity_req, four_way_handshake,
1705 rfkill_release, packet_80211,
1706 tcp_match, tcp_connlost, tcp_nomoretokens;
1707 s32 pattern_idx;
1708 u32 packet_present_len, packet_len;
1709 const void *packet;
1710};
1711
1712/**
1600 * struct cfg80211_gtk_rekey_data - rekey data 1713 * struct cfg80211_gtk_rekey_data - rekey data
1601 * @kek: key encryption key 1714 * @kek: key encryption key
1602 * @kck: key confirmation key 1715 * @kck: key confirmation key
@@ -1826,6 +1939,8 @@ struct cfg80211_gtk_rekey_data {
1826 * 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
1827 * 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
1828 * 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.
1829 */ 1944 */
1830struct cfg80211_ops { 1945struct cfg80211_ops {
1831 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1946 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2049,6 +2164,10 @@ struct cfg80211_ops {
2049 2164
2050 int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev, 2165 int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev,
2051 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);
2052}; 2171};
2053 2172
2054/* 2173/*
@@ -2245,6 +2364,14 @@ enum wiphy_wowlan_support_flags {
2245 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7), 2364 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
2246}; 2365};
2247 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
2248/** 2375/**
2249 * struct wiphy_wowlan_support - WoWLAN support data 2376 * struct wiphy_wowlan_support - WoWLAN support data
2250 * @flags: see &enum wiphy_wowlan_support_flags 2377 * @flags: see &enum wiphy_wowlan_support_flags
@@ -2252,12 +2379,16 @@ enum wiphy_wowlan_support_flags {
2252 * (see nl80211.h for the pattern definition) 2379 * (see nl80211.h for the pattern definition)
2253 * @pattern_max_len: maximum length of each pattern 2380 * @pattern_max_len: maximum length of each pattern
2254 * @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
2255 */ 2384 */
2256struct wiphy_wowlan_support { 2385struct wiphy_wowlan_support {
2257 u32 flags; 2386 u32 flags;
2258 int n_patterns; 2387 int n_patterns;
2259 int pattern_max_len; 2388 int pattern_max_len;
2260 int pattern_min_len; 2389 int pattern_min_len;
2390 int max_pkt_offset;
2391 const struct wiphy_wowlan_tcp_support *tcp;
2261}; 2392};
2262 2393
2263/** 2394/**
@@ -2357,6 +2488,14 @@ struct wiphy_wowlan_support {
2357 * 2488 *
2358 * @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
2359 * 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
2360 */ 2499 */
2361struct wiphy { 2500struct wiphy {
2362 /* assign these fields before you register the wiphy */ 2501 /* assign these fields before you register the wiphy */
@@ -2423,6 +2562,9 @@ struct wiphy {
2423 */ 2562 */
2424 u32 probe_resp_offload; 2563 u32 probe_resp_offload;
2425 2564
2565 const u8 *extended_capabilities, *extended_capabilities_mask;
2566 u8 extended_capabilities_len;
2567
2426 /* If multiple wiphys are registered and you're handed e.g. 2568 /* If multiple wiphys are registered and you're handed e.g.
2427 * a regular netdev with assigned ieee80211_ptr, you won't 2569 * a regular netdev with assigned ieee80211_ptr, you won't
2428 * know whether it points to a wiphy your driver has registered 2570 * know whether it points to a wiphy your driver has registered
@@ -2602,7 +2744,6 @@ struct cfg80211_cached_keys;
2602 * the user-set AP, monitor and WDS channel 2744 * the user-set AP, monitor and WDS channel
2603 * @preset_chan: (private) Used by the internal configuration code to 2745 * @preset_chan: (private) Used by the internal configuration code to
2604 * track the channel to be used for AP later 2746 * track the channel to be used for AP later
2605 * @preset_chantype: (private) the corresponding channel type
2606 * @bssid: (private) Used by the internal configuration code 2747 * @bssid: (private) Used by the internal configuration code
2607 * @ssid: (private) Used by the internal configuration code 2748 * @ssid: (private) Used by the internal configuration code
2608 * @ssid_len: (private) Used by the internal configuration code 2749 * @ssid_len: (private) Used by the internal configuration code
@@ -2621,6 +2762,8 @@ struct cfg80211_cached_keys;
2621 * beacons, 0 when not valid 2762 * beacons, 0 when not valid
2622 * @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
2623 * @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.
2624 */ 2767 */
2625struct wireless_dev { 2768struct wireless_dev {
2626 struct wiphy *wiphy; 2769 struct wiphy *wiphy;
@@ -2672,6 +2815,9 @@ struct wireless_dev {
2672 2815
2673 u32 ap_unexpected_nlportid; 2816 u32 ap_unexpected_nlportid;
2674 2817
2818 bool cac_started;
2819 unsigned long cac_start_time;
2820
2675#ifdef CONFIG_CFG80211_WEXT 2821#ifdef CONFIG_CFG80211_WEXT
2676 /* wext data */ 2822 /* wext data */
2677 struct { 2823 struct {
@@ -3137,25 +3283,23 @@ cfg80211_get_ibss(struct wiphy *wiphy,
3137 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); 3283 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
3138} 3284}
3139 3285
3140struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
3141 struct ieee80211_channel *channel,
3142 const u8 *meshid, size_t meshidlen,
3143 const u8 *meshcfg);
3144/** 3286/**
3145 * cfg80211_ref_bss - reference BSS struct 3287 * cfg80211_ref_bss - reference BSS struct
3288 * @wiphy: the wiphy this BSS struct belongs to
3146 * @bss: the BSS struct to reference 3289 * @bss: the BSS struct to reference
3147 * 3290 *
3148 * Increments the refcount of the given BSS struct. 3291 * Increments the refcount of the given BSS struct.
3149 */ 3292 */
3150void cfg80211_ref_bss(struct cfg80211_bss *bss); 3293void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3151 3294
3152/** 3295/**
3153 * cfg80211_put_bss - unref BSS struct 3296 * cfg80211_put_bss - unref BSS struct
3297 * @wiphy: the wiphy this BSS struct belongs to
3154 * @bss: the BSS struct 3298 * @bss: the BSS struct
3155 * 3299 *
3156 * Decrements the refcount of the given BSS struct. 3300 * Decrements the refcount of the given BSS struct.
3157 */ 3301 */
3158void cfg80211_put_bss(struct cfg80211_bss *bss); 3302void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3159 3303
3160/** 3304/**
3161 * cfg80211_unlink_bss - unlink BSS from internal data structures 3305 * cfg80211_unlink_bss - unlink BSS from internal data structures
@@ -3663,6 +3807,31 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
3663 gfp_t gfp); 3807 gfp_t gfp);
3664 3808
3665/** 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/**
3666 * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer 3835 * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer
3667 * @dev: network device 3836 * @dev: network device
3668 * @peer: peer's MAC address 3837 * @peer: peer's MAC address
@@ -3852,6 +4021,21 @@ int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
3852 enum ieee80211_p2p_attr_id attr, 4021 enum ieee80211_p2p_attr_id attr,
3853 u8 *buf, unsigned int bufsize); 4022 u8 *buf, unsigned int bufsize);
3854 4023
4024/**
4025 * cfg80211_report_wowlan_wakeup - report wakeup from WoWLAN
4026 * @wdev: the wireless device reporting the wakeup
4027 * @wakeup: the wakeup report
4028 * @gfp: allocation flags
4029 *
4030 * This function reports that the given device woke up. If it
4031 * caused the wakeup, report the reason(s), otherwise you may
4032 * pass %NULL as the @wakeup parameter to advertise that something
4033 * else caused the wakeup.
4034 */
4035void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
4036 struct cfg80211_wowlan_wakeup *wakeup,
4037 gfp_t gfp);
4038
3855/* Logging, debugging and troubleshooting/diagnostic helpers. */ 4039/* Logging, debugging and troubleshooting/diagnostic helpers. */
3856 4040
3857/* wiphy_printk helpers, similar to dev_printk */ 4041/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5c98d654fc75..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
@@ -208,6 +213,11 @@ struct ieee80211_chanctx_conf {
208 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface 213 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
209 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) 214 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
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)
216 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when
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.
211 */ 221 */
212enum ieee80211_bss_change { 222enum ieee80211_bss_change {
213 BSS_CHANGED_ASSOC = 1<<0, 223 BSS_CHANGED_ASSOC = 1<<0,
@@ -230,6 +240,8 @@ enum ieee80211_bss_change {
230 BSS_CHANGED_PS = 1<<17, 240 BSS_CHANGED_PS = 1<<17,
231 BSS_CHANGED_TXPOWER = 1<<18, 241 BSS_CHANGED_TXPOWER = 1<<18,
232 BSS_CHANGED_P2P_PS = 1<<19, 242 BSS_CHANGED_P2P_PS = 1<<19,
243 BSS_CHANGED_DTIM_PERIOD = 1<<20,
244 BSS_CHANGED_BANDWIDTH = 1<<21,
233 245
234 /* when adding here, make sure to change ieee80211_reconfig */ 246 /* when adding here, make sure to change ieee80211_reconfig */
235}; 247};
@@ -271,13 +283,19 @@ enum ieee80211_rssi_event {
271 * if the hardware cannot handle this it must set the 283 * if the hardware cannot handle this it must set the
272 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag 284 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
273 * @dtim_period: num of beacons before the next DTIM, for beaconing, 285 * @dtim_period: num of beacons before the next DTIM, for beaconing,
274 * valid in station mode only while @assoc is true and if also 286 * valid in station mode only if after the driver was notified
275 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf 287 * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then.
276 * @ps_dtim_period)
277 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old 288 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
278 * as it may have been received during scanning long ago) 289 * as it may have been received during scanning long ago). If the
290 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can
291 * only come from a beacon, but might not become valid until after
292 * association when a beacon is received (which is notified with the
293 * %BSS_CHANGED_DTIM flag.)
279 * @sync_device_ts: the device timestamp corresponding to the sync_tsf, 294 * @sync_device_ts: the device timestamp corresponding to the sync_tsf,
280 * the driver/device can use this to calculate synchronisation 295 * the driver/device can use this to calculate synchronisation
296 * (see @sync_tsf)
297 * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY
298 * is requested, see @sync_tsf/@sync_device_ts.
281 * @beacon_int: beacon interval 299 * @beacon_int: beacon interval
282 * @assoc_capability: capabilities taken from assoc resp 300 * @assoc_capability: capabilities taken from assoc resp
283 * @basic_rates: bitmap of basic rates, each bit stands for an 301 * @basic_rates: bitmap of basic rates, each bit stands for an
@@ -329,6 +347,7 @@ struct ieee80211_bss_conf {
329 u16 assoc_capability; 347 u16 assoc_capability;
330 u64 sync_tsf; 348 u64 sync_tsf;
331 u32 sync_device_ts; 349 u32 sync_device_ts;
350 u8 sync_dtim_count;
332 u32 basic_rates; 351 u32 basic_rates;
333 int mcast_rate[IEEE80211_NUM_BANDS]; 352 int mcast_rate[IEEE80211_NUM_BANDS];
334 u16 ht_operation_mode; 353 u16 ht_operation_mode;
@@ -389,6 +408,9 @@ struct ieee80211_bss_conf {
389 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be 408 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
390 * set by rate control algorithms to indicate probe rate, will 409 * set by rate control algorithms to indicate probe rate, will
391 * be cleared for fragmented frames (except on the last fragment) 410 * be cleared for fragmented frames (except on the last fragment)
411 * @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate
412 * that a frame can be transmitted while the queues are stopped for
413 * off-channel operation.
392 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, 414 * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211,
393 * used to indicate that a pending frame requires TX processing before 415 * used to indicate that a pending frame requires TX processing before
394 * it can be sent out. 416 * it can be sent out.
@@ -406,6 +428,9 @@ struct ieee80211_bss_conf {
406 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted 428 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
407 * after TX status because the destination was asleep, it must not 429 * after TX status because the destination was asleep, it must not
408 * be modified again (no seqno assignment, crypto, etc.) 430 * be modified again (no seqno assignment, crypto, etc.)
431 * @IEEE80211_TX_INTFL_MLME_CONN_TX: This frame was transmitted by the MLME
432 * code for connection establishment, this indicates that its status
433 * should kick the MLME state machine.
409 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 434 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
410 * MLME command (internal to mac80211 to figure out whether to send TX 435 * MLME command (internal to mac80211 to figure out whether to send TX
411 * status to user space) 436 * status to user space)
@@ -451,13 +476,14 @@ enum mac80211_tx_control_flags {
451 IEEE80211_TX_STAT_AMPDU = BIT(10), 476 IEEE80211_TX_STAT_AMPDU = BIT(10),
452 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), 477 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
453 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), 478 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
479 IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13),
454 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 480 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
455 IEEE80211_TX_INTFL_RETRIED = BIT(15), 481 IEEE80211_TX_INTFL_RETRIED = BIT(15),
456 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 482 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
457 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17), 483 IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17),
458 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 484 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
459 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 485 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
460 /* hole at 20, use later */ 486 IEEE80211_TX_INTFL_MLME_CONN_TX = BIT(20),
461 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), 487 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
462 IEEE80211_TX_CTL_LDPC = BIT(22), 488 IEEE80211_TX_CTL_LDPC = BIT(22),
463 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), 489 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
@@ -950,6 +976,7 @@ enum ieee80211_smps_mode {
950 * 976 *
951 * @channel: the channel to tune to 977 * @channel: the channel to tune to
952 * @channel_type: the channel (HT) type 978 * @channel_type: the channel (HT) type
979 * @radar_enabled: whether radar detection is enabled
953 * 980 *
954 * @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
955 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 982 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
@@ -976,6 +1003,7 @@ struct ieee80211_conf {
976 1003
977 struct ieee80211_channel *channel; 1004 struct ieee80211_channel *channel;
978 enum nl80211_channel_type channel_type; 1005 enum nl80211_channel_type channel_type;
1006 bool radar_enabled;
979 enum ieee80211_smps_mode smps_mode; 1007 enum ieee80211_smps_mode smps_mode;
980}; 1008};
981 1009
@@ -1173,6 +1201,24 @@ enum ieee80211_sta_state {
1173}; 1201};
1174 1202
1175/** 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/**
1176 * struct ieee80211_sta - station table entry 1222 * struct ieee80211_sta - station table entry
1177 * 1223 *
1178 * A station table entry represents a station we are possibly 1224 * A station table entry represents a station we are possibly
@@ -1194,6 +1240,12 @@ enum ieee80211_sta_state {
1194 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid 1240 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
1195 * if wme is supported. 1241 * if wme is supported.
1196 * @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)
1197 */ 1249 */
1198struct ieee80211_sta { 1250struct ieee80211_sta {
1199 u32 supp_rates[IEEE80211_NUM_BANDS]; 1251 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1204,6 +1256,9 @@ struct ieee80211_sta {
1204 bool wme; 1256 bool wme;
1205 u8 uapsd_queues; 1257 u8 uapsd_queues;
1206 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;
1207 1262
1208 /* must be last */ 1263 /* must be last */
1209 u8 drv_priv[0] __aligned(sizeof(void *)); 1264 u8 drv_priv[0] __aligned(sizeof(void *));
@@ -1328,9 +1383,9 @@ struct ieee80211_tx_control {
1328 * When this flag is set, signaling beacon-loss will cause an immediate 1383 * When this flag is set, signaling beacon-loss will cause an immediate
1329 * change to disassociated state. 1384 * change to disassociated state.
1330 * 1385 *
1331 * @IEEE80211_HW_NEED_DTIM_PERIOD: 1386 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1332 * This device needs to know the DTIM period for the BSS before 1387 * This device needs to get data from beacon before association (i.e.
1333 * associating. 1388 * dtim_period).
1334 * 1389 *
1335 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports 1390 * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports
1336 * per-station GTKs as used by IBSS RSN or during fast transition. If 1391 * per-station GTKs as used by IBSS RSN or during fast transition. If
@@ -1350,10 +1405,6 @@ struct ieee80211_tx_control {
1350 * setup strictly in HW. mac80211 should not attempt to do this in 1405 * setup strictly in HW. mac80211 should not attempt to do this in
1351 * software. 1406 * software.
1352 * 1407 *
1353 * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while
1354 * being idle (i.e. mac80211 doesn't have to go idle-off during the
1355 * the scan).
1356 *
1357 * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of 1408 * @IEEE80211_HW_WANT_MONITOR_VIF: The driver would like to be informed of
1358 * a virtual monitor interface when monitor interfaces are the only 1409 * a virtual monitor interface when monitor interfaces are the only
1359 * active interfaces. 1410 * active interfaces.
@@ -1367,9 +1418,8 @@ struct ieee80211_tx_control {
1367 * P2P Interface. This will be honoured even if more than one interface 1418 * P2P Interface. This will be honoured even if more than one interface
1368 * is supported. 1419 * is supported.
1369 * 1420 *
1370 * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session 1421 * @IEEE80211_HW_TIMING_BEACON_ONLY: Use sync timing from beacon frames
1371 * should be tear down once BAR frame will not be acked. 1422 * only, to allow getting TBTT of a DTIM beacon.
1372 *
1373 */ 1423 */
1374enum ieee80211_hw_flags { 1424enum ieee80211_hw_flags {
1375 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1425 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1379,7 +1429,7 @@ enum ieee80211_hw_flags {
1379 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 1429 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
1380 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, 1430 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
1381 IEEE80211_HW_SIGNAL_DBM = 1<<6, 1431 IEEE80211_HW_SIGNAL_DBM = 1<<6,
1382 IEEE80211_HW_NEED_DTIM_PERIOD = 1<<7, 1432 IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC = 1<<7,
1383 IEEE80211_HW_SPECTRUM_MGMT = 1<<8, 1433 IEEE80211_HW_SPECTRUM_MGMT = 1<<8,
1384 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9, 1434 IEEE80211_HW_AMPDU_AGGREGATION = 1<<9,
1385 IEEE80211_HW_SUPPORTS_PS = 1<<10, 1435 IEEE80211_HW_SUPPORTS_PS = 1<<10,
@@ -1396,9 +1446,8 @@ enum ieee80211_hw_flags {
1396 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1446 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1397 IEEE80211_HW_AP_LINK_PS = 1<<22, 1447 IEEE80211_HW_AP_LINK_PS = 1<<22,
1398 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1448 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1399 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1400 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1449 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
1401 IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26, 1450 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26,
1402}; 1451};
1403 1452
1404/** 1453/**
@@ -1683,15 +1732,6 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
1683 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS 1732 * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS
1684 * enabled whenever user has enabled powersave. 1733 * enabled whenever user has enabled powersave.
1685 * 1734 *
1686 * Some hardware need to toggle a single shared antenna between WLAN and
1687 * Bluetooth to facilitate co-existence. These types of hardware set
1688 * limitations on the use of host controlled dynamic powersave whenever there
1689 * is simultaneous WLAN and Bluetooth traffic. For these types of hardware, the
1690 * driver may request temporarily going into full power save, in order to
1691 * enable toggling the antenna between BT and WLAN. If the driver requests
1692 * disabling dynamic powersave, the @dynamic_ps_timeout value will be
1693 * temporarily set to zero until the driver re-enables dynamic powersave.
1694 *
1695 * Driver informs U-APSD client support by enabling 1735 * Driver informs U-APSD client support by enabling
1696 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the 1736 * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the
1697 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS 1737 * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS
@@ -2077,16 +2117,21 @@ enum ieee80211_frame_release_type {
2077 * enum ieee80211_rate_control_changed - flags to indicate what changed 2117 * enum ieee80211_rate_control_changed - flags to indicate what changed
2078 * 2118 *
2079 * @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
2080 * 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.
2081 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed. 2123 * @IEEE80211_RC_SMPS_CHANGED: The SMPS state of the station changed.
2082 * @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
2083 * changed (in IBSS mode) due to discovering more information about 2125 * changed (in IBSS mode) due to discovering more information about
2084 * the peer. 2126 * the peer.
2127 * @IEEE80211_RC_NSS_CHANGED: N_SS (number of spatial streams) was changed
2128 * by the peer
2085 */ 2129 */
2086enum ieee80211_rate_control_changed { 2130enum ieee80211_rate_control_changed {
2087 IEEE80211_RC_BW_CHANGED = BIT(0), 2131 IEEE80211_RC_BW_CHANGED = BIT(0),
2088 IEEE80211_RC_SMPS_CHANGED = BIT(1), 2132 IEEE80211_RC_SMPS_CHANGED = BIT(1),
2089 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2), 2133 IEEE80211_RC_SUPP_RATES_CHANGED = BIT(2),
2134 IEEE80211_RC_NSS_CHANGED = BIT(3),
2090}; 2135};
2091 2136
2092/** 2137/**
@@ -2167,6 +2212,18 @@ enum ieee80211_rate_control_changed {
2167 * MAC address of the device going away. 2212 * MAC address of the device going away.
2168 * Hence, this callback must be implemented. It can sleep. 2213 * Hence, this callback must be implemented. It can sleep.
2169 * 2214 *
2215 * @add_interface_debugfs: Drivers can use this callback to add debugfs files
2216 * when a vif is added to mac80211. This callback and
2217 * @remove_interface_debugfs should be within a CONFIG_MAC80211_DEBUGFS
2218 * conditional. @remove_interface_debugfs must be provided for cleanup.
2219 * This callback can sleep.
2220 *
2221 * @remove_interface_debugfs: Remove the debugfs files which were added using
2222 * @add_interface_debugfs. This callback must remove all debugfs entries
2223 * that were added because mac80211 only removes interface debugfs when the
2224 * interface is destroyed, not when it is removed from the driver.
2225 * This callback can sleep.
2226 *
2170 * @config: Handler for configuration requests. IEEE 802.11 code calls this 2227 * @config: Handler for configuration requests. IEEE 802.11 code calls this
2171 * function to change hardware configuration, e.g., channel. 2228 * function to change hardware configuration, e.g., channel.
2172 * This function should never fail but returns a negative error code 2229 * This function should never fail but returns a negative error code
@@ -2580,6 +2637,12 @@ struct ieee80211_ops {
2580 struct ieee80211_vif *vif, 2637 struct ieee80211_vif *vif,
2581 struct ieee80211_sta *sta, 2638 struct ieee80211_sta *sta,
2582 struct dentry *dir); 2639 struct dentry *dir);
2640 void (*add_interface_debugfs)(struct ieee80211_hw *hw,
2641 struct ieee80211_vif *vif,
2642 struct dentry *dir);
2643 void (*remove_interface_debugfs)(struct ieee80211_hw *hw,
2644 struct ieee80211_vif *vif,
2645 struct dentry *dir);
2583#endif 2646#endif
2584 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2647 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2585 enum sta_notify_cmd, struct ieee80211_sta *sta); 2648 enum sta_notify_cmd, struct ieee80211_sta *sta);
@@ -3877,6 +3940,8 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
3877 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and 3940 * When beacon filtering is enabled with %IEEE80211_VIF_BEACON_FILTER, and
3878 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver 3941 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
3879 * needs to inform if the connection to the AP has been lost. 3942 * needs to inform if the connection to the AP has been lost.
3943 * The function may also be called if the connection needs to be terminated
3944 * for some other reason, even if %IEEE80211_HW_CONNECTION_MONITOR isn't set.
3880 * 3945 *
3881 * This function will cause immediate change to disassociated state, 3946 * This function will cause immediate change to disassociated state,
3882 * without connection recovery attempts. 3947 * without connection recovery attempts.
@@ -3907,36 +3972,6 @@ void ieee80211_connection_loss(struct ieee80211_vif *vif);
3907void ieee80211_resume_disconnect(struct ieee80211_vif *vif); 3972void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
3908 3973
3909/** 3974/**
3910 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
3911 *
3912 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3913 *
3914 * Some hardware require full power save to manage simultaneous BT traffic
3915 * on the WLAN frequency. Full PSM is required periodically, whenever there are
3916 * burst of BT traffic. The hardware gets information of BT traffic via
3917 * hardware co-existence lines, and consequentially requests mac80211 to
3918 * (temporarily) enter full psm.
3919 * This function will only temporarily disable dynamic PS, not enable PSM if
3920 * it was not already enabled.
3921 * The driver must make sure to re-enable dynamic PS using
3922 * ieee80211_enable_dyn_ps() if the driver has disabled it.
3923 *
3924 */
3925void ieee80211_disable_dyn_ps(struct ieee80211_vif *vif);
3926
3927/**
3928 * ieee80211_enable_dyn_ps - restore dynamic psm after being disabled
3929 *
3930 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3931 *
3932 * This function restores dynamic PS after being temporarily disabled via
3933 * ieee80211_disable_dyn_ps(). Each ieee80211_disable_dyn_ps() call must
3934 * be coupled with an eventual call to this function.
3935 *
3936 */
3937void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif);
3938
3939/**
3940 * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring 3975 * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring
3941 * rssi threshold triggered 3976 * rssi threshold triggered
3942 * 3977 *
@@ -3953,6 +3988,13 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
3953 gfp_t gfp); 3988 gfp_t gfp);
3954 3989
3955/** 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/**
3956 * ieee80211_chswitch_done - Complete channel switch process 3998 * ieee80211_chswitch_done - Complete channel switch process
3957 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3999 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3958 * @success: make the channel switch successful or not 4000 * @success: make the channel switch successful or not
@@ -4211,4 +4253,16 @@ void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
4211 */ 4253 */
4212int ieee80211_ave_rssi(struct ieee80211_vif *vif); 4254int ieee80211_ave_rssi(struct ieee80211_vif *vif);
4213 4255
4256/**
4257 * ieee80211_report_wowlan_wakeup - report WoWLAN wakeup
4258 * @vif: virtual interface
4259 * @wakeup: wakeup reason(s)
4260 * @gfp: allocation flags
4261 *
4262 * See cfg80211_report_wowlan_wakeup().
4263 */
4264void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif,
4265 struct cfg80211_wowlan_wakeup *wakeup,
4266 gfp_t gfp);
4267
4214#endif /* MAC80211_H */ 4268#endif /* MAC80211_H */
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5b7dbc1ea966..c46bb016f4e4 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -513,6 +513,12 @@
513 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For 513 * command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
514 * more background information, see 514 * more background information, see
515 * http://wireless.kernel.org/en/users/Documentation/WoWLAN. 515 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
516 * The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
517 * from the driver reporting the wakeup reason. In this case, the
518 * @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
519 * for the wakeup, if it was caused by wireless. If it is not present
520 * in the wakeup notification, the wireless device didn't cause the
521 * wakeup but reports that it was woken up.
516 * 522 *
517 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver 523 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
518 * the necessary information for supporting GTK rekey offload. This 524 * the necessary information for supporting GTK rekey offload. This
@@ -597,6 +603,14 @@
597 * 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
598 * ACL list during %NL80211_CMD_STOP_AP. 604 * ACL list during %NL80211_CMD_STOP_AP.
599 * 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 *
600 * @NL80211_CMD_MAX: highest used command number 614 * @NL80211_CMD_MAX: highest used command number
601 * @__NL80211_CMD_AFTER_LAST: internal use 615 * @__NL80211_CMD_AFTER_LAST: internal use
602 */ 616 */
@@ -749,6 +763,8 @@ enum nl80211_commands {
749 763
750 NL80211_CMD_SET_MAC_ACL, 764 NL80211_CMD_SET_MAC_ACL,
751 765
766 NL80211_CMD_RADAR_DETECT,
767
752 /* add new commands above here */ 768 /* add new commands above here */
753 769
754 /* used to define NL80211_CMD_MAX below */ 770 /* used to define NL80211_CMD_MAX below */
@@ -1336,6 +1352,22 @@ enum nl80211_commands {
1336 * number of MAC addresses that a device can support for MAC 1352 * number of MAC addresses that a device can support for MAC
1337 * ACL. 1353 * ACL.
1338 * 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 *
1339 * @NL80211_ATTR_MAX: highest attribute number currently defined 1371 * @NL80211_ATTR_MAX: highest attribute number currently defined
1340 * @__NL80211_ATTR_AFTER_LAST: internal use 1372 * @__NL80211_ATTR_AFTER_LAST: internal use
1341 */ 1373 */
@@ -1614,6 +1646,14 @@ enum nl80211_attrs {
1614 1646
1615 NL80211_ATTR_MAC_ACL_MAX, 1647 NL80211_ATTR_MAC_ACL_MAX,
1616 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
1617 /* add attributes here, update the policy in nl80211.c */ 1657 /* add attributes here, update the policy in nl80211.c */
1618 1658
1619 __NL80211_ATTR_AFTER_LAST, 1659 __NL80211_ATTR_AFTER_LAST,
@@ -1851,6 +1891,8 @@ enum nl80211_sta_bss_param {
1851 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) 1891 * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
1852 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) 1892 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
1853 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) 1893 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
1894 * @NL80211_STA_INFO_RX_BYTES64: total received bytes (u64, from this station)
1895 * @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (u64, to this station)
1854 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) 1896 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
1855 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute 1897 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
1856 * containing info as possible, see &enum nl80211_rate_info 1898 * containing info as possible, see &enum nl80211_rate_info
@@ -1903,6 +1945,8 @@ enum nl80211_sta_info {
1903 NL80211_STA_INFO_LOCAL_PM, 1945 NL80211_STA_INFO_LOCAL_PM,
1904 NL80211_STA_INFO_PEER_PM, 1946 NL80211_STA_INFO_PEER_PM,
1905 NL80211_STA_INFO_NONPEER_PM, 1947 NL80211_STA_INFO_NONPEER_PM,
1948 NL80211_STA_INFO_RX_BYTES64,
1949 NL80211_STA_INFO_TX_BYTES64,
1906 1950
1907 /* keep last */ 1951 /* keep last */
1908 __NL80211_STA_INFO_AFTER_LAST, 1952 __NL80211_STA_INFO_AFTER_LAST,
@@ -2012,6 +2056,20 @@ enum nl80211_band_attr {
2012 * on this channel in current regulatory domain. 2056 * on this channel in current regulatory domain.
2013 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 2057 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
2014 * (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
2015 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number 2073 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
2016 * currently defined 2074 * currently defined
2017 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use 2075 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
@@ -2024,6 +2082,12 @@ enum nl80211_frequency_attr {
2024 NL80211_FREQUENCY_ATTR_NO_IBSS, 2082 NL80211_FREQUENCY_ATTR_NO_IBSS,
2025 NL80211_FREQUENCY_ATTR_RADAR, 2083 NL80211_FREQUENCY_ATTR_RADAR,
2026 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,
2027 2091
2028 /* keep last */ 2092 /* keep last */
2029 __NL80211_FREQUENCY_ATTR_AFTER_LAST, 2093 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -2896,10 +2960,12 @@ enum nl80211_tx_power_setting {
2896 * 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.
2897 * 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
2898 * 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
2899 * twelve zero bytes, and a mask of "0xed,0x07". 2963 * twelve zero bytes, and a mask of "0xed,0x01".
2900 * 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
2901 * 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
2902 * 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
2903 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes 2969 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes
2904 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number 2970 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number
2905 */ 2971 */
@@ -2907,6 +2973,7 @@ enum nl80211_wowlan_packet_pattern_attr {
2907 __NL80211_WOWLAN_PKTPAT_INVALID, 2973 __NL80211_WOWLAN_PKTPAT_INVALID,
2908 NL80211_WOWLAN_PKTPAT_MASK, 2974 NL80211_WOWLAN_PKTPAT_MASK,
2909 NL80211_WOWLAN_PKTPAT_PATTERN, 2975 NL80211_WOWLAN_PKTPAT_PATTERN,
2976 NL80211_WOWLAN_PKTPAT_OFFSET,
2910 2977
2911 NUM_NL80211_WOWLAN_PKTPAT, 2978 NUM_NL80211_WOWLAN_PKTPAT,
2912 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, 2979 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
@@ -2917,6 +2984,7 @@ enum nl80211_wowlan_packet_pattern_attr {
2917 * @max_patterns: maximum number of patterns supported 2984 * @max_patterns: maximum number of patterns supported
2918 * @min_pattern_len: minimum length of each pattern 2985 * @min_pattern_len: minimum length of each pattern
2919 * @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
2920 * 2988 *
2921 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 2989 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
2922 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 2990 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the
@@ -2926,6 +2994,7 @@ struct nl80211_wowlan_pattern_support {
2926 __u32 max_patterns; 2994 __u32 max_patterns;
2927 __u32 min_pattern_len; 2995 __u32 min_pattern_len;
2928 __u32 max_pattern_len; 2996 __u32 max_pattern_len;
2997 __u32 max_pkt_offset;
2929} __attribute__((packed)); 2998} __attribute__((packed));
2930 2999
2931/** 3000/**
@@ -2941,12 +3010,17 @@ struct nl80211_wowlan_pattern_support {
2941 * @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
2942 * 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
2943 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. 3012 * defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
2944 * 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
2945 * 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
2946 * 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.
2947 * 3017 *
2948 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 3018 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2949 * carrying a &struct nl80211_wowlan_pattern_support. 3019 * carrying a &struct nl80211_wowlan_pattern_support.
3020 *
3021 * When reporting wakeup. it is a u32 attribute containing the 0-based
3022 * index of the pattern that caused the wakeup, in the patterns passed
3023 * to the kernel when configuring.
2950 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be 3024 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
2951 * used when setting, used only to indicate that GTK rekeying is supported 3025 * used when setting, used only to indicate that GTK rekeying is supported
2952 * by the device (flag) 3026 * by the device (flag)
@@ -2957,8 +3031,36 @@ struct nl80211_wowlan_pattern_support {
2957 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) 3031 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
2958 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released 3032 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
2959 * (on devices that have rfkill in the device) (flag) 3033 * (on devices that have rfkill in the device) (flag)
3034 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains
3035 * the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame
3036 * may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN
3037 * attribute contains the original length.
3038 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11
3039 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211
3040 * attribute if the packet was truncated somewhere.
3041 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the
3042 * 802.11 packet that caused the wakeup, e.g. a magic packet. The frame may
3043 * be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute
3044 * contains the original length.
3045 * @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
3046 * packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
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
2960 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers 3059 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2961 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number 3060 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
3061 *
3062 * These nested attributes are used to configure the wakeup triggers and
3063 * to report the wakeup reason(s).
2962 */ 3064 */
2963enum nl80211_wowlan_triggers { 3065enum nl80211_wowlan_triggers {
2964 __NL80211_WOWLAN_TRIG_INVALID, 3066 __NL80211_WOWLAN_TRIG_INVALID,
@@ -2971,6 +3073,14 @@ enum nl80211_wowlan_triggers {
2971 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, 3073 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
2972 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, 3074 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
2973 NL80211_WOWLAN_TRIG_RFKILL_RELEASE, 3075 NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
3076 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
3077 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
3078 NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
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,
2974 3084
2975 /* keep last */ 3085 /* keep last */
2976 NUM_NL80211_WOWLAN_TRIG, 3086 NUM_NL80211_WOWLAN_TRIG,
@@ -2978,6 +3088,116 @@ enum nl80211_wowlan_triggers {
2978}; 3088};
2979 3089
2980/** 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/**
2981 * enum nl80211_iface_limit_attrs - limit attributes 3201 * enum nl80211_iface_limit_attrs - limit attributes
2982 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 3202 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
2983 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 3203 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
@@ -3234,6 +3454,8 @@ enum nl80211_ap_sme_features {
3234 * 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
3235 * stations in authenticated/associated state, so to add unauthenticated 3455 * stations in authenticated/associated state, so to add unauthenticated
3236 * 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
3237 */ 3459 */
3238enum nl80211_feature_flags { 3460enum nl80211_feature_flags {
3239 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3461 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3249,7 +3471,9 @@ enum nl80211_feature_flags {
3249 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, 3471 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
3250 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11, 3472 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
3251 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12, 3473 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
3252 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,
3253}; 3477};
3254 3478
3255/** 3479/**
@@ -3323,4 +3547,44 @@ enum nl80211_acl_policy {
3323 NL80211_ACL_POLICY_DENY_UNLESS_LISTED, 3547 NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
3324}; 3548};
3325 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
3326#endif /* __LINUX_NL80211_H */ 3590#endif /* __LINUX_NL80211_H */