aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r--include/net/bluetooth/hci_core.h37
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
797static 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
794static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, 821static 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);
987int hci_reset_dev(struct hci_dev *hdev); 1014int hci_reset_dev(struct hci_dev *hdev);
988int hci_dev_open(__u16 dev); 1015int hci_dev_open(__u16 dev);
989int hci_dev_close(__u16 dev); 1016int hci_dev_close(__u16 dev);
1017int hci_dev_do_close(struct hci_dev *hdev);
990int hci_dev_reset(__u16 dev); 1018int hci_dev_reset(__u16 dev);
991int hci_dev_reset_stat(__u16 dev); 1019int hci_dev_reset_stat(__u16 dev);
992int hci_dev_cmd(unsigned int cmd, void __user *arg); 1020int hci_dev_cmd(unsigned int cmd, void __user *arg);
@@ -1014,9 +1042,6 @@ void hci_conn_params_clear_disabled(struct hci_dev *hdev);
1014struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list, 1042struct 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);
1017struct hci_conn_params *hci_explicit_connect_lookup(struct hci_dev *hdev,
1018 bdaddr_t *addr,
1019 u8 addr_type);
1020 1045
1021void hci_uuids_clear(struct hci_dev *hdev); 1046void hci_uuids_clear(struct hci_dev *hdev);
1022 1047
@@ -1065,6 +1090,7 @@ int hci_remove_adv_instance(struct hci_dev *hdev, u8 instance);
1065void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 1090void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
1066 1091
1067int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb); 1092int hci_recv_frame(struct hci_dev *hdev, struct sk_buff *skb);
1093int hci_recv_diag(struct hci_dev *hdev, struct sk_buff *skb);
1068 1094
1069void hci_init_sysfs(struct hci_dev *hdev); 1095void hci_init_sysfs(struct hci_dev *hdev);
1070void hci_conn_init_sysfs(struct hci_conn *conn); 1096void 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
1349void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); 1375void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
1350 1376
1377struct 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 ----- */
1352void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); 1381void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
1353void hci_send_to_channel(unsigned short channel, struct sk_buff *skb, 1382void 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,
1452void mgmt_discovering(struct hci_dev *hdev, u8 discovering); 1481void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
1453bool mgmt_powering_down(struct hci_dev *hdev); 1482bool mgmt_powering_down(struct hci_dev *hdev);
1454void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent); 1483void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent);
1455void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk); 1484void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent);
1456void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk, 1485void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk,
1457 bool persistent); 1486 bool persistent);
1458void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr, 1487void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,