aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci_core.h
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-11-05 15:50:22 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-11-05 15:50:22 -0500
commit33b443422eda3828814e8c4b17cf4202ec6ac529 (patch)
tree8bec6c2b851bc7924ff2ec26e08c5858cc4c51fd /include/net/bluetooth/hci_core.h
parentb476d3f143e8b213273834e92615370ca65ff126 (diff)
parentd78a32a8fcf775111ccc9ba611a08ca5c29784b6 (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.h89
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 {
81struct bdaddr_list { 81struct 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
86struct bt_uuid { 87struct 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);
730int hci_inquiry(void __user *arg); 736int hci_inquiry(void __user *arg);
731 737
732struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, 738struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev,
733 bdaddr_t *bdaddr); 739 bdaddr_t *bdaddr, u8 type);
734int hci_blacklist_clear(struct hci_dev *hdev); 740int hci_blacklist_clear(struct hci_dev *hdev);
735int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 741int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
736int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 742int 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);
765int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count); 771int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count);
766 772
767void hci_init_sysfs(struct hci_dev *hdev); 773void hci_init_sysfs(struct hci_dev *hdev);
768int hci_add_sysfs(struct hci_dev *hdev);
769void hci_del_sysfs(struct hci_dev *hdev);
770void hci_conn_init_sysfs(struct hci_conn *conn); 774void hci_conn_init_sysfs(struct hci_conn *conn);
771void hci_conn_add_sysfs(struct hci_conn *conn); 775void hci_conn_add_sysfs(struct hci_conn *conn);
772void hci_conn_del_sysfs(struct hci_conn *conn); 776void 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
1012static 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
1029static 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
1040int hci_register_cb(struct hci_cb *hcb); 1016int hci_register_cb(struct hci_cb *hcb);
1041int hci_unregister_cb(struct hci_cb *hcb); 1017int hci_unregister_cb(struct hci_cb *hcb);
1042 1018
@@ -1100,11 +1076,12 @@ void mgmt_index_added(struct hci_dev *hdev);
1100void mgmt_index_removed(struct hci_dev *hdev); 1076void mgmt_index_removed(struct hci_dev *hdev);
1101void mgmt_set_powered_failed(struct hci_dev *hdev, int err); 1077void mgmt_set_powered_failed(struct hci_dev *hdev, int err);
1102int mgmt_powered(struct hci_dev *hdev, u8 powered); 1078int mgmt_powered(struct hci_dev *hdev, u8 powered);
1103int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); 1079void mgmt_discoverable_timeout(struct hci_dev *hdev);
1104int mgmt_connectable(struct hci_dev *hdev, u8 connectable); 1080void mgmt_discoverable(struct hci_dev *hdev, u8 discoverable);
1105int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); 1081void mgmt_connectable(struct hci_dev *hdev, u8 connectable);
1106int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, 1082void mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
1107 bool persistent); 1083void mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
1084 bool persistent);
1108void mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1085void 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);
1115void mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1092void 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);
1117int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); 1094void mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure);
1118int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, 1095void mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
1119 u8 status); 1096 u8 status);
1120int mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, 1097void mgmt_pin_code_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
1121 u8 status); 1098 u8 status);
1122int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, 1099int 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,
1135int mgmt_user_passkey_notify(struct hci_dev *hdev, bdaddr_t *bdaddr, 1112int 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);
1138int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1115void 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);
1140int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status); 1117void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
1141int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status); 1118void mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 enable, u8 status);
1142int mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class, 1119void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
1143 u8 status); 1120 u8 status);
1144int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); 1121void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
1145int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, 1122void mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash,
1146 u8 *randomizer, u8 status); 1123 u8 *randomizer, u8 status);
1147void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1124void 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,
1152void mgmt_discovering(struct hci_dev *hdev, u8 discovering); 1129void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
1153int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 1130int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1154int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 1131int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1155int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent); 1132void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent);
1156void mgmt_reenable_advertising(struct hci_dev *hdev); 1133void 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
1186void hci_update_ad(struct hci_request *req);
1187
1188void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 1163void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
1189 u16 latency, u16 to_multiplier); 1164 u16 latency, u16 to_multiplier);
1190void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], 1165void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],