diff options
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9e1a59e01fa2..1878d0a96333 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -398,6 +398,8 @@ struct hci_dev { | |||
398 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); | 398 | int (*send)(struct hci_dev *hdev, struct sk_buff *skb); |
399 | void (*notify)(struct hci_dev *hdev, unsigned int evt); | 399 | void (*notify)(struct hci_dev *hdev, unsigned int evt); |
400 | void (*hw_error)(struct hci_dev *hdev, u8 code); | 400 | void (*hw_error)(struct hci_dev *hdev, u8 code); |
401 | int (*post_init)(struct hci_dev *hdev); | ||
402 | int (*set_diag)(struct hci_dev *hdev, bool enable); | ||
401 | int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); | 403 | int (*set_bdaddr)(struct hci_dev *hdev, const bdaddr_t *bdaddr); |
402 | }; | 404 | }; |
403 | 405 | ||
@@ -469,6 +471,7 @@ struct hci_conn { | |||
469 | struct delayed_work auto_accept_work; | 471 | struct delayed_work auto_accept_work; |
470 | struct delayed_work idle_work; | 472 | struct delayed_work idle_work; |
471 | struct delayed_work le_conn_timeout; | 473 | struct delayed_work le_conn_timeout; |
474 | struct work_struct le_scan_cleanup; | ||
472 | 475 | ||
473 | struct device dev; | 476 | struct device dev; |
474 | struct dentry *debugfs; | 477 | struct dentry *debugfs; |
@@ -791,6 +794,30 @@ static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev, | |||
791 | return NULL; | 794 | return NULL; |
792 | } | 795 | } |
793 | 796 | ||
797 | static inline struct hci_conn *hci_conn_hash_lookup_le(struct hci_dev *hdev, | ||
798 | bdaddr_t *ba, | ||
799 | __u8 ba_type) | ||
800 | { | ||
801 | struct hci_conn_hash *h = &hdev->conn_hash; | ||
802 | struct hci_conn *c; | ||
803 | |||
804 | rcu_read_lock(); | ||
805 | |||
806 | list_for_each_entry_rcu(c, &h->list, list) { | ||
807 | if (c->type != LE_LINK) | ||
808 | continue; | ||
809 | |||
810 | if (ba_type == c->dst_type && !bacmp(&c->dst, ba)) { | ||
811 | rcu_read_unlock(); | ||
812 | return c; | ||
813 | } | ||
814 | } | ||
815 | |||
816 | rcu_read_unlock(); | ||
817 | |||
818 | return NULL; | ||
819 | } | ||
820 | |||
794 | static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, | 821 | static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, |
795 | __u8 type, __u16 state) | 822 | __u8 type, __u16 state) |
796 | { | 823 | { |
@@ -987,6 +1014,7 @@ int hci_resume_dev(struct hci_dev *hdev); | |||
987 | int hci_reset_dev(struct hci_dev *hdev); | 1014 | int hci_reset_dev(struct hci_dev *hdev); |
988 | int hci_dev_open(__u16 dev); | 1015 | int hci_dev_open(__u16 dev); |
989 | int hci_dev_close(__u16 dev); | 1016 | int hci_dev_close(__u16 dev); |
1017 | int hci_dev_do_close(struct hci_dev *hdev); | ||
990 | int hci_dev_reset(__u16 dev); | 1018 | int hci_dev_reset(__u16 dev); |
991 | int hci_dev_reset_stat(__u16 dev); | 1019 | int hci_dev_reset_stat(__u16 dev); |
992 | int hci_dev_cmd(unsigned int cmd, void __user *arg); | 1020 | int hci_dev_cmd(unsigned int cmd, void __user *arg); |
@@ -1014,9 +1042,6 @@ void hci_conn_params_clear_disabled(struct hci_dev *hdev); | |||
1014 | struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, | 1042 | struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, |
1015 | bdaddr_t *addr, | 1043 | bdaddr_t *addr, |
1016 | u8 addr_type); | 1044 | u8 addr_type); |
1017 | struct hci_conn_params *hci_explicit_connect_lookup(struct hci_dev *hdev, | ||
1018 | bdaddr_t *addr, | ||
1019 | u8 addr_type); | ||
1020 | 1045 | ||
1021 | void hci_uuids_clear(struct hci_dev *hdev); | 1046 | void hci_uuids_clear(struct hci_dev *hdev); |
1022 | 1047 | ||
@@ -1065,6 +1090,7 @@ int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance); | |||
1065 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 1090 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
1066 | 1091 | ||
1067 | int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb); | 1092 | int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb); |
1093 | int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb); | ||
1068 | 1094 | ||
1069 | void hci_init_sysfs(struct hci_dev *hdev); | 1095 | void hci_init_sysfs(struct hci_dev *hdev); |
1070 | void hci_conn_init_sysfs(struct hci_conn *conn); | 1096 | void hci_conn_init_sysfs(struct hci_conn *conn); |
@@ -1348,6 +1374,9 @@ void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); | |||
1348 | 1374 | ||
1349 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); | 1375 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); |
1350 | 1376 | ||
1377 | struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, | ||
1378 | const void *param, u32 timeout); | ||
1379 | |||
1351 | /* ----- HCI Sockets ----- */ | 1380 | /* ----- HCI Sockets ----- */ |
1352 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); | 1381 | void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); |
1353 | void hci_send_to_channel(unsigned short channel, struct sk_buff *skb, | 1382 | void hci_send_to_channel(unsigned short channel, struct sk_buff *skb, |
@@ -1452,7 +1481,7 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
1452 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); | 1481 | void mgmt_discovering(struct hci_dev *hdev, u8 discovering); |
1453 | bool mgmt_powering_down(struct hci_dev *hdev); | 1482 | bool mgmt_powering_down(struct hci_dev *hdev); |
1454 | void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); | 1483 | void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); |
1455 | void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk); | 1484 | void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent); |
1456 | void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, | 1485 | void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, |
1457 | bool persistent); | 1486 | bool persistent); |
1458 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, | 1487 | void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, |