diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-11-05 15:50:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-11-05 15:50:22 -0500 |
commit | 33b443422eda3828814e8c4b17cf4202ec6ac529 (patch) | |
tree | 8bec6c2b851bc7924ff2ec26e08c5858cc4c51fd /include/net/bluetooth/hci_core.h | |
parent | b476d3f143e8b213273834e92615370ca65ff126 (diff) | |
parent | d78a32a8fcf775111ccc9ba611a08ca5c29784b6 (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 89 |
1 files changed, 32 insertions, 57 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 4e208420d84c..8c0ab3d86f95 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -81,6 +81,7 @@ struct hci_conn_hash { | |||
81 | struct bdaddr_list { | 81 | struct bdaddr_list { |
82 | struct list_head list; | 82 | struct list_head list; |
83 | bdaddr_t bdaddr; | 83 | bdaddr_t bdaddr; |
84 | u8 bdaddr_type; | ||
84 | }; | 85 | }; |
85 | 86 | ||
86 | struct bt_uuid { | 87 | struct bt_uuid { |
@@ -141,6 +142,7 @@ struct hci_dev { | |||
141 | __u8 dev_type; | 142 | __u8 dev_type; |
142 | bdaddr_t bdaddr; | 143 | bdaddr_t bdaddr; |
143 | bdaddr_t static_addr; | 144 | bdaddr_t static_addr; |
145 | __u8 own_addr_type; | ||
144 | __u8 dev_name[HCI_MAX_NAME_LENGTH]; | 146 | __u8 dev_name[HCI_MAX_NAME_LENGTH]; |
145 | __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH]; | 147 | __u8 short_name[HCI_MAX_SHORT_NAME_LENGTH]; |
146 | __u8 eir[HCI_MAX_EIR_LENGTH]; | 148 | __u8 eir[HCI_MAX_EIR_LENGTH]; |
@@ -167,6 +169,9 @@ struct hci_dev { | |||
167 | __u8 page_scan_type; | 169 | __u8 page_scan_type; |
168 | __u16 le_scan_interval; | 170 | __u16 le_scan_interval; |
169 | __u16 le_scan_window; | 171 | __u16 le_scan_window; |
172 | __u16 le_conn_min_interval; | ||
173 | __u16 le_conn_max_interval; | ||
174 | __u8 ssp_debug_mode; | ||
170 | 175 | ||
171 | __u16 devid_source; | 176 | __u16 devid_source; |
172 | __u16 devid_vendor; | 177 | __u16 devid_vendor; |
@@ -283,6 +288,8 @@ struct hci_dev { | |||
283 | __s8 adv_tx_power; | 288 | __s8 adv_tx_power; |
284 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | 289 | __u8 adv_data[HCI_MAX_AD_LENGTH]; |
285 | __u8 adv_data_len; | 290 | __u8 adv_data_len; |
291 | __u8 scan_rsp_data[HCI_MAX_AD_LENGTH]; | ||
292 | __u8 scan_rsp_data_len; | ||
286 | 293 | ||
287 | int (*open)(struct hci_dev *hdev); | 294 | int (*open)(struct hci_dev *hdev); |
288 | int (*close)(struct hci_dev *hdev); | 295 | int (*close)(struct hci_dev *hdev); |
@@ -311,7 +318,6 @@ struct hci_conn { | |||
311 | __u8 attempt; | 318 | __u8 attempt; |
312 | __u8 dev_class[3]; | 319 | __u8 dev_class[3]; |
313 | __u8 features[HCI_MAX_PAGES][8]; | 320 | __u8 features[HCI_MAX_PAGES][8]; |
314 | __u16 interval; | ||
315 | __u16 pkt_type; | 321 | __u16 pkt_type; |
316 | __u16 link_policy; | 322 | __u16 link_policy; |
317 | __u32 link_mode; | 323 | __u32 link_mode; |
@@ -339,8 +345,8 @@ struct hci_conn { | |||
339 | struct list_head chan_list; | 345 | struct list_head chan_list; |
340 | 346 | ||
341 | struct delayed_work disc_work; | 347 | struct delayed_work disc_work; |
342 | struct timer_list idle_timer; | 348 | struct delayed_work auto_accept_work; |
343 | struct timer_list auto_accept_timer; | 349 | struct delayed_work idle_work; |
344 | 350 | ||
345 | struct device dev; | 351 | struct device dev; |
346 | 352 | ||
@@ -649,7 +655,7 @@ static inline void hci_conn_drop(struct hci_conn *conn) | |||
649 | switch (conn->type) { | 655 | switch (conn->type) { |
650 | case ACL_LINK: | 656 | case ACL_LINK: |
651 | case LE_LINK: | 657 | case LE_LINK: |
652 | del_timer(&conn->idle_timer); | 658 | cancel_delayed_work(&conn->idle_work); |
653 | if (conn->state == BT_CONNECTED) { | 659 | if (conn->state == BT_CONNECTED) { |
654 | timeo = conn->disc_timeout; | 660 | timeo = conn->disc_timeout; |
655 | if (!conn->out) | 661 | if (!conn->out) |
@@ -730,7 +736,7 @@ int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | |||
730 | int hci_inquiry(void __user *arg); | 736 | int hci_inquiry(void __user *arg); |
731 | 737 | ||
732 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, | 738 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, |
733 | bdaddr_t *bdaddr); | 739 | bdaddr_t *bdaddr, u8 type); |
734 | int hci_blacklist_clear(struct hci_dev *hdev); | 740 | int hci_blacklist_clear(struct hci_dev *hdev); |
735 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 741 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
736 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 742 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
@@ -765,8 +771,6 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); | |||
765 | int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); | 771 | int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); |
766 | 772 | ||
767 | void hci_init_sysfs(struct hci_dev *hdev); | 773 | void hci_init_sysfs(struct hci_dev *hdev); |
768 | int hci_add_sysfs(struct hci_dev *hdev); | ||
769 | void hci_del_sysfs(struct hci_dev *hdev); | ||
770 | void hci_conn_init_sysfs(struct hci_conn *conn); | 774 | void hci_conn_init_sysfs(struct hci_conn *conn); |
771 | void hci_conn_add_sysfs(struct hci_conn *conn); | 775 | void hci_conn_add_sysfs(struct hci_conn *conn); |
772 | void hci_conn_del_sysfs(struct hci_conn *conn); | 776 | void hci_conn_del_sysfs(struct hci_conn *conn); |
@@ -1009,34 +1013,6 @@ static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) | |||
1009 | return false; | 1013 | return false; |
1010 | } | 1014 | } |
1011 | 1015 | ||
1012 | static inline size_t eir_get_length(u8 *eir, size_t eir_len) | ||
1013 | { | ||
1014 | size_t parsed = 0; | ||
1015 | |||
1016 | while (parsed < eir_len) { | ||
1017 | u8 field_len = eir[0]; | ||
1018 | |||
1019 | if (field_len == 0) | ||
1020 | return parsed; | ||
1021 | |||
1022 | parsed += field_len + 1; | ||
1023 | eir += field_len + 1; | ||
1024 | } | ||
1025 | |||
1026 | return eir_len; | ||
1027 | } | ||
1028 | |||
1029 | static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, | ||
1030 | u8 data_len) | ||
1031 | { | ||
1032 | eir[eir_len++] = sizeof(type) + data_len; | ||
1033 | eir[eir_len++] = type; | ||
1034 | memcpy(&eir[eir_len], data, data_len); | ||
1035 | eir_len += data_len; | ||
1036 | |||
1037 | return eir_len; | ||
1038 | } | ||
1039 | |||
1040 | int hci_register_cb(struct hci_cb *hcb); | 1016 | int hci_register_cb(struct hci_cb *hcb); |
1041 | int hci_unregister_cb(struct hci_cb *hcb); | 1017 | int hci_unregister_cb(struct hci_cb *hcb); |
1042 | 1018 | ||
@@ -1100,11 +1076,12 @@ void mgmt_index_added(struct hci_dev *hdev); | |||
1100 | void mgmt_index_removed(struct hci_dev *hdev); | 1076 | void mgmt_index_removed(struct hci_dev *hdev); |
1101 | void mgmt_set_powered_failed(struct hci_dev *hdev, int err); | 1077 | void mgmt_set_powered_failed(struct hci_dev *hdev, int err); |
1102 | int mgmt_powered(struct hci_dev *hdev, u8 powered); | 1078 | int mgmt_powered(struct hci_dev *hdev, u8 powered); |
1103 | int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); | 1079 | void mgmt_discoverable_timeout(struct hci_dev *hdev); |
1104 | int mgmt_connectable(struct hci_dev *hdev, u8 connectable); | 1080 | void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); |
1105 | int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); | 1081 | void mgmt_connectable(struct hci_dev *hdev, u8 connectable); |
1106 | int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, | 1082 | void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); |
1107 | bool persistent); | 1083 | void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, |
1084 | bool persistent); | ||
1108 | void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1085 | void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
1109 | u8 addr_type, u32 flags, u8 *name, u8 name_len, | 1086 | u8 addr_type, u32 flags, u8 *name, u8 name_len, |
1110 | u8 *dev_class); | 1087 | u8 *dev_class); |
@@ -1114,11 +1091,11 @@ void mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
1114 | u8 link_type, u8 addr_type, u8 status); | 1091 | u8 link_type, u8 addr_type, u8 status); |
1115 | void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1092 | void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
1116 | u8 addr_type, u8 status); | 1093 | u8 addr_type, u8 status); |
1117 | int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); | 1094 | void mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); |
1118 | int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1095 | void mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1119 | u8 status); | 1096 | u8 status); |
1120 | int mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1097 | void mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1121 | u8 status); | 1098 | u8 status); |
1122 | int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1099 | int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1123 | u8 link_type, u8 addr_type, __le32 value, | 1100 | u8 link_type, u8 addr_type, __le32 value, |
1124 | u8 confirm_hint); | 1101 | u8 confirm_hint); |
@@ -1135,15 +1112,15 @@ int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
1135 | int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1112 | int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, |
1136 | u8 link_type, u8 addr_type, u32 passkey, | 1113 | u8 link_type, u8 addr_type, u32 passkey, |
1137 | u8 entered); | 1114 | u8 entered); |
1138 | int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1115 | void mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
1139 | u8 addr_type, u8 status); | 1116 | u8 addr_type, u8 status); |
1140 | int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); | 1117 | void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); |
1141 | int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); | 1118 | void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); |
1142 | int mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, | 1119 | void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, |
1143 | u8 status); | 1120 | u8 status); |
1144 | int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); | 1121 | void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); |
1145 | int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, | 1122 | void mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, |
1146 | u8 *randomizer, u8 status); | 1123 | u8 *randomizer, u8 status); |
1147 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 1124 | void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
1148 | u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, | 1125 | u8 addr_type, u8 *dev_class, s8 rssi, u8 cfm_name, |
1149 | u8 ssp, u8 *eir, u16 eir_len); | 1126 | u8 ssp, u8 *eir, u16 eir_len); |
@@ -1152,7 +1129,7 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
1152 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); | 1129 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); |
1153 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 1130 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
1154 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 1131 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
1155 | int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); | 1132 | void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); |
1156 | void mgmt_reenable_advertising(struct hci_dev *hdev); | 1133 | void mgmt_reenable_advertising(struct hci_dev *hdev); |
1157 | 1134 | ||
1158 | /* HCI info for socket */ | 1135 | /* HCI info for socket */ |
@@ -1183,8 +1160,6 @@ struct hci_sec_filter { | |||
1183 | #define hci_req_lock(d) mutex_lock(&d->req_lock) | 1160 | #define hci_req_lock(d) mutex_lock(&d->req_lock) |
1184 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) | 1161 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) |
1185 | 1162 | ||
1186 | void hci_update_ad(struct hci_request *req); | ||
1187 | |||
1188 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | 1163 | void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, |
1189 | u16 latency, u16 to_multiplier); | 1164 | u16 latency, u16 to_multiplier); |
1190 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], | 1165 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], |