diff options
author | John W. Linville <linville@tuxdriver.com> | 2014-12-05 14:12:24 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-12-05 14:12:24 -0500 |
commit | f700076a9d1024a8184a7b6642edebd53a46a481 (patch) | |
tree | 4383ac2a2e624a0757f658b406ac335d89c829c9 /include | |
parent | 7be6ff65ce7df4fc6bfd87d261a723a5558fee72 (diff) | |
parent | 5a34bd5f5d8119def4feb1d2b4e3906b71059416 (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/hci.h | 41 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 38 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 6 | ||||
-rw-r--r-- | include/net/bluetooth/mgmt.h | 12 |
4 files changed, 71 insertions, 26 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index e56f9099f8e3..40129b3838b2 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -163,6 +163,7 @@ enum { | |||
163 | enum { | 163 | enum { |
164 | HCI_DUT_MODE, | 164 | HCI_DUT_MODE, |
165 | HCI_FORCE_SC, | 165 | HCI_FORCE_SC, |
166 | HCI_FORCE_LESC, | ||
166 | HCI_FORCE_STATIC_ADDR, | 167 | HCI_FORCE_STATIC_ADDR, |
167 | }; | 168 | }; |
168 | 169 | ||
@@ -342,6 +343,7 @@ enum { | |||
342 | #define HCI_LE_ENCRYPTION 0x01 | 343 | #define HCI_LE_ENCRYPTION 0x01 |
343 | #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 | 344 | #define HCI_LE_CONN_PARAM_REQ_PROC 0x02 |
344 | #define HCI_LE_PING 0x10 | 345 | #define HCI_LE_PING 0x10 |
346 | #define HCI_LE_EXT_SCAN_POLICY 0x80 | ||
345 | 347 | ||
346 | /* Connection modes */ | 348 | /* Connection modes */ |
347 | #define HCI_CM_ACTIVE 0x0000 | 349 | #define HCI_CM_ACTIVE 0x0000 |
@@ -411,6 +413,7 @@ enum { | |||
411 | 413 | ||
412 | /* The core spec defines 127 as the "not available" value */ | 414 | /* The core spec defines 127 as the "not available" value */ |
413 | #define HCI_TX_POWER_INVALID 127 | 415 | #define HCI_TX_POWER_INVALID 127 |
416 | #define HCI_RSSI_INVALID 127 | ||
414 | 417 | ||
415 | #define HCI_ROLE_MASTER 0x00 | 418 | #define HCI_ROLE_MASTER 0x00 |
416 | #define HCI_ROLE_SLAVE 0x01 | 419 | #define HCI_ROLE_SLAVE 0x01 |
@@ -1749,6 +1752,25 @@ struct hci_ev_le_conn_complete { | |||
1749 | __u8 clk_accurancy; | 1752 | __u8 clk_accurancy; |
1750 | } __packed; | 1753 | } __packed; |
1751 | 1754 | ||
1755 | /* Advertising report event types */ | ||
1756 | #define LE_ADV_IND 0x00 | ||
1757 | #define LE_ADV_DIRECT_IND 0x01 | ||
1758 | #define LE_ADV_SCAN_IND 0x02 | ||
1759 | #define LE_ADV_NONCONN_IND 0x03 | ||
1760 | #define LE_ADV_SCAN_RSP 0x04 | ||
1761 | |||
1762 | #define ADDR_LE_DEV_PUBLIC 0x00 | ||
1763 | #define ADDR_LE_DEV_RANDOM 0x01 | ||
1764 | |||
1765 | #define HCI_EV_LE_ADVERTISING_REPORT 0x02 | ||
1766 | struct hci_ev_le_advertising_info { | ||
1767 | __u8 evt_type; | ||
1768 | __u8 bdaddr_type; | ||
1769 | bdaddr_t bdaddr; | ||
1770 | __u8 length; | ||
1771 | __u8 data[0]; | ||
1772 | } __packed; | ||
1773 | |||
1752 | #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 | 1774 | #define HCI_EV_LE_CONN_UPDATE_COMPLETE 0x03 |
1753 | struct hci_ev_le_conn_update_complete { | 1775 | struct hci_ev_le_conn_update_complete { |
1754 | __u8 status; | 1776 | __u8 status; |
@@ -1774,23 +1796,14 @@ struct hci_ev_le_remote_conn_param_req { | |||
1774 | __le16 timeout; | 1796 | __le16 timeout; |
1775 | } __packed; | 1797 | } __packed; |
1776 | 1798 | ||
1777 | /* Advertising report event types */ | 1799 | #define HCI_EV_LE_DIRECT_ADV_REPORT 0x0B |
1778 | #define LE_ADV_IND 0x00 | 1800 | struct hci_ev_le_direct_adv_info { |
1779 | #define LE_ADV_DIRECT_IND 0x01 | ||
1780 | #define LE_ADV_SCAN_IND 0x02 | ||
1781 | #define LE_ADV_NONCONN_IND 0x03 | ||
1782 | #define LE_ADV_SCAN_RSP 0x04 | ||
1783 | |||
1784 | #define ADDR_LE_DEV_PUBLIC 0x00 | ||
1785 | #define ADDR_LE_DEV_RANDOM 0x01 | ||
1786 | |||
1787 | #define HCI_EV_LE_ADVERTISING_REPORT 0x02 | ||
1788 | struct hci_ev_le_advertising_info { | ||
1789 | __u8 evt_type; | 1801 | __u8 evt_type; |
1790 | __u8 bdaddr_type; | 1802 | __u8 bdaddr_type; |
1791 | bdaddr_t bdaddr; | 1803 | bdaddr_t bdaddr; |
1792 | __u8 length; | 1804 | __u8 direct_addr_type; |
1793 | __u8 data[0]; | 1805 | bdaddr_t direct_addr; |
1806 | __s8 rssi; | ||
1794 | } __packed; | 1807 | } __packed; |
1795 | 1808 | ||
1796 | /* Internal events generated by Bluetooth stack */ | 1809 | /* Internal events generated by Bluetooth stack */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 396c09840fdf..3c7827005c25 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -75,6 +75,10 @@ struct discovery_state { | |||
75 | u32 last_adv_flags; | 75 | u32 last_adv_flags; |
76 | u8 last_adv_data[HCI_MAX_AD_LENGTH]; | 76 | u8 last_adv_data[HCI_MAX_AD_LENGTH]; |
77 | u8 last_adv_data_len; | 77 | u8 last_adv_data_len; |
78 | bool report_invalid_rssi; | ||
79 | s8 rssi; | ||
80 | u16 uuid_count; | ||
81 | u8 (*uuids)[16]; | ||
78 | }; | 82 | }; |
79 | 83 | ||
80 | struct hci_conn_hash { | 84 | struct hci_conn_hash { |
@@ -140,6 +144,7 @@ struct link_key { | |||
140 | struct oob_data { | 144 | struct oob_data { |
141 | struct list_head list; | 145 | struct list_head list; |
142 | bdaddr_t bdaddr; | 146 | bdaddr_t bdaddr; |
147 | u8 bdaddr_type; | ||
143 | u8 hash192[16]; | 148 | u8 hash192[16]; |
144 | u8 rand192[16]; | 149 | u8 rand192[16]; |
145 | u8 hash256[16]; | 150 | u8 hash256[16]; |
@@ -306,6 +311,7 @@ struct hci_dev { | |||
306 | __u32 req_result; | 311 | __u32 req_result; |
307 | 312 | ||
308 | void *smp_data; | 313 | void *smp_data; |
314 | void *smp_bredr_data; | ||
309 | 315 | ||
310 | struct discovery_state discovery; | 316 | struct discovery_state discovery; |
311 | struct hci_conn_hash conn_hash; | 317 | struct hci_conn_hash conn_hash; |
@@ -501,6 +507,17 @@ static inline void discovery_init(struct hci_dev *hdev) | |||
501 | INIT_LIST_HEAD(&hdev->discovery.all); | 507 | INIT_LIST_HEAD(&hdev->discovery.all); |
502 | INIT_LIST_HEAD(&hdev->discovery.unknown); | 508 | INIT_LIST_HEAD(&hdev->discovery.unknown); |
503 | INIT_LIST_HEAD(&hdev->discovery.resolve); | 509 | INIT_LIST_HEAD(&hdev->discovery.resolve); |
510 | hdev->discovery.report_invalid_rssi = true; | ||
511 | hdev->discovery.rssi = HCI_RSSI_INVALID; | ||
512 | } | ||
513 | |||
514 | static inline void hci_discovery_filter_clear(struct hci_dev *hdev) | ||
515 | { | ||
516 | hdev->discovery.report_invalid_rssi = true; | ||
517 | hdev->discovery.rssi = HCI_RSSI_INVALID; | ||
518 | hdev->discovery.uuid_count = 0; | ||
519 | kfree(hdev->discovery.uuids); | ||
520 | hdev->discovery.uuids = NULL; | ||
504 | } | 521 | } |
505 | 522 | ||
506 | bool hci_discovery_active(struct hci_dev *hdev); | 523 | bool hci_discovery_active(struct hci_dev *hdev); |
@@ -559,6 +576,7 @@ enum { | |||
559 | HCI_CONN_AUTH_INITIATOR, | 576 | HCI_CONN_AUTH_INITIATOR, |
560 | HCI_CONN_DROP, | 577 | HCI_CONN_DROP, |
561 | HCI_CONN_PARAM_REMOVAL_PEND, | 578 | HCI_CONN_PARAM_REMOVAL_PEND, |
579 | HCI_CONN_NEW_LINK_KEY, | ||
562 | }; | 580 | }; |
563 | 581 | ||
564 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 582 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
@@ -921,13 +939,11 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | |||
921 | struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, | 939 | struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, |
922 | bdaddr_t *bdaddr, u8 *val, u8 type, | 940 | bdaddr_t *bdaddr, u8 *val, u8 type, |
923 | u8 pin_len, bool *persistent); | 941 | u8 pin_len, bool *persistent); |
924 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand, | ||
925 | u8 role); | ||
926 | struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, | 942 | struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, |
927 | u8 addr_type, u8 type, u8 authenticated, | 943 | u8 addr_type, u8 type, u8 authenticated, |
928 | u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); | 944 | u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); |
929 | struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, | 945 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, |
930 | u8 addr_type, u8 role); | 946 | u8 addr_type, u8 role); |
931 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); | 947 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); |
932 | void hci_smp_ltks_clear(struct hci_dev *hdev); | 948 | void hci_smp_ltks_clear(struct hci_dev *hdev); |
933 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 949 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
@@ -942,13 +958,12 @@ void hci_smp_irks_clear(struct hci_dev *hdev); | |||
942 | 958 | ||
943 | void hci_remote_oob_data_clear(struct hci_dev *hdev); | 959 | void hci_remote_oob_data_clear(struct hci_dev *hdev); |
944 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, | 960 | struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, |
945 | bdaddr_t *bdaddr); | 961 | bdaddr_t *bdaddr, u8 bdaddr_type); |
946 | int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | 962 | int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, |
947 | u8 *hash, u8 *rand); | 963 | u8 bdaddr_type, u8 *hash192, u8 *rand192, |
948 | int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr, | 964 | u8 *hash256, u8 *rand256); |
949 | u8 *hash192, u8 *rand192, | 965 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, |
950 | u8 *hash256, u8 *rand256); | 966 | u8 bdaddr_type); |
951 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | ||
952 | 967 | ||
953 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 968 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
954 | 969 | ||
@@ -999,6 +1014,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
999 | 1014 | ||
1000 | #define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ | 1015 | #define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ |
1001 | !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) | 1016 | !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) |
1017 | #define bredr_sc_enabled(dev) ((lmp_sc_capable(dev) || \ | ||
1018 | test_bit(HCI_FORCE_SC, &(dev)->dbg_flags)) && \ | ||
1019 | test_bit(HCI_SC_ENABLED, &(dev)->dev_flags)) | ||
1002 | 1020 | ||
1003 | /* ----- HCI protocols ----- */ | 1021 | /* ----- HCI protocols ----- */ |
1004 | #define HCI_PROTO_DEFER 0x01 | 1022 | #define HCI_PROTO_DEFER 0x01 |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 061e648052c8..eee3ef530e79 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -141,6 +141,7 @@ struct l2cap_conninfo { | |||
141 | #define L2CAP_FC_ATT 0x10 | 141 | #define L2CAP_FC_ATT 0x10 |
142 | #define L2CAP_FC_SIG_LE 0x20 | 142 | #define L2CAP_FC_SIG_LE 0x20 |
143 | #define L2CAP_FC_SMP_LE 0x40 | 143 | #define L2CAP_FC_SMP_LE 0x40 |
144 | #define L2CAP_FC_SMP_BREDR 0x80 | ||
144 | 145 | ||
145 | /* L2CAP Control Field bit masks */ | 146 | /* L2CAP Control Field bit masks */ |
146 | #define L2CAP_CTRL_SAR 0xC000 | 147 | #define L2CAP_CTRL_SAR 0xC000 |
@@ -255,6 +256,7 @@ struct l2cap_conn_rsp { | |||
255 | #define L2CAP_CID_ATT 0x0004 | 256 | #define L2CAP_CID_ATT 0x0004 |
256 | #define L2CAP_CID_LE_SIGNALING 0x0005 | 257 | #define L2CAP_CID_LE_SIGNALING 0x0005 |
257 | #define L2CAP_CID_SMP 0x0006 | 258 | #define L2CAP_CID_SMP 0x0006 |
259 | #define L2CAP_CID_SMP_BREDR 0x0007 | ||
258 | #define L2CAP_CID_DYN_START 0x0040 | 260 | #define L2CAP_CID_DYN_START 0x0040 |
259 | #define L2CAP_CID_DYN_END 0xffff | 261 | #define L2CAP_CID_DYN_END 0xffff |
260 | #define L2CAP_CID_LE_DYN_END 0x007f | 262 | #define L2CAP_CID_LE_DYN_END 0x007f |
@@ -619,8 +621,8 @@ struct l2cap_conn { | |||
619 | unsigned int mtu; | 621 | unsigned int mtu; |
620 | 622 | ||
621 | __u32 feat_mask; | 623 | __u32 feat_mask; |
622 | __u8 fixed_chan_mask; | 624 | __u8 remote_fixed_chan; |
623 | bool hs_enabled; | 625 | __u8 local_fixed_chan; |
624 | 626 | ||
625 | __u8 info_state; | 627 | __u8 info_state; |
626 | __u8 info_ident; | 628 | __u8 info_ident; |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index b391fd663468..95c34d5180fa 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -184,6 +184,9 @@ struct mgmt_cp_load_link_keys { | |||
184 | 184 | ||
185 | #define MGMT_LTK_UNAUTHENTICATED 0x00 | 185 | #define MGMT_LTK_UNAUTHENTICATED 0x00 |
186 | #define MGMT_LTK_AUTHENTICATED 0x01 | 186 | #define MGMT_LTK_AUTHENTICATED 0x01 |
187 | #define MGMT_LTK_P256_UNAUTH 0x02 | ||
188 | #define MGMT_LTK_P256_AUTH 0x03 | ||
189 | #define MGMT_LTK_P256_DEBUG 0x04 | ||
187 | 190 | ||
188 | struct mgmt_ltk_info { | 191 | struct mgmt_ltk_info { |
189 | struct mgmt_addr_info addr; | 192 | struct mgmt_addr_info addr; |
@@ -495,6 +498,15 @@ struct mgmt_cp_set_public_address { | |||
495 | } __packed; | 498 | } __packed; |
496 | #define MGMT_SET_PUBLIC_ADDRESS_SIZE 6 | 499 | #define MGMT_SET_PUBLIC_ADDRESS_SIZE 6 |
497 | 500 | ||
501 | #define MGMT_OP_START_SERVICE_DISCOVERY 0x003A | ||
502 | struct mgmt_cp_start_service_discovery { | ||
503 | __u8 type; | ||
504 | __s8 rssi; | ||
505 | __le16 uuid_count; | ||
506 | __u8 uuids[0][16]; | ||
507 | } __packed; | ||
508 | #define MGMT_START_SERVICE_DISCOVERY_SIZE 4 | ||
509 | |||
498 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 510 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
499 | struct mgmt_ev_cmd_complete { | 511 | struct mgmt_ev_cmd_complete { |
500 | __le16 opcode; | 512 | __le16 opcode; |