aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-07-28 20:36:25 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-28 20:36:25 -0400
commit3fd0202a0dfe07d255c5462d7d0e27673ca10430 (patch)
tree126483df9ff404e0d31cdcad18ad4280df06d89f /include
parenta67eed571aa505f51a4d02cab765a9d4f6ef80c4 (diff)
parent9a244409d0b0cf3b1e46f1dc331f2c718597fae0 (diff)
Merge tag 'master-2014-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says: ==================== pull request: wireless-next 2014-07-25 Please pull this batch of updates intended for the 3.17 stream! For the mac80211 bits, Johannes says: "We have a lot of TDLS patches, among them a fix that should make hwsim tests happy again. The rest, this time, is mostly small fixes." For the Bluetooth bits, Gustavo says: "Some more patches for 3.17. The most important change here is the move of the 6lowpan code to net/6lowpan. It has been agreed with Davem that this change will go through the bluetooth tree. The rest are mostly clean up and fixes." and, "Here follows some more patches for 3.17. These are mostly fixes to what we've sent to you before for next merge window." For the iwlwifi bits, Emmanuel says: "I have the usual amount of BT Coex stuff. Arik continues to work on TDLS and Ariej contributes a few things for HS2.0. I added a few more things to the firmware debugging infrastructure. Eran fixes a small bug - pretty normal content." And for the Atheros bits, Kalle says: "For ath6kl me and Jessica added support for ar6004 hw3.0, our latest version of ar6004. For ath10k Janusz added a printout so that it's easier to check what ath10k kconfig options are enabled. He also added a debugfs file to configure maximum amsdu and ampdu values. Also we had few fixes as usual." On top of that is the usual large batch of various driver updates -- brcmfmac, mwifiex, the TI drivers, and wil6210 all get some action. RafaƂ has also been very busy with b43 and related updates. Also, I pulled the wireless tree into this in order to resolve a merge conflict... P.S. The change to fs/compat_ioctl.c reflects a name change in a Bluetooth header file... ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bcma/bcma.h2
-rw-r--r--include/linux/ieee80211.h20
-rw-r--r--include/linux/ssb/ssb_regs.h37
-rw-r--r--include/net/bluetooth/hci.h156
-rw-r--r--include/net/bluetooth/hci_core.h54
-rw-r--r--include/net/bluetooth/hci_sock.h175
-rw-r--r--include/net/bluetooth/l2cap.h10
-rw-r--r--include/net/bluetooth/sco.h30
-rw-r--r--include/net/mac80211.h34
9 files changed, 295 insertions, 223 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 452286a38b2b..969af0f2bdf9 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -158,6 +158,8 @@ struct bcma_host_ops {
158/* Chip IDs of PCIe devices */ 158/* Chip IDs of PCIe devices */
159#define BCMA_CHIP_ID_BCM4313 0x4313 159#define BCMA_CHIP_ID_BCM4313 0x4313
160#define BCMA_CHIP_ID_BCM43142 43142 160#define BCMA_CHIP_ID_BCM43142 43142
161#define BCMA_CHIP_ID_BCM43217 43217
162#define BCMA_CHIP_ID_BCM43222 43222
161#define BCMA_CHIP_ID_BCM43224 43224 163#define BCMA_CHIP_ID_BCM43224 43224
162#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 164#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8
163#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa 165#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 75d17e15da33..63ab3873c5ed 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1001,6 +1001,26 @@ struct ieee80211_vendor_ie {
1001 u8 oui_type; 1001 u8 oui_type;
1002} __packed; 1002} __packed;
1003 1003
1004struct ieee80211_wmm_ac_param {
1005 u8 aci_aifsn; /* AIFSN, ACM, ACI */
1006 u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
1007 __le16 txop_limit;
1008} __packed;
1009
1010struct ieee80211_wmm_param_ie {
1011 u8 element_id; /* Element ID: 221 (0xdd); */
1012 u8 len; /* Length: 24 */
1013 /* required fields for WMM version 1 */
1014 u8 oui[3]; /* 00:50:f2 */
1015 u8 oui_type; /* 2 */
1016 u8 oui_subtype; /* 1 */
1017 u8 version; /* 1 for WMM version 1.0 */
1018 u8 qos_info; /* AP/STA specific QoS info */
1019 u8 reserved; /* 0 */
1020 /* AC_BE, AC_BK, AC_VI, AC_VO */
1021 struct ieee80211_wmm_ac_param ac[4];
1022} __packed;
1023
1004/* Control frames */ 1024/* Control frames */
1005struct ieee80211_rts { 1025struct ieee80211_rts {
1006 __le16 frame_control; 1026 __le16 frame_control;
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index f9f931c89e3e..f7b9100686c3 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -345,6 +345,43 @@
345#define SSB_SPROM4_TXPID5GH2_SHIFT 0 345#define SSB_SPROM4_TXPID5GH2_SHIFT 0
346#define SSB_SPROM4_TXPID5GH3 0xFF00 346#define SSB_SPROM4_TXPID5GH3 0xFF00
347#define SSB_SPROM4_TXPID5GH3_SHIFT 8 347#define SSB_SPROM4_TXPID5GH3_SHIFT 8
348
349/* There are 4 blocks with power info sharing the same layout */
350#define SSB_SPROM4_PWR_INFO_CORE0 0x0080
351#define SSB_SPROM4_PWR_INFO_CORE1 0x00AE
352#define SSB_SPROM4_PWR_INFO_CORE2 0x00DC
353#define SSB_SPROM4_PWR_INFO_CORE3 0x010A
354
355#define SSB_SPROM4_2G_MAXP_ITSSI 0x00 /* 2 GHz ITSSI and 2 GHz Max Power */
356#define SSB_SPROM4_2G_MAXP 0x00FF
357#define SSB_SPROM4_2G_ITSSI 0xFF00
358#define SSB_SPROM4_2G_ITSSI_SHIFT 8
359#define SSB_SPROM4_2G_PA_0 0x02 /* 2 GHz power amp */
360#define SSB_SPROM4_2G_PA_1 0x04
361#define SSB_SPROM4_2G_PA_2 0x06
362#define SSB_SPROM4_2G_PA_3 0x08
363#define SSB_SPROM4_5G_MAXP_ITSSI 0x0A /* 5 GHz ITSSI and 5.3 GHz Max Power */
364#define SSB_SPROM4_5G_MAXP 0x00FF
365#define SSB_SPROM4_5G_ITSSI 0xFF00
366#define SSB_SPROM4_5G_ITSSI_SHIFT 8
367#define SSB_SPROM4_5GHL_MAXP 0x0C /* 5.2 GHz and 5.8 GHz Max Power */
368#define SSB_SPROM4_5GH_MAXP 0x00FF
369#define SSB_SPROM4_5GL_MAXP 0xFF00
370#define SSB_SPROM4_5GL_MAXP_SHIFT 8
371#define SSB_SPROM4_5G_PA_0 0x0E /* 5.3 GHz power amp */
372#define SSB_SPROM4_5G_PA_1 0x10
373#define SSB_SPROM4_5G_PA_2 0x12
374#define SSB_SPROM4_5G_PA_3 0x14
375#define SSB_SPROM4_5GL_PA_0 0x16 /* 5.2 GHz power amp */
376#define SSB_SPROM4_5GL_PA_1 0x18
377#define SSB_SPROM4_5GL_PA_2 0x1A
378#define SSB_SPROM4_5GL_PA_3 0x1C
379#define SSB_SPROM4_5GH_PA_0 0x1E /* 5.8 GHz power amp */
380#define SSB_SPROM4_5GH_PA_1 0x20
381#define SSB_SPROM4_5GH_PA_2 0x22
382#define SSB_SPROM4_5GH_PA_3 0x24
383
384/* TODO: Make it deprecated */
348#define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */ 385#define SSB_SPROM4_MAXP_BG 0x0080 /* Max Power BG in path 1 */
349#define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ 386#define SSB_SPROM4_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */
350#define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ 387#define SSB_SPROM4_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index a01236e2df13..f0a3d8890760 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -202,33 +202,6 @@ enum {
202#define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \ 202#define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \
203 BIT(HCI_FAST_CONNECTABLE) | BIT(HCI_LE_ADV)) 203 BIT(HCI_FAST_CONNECTABLE) | BIT(HCI_LE_ADV))
204 204
205/* HCI ioctl defines */
206#define HCIDEVUP _IOW('H', 201, int)
207#define HCIDEVDOWN _IOW('H', 202, int)
208#define HCIDEVRESET _IOW('H', 203, int)
209#define HCIDEVRESTAT _IOW('H', 204, int)
210
211#define HCIGETDEVLIST _IOR('H', 210, int)
212#define HCIGETDEVINFO _IOR('H', 211, int)
213#define HCIGETCONNLIST _IOR('H', 212, int)
214#define HCIGETCONNINFO _IOR('H', 213, int)
215#define HCIGETAUTHINFO _IOR('H', 215, int)
216
217#define HCISETRAW _IOW('H', 220, int)
218#define HCISETSCAN _IOW('H', 221, int)
219#define HCISETAUTH _IOW('H', 222, int)
220#define HCISETENCRYPT _IOW('H', 223, int)
221#define HCISETPTYPE _IOW('H', 224, int)
222#define HCISETLINKPOL _IOW('H', 225, int)
223#define HCISETLINKMODE _IOW('H', 226, int)
224#define HCISETACLMTU _IOW('H', 227, int)
225#define HCISETSCOMTU _IOW('H', 228, int)
226
227#define HCIBLOCKADDR _IOW('H', 230, int)
228#define HCIUNBLOCKADDR _IOW('H', 231, int)
229
230#define HCIINQUIRY _IOR('H', 240, int)
231
232/* HCI timeouts */ 205/* HCI timeouts */
233#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 206#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
234#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 207#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
@@ -356,6 +329,7 @@ enum {
356#define LMP_HOST_SC 0x08 329#define LMP_HOST_SC 0x08
357 330
358/* LE features */ 331/* LE features */
332#define HCI_LE_ENCRYPTION 0x01
359#define HCI_LE_CONN_PARAM_REQ_PROC 0x02 333#define HCI_LE_CONN_PARAM_REQ_PROC 0x02
360#define HCI_LE_PING 0x10 334#define HCI_LE_PING 0x10
361 335
@@ -427,6 +401,9 @@ enum {
427/* The core spec defines 127 as the "not available" value */ 401/* The core spec defines 127 as the "not available" value */
428#define HCI_TX_POWER_INVALID 127 402#define HCI_TX_POWER_INVALID 127
429 403
404#define HCI_ROLE_MASTER 0x00
405#define HCI_ROLE_SLAVE 0x01
406
430/* Extended Inquiry Response field types */ 407/* Extended Inquiry Response field types */
431#define EIR_FLAGS 0x01 /* flags */ 408#define EIR_FLAGS 0x01 /* flags */
432#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 409#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
@@ -1739,9 +1716,6 @@ struct hci_ev_sync_train_complete {
1739 1716
1740#define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54 1717#define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54
1741 1718
1742/* Low energy meta events */
1743#define LE_CONN_ROLE_MASTER 0x00
1744
1745#define HCI_EV_LE_CONN_COMPLETE 0x01 1719#define HCI_EV_LE_CONN_COMPLETE 0x01
1746struct hci_ev_le_conn_complete { 1720struct hci_ev_le_conn_complete {
1747 __u8 status; 1721 __u8 status;
@@ -1871,126 +1845,4 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
1871#define hci_handle(h) (h & 0x0fff) 1845#define hci_handle(h) (h & 0x0fff)
1872#define hci_flags(h) (h >> 12) 1846#define hci_flags(h) (h >> 12)
1873 1847
1874/* ---- HCI Sockets ---- */
1875
1876/* Socket options */
1877#define HCI_DATA_DIR 1
1878#define HCI_FILTER 2
1879#define HCI_TIME_STAMP 3
1880
1881/* CMSG flags */
1882#define HCI_CMSG_DIR 0x0001
1883#define HCI_CMSG_TSTAMP 0x0002
1884
1885struct sockaddr_hci {
1886 sa_family_t hci_family;
1887 unsigned short hci_dev;
1888 unsigned short hci_channel;
1889};
1890#define HCI_DEV_NONE 0xffff
1891
1892#define HCI_CHANNEL_RAW 0
1893#define HCI_CHANNEL_USER 1
1894#define HCI_CHANNEL_MONITOR 2
1895#define HCI_CHANNEL_CONTROL 3
1896
1897struct hci_filter {
1898 unsigned long type_mask;
1899 unsigned long event_mask[2];
1900 __le16 opcode;
1901};
1902
1903struct hci_ufilter {
1904 __u32 type_mask;
1905 __u32 event_mask[2];
1906 __le16 opcode;
1907};
1908
1909#define HCI_FLT_TYPE_BITS 31
1910#define HCI_FLT_EVENT_BITS 63
1911#define HCI_FLT_OGF_BITS 63
1912#define HCI_FLT_OCF_BITS 127
1913
1914/* ---- HCI Ioctl requests structures ---- */
1915struct hci_dev_stats {
1916 __u32 err_rx;
1917 __u32 err_tx;
1918 __u32 cmd_tx;
1919 __u32 evt_rx;
1920 __u32 acl_tx;
1921 __u32 acl_rx;
1922 __u32 sco_tx;
1923 __u32 sco_rx;
1924 __u32 byte_rx;
1925 __u32 byte_tx;
1926};
1927
1928struct hci_dev_info {
1929 __u16 dev_id;
1930 char name[8];
1931
1932 bdaddr_t bdaddr;
1933
1934 __u32 flags;
1935 __u8 type;
1936
1937 __u8 features[8];
1938
1939 __u32 pkt_type;
1940 __u32 link_policy;
1941 __u32 link_mode;
1942
1943 __u16 acl_mtu;
1944 __u16 acl_pkts;
1945 __u16 sco_mtu;
1946 __u16 sco_pkts;
1947
1948 struct hci_dev_stats stat;
1949};
1950
1951struct hci_conn_info {
1952 __u16 handle;
1953 bdaddr_t bdaddr;
1954 __u8 type;
1955 __u8 out;
1956 __u16 state;
1957 __u32 link_mode;
1958};
1959
1960struct hci_dev_req {
1961 __u16 dev_id;
1962 __u32 dev_opt;
1963};
1964
1965struct hci_dev_list_req {
1966 __u16 dev_num;
1967 struct hci_dev_req dev_req[0]; /* hci_dev_req structures */
1968};
1969
1970struct hci_conn_list_req {
1971 __u16 dev_id;
1972 __u16 conn_num;
1973 struct hci_conn_info conn_info[0];
1974};
1975
1976struct hci_conn_info_req {
1977 bdaddr_t bdaddr;
1978 __u8 type;
1979 struct hci_conn_info conn_info[0];
1980};
1981
1982struct hci_auth_info_req {
1983 bdaddr_t bdaddr;
1984 __u8 type;
1985};
1986
1987struct hci_inquiry_req {
1988 __u16 dev_id;
1989 __u16 flags;
1990 __u8 lap[3];
1991 __u8 length;
1992 __u8 num_rsp;
1993};
1994#define IREQ_CACHE_FLUSH 0x0001
1995
1996#endif /* __HCI_H */ 1848#endif /* __HCI_H */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index e69c2b08c0c6..996ed065b6c2 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -26,6 +26,7 @@
26#define __HCI_CORE_H 26#define __HCI_CORE_H
27 27
28#include <net/bluetooth/hci.h> 28#include <net/bluetooth/hci.h>
29#include <net/bluetooth/hci_sock.h>
29 30
30/* HCI priority */ 31/* HCI priority */
31#define HCI_PRIO_MAX 7 32#define HCI_PRIO_MAX 7
@@ -82,6 +83,7 @@ struct hci_conn_hash {
82 unsigned int amp_num; 83 unsigned int amp_num;
83 unsigned int sco_num; 84 unsigned int sco_num;
84 unsigned int le_num; 85 unsigned int le_num;
86 unsigned int le_num_slave;
85}; 87};
86 88
87struct bdaddr_list { 89struct bdaddr_list {
@@ -370,6 +372,7 @@ struct hci_conn {
370 __u16 state; 372 __u16 state;
371 __u8 mode; 373 __u8 mode;
372 __u8 type; 374 __u8 type;
375 __u8 role;
373 bool out; 376 bool out;
374 __u8 attempt; 377 __u8 attempt;
375 __u8 dev_class[3]; 378 __u8 dev_class[3];
@@ -539,12 +542,12 @@ enum {
539 HCI_CONN_POWER_SAVE, 542 HCI_CONN_POWER_SAVE,
540 HCI_CONN_REMOTE_OOB, 543 HCI_CONN_REMOTE_OOB,
541 HCI_CONN_FLUSH_KEY, 544 HCI_CONN_FLUSH_KEY,
542 HCI_CONN_MASTER,
543 HCI_CONN_ENCRYPT, 545 HCI_CONN_ENCRYPT,
544 HCI_CONN_AUTH, 546 HCI_CONN_AUTH,
545 HCI_CONN_SECURE, 547 HCI_CONN_SECURE,
546 HCI_CONN_FIPS, 548 HCI_CONN_FIPS,
547 HCI_CONN_STK_ENCRYPT, 549 HCI_CONN_STK_ENCRYPT,
550 HCI_CONN_AUTH_INITIATOR,
548}; 551};
549 552
550static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 553static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
@@ -574,6 +577,8 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
574 break; 577 break;
575 case LE_LINK: 578 case LE_LINK:
576 h->le_num++; 579 h->le_num++;
580 if (c->role == HCI_ROLE_SLAVE)
581 h->le_num_slave++;
577 break; 582 break;
578 case SCO_LINK: 583 case SCO_LINK:
579 case ESCO_LINK: 584 case ESCO_LINK:
@@ -598,6 +603,8 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
598 break; 603 break;
599 case LE_LINK: 604 case LE_LINK:
600 h->le_num--; 605 h->le_num--;
606 if (c->role == HCI_ROLE_SLAVE)
607 h->le_num_slave--;
601 break; 608 break;
602 case SCO_LINK: 609 case SCO_LINK:
603 case ESCO_LINK: 610 case ESCO_LINK:
@@ -694,7 +701,8 @@ void hci_disconnect(struct hci_conn *conn, __u8 reason);
694bool hci_setup_sync(struct hci_conn *conn, __u16 handle); 701bool hci_setup_sync(struct hci_conn *conn, __u16 handle);
695void hci_sco_setup(struct hci_conn *conn, __u8 status); 702void hci_sco_setup(struct hci_conn *conn, __u8 status);
696 703
697struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); 704struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
705 u8 role);
698int hci_conn_del(struct hci_conn *conn); 706int hci_conn_del(struct hci_conn *conn);
699void hci_conn_hash_flush(struct hci_dev *hdev); 707void hci_conn_hash_flush(struct hci_dev *hdev);
700void hci_conn_check_pending(struct hci_dev *hdev); 708void hci_conn_check_pending(struct hci_dev *hdev);
@@ -706,14 +714,15 @@ struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
706 714
707struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst, 715struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
708 u8 dst_type, u8 sec_level, u16 conn_timeout, 716 u8 dst_type, u8 sec_level, u16 conn_timeout,
709 bool master); 717 u8 role);
710struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst, 718struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
711 u8 sec_level, u8 auth_type); 719 u8 sec_level, u8 auth_type);
712struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst, 720struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
713 __u16 setting); 721 __u16 setting);
714int hci_conn_check_link_mode(struct hci_conn *conn); 722int hci_conn_check_link_mode(struct hci_conn *conn);
715int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 723int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
716int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); 724int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type,
725 bool initiator);
717int hci_conn_change_link_key(struct hci_conn *conn); 726int hci_conn_change_link_key(struct hci_conn *conn);
718int hci_conn_switch_role(struct hci_conn *conn, __u8 role); 727int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
719 728
@@ -880,12 +889,12 @@ struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
880 bdaddr_t *bdaddr, u8 *val, u8 type, 889 bdaddr_t *bdaddr, u8 *val, u8 type,
881 u8 pin_len, bool *persistent); 890 u8 pin_len, bool *persistent);
882struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand, 891struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand,
883 bool master); 892 u8 role);
884struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, 893struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
885 u8 addr_type, u8 type, u8 authenticated, 894 u8 addr_type, u8 type, u8 authenticated,
886 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); 895 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand);
887struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, 896struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
888 u8 addr_type, bool master); 897 u8 addr_type, u8 role);
889int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); 898int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
890void hci_smp_ltks_clear(struct hci_dev *hdev); 899void hci_smp_ltks_clear(struct hci_dev *hdev);
891int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 900int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
@@ -1239,6 +1248,7 @@ void hci_req_add(struct hci_request *req, u16 opcode, u32 plen,
1239void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, 1248void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen,
1240 const void *param, u8 event); 1249 const void *param, u8 event);
1241void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); 1250void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status);
1251bool hci_req_pending(struct hci_dev *hdev);
1242 1252
1243void hci_req_add_le_scan_disable(struct hci_request *req); 1253void hci_req_add_le_scan_disable(struct hci_request *req);
1244void hci_req_add_le_passive_scan(struct hci_request *req); 1254void hci_req_add_le_passive_scan(struct hci_request *req);
@@ -1286,10 +1296,8 @@ void mgmt_index_added(struct hci_dev *hdev);
1286void mgmt_index_removed(struct hci_dev *hdev); 1296void mgmt_index_removed(struct hci_dev *hdev);
1287void mgmt_set_powered_failed(struct hci_dev *hdev, int err); 1297void mgmt_set_powered_failed(struct hci_dev *hdev, int err);
1288int mgmt_powered(struct hci_dev *hdev, u8 powered); 1298int mgmt_powered(struct hci_dev *hdev, u8 powered);
1299int mgmt_update_adv_data(struct hci_dev *hdev);
1289void mgmt_discoverable_timeout(struct hci_dev *hdev); 1300void mgmt_discoverable_timeout(struct hci_dev *hdev);
1290void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable);
1291void mgmt_connectable(struct hci_dev *hdev, u8 connectable);
1292void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
1293void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, 1301void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
1294 bool persistent); 1302 bool persistent);
1295void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1303void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
@@ -1350,34 +1358,6 @@ void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,
1350void mgmt_reenable_advertising(struct hci_dev *hdev); 1358void mgmt_reenable_advertising(struct hci_dev *hdev);
1351void mgmt_smp_complete(struct hci_conn *conn, bool complete); 1359void mgmt_smp_complete(struct hci_conn *conn, bool complete);
1352 1360
1353/* HCI info for socket */
1354#define hci_pi(sk) ((struct hci_pinfo *) sk)
1355
1356struct hci_pinfo {
1357 struct bt_sock bt;
1358 struct hci_dev *hdev;
1359 struct hci_filter filter;
1360 __u32 cmsg_mask;
1361 unsigned short channel;
1362};
1363
1364/* HCI security filter */
1365#define HCI_SFLT_MAX_OGF 5
1366
1367struct hci_sec_filter {
1368 __u32 type_mask;
1369 __u32 event_mask[2];
1370 __u32 ocf_mask[HCI_SFLT_MAX_OGF + 1][4];
1371};
1372
1373/* ----- HCI requests ----- */
1374#define HCI_REQ_DONE 0
1375#define HCI_REQ_PEND 1
1376#define HCI_REQ_CANCELED 2
1377
1378#define hci_req_lock(d) mutex_lock(&d->req_lock)
1379#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
1380
1381u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency, 1361u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
1382 u16 to_multiplier); 1362 u16 to_multiplier);
1383void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand, 1363void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
diff --git a/include/net/bluetooth/hci_sock.h b/include/net/bluetooth/hci_sock.h
new file mode 100644
index 000000000000..9a46d665c1b5
--- /dev/null
+++ b/include/net/bluetooth/hci_sock.h
@@ -0,0 +1,175 @@
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as
9 published by the Free Software Foundation;
10
11 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
12 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
20 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22 SOFTWARE IS DISCLAIMED.
23*/
24
25#ifndef __HCI_SOCK_H
26#define __HCI_SOCK_H
27
28/* Socket options */
29#define HCI_DATA_DIR 1
30#define HCI_FILTER 2
31#define HCI_TIME_STAMP 3
32
33/* CMSG flags */
34#define HCI_CMSG_DIR 0x0001
35#define HCI_CMSG_TSTAMP 0x0002
36
37struct sockaddr_hci {
38 sa_family_t hci_family;
39 unsigned short hci_dev;
40 unsigned short hci_channel;
41};
42#define HCI_DEV_NONE 0xffff
43
44#define HCI_CHANNEL_RAW 0
45#define HCI_CHANNEL_USER 1
46#define HCI_CHANNEL_MONITOR 2
47#define HCI_CHANNEL_CONTROL 3
48
49struct hci_filter {
50 unsigned long type_mask;
51 unsigned long event_mask[2];
52 __le16 opcode;
53};
54
55struct hci_ufilter {
56 __u32 type_mask;
57 __u32 event_mask[2];
58 __le16 opcode;
59};
60
61#define HCI_FLT_TYPE_BITS 31
62#define HCI_FLT_EVENT_BITS 63
63#define HCI_FLT_OGF_BITS 63
64#define HCI_FLT_OCF_BITS 127
65
66/* Ioctl defines */
67#define HCIDEVUP _IOW('H', 201, int)
68#define HCIDEVDOWN _IOW('H', 202, int)
69#define HCIDEVRESET _IOW('H', 203, int)
70#define HCIDEVRESTAT _IOW('H', 204, int)
71
72#define HCIGETDEVLIST _IOR('H', 210, int)
73#define HCIGETDEVINFO _IOR('H', 211, int)
74#define HCIGETCONNLIST _IOR('H', 212, int)
75#define HCIGETCONNINFO _IOR('H', 213, int)
76#define HCIGETAUTHINFO _IOR('H', 215, int)
77
78#define HCISETRAW _IOW('H', 220, int)
79#define HCISETSCAN _IOW('H', 221, int)
80#define HCISETAUTH _IOW('H', 222, int)
81#define HCISETENCRYPT _IOW('H', 223, int)
82#define HCISETPTYPE _IOW('H', 224, int)
83#define HCISETLINKPOL _IOW('H', 225, int)
84#define HCISETLINKMODE _IOW('H', 226, int)
85#define HCISETACLMTU _IOW('H', 227, int)
86#define HCISETSCOMTU _IOW('H', 228, int)
87
88#define HCIBLOCKADDR _IOW('H', 230, int)
89#define HCIUNBLOCKADDR _IOW('H', 231, int)
90
91#define HCIINQUIRY _IOR('H', 240, int)
92
93/* Ioctl requests structures */
94struct hci_dev_stats {
95 __u32 err_rx;
96 __u32 err_tx;
97 __u32 cmd_tx;
98 __u32 evt_rx;
99 __u32 acl_tx;
100 __u32 acl_rx;
101 __u32 sco_tx;
102 __u32 sco_rx;
103 __u32 byte_rx;
104 __u32 byte_tx;
105};
106
107struct hci_dev_info {
108 __u16 dev_id;
109 char name[8];
110
111 bdaddr_t bdaddr;
112
113 __u32 flags;
114 __u8 type;
115
116 __u8 features[8];
117
118 __u32 pkt_type;
119 __u32 link_policy;
120 __u32 link_mode;
121
122 __u16 acl_mtu;
123 __u16 acl_pkts;
124 __u16 sco_mtu;
125 __u16 sco_pkts;
126
127 struct hci_dev_stats stat;
128};
129
130struct hci_conn_info {
131 __u16 handle;
132 bdaddr_t bdaddr;
133 __u8 type;
134 __u8 out;
135 __u16 state;
136 __u32 link_mode;
137};
138
139struct hci_dev_req {
140 __u16 dev_id;
141 __u32 dev_opt;
142};
143
144struct hci_dev_list_req {
145 __u16 dev_num;
146 struct hci_dev_req dev_req[0]; /* hci_dev_req structures */
147};
148
149struct hci_conn_list_req {
150 __u16 dev_id;
151 __u16 conn_num;
152 struct hci_conn_info conn_info[0];
153};
154
155struct hci_conn_info_req {
156 bdaddr_t bdaddr;
157 __u8 type;
158 struct hci_conn_info conn_info[0];
159};
160
161struct hci_auth_info_req {
162 bdaddr_t bdaddr;
163 __u8 type;
164};
165
166struct hci_inquiry_req {
167 __u16 dev_id;
168 __u16 flags;
169 __u8 lap[3];
170 __u8 length;
171 __u8 num_rsp;
172};
173#define IREQ_CACHE_FLUSH 0x0001
174
175#endif /* __HCI_SOCK_H */
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index e0c6a9abdb62..8df15ad0d43f 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -134,9 +134,12 @@ struct l2cap_conninfo {
134#define L2CAP_FCS_CRC16 0x01 134#define L2CAP_FCS_CRC16 0x01
135 135
136/* L2CAP fixed channels */ 136/* L2CAP fixed channels */
137#define L2CAP_FC_L2CAP 0x02 137#define L2CAP_FC_SIG_BREDR 0x02
138#define L2CAP_FC_CONNLESS 0x04 138#define L2CAP_FC_CONNLESS 0x04
139#define L2CAP_FC_A2MP 0x08 139#define L2CAP_FC_A2MP 0x08
140#define L2CAP_FC_ATT 0x10
141#define L2CAP_FC_SIG_LE 0x20
142#define L2CAP_FC_SMP_LE 0x40
140 143
141/* L2CAP Control Field bit masks */ 144/* L2CAP Control Field bit masks */
142#define L2CAP_CTRL_SAR 0xC000 145#define L2CAP_CTRL_SAR 0xC000
@@ -622,11 +625,10 @@ struct l2cap_conn {
622 625
623 struct delayed_work info_timer; 626 struct delayed_work info_timer;
624 627
625 spinlock_t lock;
626
627 struct sk_buff *rx_skb; 628 struct sk_buff *rx_skb;
628 __u32 rx_len; 629 __u32 rx_len;
629 __u8 tx_ident; 630 __u8 tx_ident;
631 struct mutex ident_lock;
630 632
631 struct sk_buff_head pending_rx; 633 struct sk_buff_head pending_rx;
632 struct work_struct pending_rx_work; 634 struct work_struct pending_rx_work;
@@ -903,7 +905,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
903 bdaddr_t *dst, u8 dst_type); 905 bdaddr_t *dst, u8 dst_type);
904int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len); 906int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
905void l2cap_chan_busy(struct l2cap_chan *chan, int busy); 907void l2cap_chan_busy(struct l2cap_chan *chan, int busy);
906int l2cap_chan_check_security(struct l2cap_chan *chan); 908int l2cap_chan_check_security(struct l2cap_chan *chan, bool initiator);
907void l2cap_chan_set_defaults(struct l2cap_chan *chan); 909void l2cap_chan_set_defaults(struct l2cap_chan *chan);
908int l2cap_ertm_init(struct l2cap_chan *chan); 910int l2cap_ertm_init(struct l2cap_chan *chan);
909void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 911void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h
index 2019d1a0996a..f40ddb4264fc 100644
--- a/include/net/bluetooth/sco.h
+++ b/include/net/bluetooth/sco.h
@@ -27,11 +27,6 @@
27 27
28/* SCO defaults */ 28/* SCO defaults */
29#define SCO_DEFAULT_MTU 500 29#define SCO_DEFAULT_MTU 500
30#define SCO_DEFAULT_FLUSH_TO 0xFFFF
31
32#define SCO_CONN_TIMEOUT (HZ * 40)
33#define SCO_DISCONN_TIMEOUT (HZ * 2)
34#define SCO_CONN_IDLE_TIMEOUT (HZ * 60)
35 30
36/* SCO socket address */ 31/* SCO socket address */
37struct sockaddr_sco { 32struct sockaddr_sco {
@@ -51,29 +46,4 @@ struct sco_conninfo {
51 __u8 dev_class[3]; 46 __u8 dev_class[3];
52}; 47};
53 48
54/* ---- SCO connections ---- */
55struct sco_conn {
56 struct hci_conn *hcon;
57
58 spinlock_t lock;
59 struct sock *sk;
60
61 unsigned int mtu;
62};
63
64#define sco_conn_lock(c) spin_lock(&c->lock);
65#define sco_conn_unlock(c) spin_unlock(&c->lock);
66
67/* ----- SCO socket info ----- */
68#define sco_pi(sk) ((struct sco_pinfo *) sk)
69
70struct sco_pinfo {
71 struct bt_sock bt;
72 bdaddr_t src;
73 bdaddr_t dst;
74 __u32 flags;
75 __u16 setting;
76 struct sco_conn *conn;
77};
78
79#endif /* __SCO_H */ 49#endif /* __SCO_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9ce5cb17ed82..dae2e24616e1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4552,6 +4552,40 @@ void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
4552 */ 4552 */
4553void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn); 4553void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn);
4554 4554
4555/**
4556 * ieee80211_start_rx_ba_session_offl - start a Rx BA session
4557 *
4558 * Some device drivers may offload part of the Rx aggregation flow including
4559 * AddBa/DelBa negotiation but may otherwise be incapable of full Rx
4560 * reordering.
4561 *
4562 * Create structures responsible for reordering so device drivers may call here
4563 * when they complete AddBa negotiation.
4564 *
4565 * @vif: &struct ieee80211_vif pointer from the add_interface callback
4566 * @addr: station mac address
4567 * @tid: the rx tid
4568 */
4569void ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif,
4570 const u8 *addr, u16 tid);
4571
4572/**
4573 * ieee80211_stop_rx_ba_session_offl - stop a Rx BA session
4574 *
4575 * Some device drivers may offload part of the Rx aggregation flow including
4576 * AddBa/DelBa negotiation but may otherwise be incapable of full Rx
4577 * reordering.
4578 *
4579 * Destroy structures responsible for reordering so device drivers may call here
4580 * when they complete DelBa negotiation.
4581 *
4582 * @vif: &struct ieee80211_vif pointer from the add_interface callback
4583 * @addr: station mac address
4584 * @tid: the rx tid
4585 */
4586void ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif,
4587 const u8 *addr, u16 tid);
4588
4555/* Rate control API */ 4589/* Rate control API */
4556 4590
4557/** 4591/**