Lines Matching refs:conn
434 void (*connect_cfm_cb) (struct hci_conn *conn, u8 status);
435 void (*security_cfm_cb) (struct hci_conn *conn, u8 status);
436 void (*disconn_cfm_cb) (struct hci_conn *conn, u8 reason);
442 struct hci_conn *conn; member
468 struct hci_conn *conn; member
558 static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) in hci_conn_ssp_enabled() argument
560 struct hci_dev *hdev = conn->hdev; in hci_conn_ssp_enabled()
562 test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); in hci_conn_ssp_enabled()
565 static inline bool hci_conn_sc_enabled(struct hci_conn *conn) in hci_conn_sc_enabled() argument
567 struct hci_dev *hdev = conn->hdev; in hci_conn_sc_enabled()
569 test_bit(HCI_CONN_SC_ENABLED, &conn->flags); in hci_conn_sc_enabled()
705 int hci_disconnect(struct hci_conn *conn, __u8 reason);
706 bool hci_setup_sync(struct hci_conn *conn, __u16 handle);
707 void hci_sco_setup(struct hci_conn *conn, __u8 status);
711 int hci_conn_del(struct hci_conn *conn);
715 struct hci_chan *hci_chan_create(struct hci_conn *conn);
717 void hci_chan_list_flush(struct hci_conn *conn);
727 int hci_conn_check_link_mode(struct hci_conn *conn);
728 int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
729 int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type,
731 int hci_conn_change_link_key(struct hci_conn *conn);
732 int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
734 void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active);
736 void hci_le_conn_failed(struct hci_conn *conn, u8 status);
759 static inline struct hci_conn *hci_conn_get(struct hci_conn *conn) in hci_conn_get() argument
761 get_device(&conn->dev); in hci_conn_get()
762 return conn; in hci_conn_get()
765 static inline void hci_conn_put(struct hci_conn *conn) in hci_conn_put() argument
767 put_device(&conn->dev); in hci_conn_put()
770 static inline void hci_conn_hold(struct hci_conn *conn) in hci_conn_hold() argument
772 BT_DBG("hcon %p orig refcnt %d", conn, atomic_read(&conn->refcnt)); in hci_conn_hold()
774 atomic_inc(&conn->refcnt); in hci_conn_hold()
775 cancel_delayed_work(&conn->disc_work); in hci_conn_hold()
778 static inline void hci_conn_drop(struct hci_conn *conn) in hci_conn_drop() argument
780 BT_DBG("hcon %p orig refcnt %d", conn, atomic_read(&conn->refcnt)); in hci_conn_drop()
782 if (atomic_dec_and_test(&conn->refcnt)) { in hci_conn_drop()
785 switch (conn->type) { in hci_conn_drop()
788 cancel_delayed_work(&conn->idle_work); in hci_conn_drop()
789 if (conn->state == BT_CONNECTED) { in hci_conn_drop()
790 timeo = conn->disc_timeout; in hci_conn_drop()
791 if (!conn->out) in hci_conn_drop()
799 timeo = conn->disc_timeout; in hci_conn_drop()
807 cancel_delayed_work(&conn->disc_work); in hci_conn_drop()
808 queue_delayed_work(conn->hdev->workqueue, in hci_conn_drop()
809 &conn->disc_work, timeo); in hci_conn_drop()
894 struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
932 void hci_conn_init_sysfs(struct hci_conn *conn);
933 void hci_conn_add_sysfs(struct hci_conn *conn);
934 void hci_conn_del_sysfs(struct hci_conn *conn);
996 static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status) in hci_proto_connect_cfm() argument
998 switch (conn->type) { in hci_proto_connect_cfm()
1001 l2cap_connect_cfm(conn, status); in hci_proto_connect_cfm()
1006 sco_connect_cfm(conn, status); in hci_proto_connect_cfm()
1010 BT_ERR("unknown link type %d", conn->type); in hci_proto_connect_cfm()
1014 if (conn->connect_cfm_cb) in hci_proto_connect_cfm()
1015 conn->connect_cfm_cb(conn, status); in hci_proto_connect_cfm()
1018 static inline int hci_proto_disconn_ind(struct hci_conn *conn) in hci_proto_disconn_ind() argument
1020 if (conn->type != ACL_LINK && conn->type != LE_LINK) in hci_proto_disconn_ind()
1023 return l2cap_disconn_ind(conn); in hci_proto_disconn_ind()
1026 static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason) in hci_proto_disconn_cfm() argument
1028 switch (conn->type) { in hci_proto_disconn_cfm()
1031 l2cap_disconn_cfm(conn, reason); in hci_proto_disconn_cfm()
1036 sco_disconn_cfm(conn, reason); in hci_proto_disconn_cfm()
1044 BT_ERR("unknown link type %d", conn->type); in hci_proto_disconn_cfm()
1048 if (conn->disconn_cfm_cb) in hci_proto_disconn_cfm()
1049 conn->disconn_cfm_cb(conn, reason); in hci_proto_disconn_cfm()
1052 static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status) in hci_proto_auth_cfm() argument
1056 if (conn->type != ACL_LINK && conn->type != LE_LINK) in hci_proto_auth_cfm()
1059 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) in hci_proto_auth_cfm()
1062 encrypt = test_bit(HCI_CONN_ENCRYPT, &conn->flags) ? 0x01 : 0x00; in hci_proto_auth_cfm()
1063 l2cap_security_cfm(conn, status, encrypt); in hci_proto_auth_cfm()
1065 if (conn->security_cfm_cb) in hci_proto_auth_cfm()
1066 conn->security_cfm_cb(conn, status); in hci_proto_auth_cfm()
1069 static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, in hci_proto_encrypt_cfm() argument
1072 if (conn->type != ACL_LINK && conn->type != LE_LINK) in hci_proto_encrypt_cfm()
1075 l2cap_security_cfm(conn, status, encrypt); in hci_proto_encrypt_cfm()
1077 if (conn->security_cfm_cb) in hci_proto_encrypt_cfm()
1078 conn->security_cfm_cb(conn, status); in hci_proto_encrypt_cfm()
1087 void (*security_cfm) (struct hci_conn *conn, __u8 status,
1089 void (*key_change_cfm) (struct hci_conn *conn, __u8 status);
1090 void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role);
1093 static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) in hci_auth_cfm() argument
1098 hci_proto_auth_cfm(conn, status); in hci_auth_cfm()
1100 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags)) in hci_auth_cfm()
1103 encrypt = test_bit(HCI_CONN_ENCRYPT, &conn->flags) ? 0x01 : 0x00; in hci_auth_cfm()
1108 cb->security_cfm(conn, status, encrypt); in hci_auth_cfm()
1113 static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, in hci_encrypt_cfm() argument
1118 if (conn->sec_level == BT_SECURITY_SDP) in hci_encrypt_cfm()
1119 conn->sec_level = BT_SECURITY_LOW; in hci_encrypt_cfm()
1121 if (conn->pending_sec_level > conn->sec_level) in hci_encrypt_cfm()
1122 conn->sec_level = conn->pending_sec_level; in hci_encrypt_cfm()
1124 hci_proto_encrypt_cfm(conn, status, encrypt); in hci_encrypt_cfm()
1129 cb->security_cfm(conn, status, encrypt); in hci_encrypt_cfm()
1134 static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) in hci_key_change_cfm() argument
1141 cb->key_change_cfm(conn, status); in hci_key_change_cfm()
1146 static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, in hci_role_switch_cfm() argument
1154 cb->role_switch_cfm(conn, status, role); in hci_role_switch_cfm()
1274 void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
1344 void mgmt_auth_failed(struct hci_conn *conn, u8 status);
1369 void mgmt_smp_complete(struct hci_conn *conn, bool complete);
1371 u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
1373 void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,