aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/bcma/bcma.h2
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h51
-rw-r--r--include/linux/bcma/bcma_driver_gmac_cmn.h100
-rw-r--r--include/linux/nl80211.h53
-rw-r--r--include/net/bluetooth/hci.h11
-rw-r--r--include/net/bluetooth/hci_core.h8
-rw-r--r--include/net/bluetooth/l2cap.h5
-rw-r--r--include/net/bluetooth/mgmt.h2
-rw-r--r--include/net/cfg80211.h107
-rw-r--r--include/net/mac80211.h40
-rw-r--r--include/net/regulatory.h5
11 files changed, 316 insertions, 68 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 03b2f30d2ace..1954a4e305a3 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -7,6 +7,7 @@
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/bcma/bcma_driver_mips.h> 9#include <linux/bcma/bcma_driver_mips.h>
10#include <linux/bcma/bcma_driver_gmac_cmn.h>
10#include <linux/ssb/ssb.h> /* SPROM sharing */ 11#include <linux/ssb/ssb.h> /* SPROM sharing */
11 12
12#include "bcma_regs.h" 13#include "bcma_regs.h"
@@ -252,6 +253,7 @@ struct bcma_bus {
252 struct bcma_drv_cc drv_cc; 253 struct bcma_drv_cc drv_cc;
253 struct bcma_drv_pci drv_pci; 254 struct bcma_drv_pci drv_pci;
254 struct bcma_drv_mips drv_mips; 255 struct bcma_drv_mips drv_mips;
256 struct bcma_drv_gmac_cmn drv_gmac_cmn;
255 257
256 /* We decided to share SPROM struct with SSB as long as we do not need 258 /* We decided to share SPROM struct with SSB as long as we do not need
257 * any hacks for BCMA. This simplifies drivers code. */ 259 * any hacks for BCMA. This simplifies drivers code. */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index fbd0d49dc4d2..3c80885fa829 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -24,7 +24,7 @@
24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ 24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */
25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ 25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */
26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ 26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */
27#define BCMA_CC_FLASHT_NFLASH 0x00000200 27#define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */
28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ 28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */
29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ 29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */
30#define BCMA_PLLTYPE_NONE 0x00000000 30#define BCMA_PLLTYPE_NONE 0x00000000
@@ -45,6 +45,7 @@
45#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ 45#define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */
46#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ 46#define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */
47#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ 47#define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */
48#define BCMA_CC_CAP_NFLASH 0x80000000 /* NAND flash present (rev >= 35 or BCM4706?) */
48#define BCMA_CC_CORECTL 0x0008 49#define BCMA_CC_CORECTL 0x0008
49#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ 50#define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */
50#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ 51#define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */
@@ -122,10 +123,58 @@
122#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */ 123#define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */
123#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */ 124#define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */
124#define BCMA_CC_FLASHCTL 0x0040 125#define BCMA_CC_FLASHCTL 0x0040
126/* Start/busy bit in flashcontrol */
127#define BCMA_CC_FLASHCTL_OPCODE 0x000000ff
128#define BCMA_CC_FLASHCTL_ACTION 0x00000700
129#define BCMA_CC_FLASHCTL_CS_ACTIVE 0x00001000 /* Chip Select Active, rev >= 20 */
125#define BCMA_CC_FLASHCTL_START 0x80000000 130#define BCMA_CC_FLASHCTL_START 0x80000000
126#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START 131#define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START
132/* Flashcontrol action + opcodes for ST flashes */
133#define BCMA_CC_FLASHCTL_ST_WREN 0x0006 /* Write Enable */
134#define BCMA_CC_FLASHCTL_ST_WRDIS 0x0004 /* Write Disable */
135#define BCMA_CC_FLASHCTL_ST_RDSR 0x0105 /* Read Status Register */
136#define BCMA_CC_FLASHCTL_ST_WRSR 0x0101 /* Write Status Register */
137#define BCMA_CC_FLASHCTL_ST_READ 0x0303 /* Read Data Bytes */
138#define BCMA_CC_FLASHCTL_ST_PP 0x0302 /* Page Program */
139#define BCMA_CC_FLASHCTL_ST_SE 0x02d8 /* Sector Erase */
140#define BCMA_CC_FLASHCTL_ST_BE 0x00c7 /* Bulk Erase */
141#define BCMA_CC_FLASHCTL_ST_DP 0x00b9 /* Deep Power-down */
142#define BCMA_CC_FLASHCTL_ST_RES 0x03ab /* Read Electronic Signature */
143#define BCMA_CC_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */
144#define BCMA_CC_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */
145/* Flashcontrol action + opcodes for Atmel flashes */
146#define BCMA_CC_FLASHCTL_AT_READ 0x07e8
147#define BCMA_CC_FLASHCTL_AT_PAGE_READ 0x07d2
148#define BCMA_CC_FLASHCTL_AT_STATUS 0x01d7
149#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE 0x0384
150#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE 0x0387
151#define BCMA_CC_FLASHCTL_AT_BUF1_ERASE_PROGRAM 0x0283
152#define BCMA_CC_FLASHCTL_AT_BUF2_ERASE_PROGRAM 0x0286
153#define BCMA_CC_FLASHCTL_AT_BUF1_PROGRAM 0x0288
154#define BCMA_CC_FLASHCTL_AT_BUF2_PROGRAM 0x0289
155#define BCMA_CC_FLASHCTL_AT_PAGE_ERASE 0x0281
156#define BCMA_CC_FLASHCTL_AT_BLOCK_ERASE 0x0250
157#define BCMA_CC_FLASHCTL_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
158#define BCMA_CC_FLASHCTL_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
159#define BCMA_CC_FLASHCTL_AT_BUF1_LOAD 0x0253
160#define BCMA_CC_FLASHCTL_AT_BUF2_LOAD 0x0255
161#define BCMA_CC_FLASHCTL_AT_BUF1_COMPARE 0x0260
162#define BCMA_CC_FLASHCTL_AT_BUF2_COMPARE 0x0261
163#define BCMA_CC_FLASHCTL_AT_BUF1_REPROGRAM 0x0258
164#define BCMA_CC_FLASHCTL_AT_BUF2_REPROGRAM 0x0259
127#define BCMA_CC_FLASHADDR 0x0044 165#define BCMA_CC_FLASHADDR 0x0044
128#define BCMA_CC_FLASHDATA 0x0048 166#define BCMA_CC_FLASHDATA 0x0048
167/* Status register bits for ST flashes */
168#define BCMA_CC_FLASHDATA_ST_WIP 0x01 /* Write In Progress */
169#define BCMA_CC_FLASHDATA_ST_WEL 0x02 /* Write Enable Latch */
170#define BCMA_CC_FLASHDATA_ST_BP_MASK 0x1c /* Block Protect */
171#define BCMA_CC_FLASHDATA_ST_BP_SHIFT 2
172#define BCMA_CC_FLASHDATA_ST_SRWD 0x80 /* Status Register Write Disable */
173/* Status register bits for Atmel flashes */
174#define BCMA_CC_FLASHDATA_AT_READY 0x80
175#define BCMA_CC_FLASHDATA_AT_MISMATCH 0x40
176#define BCMA_CC_FLASHDATA_AT_ID_MASK 0x38
177#define BCMA_CC_FLASHDATA_AT_ID_SHIFT 3
129#define BCMA_CC_BCAST_ADDR 0x0050 178#define BCMA_CC_BCAST_ADDR 0x0050
130#define BCMA_CC_BCAST_DATA 0x0054 179#define BCMA_CC_BCAST_DATA 0x0054
131#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */ 180#define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */
diff --git a/include/linux/bcma/bcma_driver_gmac_cmn.h b/include/linux/bcma/bcma_driver_gmac_cmn.h
new file mode 100644
index 000000000000..def894b83b0d
--- /dev/null
+++ b/include/linux/bcma/bcma_driver_gmac_cmn.h
@@ -0,0 +1,100 @@
1#ifndef LINUX_BCMA_DRIVER_GMAC_CMN_H_
2#define LINUX_BCMA_DRIVER_GMAC_CMN_H_
3
4#include <linux/types.h>
5
6#define BCMA_GMAC_CMN_STAG0 0x000
7#define BCMA_GMAC_CMN_STAG1 0x004
8#define BCMA_GMAC_CMN_STAG2 0x008
9#define BCMA_GMAC_CMN_STAG3 0x00C
10#define BCMA_GMAC_CMN_PARSER_CTL 0x020
11#define BCMA_GMAC_CMN_MIB_MAX_LEN 0x024
12#define BCMA_GMAC_CMN_PHY_ACCESS 0x100
13#define BCMA_GMAC_CMN_PA_DATA_MASK 0x0000ffff
14#define BCMA_GMAC_CMN_PA_ADDR_MASK 0x001f0000
15#define BCMA_GMAC_CMN_PA_ADDR_SHIFT 16
16#define BCMA_GMAC_CMN_PA_REG_MASK 0x1f000000
17#define BCMA_GMAC_CMN_PA_REG_SHIFT 24
18#define BCMA_GMAC_CMN_PA_WRITE 0x20000000
19#define BCMA_GMAC_CMN_PA_START 0x40000000
20#define BCMA_GMAC_CMN_PHY_CTL 0x104
21#define BCMA_GMAC_CMN_PC_EPA_MASK 0x0000001f
22#define BCMA_GMAC_CMN_PC_MCT_MASK 0x007f0000
23#define BCMA_GMAC_CMN_PC_MCT_SHIFT 16
24#define BCMA_GMAC_CMN_PC_MTE 0x00800000
25#define BCMA_GMAC_CMN_GMAC0_RGMII_CTL 0x110
26#define BCMA_GMAC_CMN_CFP_ACCESS 0x200
27#define BCMA_GMAC_CMN_CFP_TCAM_DATA0 0x210
28#define BCMA_GMAC_CMN_CFP_TCAM_DATA1 0x214
29#define BCMA_GMAC_CMN_CFP_TCAM_DATA2 0x218
30#define BCMA_GMAC_CMN_CFP_TCAM_DATA3 0x21C
31#define BCMA_GMAC_CMN_CFP_TCAM_DATA4 0x220
32#define BCMA_GMAC_CMN_CFP_TCAM_DATA5 0x224
33#define BCMA_GMAC_CMN_CFP_TCAM_DATA6 0x228
34#define BCMA_GMAC_CMN_CFP_TCAM_DATA7 0x22C
35#define BCMA_GMAC_CMN_CFP_TCAM_MASK0 0x230
36#define BCMA_GMAC_CMN_CFP_TCAM_MASK1 0x234
37#define BCMA_GMAC_CMN_CFP_TCAM_MASK2 0x238
38#define BCMA_GMAC_CMN_CFP_TCAM_MASK3 0x23C
39#define BCMA_GMAC_CMN_CFP_TCAM_MASK4 0x240
40#define BCMA_GMAC_CMN_CFP_TCAM_MASK5 0x244
41#define BCMA_GMAC_CMN_CFP_TCAM_MASK6 0x248
42#define BCMA_GMAC_CMN_CFP_TCAM_MASK7 0x24C
43#define BCMA_GMAC_CMN_CFP_ACTION_DATA 0x250
44#define BCMA_GMAC_CMN_TCAM_BIST_CTL 0x2A0
45#define BCMA_GMAC_CMN_TCAM_BIST_STATUS 0x2A4
46#define BCMA_GMAC_CMN_TCAM_CMP_STATUS 0x2A8
47#define BCMA_GMAC_CMN_TCAM_DISABLE 0x2AC
48#define BCMA_GMAC_CMN_TCAM_TEST_CTL 0x2F0
49#define BCMA_GMAC_CMN_UDF_0_A3_A0 0x300
50#define BCMA_GMAC_CMN_UDF_0_A7_A4 0x304
51#define BCMA_GMAC_CMN_UDF_0_A8 0x308
52#define BCMA_GMAC_CMN_UDF_1_A3_A0 0x310
53#define BCMA_GMAC_CMN_UDF_1_A7_A4 0x314
54#define BCMA_GMAC_CMN_UDF_1_A8 0x318
55#define BCMA_GMAC_CMN_UDF_2_A3_A0 0x320
56#define BCMA_GMAC_CMN_UDF_2_A7_A4 0x324
57#define BCMA_GMAC_CMN_UDF_2_A8 0x328
58#define BCMA_GMAC_CMN_UDF_0_B3_B0 0x330
59#define BCMA_GMAC_CMN_UDF_0_B7_B4 0x334
60#define BCMA_GMAC_CMN_UDF_0_B8 0x338
61#define BCMA_GMAC_CMN_UDF_1_B3_B0 0x340
62#define BCMA_GMAC_CMN_UDF_1_B7_B4 0x344
63#define BCMA_GMAC_CMN_UDF_1_B8 0x348
64#define BCMA_GMAC_CMN_UDF_2_B3_B0 0x350
65#define BCMA_GMAC_CMN_UDF_2_B7_B4 0x354
66#define BCMA_GMAC_CMN_UDF_2_B8 0x358
67#define BCMA_GMAC_CMN_UDF_0_C3_C0 0x360
68#define BCMA_GMAC_CMN_UDF_0_C7_C4 0x364
69#define BCMA_GMAC_CMN_UDF_0_C8 0x368
70#define BCMA_GMAC_CMN_UDF_1_C3_C0 0x370
71#define BCMA_GMAC_CMN_UDF_1_C7_C4 0x374
72#define BCMA_GMAC_CMN_UDF_1_C8 0x378
73#define BCMA_GMAC_CMN_UDF_2_C3_C0 0x380
74#define BCMA_GMAC_CMN_UDF_2_C7_C4 0x384
75#define BCMA_GMAC_CMN_UDF_2_C8 0x388
76#define BCMA_GMAC_CMN_UDF_0_D3_D0 0x390
77#define BCMA_GMAC_CMN_UDF_0_D7_D4 0x394
78#define BCMA_GMAC_CMN_UDF_0_D11_D8 0x394
79
80struct bcma_drv_gmac_cmn {
81 struct bcma_device *core;
82
83 /* Drivers accessing BCMA_GMAC_CMN_PHY_ACCESS and
84 * BCMA_GMAC_CMN_PHY_CTL need to take that mutex first. */
85 struct mutex phy_mutex;
86};
87
88/* Register access */
89#define gmac_cmn_read16(gc, offset) bcma_read16((gc)->core, offset)
90#define gmac_cmn_read32(gc, offset) bcma_read32((gc)->core, offset)
91#define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val)
92#define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val)
93
94#ifdef CONFIG_BCMA_DRIVER_GMAC_CMN
95extern void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc);
96#else
97static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { }
98#endif
99
100#endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index db961a59247f..2f3878806403 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -771,6 +771,9 @@ enum nl80211_commands {
771 * @NL80211_ATTR_IFNAME: network interface name 771 * @NL80211_ATTR_IFNAME: network interface name
772 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype 772 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
773 * 773 *
774 * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
775 * that don't have a netdev (u64)
776 *
774 * @NL80211_ATTR_MAC: MAC address (various uses) 777 * @NL80211_ATTR_MAC: MAC address (various uses)
775 * 778 *
776 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of 779 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
@@ -1242,6 +1245,12 @@ enum nl80211_commands {
1242 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds 1245 * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
1243 * or 0 to disable background scan. 1246 * or 0 to disable background scan.
1244 * 1247 *
1248 * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
1249 * userspace. If unset it is assumed the hint comes directly from
1250 * a user. If set code could specify exactly what type of source
1251 * was used to provide the hint. For the different types of
1252 * allowed user regulatory hints see nl80211_user_reg_hint_type.
1253 *
1245 * @NL80211_ATTR_MAX: highest attribute number currently defined 1254 * @NL80211_ATTR_MAX: highest attribute number currently defined
1246 * @__NL80211_ATTR_AFTER_LAST: internal use 1255 * @__NL80211_ATTR_AFTER_LAST: internal use
1247 */ 1256 */
@@ -1493,6 +1502,10 @@ enum nl80211_attrs {
1493 1502
1494 NL80211_ATTR_BG_SCAN_PERIOD, 1503 NL80211_ATTR_BG_SCAN_PERIOD,
1495 1504
1505 NL80211_ATTR_WDEV,
1506
1507 NL80211_ATTR_USER_REG_HINT_TYPE,
1508
1496 /* add attributes here, update the policy in nl80211.c */ 1509 /* add attributes here, update the policy in nl80211.c */
1497 1510
1498 __NL80211_ATTR_AFTER_LAST, 1511 __NL80211_ATTR_AFTER_LAST,
@@ -1545,6 +1558,8 @@ enum nl80211_attrs {
1545/* default RSSI threshold for scan results if none specified. */ 1558/* default RSSI threshold for scan results if none specified. */
1546#define NL80211_SCAN_RSSI_THOLD_OFF -300 1559#define NL80211_SCAN_RSSI_THOLD_OFF -300
1547 1560
1561#define NL80211_CQM_TXE_MAX_INTVL 1800
1562
1548/** 1563/**
1549 * enum nl80211_iftype - (virtual) interface types 1564 * enum nl80211_iftype - (virtual) interface types
1550 * 1565 *
@@ -2054,6 +2069,26 @@ enum nl80211_dfs_regions {
2054}; 2069};
2055 2070
2056/** 2071/**
2072 * enum nl80211_user_reg_hint_type - type of user regulatory hint
2073 *
2074 * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
2075 * assumed if the attribute is not set.
2076 * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
2077 * base station. Device drivers that have been tested to work
2078 * properly to support this type of hint can enable these hints
2079 * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
2080 * capability on the struct wiphy. The wireless core will
2081 * ignore all cell base station hints until at least one device
2082 * present has been registered with the wireless core that
2083 * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
2084 * supported feature.
2085 */
2086enum nl80211_user_reg_hint_type {
2087 NL80211_USER_REG_HINT_USER = 0,
2088 NL80211_USER_REG_HINT_CELL_BASE = 1,
2089};
2090
2091/**
2057 * enum nl80211_survey_info - survey information 2092 * enum nl80211_survey_info - survey information
2058 * 2093 *
2059 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO 2094 * These attribute types are used with %NL80211_ATTR_SURVEY_INFO
@@ -2584,6 +2619,17 @@ enum nl80211_ps_state {
2584 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event 2619 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
2585 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many 2620 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
2586 * consecutive packets were not acknowledged by the peer 2621 * consecutive packets were not acknowledged by the peer
2622 * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
2623 * during the given %NL80211_ATTR_CQM_TXE_INTVL before an
2624 * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
2625 * %NL80211_ATTR_CQM_TXE_PKTS is generated.
2626 * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
2627 * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
2628 * checked.
2629 * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
2630 * interval in which %NL80211_ATTR_CQM_TXE_PKTS and
2631 * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
2632 * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
2587 * @__NL80211_ATTR_CQM_AFTER_LAST: internal 2633 * @__NL80211_ATTR_CQM_AFTER_LAST: internal
2588 * @NL80211_ATTR_CQM_MAX: highest key attribute 2634 * @NL80211_ATTR_CQM_MAX: highest key attribute
2589 */ 2635 */
@@ -2593,6 +2639,9 @@ enum nl80211_attr_cqm {
2593 NL80211_ATTR_CQM_RSSI_HYST, 2639 NL80211_ATTR_CQM_RSSI_HYST,
2594 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, 2640 NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
2595 NL80211_ATTR_CQM_PKT_LOSS_EVENT, 2641 NL80211_ATTR_CQM_PKT_LOSS_EVENT,
2642 NL80211_ATTR_CQM_TXE_RATE,
2643 NL80211_ATTR_CQM_TXE_PKTS,
2644 NL80211_ATTR_CQM_TXE_INTVL,
2596 2645
2597 /* keep last */ 2646 /* keep last */
2598 __NL80211_ATTR_CQM_AFTER_LAST, 2647 __NL80211_ATTR_CQM_AFTER_LAST,
@@ -2942,11 +2991,15 @@ enum nl80211_ap_sme_features {
2942 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. 2991 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
2943 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up 2992 * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
2944 * the connected inactive stations in AP mode. 2993 * the connected inactive stations in AP mode.
2994 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
2995 * to work properly to suppport receiving regulatory hints from
2996 * cellular base stations.
2945 */ 2997 */
2946enum nl80211_feature_flags { 2998enum nl80211_feature_flags {
2947 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 2999 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
2948 NL80211_FEATURE_HT_IBSS = 1 << 1, 3000 NL80211_FEATURE_HT_IBSS = 1 << 1,
2949 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, 3001 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3002 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
2950}; 3003};
2951 3004
2952/** 3005/**
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 2a6b0b8b7120..ccd723e0f783 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -139,11 +139,12 @@ enum {
139#define HCIINQUIRY _IOR('H', 240, int) 139#define HCIINQUIRY _IOR('H', 240, int)
140 140
141/* HCI timeouts */ 141/* HCI timeouts */
142#define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ 142#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
143#define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ 143#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
144#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ 144#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */
145#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ 145#define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */
146#define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ 146#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
147#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
147 148
148/* HCI data types */ 149/* HCI data types */
149#define HCI_COMMAND_PKT 0x01 150#define HCI_COMMAND_PKT 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 20fd57367ddc..475b8c04ba52 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -587,18 +587,24 @@ void hci_conn_put_device(struct hci_conn *conn);
587 587
588static inline void hci_conn_hold(struct hci_conn *conn) 588static inline void hci_conn_hold(struct hci_conn *conn)
589{ 589{
590 BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt),
591 atomic_read(&conn->refcnt) + 1);
592
590 atomic_inc(&conn->refcnt); 593 atomic_inc(&conn->refcnt);
591 cancel_delayed_work(&conn->disc_work); 594 cancel_delayed_work(&conn->disc_work);
592} 595}
593 596
594static inline void hci_conn_put(struct hci_conn *conn) 597static inline void hci_conn_put(struct hci_conn *conn)
595{ 598{
599 BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt),
600 atomic_read(&conn->refcnt) - 1);
601
596 if (atomic_dec_and_test(&conn->refcnt)) { 602 if (atomic_dec_and_test(&conn->refcnt)) {
597 unsigned long timeo; 603 unsigned long timeo;
598 if (conn->type == ACL_LINK || conn->type == LE_LINK) { 604 if (conn->type == ACL_LINK || conn->type == LE_LINK) {
599 del_timer(&conn->idle_timer); 605 del_timer(&conn->idle_timer);
600 if (conn->state == BT_CONNECTED) { 606 if (conn->state == BT_CONNECTED) {
601 timeo = msecs_to_jiffies(conn->disc_timeout); 607 timeo = conn->disc_timeout;
602 if (!conn->out) 608 if (!conn->out)
603 timeo *= 2; 609 timeo *= 2;
604 } else { 610 } else {
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d80e3f0691b4..a7679f8913d2 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -464,6 +464,7 @@ struct l2cap_chan {
464 464
465 __u16 tx_win; 465 __u16 tx_win;
466 __u16 tx_win_max; 466 __u16 tx_win_max;
467 __u16 ack_win;
467 __u8 max_tx; 468 __u8 max_tx;
468 __u16 retrans_timeout; 469 __u16 retrans_timeout;
469 __u16 monitor_timeout; 470 __u16 monitor_timeout;
@@ -672,11 +673,15 @@ enum {
672 673
673static inline void l2cap_chan_hold(struct l2cap_chan *c) 674static inline void l2cap_chan_hold(struct l2cap_chan *c)
674{ 675{
676 BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));
677
675 atomic_inc(&c->refcnt); 678 atomic_inc(&c->refcnt);
676} 679}
677 680
678static inline void l2cap_chan_put(struct l2cap_chan *c) 681static inline void l2cap_chan_put(struct l2cap_chan *c)
679{ 682{
683 BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt));
684
680 if (atomic_dec_and_test(&c->refcnt)) 685 if (atomic_dec_and_test(&c->refcnt))
681 kfree(c); 686 kfree(c);
682} 687}
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 23fd0546fccb..4348ee8bda69 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -444,7 +444,7 @@ struct mgmt_ev_auth_failed {
444struct mgmt_ev_device_found { 444struct mgmt_ev_device_found {
445 struct mgmt_addr_info addr; 445 struct mgmt_addr_info addr;
446 __s8 rssi; 446 __s8 rssi;
447 __u8 flags[4]; 447 __le32 flags;
448 __le16 eir_len; 448 __le16 eir_len;
449 __u8 eir[0]; 449 __u8 eir[0];
450} __packed; 450} __packed;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 51f67a9003a9..493fa0c79005 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -999,7 +999,7 @@ struct cfg80211_ssid {
999 * @ie_len: length of ie in octets 999 * @ie_len: length of ie in octets
1000 * @rates: bitmap of rates to advertise for each band 1000 * @rates: bitmap of rates to advertise for each band
1001 * @wiphy: the wiphy this was for 1001 * @wiphy: the wiphy this was for
1002 * @dev: the interface 1002 * @wdev: the wireless device to scan for
1003 * @aborted: (internal) scan request was notified as aborted 1003 * @aborted: (internal) scan request was notified as aborted
1004 * @no_cck: used to send probe requests at non CCK rate in 2GHz band 1004 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
1005 */ 1005 */
@@ -1012,9 +1012,10 @@ struct cfg80211_scan_request {
1012 1012
1013 u32 rates[IEEE80211_NUM_BANDS]; 1013 u32 rates[IEEE80211_NUM_BANDS];
1014 1014
1015 struct wireless_dev *wdev;
1016
1015 /* internal */ 1017 /* internal */
1016 struct wiphy *wiphy; 1018 struct wiphy *wiphy;
1017 struct net_device *dev;
1018 bool aborted; 1019 bool aborted;
1019 bool no_cck; 1020 bool no_cck;
1020 1021
@@ -1435,10 +1436,10 @@ struct cfg80211_gtk_rekey_data {
1435 * 1436 *
1436 * @add_virtual_intf: create a new virtual interface with the given name, 1437 * @add_virtual_intf: create a new virtual interface with the given name,
1437 * must set the struct wireless_dev's iftype. Beware: You must create 1438 * must set the struct wireless_dev's iftype. Beware: You must create
1438 * the new netdev in the wiphy's network namespace! Returns the netdev, 1439 * the new netdev in the wiphy's network namespace! Returns the struct
1439 * or an ERR_PTR. 1440 * wireless_dev, or an ERR_PTR.
1440 * 1441 *
1441 * @del_virtual_intf: remove the virtual interface determined by ifindex. 1442 * @del_virtual_intf: remove the virtual interface
1442 * 1443 *
1443 * @change_virtual_intf: change type/configuration of virtual interface, 1444 * @change_virtual_intf: change type/configuration of virtual interface,
1444 * keep the struct wireless_dev's iftype updated. 1445 * keep the struct wireless_dev's iftype updated.
@@ -1503,8 +1504,6 @@ struct cfg80211_gtk_rekey_data {
1503 * interfaces are active this callback should reject the configuration. 1504 * interfaces are active this callback should reject the configuration.
1504 * If no interfaces are active or the device is down, the channel should 1505 * If no interfaces are active or the device is down, the channel should
1505 * be stored for when a monitor interface becomes active. 1506 * be stored for when a monitor interface becomes active.
1506 * @set_monitor_enabled: Notify driver that there are only monitor
1507 * interfaces running.
1508 * 1507 *
1509 * @scan: Request to do a scan. If returning zero, the scan request is given 1508 * @scan: Request to do a scan. If returning zero, the scan request is given
1510 * the driver, and will be valid until passed to cfg80211_scan_done(). 1509 * the driver, and will be valid until passed to cfg80211_scan_done().
@@ -1574,6 +1573,8 @@ struct cfg80211_gtk_rekey_data {
1574 * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 1573 * @set_power_mgmt: Configure WLAN power management. A timeout value of -1
1575 * allows the driver to adjust the dynamic ps timeout value. 1574 * allows the driver to adjust the dynamic ps timeout value.
1576 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. 1575 * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold.
1576 * @set_cqm_txe_config: Configure connection quality monitor TX error
1577 * thresholds.
1577 * @sched_scan_start: Tell the driver to start a scheduled scan. 1578 * @sched_scan_start: Tell the driver to start a scheduled scan.
1578 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled 1579 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled
1579 * scan. The driver_initiated flag specifies whether the driver 1580 * scan. The driver_initiated flag specifies whether the driver
@@ -1611,18 +1612,23 @@ struct cfg80211_gtk_rekey_data {
1611 * @get_et_strings: Ethtool API to get a set of strings to describe stats 1612 * @get_et_strings: Ethtool API to get a set of strings to describe stats
1612 * and perhaps other supported types of ethtool data-sets. 1613 * and perhaps other supported types of ethtool data-sets.
1613 * See @ethtool_ops.get_strings 1614 * See @ethtool_ops.get_strings
1615 *
1616 * @get_channel: Get the current operating channel for the virtual interface.
1617 * For monitor interfaces, it should return %NULL unless there's a single
1618 * current monitoring channel.
1614 */ 1619 */
1615struct cfg80211_ops { 1620struct cfg80211_ops {
1616 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1621 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
1617 int (*resume)(struct wiphy *wiphy); 1622 int (*resume)(struct wiphy *wiphy);
1618 void (*set_wakeup)(struct wiphy *wiphy, bool enabled); 1623 void (*set_wakeup)(struct wiphy *wiphy, bool enabled);
1619 1624
1620 struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, 1625 struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy,
1621 char *name, 1626 char *name,
1622 enum nl80211_iftype type, 1627 enum nl80211_iftype type,
1623 u32 *flags, 1628 u32 *flags,
1624 struct vif_params *params); 1629 struct vif_params *params);
1625 int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); 1630 int (*del_virtual_intf)(struct wiphy *wiphy,
1631 struct wireless_dev *wdev);
1626 int (*change_virtual_intf)(struct wiphy *wiphy, 1632 int (*change_virtual_intf)(struct wiphy *wiphy,
1627 struct net_device *dev, 1633 struct net_device *dev,
1628 enum nl80211_iftype type, u32 *flags, 1634 enum nl80211_iftype type, u32 *flags,
@@ -1699,7 +1705,7 @@ struct cfg80211_ops {
1699 struct ieee80211_channel *chan, 1705 struct ieee80211_channel *chan,
1700 enum nl80211_channel_type channel_type); 1706 enum nl80211_channel_type channel_type);
1701 1707
1702 int (*scan)(struct wiphy *wiphy, struct net_device *dev, 1708 int (*scan)(struct wiphy *wiphy,
1703 struct cfg80211_scan_request *request); 1709 struct cfg80211_scan_request *request);
1704 1710
1705 int (*auth)(struct wiphy *wiphy, struct net_device *dev, 1711 int (*auth)(struct wiphy *wiphy, struct net_device *dev,
@@ -1753,23 +1759,23 @@ struct cfg80211_ops {
1753 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); 1759 int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
1754 1760
1755 int (*remain_on_channel)(struct wiphy *wiphy, 1761 int (*remain_on_channel)(struct wiphy *wiphy,
1756 struct net_device *dev, 1762 struct wireless_dev *wdev,
1757 struct ieee80211_channel *chan, 1763 struct ieee80211_channel *chan,
1758 enum nl80211_channel_type channel_type, 1764 enum nl80211_channel_type channel_type,
1759 unsigned int duration, 1765 unsigned int duration,
1760 u64 *cookie); 1766 u64 *cookie);
1761 int (*cancel_remain_on_channel)(struct wiphy *wiphy, 1767 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
1762 struct net_device *dev, 1768 struct wireless_dev *wdev,
1763 u64 cookie); 1769 u64 cookie);
1764 1770
1765 int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, 1771 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
1766 struct ieee80211_channel *chan, bool offchan, 1772 struct ieee80211_channel *chan, bool offchan,
1767 enum nl80211_channel_type channel_type, 1773 enum nl80211_channel_type channel_type,
1768 bool channel_type_valid, unsigned int wait, 1774 bool channel_type_valid, unsigned int wait,
1769 const u8 *buf, size_t len, bool no_cck, 1775 const u8 *buf, size_t len, bool no_cck,
1770 bool dont_wait_for_ack, u64 *cookie); 1776 bool dont_wait_for_ack, u64 *cookie);
1771 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 1777 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
1772 struct net_device *dev, 1778 struct wireless_dev *wdev,
1773 u64 cookie); 1779 u64 cookie);
1774 1780
1775 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, 1781 int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
@@ -1779,8 +1785,12 @@ struct cfg80211_ops {
1779 struct net_device *dev, 1785 struct net_device *dev,
1780 s32 rssi_thold, u32 rssi_hyst); 1786 s32 rssi_thold, u32 rssi_hyst);
1781 1787
1788 int (*set_cqm_txe_config)(struct wiphy *wiphy,
1789 struct net_device *dev,
1790 u32 rate, u32 pkts, u32 intvl);
1791
1782 void (*mgmt_frame_register)(struct wiphy *wiphy, 1792 void (*mgmt_frame_register)(struct wiphy *wiphy,
1783 struct net_device *dev, 1793 struct wireless_dev *wdev,
1784 u16 frame_type, bool reg); 1794 u16 frame_type, bool reg);
1785 1795
1786 int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); 1796 int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
@@ -1818,7 +1828,10 @@ struct cfg80211_ops {
1818 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, 1828 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
1819 u32 sset, u8 *data); 1829 u32 sset, u8 *data);
1820 1830
1821 void (*set_monitor_enabled)(struct wiphy *wiphy, bool enabled); 1831 struct ieee80211_channel *
1832 (*get_channel)(struct wiphy *wiphy,
1833 struct wireless_dev *wdev,
1834 enum nl80211_channel_type *type);
1822}; 1835};
1823 1836
1824/* 1837/*
@@ -2341,17 +2354,25 @@ struct cfg80211_internal_bss;
2341struct cfg80211_cached_keys; 2354struct cfg80211_cached_keys;
2342 2355
2343/** 2356/**
2344 * struct wireless_dev - wireless per-netdev state 2357 * struct wireless_dev - wireless device state
2358 *
2359 * For netdevs, this structure must be allocated by the driver
2360 * that uses the ieee80211_ptr field in struct net_device (this
2361 * is intentional so it can be allocated along with the netdev.)
2362 * It need not be registered then as netdev registration will
2363 * be intercepted by cfg80211 to see the new wireless device.
2345 * 2364 *
2346 * This structure must be allocated by the driver/stack 2365 * For non-netdev uses, it must also be allocated by the driver
2347 * that uses the ieee80211_ptr field in struct net_device 2366 * in response to the cfg80211 callbacks that require it, as
2348 * (this is intentional so it can be allocated along with 2367 * there's no netdev registration in that case it may not be
2349 * the netdev.) 2368 * allocated outside of callback operations that return it.
2350 * 2369 *
2351 * @wiphy: pointer to hardware description 2370 * @wiphy: pointer to hardware description
2352 * @iftype: interface type 2371 * @iftype: interface type
2353 * @list: (private) Used to collect the interfaces 2372 * @list: (private) Used to collect the interfaces
2354 * @netdev: (private) Used to reference back to the netdev 2373 * @netdev: (private) Used to reference back to the netdev, may be %NULL
2374 * @identifier: (private) Identifier used in nl80211 to identify this
2375 * wireless device if it has no netdev
2355 * @current_bss: (private) Used by the internal configuration code 2376 * @current_bss: (private) Used by the internal configuration code
2356 * @channel: (private) Used by the internal configuration code to track 2377 * @channel: (private) Used by the internal configuration code to track
2357 * the user-set AP, monitor and WDS channel 2378 * the user-set AP, monitor and WDS channel
@@ -2383,6 +2404,8 @@ struct wireless_dev {
2383 struct list_head list; 2404 struct list_head list;
2384 struct net_device *netdev; 2405 struct net_device *netdev;
2385 2406
2407 u32 identifier;
2408
2386 struct list_head mgmt_registrations; 2409 struct list_head mgmt_registrations;
2387 spinlock_t mgmt_registrations_lock; 2410 spinlock_t mgmt_registrations_lock;
2388 2411
@@ -3269,7 +3292,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
3269 3292
3270/** 3293/**
3271 * cfg80211_ready_on_channel - notification of remain_on_channel start 3294 * cfg80211_ready_on_channel - notification of remain_on_channel start
3272 * @dev: network device 3295 * @wdev: wireless device
3273 * @cookie: the request cookie 3296 * @cookie: the request cookie
3274 * @chan: The current channel (from remain_on_channel request) 3297 * @chan: The current channel (from remain_on_channel request)
3275 * @channel_type: Channel type 3298 * @channel_type: Channel type
@@ -3277,21 +3300,20 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
3277 * channel 3300 * channel
3278 * @gfp: allocation flags 3301 * @gfp: allocation flags
3279 */ 3302 */
3280void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie, 3303void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
3281 struct ieee80211_channel *chan, 3304 struct ieee80211_channel *chan,
3282 enum nl80211_channel_type channel_type, 3305 enum nl80211_channel_type channel_type,
3283 unsigned int duration, gfp_t gfp); 3306 unsigned int duration, gfp_t gfp);
3284 3307
3285/** 3308/**
3286 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired 3309 * cfg80211_remain_on_channel_expired - remain_on_channel duration expired
3287 * @dev: network device 3310 * @wdev: wireless device
3288 * @cookie: the request cookie 3311 * @cookie: the request cookie
3289 * @chan: The current channel (from remain_on_channel request) 3312 * @chan: The current channel (from remain_on_channel request)
3290 * @channel_type: Channel type 3313 * @channel_type: Channel type
3291 * @gfp: allocation flags 3314 * @gfp: allocation flags
3292 */ 3315 */
3293void cfg80211_remain_on_channel_expired(struct net_device *dev, 3316void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
3294 u64 cookie,
3295 struct ieee80211_channel *chan, 3317 struct ieee80211_channel *chan,
3296 enum nl80211_channel_type channel_type, 3318 enum nl80211_channel_type channel_type,
3297 gfp_t gfp); 3319 gfp_t gfp);
@@ -3319,7 +3341,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3319 3341
3320/** 3342/**
3321 * cfg80211_rx_mgmt - notification of received, unprocessed management frame 3343 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
3322 * @dev: network device 3344 * @wdev: wireless device receiving the frame
3323 * @freq: Frequency on which the frame was received in MHz 3345 * @freq: Frequency on which the frame was received in MHz
3324 * @sig_dbm: signal strength in mBm, or 0 if unknown 3346 * @sig_dbm: signal strength in mBm, or 0 if unknown
3325 * @buf: Management frame (header + body) 3347 * @buf: Management frame (header + body)
@@ -3334,12 +3356,12 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp);
3334 * This function is called whenever an Action frame is received for a station 3356 * This function is called whenever an Action frame is received for a station
3335 * mode interface, but is not processed in kernel. 3357 * mode interface, but is not processed in kernel.
3336 */ 3358 */
3337bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, 3359bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
3338 const u8 *buf, size_t len, gfp_t gfp); 3360 const u8 *buf, size_t len, gfp_t gfp);
3339 3361
3340/** 3362/**
3341 * cfg80211_mgmt_tx_status - notification of TX status for management frame 3363 * cfg80211_mgmt_tx_status - notification of TX status for management frame
3342 * @dev: network device 3364 * @wdev: wireless device receiving the frame
3343 * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() 3365 * @cookie: Cookie returned by cfg80211_ops::mgmt_tx()
3344 * @buf: Management frame (header + body) 3366 * @buf: Management frame (header + body)
3345 * @len: length of the frame data 3367 * @len: length of the frame data
@@ -3350,7 +3372,7 @@ bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm,
3350 * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the 3372 * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the
3351 * transmission attempt. 3373 * transmission attempt.
3352 */ 3374 */
3353void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, 3375void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
3354 const u8 *buf, size_t len, bool ack, gfp_t gfp); 3376 const u8 *buf, size_t len, bool ack, gfp_t gfp);
3355 3377
3356 3378
@@ -3380,6 +3402,21 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3380 const u8 *peer, u32 num_packets, gfp_t gfp); 3402 const u8 *peer, u32 num_packets, gfp_t gfp);
3381 3403
3382/** 3404/**
3405 * cfg80211_cqm_txe_notify - TX error rate event
3406 * @dev: network device
3407 * @peer: peer's MAC address
3408 * @num_packets: how many packets were lost
3409 * @rate: % of packets which failed transmission
3410 * @intvl: interval (in s) over which the TX failure threshold was breached.
3411 * @gfp: context flags
3412 *
3413 * Notify userspace when configured % TX failures over number of packets in a
3414 * given interval is exceeded.
3415 */
3416void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer,
3417 u32 num_packets, u32 rate, u32 intvl, gfp_t gfp);
3418
3419/**
3383 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying 3420 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
3384 * @dev: network device 3421 * @dev: network device
3385 * @bssid: BSSID of AP (to avoid races) 3422 * @bssid: BSSID of AP (to avoid races)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e3fa90ce9ecb..bb86aa6f98dd 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -233,8 +233,10 @@ enum ieee80211_rssi_event {
233 * valid in station mode only while @assoc is true and if also 233 * valid in station mode only while @assoc is true and if also
234 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf 234 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf
235 * @ps_dtim_period) 235 * @ps_dtim_period)
236 * @last_tsf: last beacon's/probe response's TSF timestamp (could be old 236 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
237 * as it may have been received during scanning long ago) 237 * as it may have been received during scanning long ago)
238 * @sync_device_ts: the device timestamp corresponding to the sync_tsf,
239 * the driver/device can use this to calculate synchronisation
238 * @beacon_int: beacon interval 240 * @beacon_int: beacon interval
239 * @assoc_capability: capabilities taken from assoc resp 241 * @assoc_capability: capabilities taken from assoc resp
240 * @basic_rates: bitmap of basic rates, each bit stands for an 242 * @basic_rates: bitmap of basic rates, each bit stands for an
@@ -281,7 +283,8 @@ struct ieee80211_bss_conf {
281 u8 dtim_period; 283 u8 dtim_period;
282 u16 beacon_int; 284 u16 beacon_int;
283 u16 assoc_capability; 285 u16 assoc_capability;
284 u64 last_tsf; 286 u64 sync_tsf;
287 u32 sync_device_ts;
285 u32 basic_rates; 288 u32 basic_rates;
286 int mcast_rate[IEEE80211_NUM_BANDS]; 289 int mcast_rate[IEEE80211_NUM_BANDS];
287 u16 ht_operation_mode; 290 u16 ht_operation_mode;
@@ -696,6 +699,8 @@ enum mac80211_rx_flags {
696 * 699 *
697 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 700 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
698 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 701 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
702 * @device_timestamp: arbitrary timestamp for the device, mac80211 doesn't use
703 * it but can store it and pass it back to the driver for synchronisation
699 * @band: the active band when this frame was received 704 * @band: the active band when this frame was received
700 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 705 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
701 * @signal: signal strength when receiving this frame, either in dBm, in dB or 706 * @signal: signal strength when receiving this frame, either in dBm, in dB or
@@ -709,13 +714,14 @@ enum mac80211_rx_flags {
709 */ 714 */
710struct ieee80211_rx_status { 715struct ieee80211_rx_status {
711 u64 mactime; 716 u64 mactime;
712 enum ieee80211_band band; 717 u32 device_timestamp;
713 int freq; 718 u16 flag;
714 int signal; 719 u16 freq;
715 int antenna; 720 u8 rate_idx;
716 int rate_idx; 721 u8 rx_flags;
717 int flag; 722 u8 band;
718 unsigned int rx_flags; 723 u8 antenna;
724 s8 signal;
719}; 725};
720 726
721/** 727/**
@@ -3592,22 +3598,6 @@ void ieee80211_request_smps(struct ieee80211_vif *vif,
3592 enum ieee80211_smps_mode smps_mode); 3598 enum ieee80211_smps_mode smps_mode);
3593 3599
3594/** 3600/**
3595 * ieee80211_key_removed - disable hw acceleration for key
3596 * @key_conf: The key hw acceleration should be disabled for
3597 *
3598 * This allows drivers to indicate that the given key has been
3599 * removed from hardware acceleration, due to a new key that
3600 * was added. Don't use this if the key can continue to be used
3601 * for TX, if the key restriction is on RX only it is permitted
3602 * to keep the key for TX only and not call this function.
3603 *
3604 * Due to locking constraints, it may only be called during
3605 * @set_key. This function must be allowed to sleep, and the
3606 * key it tries to disable may still be used until it returns.
3607 */
3608void ieee80211_key_removed(struct ieee80211_key_conf *key_conf);
3609
3610/**
3611 * ieee80211_ready_on_channel - notification of remain-on-channel start 3601 * ieee80211_ready_on_channel - notification of remain-on-channel start
3612 * @hw: pointer as obtained from ieee80211_alloc_hw() 3602 * @hw: pointer as obtained from ieee80211_alloc_hw()
3613 */ 3603 */
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index a5f79933e211..7dcaa2794fde 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -52,6 +52,10 @@ enum environment_cap {
52 * DFS master operation on a known DFS region (NL80211_DFS_*), 52 * DFS master operation on a known DFS region (NL80211_DFS_*),
53 * dfs_region represents that region. Drivers can use this and the 53 * dfs_region represents that region. Drivers can use this and the
54 * @alpha2 to adjust their device's DFS parameters as required. 54 * @alpha2 to adjust their device's DFS parameters as required.
55 * @user_reg_hint_type: if the @initiator was of type
56 * %NL80211_REGDOM_SET_BY_USER, this classifies the type
57 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_*
58 * types.
55 * @intersect: indicates whether the wireless core should intersect 59 * @intersect: indicates whether the wireless core should intersect
56 * the requested regulatory domain with the presently set regulatory 60 * the requested regulatory domain with the presently set regulatory
57 * domain. 61 * domain.
@@ -70,6 +74,7 @@ enum environment_cap {
70struct regulatory_request { 74struct regulatory_request {
71 int wiphy_idx; 75 int wiphy_idx;
72 enum nl80211_reg_initiator initiator; 76 enum nl80211_reg_initiator initiator;
77 enum nl80211_user_reg_hint_type user_reg_hint_type;
73 char alpha2[2]; 78 char alpha2[2];
74 u8 dfs_region; 79 u8 dfs_region;
75 bool intersect; 80 bool intersect;