aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h36
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/tty.h6
-rw-r--r--include/linux/wl12xx.h24
-rw-r--r--include/net/bluetooth/bluetooth.h1
-rw-r--r--include/net/bluetooth/hci.h76
-rw-r--r--include/net/bluetooth/hci_core.h197
-rw-r--r--include/net/bluetooth/l2cap.h8
-rw-r--r--include/net/bluetooth/mgmt.h51
-rw-r--r--include/net/bluetooth/rfcomm.h10
-rw-r--r--include/net/cfg80211.h24
-rw-r--r--include/net/mac80211.h43
-rw-r--r--include/uapi/linux/nl80211.h42
13 files changed, 391 insertions, 128 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 5f349355ee54..06299048c4f4 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2308,42 +2308,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
2308} 2308}
2309 2309
2310/** 2310/**
2311 * ieee80211_dsss_chan_to_freq - get channel center frequency
2312 * @channel: the DSSS channel
2313 *
2314 * Convert IEEE802.11 DSSS channel to the center frequency (MHz).
2315 * Ref IEEE 802.11-2007 section 15.6
2316 */
2317static inline int ieee80211_dsss_chan_to_freq(int channel)
2318{
2319 if ((channel > 0) && (channel < 14))
2320 return 2407 + (channel * 5);
2321 else if (channel == 14)
2322 return 2484;
2323 else
2324 return -1;
2325}
2326
2327/**
2328 * ieee80211_freq_to_dsss_chan - get channel
2329 * @freq: the frequency
2330 *
2331 * Convert frequency (MHz) to IEEE802.11 DSSS channel
2332 * Ref IEEE 802.11-2007 section 15.6
2333 *
2334 * This routine selects the channel with the closest center frequency.
2335 */
2336static inline int ieee80211_freq_to_dsss_chan(int freq)
2337{
2338 if ((freq >= 2410) && (freq < 2475))
2339 return (freq - 2405) / 5;
2340 else if ((freq >= 2482) && (freq < 2487))
2341 return 14;
2342 else
2343 return -1;
2344}
2345
2346/**
2347 * ieee80211_tu_to_usec - convert time units (TU) to microseconds 2311 * ieee80211_tu_to_usec - convert time units (TU) to microseconds
2348 * @tu: the TUs 2312 * @tu: the TUs
2349 */ 2313 */
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 3737f7218f51..7bb6148d990f 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -23,6 +23,7 @@
23#define TEMP_MINOR 131 /* Temperature Sensor */ 23#define TEMP_MINOR 131 /* Temperature Sensor */
24#define RTC_MINOR 135 24#define RTC_MINOR 135
25#define EFI_RTC_MINOR 136 /* EFI Time services */ 25#define EFI_RTC_MINOR 136 /* EFI Time services */
26#define VHCI_MINOR 137
26#define SUN_OPENPROM_MINOR 139 27#define SUN_OPENPROM_MINOR 139
27#define DMAPI_MINOR 140 /* DMAPI */ 28#define DMAPI_MINOR 140 /* DMAPI */
28#define NVRAM_MINOR 144 29#define NVRAM_MINOR 144
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 90b4fdc8a61f..4781d7b27dd3 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -518,9 +518,9 @@ extern void tty_port_put(struct tty_port *port);
518 518
519static inline struct tty_port *tty_port_get(struct tty_port *port) 519static inline struct tty_port *tty_port_get(struct tty_port *port)
520{ 520{
521 if (port) 521 if (port && kref_get_unless_zero(&port->kref))
522 kref_get(&port->kref); 522 return port;
523 return port; 523 return NULL;
524} 524}
525 525
526/* If the cts flow control is enabled, return true. */ 526/* If the cts flow control is enabled, return true. */
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index a54fe82e704b..a9c723be1acf 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -48,11 +48,15 @@ enum {
48 WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */ 48 WL12XX_TCXOCLOCK_33_6 = 7, /* 33.6 MHz */
49}; 49};
50 50
51struct wl12xx_platform_data { 51struct wl1251_platform_data {
52 void (*set_power)(bool enable); 52 int power_gpio;
53 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ 53 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
54 int irq; 54 int irq;
55 bool use_eeprom; 55 bool use_eeprom;
56};
57
58struct wl12xx_platform_data {
59 int irq;
56 int board_ref_clock; 60 int board_ref_clock;
57 int board_tcxo_clock; 61 int board_tcxo_clock;
58 unsigned long platform_quirks; 62 unsigned long platform_quirks;
@@ -68,6 +72,10 @@ int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
68 72
69struct wl12xx_platform_data *wl12xx_get_platform_data(void); 73struct wl12xx_platform_data *wl12xx_get_platform_data(void);
70 74
75int wl1251_set_platform_data(const struct wl1251_platform_data *data);
76
77struct wl1251_platform_data *wl1251_get_platform_data(void);
78
71#else 79#else
72 80
73static inline 81static inline
@@ -82,6 +90,18 @@ struct wl12xx_platform_data *wl12xx_get_platform_data(void)
82 return ERR_PTR(-ENODATA); 90 return ERR_PTR(-ENODATA);
83} 91}
84 92
93static inline
94int wl1251_set_platform_data(const struct wl1251_platform_data *data)
95{
96 return -ENOSYS;
97}
98
99static inline
100struct wl1251_platform_data *wl1251_get_platform_data(void)
101{
102 return ERR_PTR(-ENODATA);
103}
104
85#endif 105#endif
86 106
87#endif 107#endif
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index f4f9ee466791..904777c1cd24 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -65,6 +65,7 @@ struct bt_security {
65#define BT_SECURITY_LOW 1 65#define BT_SECURITY_LOW 1
66#define BT_SECURITY_MEDIUM 2 66#define BT_SECURITY_MEDIUM 2
67#define BT_SECURITY_HIGH 3 67#define BT_SECURITY_HIGH 3
68#define BT_SECURITY_FIPS 4
68 69
69#define BT_DEFER_SETUP 7 70#define BT_DEFER_SETUP 7
70 71
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 66c1cd87bfe7..be150cf8cd43 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -117,11 +117,18 @@ enum {
117 HCI_SERVICE_CACHE, 117 HCI_SERVICE_CACHE,
118 HCI_DEBUG_KEYS, 118 HCI_DEBUG_KEYS,
119 HCI_DUT_MODE, 119 HCI_DUT_MODE,
120 HCI_FORCE_SC,
121 HCI_FORCE_STATIC_ADDR,
120 HCI_UNREGISTER, 122 HCI_UNREGISTER,
121 HCI_USER_CHANNEL, 123 HCI_USER_CHANNEL,
122 124
123 HCI_LE_SCAN, 125 HCI_LE_SCAN,
124 HCI_SSP_ENABLED, 126 HCI_SSP_ENABLED,
127 HCI_SC_ENABLED,
128 HCI_SC_ONLY,
129 HCI_PRIVACY,
130 HCI_RPA_EXPIRED,
131 HCI_RPA_RESOLVING,
125 HCI_HS_ENABLED, 132 HCI_HS_ENABLED,
126 HCI_LE_ENABLED, 133 HCI_LE_ENABLED,
127 HCI_ADVERTISING, 134 HCI_ADVERTISING,
@@ -133,6 +140,7 @@ enum {
133 HCI_FAST_CONNECTABLE, 140 HCI_FAST_CONNECTABLE,
134 HCI_BREDR_ENABLED, 141 HCI_BREDR_ENABLED,
135 HCI_6LOWPAN_ENABLED, 142 HCI_6LOWPAN_ENABLED,
143 HCI_LE_SCAN_INTERRUPTED,
136}; 144};
137 145
138/* A mask for the flags that are supposed to remain when a reset happens 146/* A mask for the flags that are supposed to remain when a reset happens
@@ -175,6 +183,8 @@ enum {
175#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 183#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
176#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 184#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
177#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 185#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
186#define HCI_POWER_OFF_TIMEOUT msecs_to_jiffies(5000) /* 5 seconds */
187#define HCI_LE_CONN_TIMEOUT msecs_to_jiffies(20000) /* 20 seconds */
178 188
179/* HCI data types */ 189/* HCI data types */
180#define HCI_COMMAND_PKT 0x01 190#define HCI_COMMAND_PKT 0x01
@@ -282,10 +292,14 @@ enum {
282#define LMP_SYNC_TRAIN 0x04 292#define LMP_SYNC_TRAIN 0x04
283#define LMP_SYNC_SCAN 0x08 293#define LMP_SYNC_SCAN 0x08
284 294
295#define LMP_SC 0x01
296#define LMP_PING 0x02
297
285/* Host features */ 298/* Host features */
286#define LMP_HOST_SSP 0x01 299#define LMP_HOST_SSP 0x01
287#define LMP_HOST_LE 0x02 300#define LMP_HOST_LE 0x02
288#define LMP_HOST_LE_BREDR 0x04 301#define LMP_HOST_LE_BREDR 0x04
302#define LMP_HOST_SC 0x08
289 303
290/* Connection modes */ 304/* Connection modes */
291#define HCI_CM_ACTIVE 0x0000 305#define HCI_CM_ACTIVE 0x0000
@@ -307,6 +321,7 @@ enum {
307#define HCI_LM_TRUSTED 0x0008 321#define HCI_LM_TRUSTED 0x0008
308#define HCI_LM_RELIABLE 0x0010 322#define HCI_LM_RELIABLE 0x0010
309#define HCI_LM_SECURE 0x0020 323#define HCI_LM_SECURE 0x0020
324#define HCI_LM_FIPS 0x0040
310 325
311/* Authentication types */ 326/* Authentication types */
312#define HCI_AT_NO_BONDING 0x00 327#define HCI_AT_NO_BONDING 0x00
@@ -327,17 +342,24 @@ enum {
327#define HCI_LK_LOCAL_UNIT 0x01 342#define HCI_LK_LOCAL_UNIT 0x01
328#define HCI_LK_REMOTE_UNIT 0x02 343#define HCI_LK_REMOTE_UNIT 0x02
329#define HCI_LK_DEBUG_COMBINATION 0x03 344#define HCI_LK_DEBUG_COMBINATION 0x03
330#define HCI_LK_UNAUTH_COMBINATION 0x04 345#define HCI_LK_UNAUTH_COMBINATION_P192 0x04
331#define HCI_LK_AUTH_COMBINATION 0x05 346#define HCI_LK_AUTH_COMBINATION_P192 0x05
332#define HCI_LK_CHANGED_COMBINATION 0x06 347#define HCI_LK_CHANGED_COMBINATION 0x06
348#define HCI_LK_UNAUTH_COMBINATION_P256 0x07
349#define HCI_LK_AUTH_COMBINATION_P256 0x08
333/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */ 350/* The spec doesn't define types for SMP keys, the _MASTER suffix is implied */
334#define HCI_SMP_STK 0x80 351#define HCI_SMP_STK 0x80
335#define HCI_SMP_STK_SLAVE 0x81 352#define HCI_SMP_STK_SLAVE 0x81
336#define HCI_SMP_LTK 0x82 353#define HCI_SMP_LTK 0x82
337#define HCI_SMP_LTK_SLAVE 0x83 354#define HCI_SMP_LTK_SLAVE 0x83
338 355
356/* Long Term Key types */
357#define HCI_LTK_UNAUTH 0x00
358#define HCI_LTK_AUTH 0x01
359
339/* ---- HCI Error Codes ---- */ 360/* ---- HCI Error Codes ---- */
340#define HCI_ERROR_AUTH_FAILURE 0x05 361#define HCI_ERROR_AUTH_FAILURE 0x05
362#define HCI_ERROR_MEMORY_EXCEEDED 0x07
341#define HCI_ERROR_CONNECTION_TIMEOUT 0x08 363#define HCI_ERROR_CONNECTION_TIMEOUT 0x08
342#define HCI_ERROR_REJ_BAD_ADDR 0x0f 364#define HCI_ERROR_REJ_BAD_ADDR 0x0f
343#define HCI_ERROR_REMOTE_USER_TERM 0x13 365#define HCI_ERROR_REMOTE_USER_TERM 0x13
@@ -660,6 +682,15 @@ struct hci_rp_set_csb {
660 682
661#define HCI_OP_START_SYNC_TRAIN 0x0443 683#define HCI_OP_START_SYNC_TRAIN 0x0443
662 684
685#define HCI_OP_REMOTE_OOB_EXT_DATA_REPLY 0x0445
686struct hci_cp_remote_oob_ext_data_reply {
687 bdaddr_t bdaddr;
688 __u8 hash192[16];
689 __u8 randomizer192[16];
690 __u8 hash256[16];
691 __u8 randomizer256[16];
692} __packed;
693
663#define HCI_OP_SNIFF_MODE 0x0803 694#define HCI_OP_SNIFF_MODE 0x0803
664struct hci_cp_sniff_mode { 695struct hci_cp_sniff_mode {
665 __le16 handle; 696 __le16 handle;
@@ -933,6 +964,26 @@ struct hci_rp_write_sync_train_params {
933 __le16 sync_train_int; 964 __le16 sync_train_int;
934} __packed; 965} __packed;
935 966
967#define HCI_OP_READ_SC_SUPPORT 0x0c79
968struct hci_rp_read_sc_support {
969 __u8 status;
970 __u8 support;
971} __packed;
972
973#define HCI_OP_WRITE_SC_SUPPORT 0x0c7a
974struct hci_cp_write_sc_support {
975 __u8 support;
976} __packed;
977
978#define HCI_OP_READ_LOCAL_OOB_EXT_DATA 0x0c7d
979struct hci_rp_read_local_oob_ext_data {
980 __u8 status;
981 __u8 hash192[16];
982 __u8 randomizer192[16];
983 __u8 hash256[16];
984 __u8 randomizer256[16];
985} __packed;
986
936#define HCI_OP_READ_LOCAL_VERSION 0x1001 987#define HCI_OP_READ_LOCAL_VERSION 0x1001
937struct hci_rp_read_local_version { 988struct hci_rp_read_local_version {
938 __u8 status; 989 __u8 status;
@@ -1133,6 +1184,9 @@ struct hci_cp_le_set_scan_enable {
1133 __u8 filter_dup; 1184 __u8 filter_dup;
1134} __packed; 1185} __packed;
1135 1186
1187#define HCI_LE_USE_PEER_ADDR 0x00
1188#define HCI_LE_USE_WHITELIST 0x01
1189
1136#define HCI_OP_LE_CREATE_CONN 0x200d 1190#define HCI_OP_LE_CREATE_CONN 0x200d
1137struct hci_cp_le_create_conn { 1191struct hci_cp_le_create_conn {
1138 __le16 scan_interval; 1192 __le16 scan_interval;
@@ -1157,6 +1211,20 @@ struct hci_rp_le_read_white_list_size {
1157 __u8 size; 1211 __u8 size;
1158} __packed; 1212} __packed;
1159 1213
1214#define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010
1215
1216#define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011
1217struct hci_cp_le_add_to_white_list {
1218 __u8 bdaddr_type;
1219 bdaddr_t bdaddr;
1220} __packed;
1221
1222#define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012
1223struct hci_cp_le_del_from_white_list {
1224 __u8 bdaddr_type;
1225 bdaddr_t bdaddr;
1226} __packed;
1227
1160#define HCI_OP_LE_CONN_UPDATE 0x2013 1228#define HCI_OP_LE_CONN_UPDATE 0x2013
1161struct hci_cp_le_conn_update { 1229struct hci_cp_le_conn_update {
1162 __le16 handle; 1230 __le16 handle;
@@ -1171,7 +1239,7 @@ struct hci_cp_le_conn_update {
1171#define HCI_OP_LE_START_ENC 0x2019 1239#define HCI_OP_LE_START_ENC 0x2019
1172struct hci_cp_le_start_enc { 1240struct hci_cp_le_start_enc {
1173 __le16 handle; 1241 __le16 handle;
1174 __u8 rand[8]; 1242 __le64 rand;
1175 __le16 ediv; 1243 __le16 ediv;
1176 __u8 ltk[16]; 1244 __u8 ltk[16];
1177} __packed; 1245} __packed;
@@ -1583,7 +1651,7 @@ struct hci_ev_le_conn_complete {
1583#define HCI_EV_LE_LTK_REQ 0x05 1651#define HCI_EV_LE_LTK_REQ 0x05
1584struct hci_ev_le_ltk_req { 1652struct hci_ev_le_ltk_req {
1585 __le16 handle; 1653 __le16 handle;
1586 __u8 random[8]; 1654 __le64 rand;
1587 __le16 ediv; 1655 __le16 ediv;
1588} __packed; 1656} __packed;
1589 1657
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f2f0cf5865c4..dbb788e4f265 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -99,9 +99,17 @@ struct smp_ltk {
99 u8 type; 99 u8 type;
100 u8 enc_size; 100 u8 enc_size;
101 __le16 ediv; 101 __le16 ediv;
102 u8 rand[8]; 102 __le64 rand;
103 u8 val[16]; 103 u8 val[16];
104} __packed; 104};
105
106struct smp_irk {
107 struct list_head list;
108 bdaddr_t rpa;
109 bdaddr_t bdaddr;
110 u8 addr_type;
111 u8 val[16];
112};
105 113
106struct link_key { 114struct link_key {
107 struct list_head list; 115 struct list_head list;
@@ -114,12 +122,17 @@ struct link_key {
114struct oob_data { 122struct oob_data {
115 struct list_head list; 123 struct list_head list;
116 bdaddr_t bdaddr; 124 bdaddr_t bdaddr;
117 u8 hash[16]; 125 u8 hash192[16];
118 u8 randomizer[16]; 126 u8 randomizer192[16];
127 u8 hash256[16];
128 u8 randomizer256[16];
119}; 129};
120 130
121#define HCI_MAX_SHORT_NAME_LENGTH 10 131#define HCI_MAX_SHORT_NAME_LENGTH 10
122 132
133/* Default LE RPA expiry time, 15 minutes */
134#define HCI_DEFAULT_RPA_TIMEOUT (15 * 60)
135
123struct amp_assoc { 136struct amp_assoc {
124 __u16 len; 137 __u16 len;
125 __u16 offset; 138 __u16 offset;
@@ -141,8 +154,9 @@ struct hci_dev {
141 __u8 bus; 154 __u8 bus;
142 __u8 dev_type; 155 __u8 dev_type;
143 bdaddr_t bdaddr; 156 bdaddr_t bdaddr;
157 bdaddr_t random_addr;
144 bdaddr_t static_addr; 158 bdaddr_t static_addr;
145 __u8 own_addr_type; 159 __u8 adv_addr_type;
146 __u8 dev_name[HCI_MAX_NAME_LENGTH]; 160 __u8 dev_name[HCI_MAX_NAME_LENGTH];
147 __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH]; 161 __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH];
148 __u8 eir[HCI_MAX_EIR_LENGTH]; 162 __u8 eir[HCI_MAX_EIR_LENGTH];
@@ -167,6 +181,7 @@ struct hci_dev {
167 __u16 page_scan_interval; 181 __u16 page_scan_interval;
168 __u16 page_scan_window; 182 __u16 page_scan_window;
169 __u8 page_scan_type; 183 __u8 page_scan_type;
184 __u8 le_adv_channel_map;
170 __u16 le_scan_interval; 185 __u16 le_scan_interval;
171 __u16 le_scan_window; 186 __u16 le_scan_window;
172 __u16 le_conn_min_interval; 187 __u16 le_conn_min_interval;
@@ -257,19 +272,21 @@ struct hci_dev {
257 __u32 req_status; 272 __u32 req_status;
258 __u32 req_result; 273 __u32 req_result;
259 274
260 struct list_head mgmt_pending; 275 struct crypto_blkcipher *tfm_aes;
261 276
262 struct discovery_state discovery; 277 struct discovery_state discovery;
263 struct hci_conn_hash conn_hash; 278 struct hci_conn_hash conn_hash;
264 struct list_head blacklist;
265 279
280 struct list_head mgmt_pending;
281 struct list_head blacklist;
266 struct list_head uuids; 282 struct list_head uuids;
267
268 struct list_head link_keys; 283 struct list_head link_keys;
269
270 struct list_head long_term_keys; 284 struct list_head long_term_keys;
271 285 struct list_head identity_resolving_keys;
272 struct list_head remote_oob_data; 286 struct list_head remote_oob_data;
287 struct list_head le_white_list;
288 struct list_head le_conn_params;
289 struct list_head pend_le_conns;
273 290
274 struct hci_dev_stats stat; 291 struct hci_dev_stats stat;
275 292
@@ -291,6 +308,11 @@ struct hci_dev {
291 __u8 scan_rsp_data[HCI_MAX_AD_LENGTH]; 308 __u8 scan_rsp_data[HCI_MAX_AD_LENGTH];
292 __u8 scan_rsp_data_len; 309 __u8 scan_rsp_data_len;
293 310
311 __u8 irk[16];
312 __u32 rpa_timeout;
313 struct delayed_work rpa_expired;
314 bdaddr_t rpa;
315
294 int (*open)(struct hci_dev *hdev); 316 int (*open)(struct hci_dev *hdev);
295 int (*close)(struct hci_dev *hdev); 317 int (*close)(struct hci_dev *hdev);
296 int (*flush)(struct hci_dev *hdev); 318 int (*flush)(struct hci_dev *hdev);
@@ -310,6 +332,10 @@ struct hci_conn {
310 __u8 dst_type; 332 __u8 dst_type;
311 bdaddr_t src; 333 bdaddr_t src;
312 __u8 src_type; 334 __u8 src_type;
335 bdaddr_t init_addr;
336 __u8 init_addr_type;
337 bdaddr_t resp_addr;
338 __u8 resp_addr_type;
313 __u16 handle; 339 __u16 handle;
314 __u16 state; 340 __u16 state;
315 __u8 mode; 341 __u8 mode;
@@ -332,6 +358,8 @@ struct hci_conn {
332 __u8 passkey_entered; 358 __u8 passkey_entered;
333 __u16 disc_timeout; 359 __u16 disc_timeout;
334 __u16 setting; 360 __u16 setting;
361 __u16 le_conn_min_interval;
362 __u16 le_conn_max_interval;
335 unsigned long flags; 363 unsigned long flags;
336 364
337 __u8 remote_cap; 365 __u8 remote_cap;
@@ -347,6 +375,7 @@ struct hci_conn {
347 struct delayed_work disc_work; 375 struct delayed_work disc_work;
348 struct delayed_work auto_accept_work; 376 struct delayed_work auto_accept_work;
349 struct delayed_work idle_work; 377 struct delayed_work idle_work;
378 struct delayed_work le_conn_timeout;
350 379
351 struct device dev; 380 struct device dev;
352 381
@@ -372,6 +401,22 @@ struct hci_chan {
372 __u8 state; 401 __u8 state;
373}; 402};
374 403
404struct hci_conn_params {
405 struct list_head list;
406
407 bdaddr_t addr;
408 u8 addr_type;
409
410 u16 conn_min_interval;
411 u16 conn_max_interval;
412
413 enum {
414 HCI_AUTO_CONN_DISABLED,
415 HCI_AUTO_CONN_ALWAYS,
416 HCI_AUTO_CONN_LINK_LOSS,
417 } auto_connect;
418};
419
375extern struct list_head hci_dev_list; 420extern struct list_head hci_dev_list;
376extern struct list_head hci_cb_list; 421extern struct list_head hci_cb_list;
377extern rwlock_t hci_dev_list_lock; 422extern rwlock_t hci_dev_list_lock;
@@ -446,6 +491,8 @@ enum {
446 HCI_CONN_LE_SMP_PEND, 491 HCI_CONN_LE_SMP_PEND,
447 HCI_CONN_MGMT_CONNECTED, 492 HCI_CONN_MGMT_CONNECTED,
448 HCI_CONN_SSP_ENABLED, 493 HCI_CONN_SSP_ENABLED,
494 HCI_CONN_SC_ENABLED,
495 HCI_CONN_AES_CCM,
449 HCI_CONN_POWER_SAVE, 496 HCI_CONN_POWER_SAVE,
450 HCI_CONN_REMOTE_OOB, 497 HCI_CONN_REMOTE_OOB,
451 HCI_CONN_6LOWPAN, 498 HCI_CONN_6LOWPAN,
@@ -458,6 +505,13 @@ static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
458 test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); 505 test_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
459} 506}
460 507
508static inline bool hci_conn_sc_enabled(struct hci_conn *conn)
509{
510 struct hci_dev *hdev = conn->hdev;
511 return test_bit(HCI_SC_ENABLED, &hdev->dev_flags) &&
512 test_bit(HCI_CONN_SC_ENABLED, &conn->flags);
513}
514
461static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) 515static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
462{ 516{
463 struct hci_conn_hash *h = &hdev->conn_hash; 517 struct hci_conn_hash *h = &hdev->conn_hash;
@@ -521,6 +575,13 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
521 } 575 }
522} 576}
523 577
578static inline unsigned int hci_conn_count(struct hci_dev *hdev)
579{
580 struct hci_conn_hash *c = &hdev->conn_hash;
581
582 return c->acl_num + c->amp_num + c->sco_num + c->le_num;
583}
584
524static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, 585static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
525 __u16 handle) 586 __u16 handle)
526{ 587{
@@ -594,8 +655,10 @@ void hci_chan_del(struct hci_chan *chan);
594void hci_chan_list_flush(struct hci_conn *conn); 655void hci_chan_list_flush(struct hci_conn *conn);
595struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); 656struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
596 657
597struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 658struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
598 __u8 dst_type, __u8 sec_level, __u8 auth_type); 659 u8 dst_type, u8 sec_level, u8 auth_type);
660struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
661 u8 sec_level, u8 auth_type);
599struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, 662struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
600 __u16 setting); 663 __u16 setting);
601int hci_conn_check_link_mode(struct hci_conn *conn); 664int hci_conn_check_link_mode(struct hci_conn *conn);
@@ -606,6 +669,8 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
606 669
607void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); 670void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active);
608 671
672void hci_le_conn_failed(struct hci_conn *conn, u8 status);
673
609/* 674/*
610 * hci_conn_get() and hci_conn_put() are used to control the life-time of an 675 * hci_conn_get() and hci_conn_put() are used to control the life-time of an
611 * "hci_conn" object. They do not guarantee that the hci_conn object is running, 676 * "hci_conn" object. They do not guarantee that the hci_conn object is running,
@@ -737,31 +802,64 @@ int hci_inquiry(void __user *arg);
737 802
738struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, 803struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev,
739 bdaddr_t *bdaddr, u8 type); 804 bdaddr_t *bdaddr, u8 type);
740int hci_blacklist_clear(struct hci_dev *hdev);
741int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 805int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
742int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 806int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
743 807
744int hci_uuids_clear(struct hci_dev *hdev); 808struct bdaddr_list *hci_white_list_lookup(struct hci_dev *hdev,
809 bdaddr_t *bdaddr, u8 type);
810void hci_white_list_clear(struct hci_dev *hdev);
811int hci_white_list_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
812int hci_white_list_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
813
814struct hci_conn_params *hci_conn_params_lookup(struct hci_dev *hdev,
815 bdaddr_t *addr, u8 addr_type);
816int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
817 u8 auto_connect, u16 conn_min_interval,
818 u16 conn_max_interval);
819void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
820void hci_conn_params_clear(struct hci_dev *hdev);
745 821
746int hci_link_keys_clear(struct hci_dev *hdev); 822struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
823 bdaddr_t *addr, u8 addr_type);
824void hci_pend_le_conn_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
825void hci_pend_le_conn_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
826void hci_pend_le_conns_clear(struct hci_dev *hdev);
827
828void hci_update_background_scan(struct hci_dev *hdev);
829
830void hci_uuids_clear(struct hci_dev *hdev);
831
832void hci_link_keys_clear(struct hci_dev *hdev);
747struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 833struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
748int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, 834int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
749 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); 835 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
750struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); 836struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand,
751int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type, 837 bool master);
752 int new_key, u8 authenticated, u8 tk[16], u8 enc_size, 838struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
753 __le16 ediv, u8 rand[8]); 839 u8 addr_type, u8 type, u8 authenticated,
840 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand);
754struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, 841struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
755 u8 addr_type); 842 u8 addr_type, bool master);
756int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr); 843int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
757int hci_smp_ltks_clear(struct hci_dev *hdev); 844void hci_smp_ltks_clear(struct hci_dev *hdev);
758int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 845int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
759 846
760int hci_remote_oob_data_clear(struct hci_dev *hdev); 847struct smp_irk *hci_find_irk_by_rpa(struct hci_dev *hdev, bdaddr_t *rpa);
848struct smp_irk *hci_find_irk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
849 u8 addr_type);
850struct smp_irk *hci_add_irk(struct hci_dev *hdev, bdaddr_t *bdaddr,
851 u8 addr_type, u8 val[16], bdaddr_t *rpa);
852void hci_remove_irk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type);
853void hci_smp_irks_clear(struct hci_dev *hdev);
854
855void hci_remote_oob_data_clear(struct hci_dev *hdev);
761struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, 856struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
762 bdaddr_t *bdaddr); 857 bdaddr_t *bdaddr);
763int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, 858int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
764 u8 *randomizer); 859 u8 *hash, u8 *randomizer);
860int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
861 u8 *hash192, u8 *randomizer192,
862 u8 *hash256, u8 *randomizer256);
765int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 863int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
766 864
767void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 865void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
@@ -803,9 +901,12 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
803#define lmp_csb_slave_capable(dev) ((dev)->features[2][0] & LMP_CSB_SLAVE) 901#define lmp_csb_slave_capable(dev) ((dev)->features[2][0] & LMP_CSB_SLAVE)
804#define lmp_sync_train_capable(dev) ((dev)->features[2][0] & LMP_SYNC_TRAIN) 902#define lmp_sync_train_capable(dev) ((dev)->features[2][0] & LMP_SYNC_TRAIN)
805#define lmp_sync_scan_capable(dev) ((dev)->features[2][0] & LMP_SYNC_SCAN) 903#define lmp_sync_scan_capable(dev) ((dev)->features[2][0] & LMP_SYNC_SCAN)
904#define lmp_sc_capable(dev) ((dev)->features[2][1] & LMP_SC)
905#define lmp_ping_capable(dev) ((dev)->features[2][1] & LMP_PING)
806 906
807/* ----- Host capabilities ----- */ 907/* ----- Host capabilities ----- */
808#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 908#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
909#define lmp_host_sc_capable(dev) ((dev)->features[1][0] & LMP_HOST_SC)
809#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) 910#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE))
810#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) 911#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR))
811 912
@@ -1019,6 +1120,26 @@ static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type)
1019 return false; 1120 return false;
1020} 1121}
1021 1122
1123static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type)
1124{
1125 if (addr_type != 0x01)
1126 return false;
1127
1128 if ((bdaddr->b[5] & 0xc0) == 0x40)
1129 return true;
1130
1131 return false;
1132}
1133
1134static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
1135 bdaddr_t *bdaddr, u8 addr_type)
1136{
1137 if (!hci_bdaddr_is_rpa(bdaddr, addr_type))
1138 return NULL;
1139
1140 return hci_find_irk_by_rpa(hdev, bdaddr);
1141}
1142
1022int hci_register_cb(struct hci_cb *hcb); 1143int hci_register_cb(struct hci_cb *hcb);
1023int hci_unregister_cb(struct hci_cb *hcb); 1144int hci_unregister_cb(struct hci_cb *hcb);
1024 1145
@@ -1040,6 +1161,9 @@ void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
1040 const void *param, u8 event); 1161 const void *param, u8 event);
1041void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); 1162void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status);
1042 1163
1164void hci_req_add_le_scan_disable(struct hci_request *req);
1165void hci_req_add_le_passive_scan(struct hci_request *req);
1166
1043struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, 1167struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
1044 const void *param, u32 timeout); 1168 const void *param, u32 timeout);
1045struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, 1169struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
@@ -1085,6 +1209,7 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered);
1085void mgmt_discoverable_timeout(struct hci_dev *hdev); 1209void mgmt_discoverable_timeout(struct hci_dev *hdev);
1086void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); 1210void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable);
1087void mgmt_connectable(struct hci_dev *hdev, u8 connectable); 1211void mgmt_connectable(struct hci_dev *hdev, u8 connectable);
1212void mgmt_advertising(struct hci_dev *hdev, u8 advertising);
1088void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); 1213void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
1089void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, 1214void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
1090 bool persistent); 1215 bool persistent);
@@ -1092,7 +1217,8 @@ void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1092 u8 addr_type, u32 flags, u8 *name, u8 name_len, 1217 u8 addr_type, u32 flags, u8 *name, u8 name_len,
1093 u8 *dev_class); 1218 u8 *dev_class);
1094void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, 1219void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,
1095 u8 link_type, u8 addr_type, u8 reason); 1220 u8 link_type, u8 addr_type, u8 reason,
1221 bool mgmt_connected);
1096void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, 1222void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr,
1097 u8 link_type, u8 addr_type, u8 status); 1223 u8 link_type, u8 addr_type, u8 status);
1098void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1224void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
@@ -1122,11 +1248,13 @@ void mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1122 u8 addr_type, u8 status); 1248 u8 addr_type, u8 status);
1123void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); 1249void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
1124void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); 1250void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
1251void mgmt_sc_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
1125void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, 1252void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
1126 u8 status); 1253 u8 status);
1127void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); 1254void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
1128void mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, 1255void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192,
1129 u8 *randomizer, u8 status); 1256 u8 *randomizer192, u8 *hash256,
1257 u8 *randomizer256, u8 status);
1130void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1258void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1131 u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, 1259 u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name,
1132 u8 ssp, u8 *eir, u16 eir_len); 1260 u8 ssp, u8 *eir, u16 eir_len);
@@ -1135,8 +1263,10 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1135void mgmt_discovering(struct hci_dev *hdev, u8 discovering); 1263void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
1136int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 1264int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1137int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 1265int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1138void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); 1266void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key);
1267void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk);
1139void mgmt_reenable_advertising(struct hci_dev *hdev); 1268void mgmt_reenable_advertising(struct hci_dev *hdev);
1269void mgmt_smp_complete(struct hci_conn *conn, bool complete);
1140 1270
1141/* HCI info for socket */ 1271/* HCI info for socket */
1142#define hci_pi(sk) ((struct hci_pinfo *) sk) 1272#define hci_pi(sk) ((struct hci_pinfo *) sk)
@@ -1168,9 +1298,14 @@ struct hci_sec_filter {
1168 1298
1169void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 1299void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
1170 u16 latency, u16 to_multiplier); 1300 u16 latency, u16 to_multiplier);
1171void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], 1301void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
1172 __u8 ltk[16]); 1302 __u8 ltk[16]);
1173 1303
1304int hci_update_random_address(struct hci_request *req, bool require_privacy,
1305 u8 *own_addr_type);
1306void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr,
1307 u8 *bdaddr_type);
1308
1174#define SCO_AIRMODE_MASK 0x0003 1309#define SCO_AIRMODE_MASK 0x0003
1175#define SCO_AIRMODE_CVSD 0x0000 1310#define SCO_AIRMODE_CVSD 0x0000
1176#define SCO_AIRMODE_TRANSP 0x0003 1311#define SCO_AIRMODE_TRANSP 0x0003
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index dbc4a89984ca..4abdcb220e3a 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -91,6 +91,7 @@ struct l2cap_conninfo {
91#define L2CAP_LM_TRUSTED 0x0008 91#define L2CAP_LM_TRUSTED 0x0008
92#define L2CAP_LM_RELIABLE 0x0010 92#define L2CAP_LM_RELIABLE 0x0010
93#define L2CAP_LM_SECURE 0x0020 93#define L2CAP_LM_SECURE 0x0020
94#define L2CAP_LM_FIPS 0x0040
94 95
95/* L2CAP command codes */ 96/* L2CAP command codes */
96#define L2CAP_COMMAND_REJ 0x01 97#define L2CAP_COMMAND_REJ 0x01
@@ -623,6 +624,9 @@ struct l2cap_conn {
623 __u32 rx_len; 624 __u32 rx_len;
624 __u8 tx_ident; 625 __u8 tx_ident;
625 626
627 struct sk_buff_head pending_rx;
628 struct work_struct pending_rx_work;
629
626 __u8 disc_reason; 630 __u8 disc_reason;
627 631
628 struct delayed_work security_timer; 632 struct delayed_work security_timer;
@@ -647,7 +651,7 @@ struct l2cap_user {
647#define L2CAP_CHAN_RAW 1 651#define L2CAP_CHAN_RAW 1
648#define L2CAP_CHAN_CONN_LESS 2 652#define L2CAP_CHAN_CONN_LESS 2
649#define L2CAP_CHAN_CONN_ORIENTED 3 653#define L2CAP_CHAN_CONN_ORIENTED 3
650#define L2CAP_CHAN_CONN_FIX_A2MP 4 654#define L2CAP_CHAN_FIXED 4
651 655
652/* ----- L2CAP socket info ----- */ 656/* ----- L2CAP socket info ----- */
653#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) 657#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
@@ -853,7 +857,6 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan)
853} 857}
854 858
855extern bool disable_ertm; 859extern bool disable_ertm;
856extern bool enable_lecoc;
857 860
858int l2cap_init_sockets(void); 861int l2cap_init_sockets(void);
859void l2cap_cleanup_sockets(void); 862void l2cap_cleanup_sockets(void);
@@ -878,6 +881,7 @@ int l2cap_ertm_init(struct l2cap_chan *chan);
878void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 881void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
879void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 882void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
880void l2cap_chan_del(struct l2cap_chan *chan, int err); 883void l2cap_chan_del(struct l2cap_chan *chan, int err);
884void l2cap_conn_update_id_addr(struct hci_conn *hcon);
881void l2cap_send_conn_req(struct l2cap_chan *chan); 885void l2cap_send_conn_req(struct l2cap_chan *chan);
882void l2cap_move_start(struct l2cap_chan *chan); 886void l2cap_move_start(struct l2cap_chan *chan);
883void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, 887void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 518c5c84e39a..0326648fd799 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -94,6 +94,9 @@ struct mgmt_rp_read_index_list {
94#define MGMT_SETTING_HS 0x00000100 94#define MGMT_SETTING_HS 0x00000100
95#define MGMT_SETTING_LE 0x00000200 95#define MGMT_SETTING_LE 0x00000200
96#define MGMT_SETTING_ADVERTISING 0x00000400 96#define MGMT_SETTING_ADVERTISING 0x00000400
97#define MGMT_SETTING_SECURE_CONN 0x00000800
98#define MGMT_SETTING_DEBUG_KEYS 0x00001000
99#define MGMT_SETTING_PRIVACY 0x00002000
97 100
98#define MGMT_OP_READ_INFO 0x0004 101#define MGMT_OP_READ_INFO 0x0004
99#define MGMT_READ_INFO_SIZE 0 102#define MGMT_READ_INFO_SIZE 0
@@ -180,11 +183,11 @@ struct mgmt_cp_load_link_keys {
180 183
181struct mgmt_ltk_info { 184struct mgmt_ltk_info {
182 struct mgmt_addr_info addr; 185 struct mgmt_addr_info addr;
183 __u8 authenticated; 186 __u8 type;
184 __u8 master; 187 __u8 master;
185 __u8 enc_size; 188 __u8 enc_size;
186 __le16 ediv; 189 __le16 ediv;
187 __u8 rand[8]; 190 __le64 rand;
188 __u8 val[16]; 191 __u8 val[16];
189} __packed; 192} __packed;
190 193
@@ -294,6 +297,12 @@ struct mgmt_rp_read_local_oob_data {
294 __u8 hash[16]; 297 __u8 hash[16];
295 __u8 randomizer[16]; 298 __u8 randomizer[16];
296} __packed; 299} __packed;
300struct mgmt_rp_read_local_oob_ext_data {
301 __u8 hash192[16];
302 __u8 randomizer192[16];
303 __u8 hash256[16];
304 __u8 randomizer256[16];
305} __packed;
297 306
298#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021 307#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021
299struct mgmt_cp_add_remote_oob_data { 308struct mgmt_cp_add_remote_oob_data {
@@ -302,6 +311,14 @@ struct mgmt_cp_add_remote_oob_data {
302 __u8 randomizer[16]; 311 __u8 randomizer[16];
303} __packed; 312} __packed;
304#define MGMT_ADD_REMOTE_OOB_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 32) 313#define MGMT_ADD_REMOTE_OOB_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 32)
314struct mgmt_cp_add_remote_oob_ext_data {
315 struct mgmt_addr_info addr;
316 __u8 hash192[16];
317 __u8 randomizer192[16];
318 __u8 hash256[16];
319 __u8 randomizer256[16];
320} __packed;
321#define MGMT_ADD_REMOTE_OOB_EXT_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 64)
305 322
306#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0022 323#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0022
307struct mgmt_cp_remove_remote_oob_data { 324struct mgmt_cp_remove_remote_oob_data {
@@ -369,6 +386,29 @@ struct mgmt_cp_set_scan_params {
369} __packed; 386} __packed;
370#define MGMT_SET_SCAN_PARAMS_SIZE 4 387#define MGMT_SET_SCAN_PARAMS_SIZE 4
371 388
389#define MGMT_OP_SET_SECURE_CONN 0x002D
390
391#define MGMT_OP_SET_DEBUG_KEYS 0x002E
392
393#define MGMT_OP_SET_PRIVACY 0x002F
394struct mgmt_cp_set_privacy {
395 __u8 privacy;
396 __u8 irk[16];
397} __packed;
398#define MGMT_SET_PRIVACY_SIZE 17
399
400struct mgmt_irk_info {
401 struct mgmt_addr_info addr;
402 __u8 val[16];
403} __packed;
404
405#define MGMT_OP_LOAD_IRKS 0x0030
406struct mgmt_cp_load_irks {
407 __le16 irk_count;
408 struct mgmt_irk_info irks[0];
409} __packed;
410#define MGMT_LOAD_IRKS_SIZE 2
411
372#define MGMT_EV_CMD_COMPLETE 0x0001 412#define MGMT_EV_CMD_COMPLETE 0x0001
373struct mgmt_ev_cmd_complete { 413struct mgmt_ev_cmd_complete {
374 __le16 opcode; 414 __le16 opcode;
@@ -504,3 +544,10 @@ struct mgmt_ev_passkey_notify {
504 __le32 passkey; 544 __le32 passkey;
505 __u8 entered; 545 __u8 entered;
506} __packed; 546} __packed;
547
548#define MGMT_EV_NEW_IRK 0x0018
549struct mgmt_ev_new_irk {
550 __u8 store_hint;
551 bdaddr_t rpa;
552 struct mgmt_irk_info irk;
553} __packed;
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 486213a1aed8..2611cc389d7d 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -238,9 +238,11 @@ int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
238 u8 channel); 238 u8 channel);
239int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason); 239int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason);
240int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb); 240int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb);
241void rfcomm_dlc_send_noerror(struct rfcomm_dlc *d, struct sk_buff *skb);
241int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig); 242int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig);
242int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig); 243int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig);
243void rfcomm_dlc_accept(struct rfcomm_dlc *d); 244void rfcomm_dlc_accept(struct rfcomm_dlc *d);
245struct rfcomm_dlc *rfcomm_dlc_exists(bdaddr_t *src, bdaddr_t *dst, u8 channel);
244 246
245#define rfcomm_dlc_lock(d) spin_lock(&d->lock) 247#define rfcomm_dlc_lock(d) spin_lock(&d->lock)
246#define rfcomm_dlc_unlock(d) spin_unlock(&d->lock) 248#define rfcomm_dlc_unlock(d) spin_unlock(&d->lock)
@@ -295,6 +297,7 @@ struct rfcomm_conninfo {
295#define RFCOMM_LM_TRUSTED 0x0008 297#define RFCOMM_LM_TRUSTED 0x0008
296#define RFCOMM_LM_RELIABLE 0x0010 298#define RFCOMM_LM_RELIABLE 0x0010
297#define RFCOMM_LM_SECURE 0x0020 299#define RFCOMM_LM_SECURE 0x0020
300#define RFCOMM_LM_FIPS 0x0040
298 301
299#define rfcomm_pi(sk) ((struct rfcomm_pinfo *) sk) 302#define rfcomm_pi(sk) ((struct rfcomm_pinfo *) sk)
300 303
@@ -323,11 +326,16 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel,
323#define RFCOMMGETDEVINFO _IOR('R', 211, int) 326#define RFCOMMGETDEVINFO _IOR('R', 211, int)
324#define RFCOMMSTEALDLC _IOW('R', 220, int) 327#define RFCOMMSTEALDLC _IOW('R', 220, int)
325 328
329/* rfcomm_dev.flags bit definitions */
326#define RFCOMM_REUSE_DLC 0 330#define RFCOMM_REUSE_DLC 0
327#define RFCOMM_RELEASE_ONHUP 1 331#define RFCOMM_RELEASE_ONHUP 1
328#define RFCOMM_HANGUP_NOW 2 332#define RFCOMM_HANGUP_NOW 2
329#define RFCOMM_TTY_ATTACHED 3 333#define RFCOMM_TTY_ATTACHED 3
330#define RFCOMM_TTY_RELEASED 4 334#define RFCOMM_DEFUNCT_BIT4 4 /* don't reuse this bit - userspace visible */
335
336/* rfcomm_dev.status bit definitions */
337#define RFCOMM_DEV_RELEASED 0
338#define RFCOMM_TTY_OWNED 1
331 339
332struct rfcomm_dev_req { 340struct rfcomm_dev_req {
333 s16 dev_id; 341 s16 dev_id;
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9f90554e88c4..8c9ba44fb7cf 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2206,7 +2206,12 @@ struct cfg80211_qos_map {
2206 * @set_cqm_txe_config: Configure connection quality monitor TX error 2206 * @set_cqm_txe_config: Configure connection quality monitor TX error
2207 * thresholds. 2207 * thresholds.
2208 * @sched_scan_start: Tell the driver to start a scheduled scan. 2208 * @sched_scan_start: Tell the driver to start a scheduled scan.
2209 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan. 2209 * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan. This
2210 * call must stop the scheduled scan and be ready for starting a new one
2211 * before it returns, i.e. @sched_scan_start may be called immediately
2212 * after that again and should not fail in that case. The driver should
2213 * not call cfg80211_sched_scan_stopped() for a requested stop (when this
2214 * method returns 0.)
2210 * 2215 *
2211 * @mgmt_frame_register: Notify driver that a management frame type was 2216 * @mgmt_frame_register: Notify driver that a management frame type was
2212 * registered. Note that this callback may not sleep, and cannot run 2217 * registered. Note that this callback may not sleep, and cannot run
@@ -2465,7 +2470,8 @@ struct cfg80211_ops {
2465 2470
2466 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, 2471 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
2467 u8 *peer, u8 action_code, u8 dialog_token, 2472 u8 *peer, u8 action_code, u8 dialog_token,
2468 u16 status_code, const u8 *buf, size_t len); 2473 u16 status_code, u32 peer_capability,
2474 const u8 *buf, size_t len);
2469 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, 2475 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
2470 u8 *peer, enum nl80211_tdls_operation oper); 2476 u8 *peer, enum nl80211_tdls_operation oper);
2471 2477
@@ -2610,9 +2616,12 @@ struct ieee80211_iface_limit {
2610 * only in special cases. 2616 * only in special cases.
2611 * @radar_detect_widths: bitmap of channel widths supported for radar detection 2617 * @radar_detect_widths: bitmap of channel widths supported for radar detection
2612 * 2618 *
2613 * These examples can be expressed as follows: 2619 * With this structure the driver can describe which interface
2620 * combinations it supports concurrently.
2614 * 2621 *
2615 * Allow #STA <= 1, #AP <= 1, matching BI, channels = 1, 2 total: 2622 * Examples:
2623 *
2624 * 1. Allow #STA <= 1, #AP <= 1, matching BI, channels = 1, 2 total:
2616 * 2625 *
2617 * struct ieee80211_iface_limit limits1[] = { 2626 * struct ieee80211_iface_limit limits1[] = {
2618 * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), }, 2627 * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
@@ -2626,7 +2635,7 @@ struct ieee80211_iface_limit {
2626 * }; 2635 * };
2627 * 2636 *
2628 * 2637 *
2629 * Allow #{AP, P2P-GO} <= 8, channels = 1, 8 total: 2638 * 2. Allow #{AP, P2P-GO} <= 8, channels = 1, 8 total:
2630 * 2639 *
2631 * struct ieee80211_iface_limit limits2[] = { 2640 * struct ieee80211_iface_limit limits2[] = {
2632 * { .max = 8, .types = BIT(NL80211_IFTYPE_AP) | 2641 * { .max = 8, .types = BIT(NL80211_IFTYPE_AP) |
@@ -2640,7 +2649,8 @@ struct ieee80211_iface_limit {
2640 * }; 2649 * };
2641 * 2650 *
2642 * 2651 *
2643 * Allow #STA <= 1, #{P2P-client,P2P-GO} <= 3 on two channels, 4 total. 2652 * 3. Allow #STA <= 1, #{P2P-client,P2P-GO} <= 3 on two channels, 4 total.
2653 *
2644 * This allows for an infrastructure connection and three P2P connections. 2654 * This allows for an infrastructure connection and three P2P connections.
2645 * 2655 *
2646 * struct ieee80211_iface_limit limits3[] = { 2656 * struct ieee80211_iface_limit limits3[] = {
@@ -2790,7 +2800,7 @@ struct wiphy_vendor_command {
2790 * @perm_addr: permanent MAC address of this device 2800 * @perm_addr: permanent MAC address of this device
2791 * @addr_mask: If the device supports multiple MAC addresses by masking, 2801 * @addr_mask: If the device supports multiple MAC addresses by masking,
2792 * set this to a mask with variable bits set to 1, e.g. if the last 2802 * set this to a mask with variable bits set to 1, e.g. if the last
2793 * four bits are variable then set it to 00:...:00:0f. The actual 2803 * four bits are variable then set it to 00-00-00-00-00-0f. The actual
2794 * variable bits shall be determined by the interfaces added, with 2804 * variable bits shall be determined by the interfaces added, with
2795 * interfaces not matching the mask being rejected to be brought up. 2805 * interfaces not matching the mask being rejected to be brought up.
2796 * @n_addresses: number of addresses in @addresses. 2806 * @n_addresses: number of addresses in @addresses.
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 4f0f29dce0aa..86faa413b37d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -66,10 +66,6 @@
66 * 66 *
67 * Secondly, when the hardware handles fragmentation, the frame handed to 67 * Secondly, when the hardware handles fragmentation, the frame handed to
68 * the driver from mac80211 is the MSDU, not the MPDU. 68 * the driver from mac80211 is the MSDU, not the MPDU.
69 *
70 * Finally, for received frames, the driver is able to indicate that it has
71 * filled a radiotap header and put that in front of the frame; if it does
72 * not do so then mac80211 may add this under certain circumstances.
73 */ 69 */
74 70
75/** 71/**
@@ -1507,8 +1503,6 @@ struct ieee80211_tx_control {
1507 * @IEEE80211_HW_CONNECTION_MONITOR: 1503 * @IEEE80211_HW_CONNECTION_MONITOR:
1508 * The hardware performs its own connection monitoring, including 1504 * The hardware performs its own connection monitoring, including
1509 * periodic keep-alives to the AP and probing the AP on beacon loss. 1505 * periodic keep-alives to the AP and probing the AP on beacon loss.
1510 * When this flag is set, signaling beacon-loss will cause an immediate
1511 * change to disassociated state.
1512 * 1506 *
1513 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC: 1507 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1514 * This device needs to get data from beacon before association (i.e. 1508 * This device needs to get data from beacon before association (i.e.
@@ -1644,10 +1638,6 @@ enum ieee80211_hw_flags {
1644 * the hw can report back. 1638 * the hw can report back.
1645 * @max_rate_tries: maximum number of tries for each stage 1639 * @max_rate_tries: maximum number of tries for each stage
1646 * 1640 *
1647 * @napi_weight: weight used for NAPI polling. You must specify an
1648 * appropriate value here if a napi_poll operation is provided
1649 * by your driver.
1650 *
1651 * @max_rx_aggregation_subframes: maximum buffer size (number of 1641 * @max_rx_aggregation_subframes: maximum buffer size (number of
1652 * sub-frames) to be used for A-MPDU block ack receiver 1642 * sub-frames) to be used for A-MPDU block ack receiver
1653 * aggregation. 1643 * aggregation.
@@ -1701,7 +1691,6 @@ struct ieee80211_hw {
1701 int vif_data_size; 1691 int vif_data_size;
1702 int sta_data_size; 1692 int sta_data_size;
1703 int chanctx_data_size; 1693 int chanctx_data_size;
1704 int napi_weight;
1705 u16 queues; 1694 u16 queues;
1706 u16 max_listen_interval; 1695 u16 max_listen_interval;
1707 s8 max_signal; 1696 s8 max_signal;
@@ -2471,6 +2460,7 @@ enum ieee80211_roc_type {
2471 * This process will continue until sched_scan_stop is called. 2460 * This process will continue until sched_scan_stop is called.
2472 * 2461 *
2473 * @sched_scan_stop: Tell the hardware to stop an ongoing scheduled scan. 2462 * @sched_scan_stop: Tell the hardware to stop an ongoing scheduled scan.
2463 * In this case, ieee80211_sched_scan_stopped() must not be called.
2474 * 2464 *
2475 * @sw_scan_start: Notifier function that is called just before a software scan 2465 * @sw_scan_start: Notifier function that is called just before a software scan
2476 * is started. Can be NULL, if the driver doesn't need this notification. 2466 * is started. Can be NULL, if the driver doesn't need this notification.
@@ -2624,8 +2614,6 @@ enum ieee80211_roc_type {
2624 * callback. They must then call ieee80211_chswitch_done() to indicate 2614 * callback. They must then call ieee80211_chswitch_done() to indicate
2625 * completion of the channel switch. 2615 * completion of the channel switch.
2626 * 2616 *
2627 * @napi_poll: Poll Rx queue for incoming data frames.
2628 *
2629 * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. 2617 * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
2630 * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may 2618 * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
2631 * reject TX/RX mask combinations they cannot support by returning -EINVAL 2619 * reject TX/RX mask combinations they cannot support by returning -EINVAL
@@ -2820,7 +2808,7 @@ struct ieee80211_ops {
2820 struct ieee80211_vif *vif, 2808 struct ieee80211_vif *vif,
2821 struct cfg80211_sched_scan_request *req, 2809 struct cfg80211_sched_scan_request *req,
2822 struct ieee80211_sched_scan_ies *ies); 2810 struct ieee80211_sched_scan_ies *ies);
2823 void (*sched_scan_stop)(struct ieee80211_hw *hw, 2811 int (*sched_scan_stop)(struct ieee80211_hw *hw,
2824 struct ieee80211_vif *vif); 2812 struct ieee80211_vif *vif);
2825 void (*sw_scan_start)(struct ieee80211_hw *hw); 2813 void (*sw_scan_start)(struct ieee80211_hw *hw);
2826 void (*sw_scan_complete)(struct ieee80211_hw *hw); 2814 void (*sw_scan_complete)(struct ieee80211_hw *hw);
@@ -2884,7 +2872,6 @@ struct ieee80211_ops {
2884 void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop); 2872 void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop);
2885 void (*channel_switch)(struct ieee80211_hw *hw, 2873 void (*channel_switch)(struct ieee80211_hw *hw,
2886 struct ieee80211_channel_switch *ch_switch); 2874 struct ieee80211_channel_switch *ch_switch);
2887 int (*napi_poll)(struct ieee80211_hw *hw, int budget);
2888 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); 2875 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
2889 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 2876 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
2890 2877
@@ -3166,21 +3153,21 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
3166 */ 3153 */
3167void ieee80211_restart_hw(struct ieee80211_hw *hw); 3154void ieee80211_restart_hw(struct ieee80211_hw *hw);
3168 3155
3169/** ieee80211_napi_schedule - schedule NAPI poll 3156/**
3170 * 3157 * ieee80211_napi_add - initialize mac80211 NAPI context
3171 * Use this function to schedule NAPI polling on a device. 3158 * @hw: the hardware to initialize the NAPI context on
3172 * 3159 * @napi: the NAPI context to initialize
3173 * @hw: the hardware to start polling 3160 * @napi_dev: dummy NAPI netdevice, here to not waste the space if the
3174 */ 3161 * driver doesn't use NAPI
3175void ieee80211_napi_schedule(struct ieee80211_hw *hw); 3162 * @poll: poll function
3176 3163 * @weight: default weight
3177/** ieee80211_napi_complete - complete NAPI polling
3178 *
3179 * Use this function to finish NAPI polling on a device.
3180 * 3164 *
3181 * @hw: the hardware to stop polling 3165 * See also netif_napi_add().
3182 */ 3166 */
3183void ieee80211_napi_complete(struct ieee80211_hw *hw); 3167void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
3168 struct net_device *napi_dev,
3169 int (*poll)(struct napi_struct *, int),
3170 int weight);
3184 3171
3185/** 3172/**
3186 * ieee80211_rx - receive frame 3173 * ieee80211_rx - receive frame
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index a12e6cae5132..ff72cab3cd3a 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -303,8 +303,9 @@
303 * passed, all channels allowed for the current regulatory domain 303 * passed, all channels allowed for the current regulatory domain
304 * are used. Extra IEs can also be passed from the userspace by 304 * are used. Extra IEs can also be passed from the userspace by
305 * using the %NL80211_ATTR_IE attribute. 305 * using the %NL80211_ATTR_IE attribute.
306 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT 306 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
307 * if scheduled scan is not running. 307 * scheduled scan is not running. The caller may assume that as soon
308 * as the call returns, it is safe to start a new scheduled scan again.
308 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan 309 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
309 * results available. 310 * results available.
310 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has 311 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
@@ -1575,6 +1576,9 @@ enum nl80211_commands {
1575 * advertise values that cannot always be met. In such cases, an attempt 1576 * advertise values that cannot always be met. In such cases, an attempt
1576 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail. 1577 * to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
1577 * 1578 *
1579 * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
1580 * As specified in the &enum nl80211_tdls_peer_capability.
1581 *
1578 * @NL80211_ATTR_MAX: highest attribute number currently defined 1582 * @NL80211_ATTR_MAX: highest attribute number currently defined
1579 * @__NL80211_ATTR_AFTER_LAST: internal use 1583 * @__NL80211_ATTR_AFTER_LAST: internal use
1580 */ 1584 */
@@ -1908,6 +1912,8 @@ enum nl80211_attrs {
1908 1912
1909 NL80211_ATTR_MAX_AP_ASSOC_STA, 1913 NL80211_ATTR_MAX_AP_ASSOC_STA,
1910 1914
1915 NL80211_ATTR_TDLS_PEER_CAPABILITY,
1916
1911 /* add attributes here, update the policy in nl80211.c */ 1917 /* add attributes here, update the policy in nl80211.c */
1912 1918
1913 __NL80211_ATTR_AFTER_LAST, 1919 __NL80211_ATTR_AFTER_LAST,
@@ -2437,10 +2443,7 @@ enum nl80211_reg_type {
2437 * in KHz. This is not a center a frequency but an actual regulatory 2443 * in KHz. This is not a center a frequency but an actual regulatory
2438 * band edge. 2444 * band edge.
2439 * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this 2445 * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
2440 * frequency range, in KHz. If not present or 0, maximum available 2446 * frequency range, in KHz.
2441 * bandwidth should be calculated base on contiguous rules and wider
2442 * channels will be allowed to cross multiple contiguous/overlapping
2443 * frequency ranges.
2444 * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain 2447 * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
2445 * for a given frequency range. The value is in mBi (100 * dBi). 2448 * for a given frequency range. The value is in mBi (100 * dBi).
2446 * If you don't have one then don't send this. 2449 * If you don't have one then don't send this.
@@ -2511,6 +2514,9 @@ enum nl80211_sched_scan_match_attr {
2511 * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed, 2514 * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
2512 * this includes probe requests or modes of operation that require 2515 * this includes probe requests or modes of operation that require
2513 * beaconing. 2516 * beaconing.
2517 * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
2518 * base on contiguous rules and wider channels will be allowed to cross
2519 * multiple contiguous/overlapping frequency ranges.
2514 */ 2520 */
2515enum nl80211_reg_rule_flags { 2521enum nl80211_reg_rule_flags {
2516 NL80211_RRF_NO_OFDM = 1<<0, 2522 NL80211_RRF_NO_OFDM = 1<<0,
@@ -2522,6 +2528,7 @@ enum nl80211_reg_rule_flags {
2522 NL80211_RRF_PTMP_ONLY = 1<<6, 2528 NL80211_RRF_PTMP_ONLY = 1<<6,
2523 NL80211_RRF_NO_IR = 1<<7, 2529 NL80211_RRF_NO_IR = 1<<7,
2524 __NL80211_RRF_NO_IBSS = 1<<8, 2530 __NL80211_RRF_NO_IBSS = 1<<8,
2531 NL80211_RRF_AUTO_BW = 1<<11,
2525}; 2532};
2526 2533
2527#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR 2534#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
@@ -3843,11 +3850,6 @@ enum nl80211_ap_sme_features {
3843 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested 3850 * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
3844 * to work properly to suppport receiving regulatory hints from 3851 * to work properly to suppport receiving regulatory hints from
3845 * cellular base stations. 3852 * cellular base stations.
3846 * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
3847 * P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
3848 * in the interface combinations, even when it's only used for scan
3849 * and remain-on-channel. This could be due to, for example, the
3850 * remain-on-channel implementation requiring a channel context.
3851 * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of 3853 * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
3852 * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station 3854 * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
3853 * mode 3855 * mode
@@ -3889,7 +3891,7 @@ enum nl80211_feature_flags {
3889 NL80211_FEATURE_HT_IBSS = 1 << 1, 3891 NL80211_FEATURE_HT_IBSS = 1 << 1,
3890 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, 3892 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3891 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, 3893 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
3892 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, 3894 /* bit 4 is reserved - don't use */
3893 NL80211_FEATURE_SAE = 1 << 5, 3895 NL80211_FEATURE_SAE = 1 << 5,
3894 NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, 3896 NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
3895 NL80211_FEATURE_SCAN_FLUSH = 1 << 7, 3897 NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
@@ -4079,4 +4081,20 @@ struct nl80211_vendor_cmd_info {
4079 __u32 subcmd; 4081 __u32 subcmd;
4080}; 4082};
4081 4083
4084/**
4085 * enum nl80211_tdls_peer_capability - TDLS peer flags.
4086 *
4087 * Used by tdls_mgmt() to determine which conditional elements need
4088 * to be added to TDLS Setup frames.
4089 *
4090 * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
4091 * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
4092 * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
4093 */
4094enum nl80211_tdls_peer_capability {
4095 NL80211_TDLS_PEER_HT = 1<<0,
4096 NL80211_TDLS_PEER_VHT = 1<<1,
4097 NL80211_TDLS_PEER_WMM = 1<<2,
4098};
4099
4082#endif /* __LINUX_NL80211_H */ 4100#endif /* __LINUX_NL80211_H */