blob: 832764dfbfb3ef194404b0937b3744670a4d6650 [file] [log] [blame]
Thomas Gleixner97fb5e82019-05-29 07:17:58 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Andrei Emeltchenko903e4542012-09-27 17:26:09 +03002/*
3 Copyright (c) 2011,2012 Intel Corp.
4
Andrei Emeltchenko903e4542012-09-27 17:26:09 +03005*/
6
7#ifndef __AMP_H
8#define __AMP_H
9
Andrei Emeltchenko52c0d6e2012-09-27 17:26:12 +030010struct amp_ctrl {
11 struct list_head list;
12 struct kref kref;
13 __u8 id;
14 __u16 assoc_len_so_far;
15 __u16 assoc_rem_len;
16 __u16 assoc_len;
17 __u8 *assoc;
18};
19
20int amp_ctrl_put(struct amp_ctrl *ctrl);
Andrei Emeltchenko0b26ab92012-09-27 17:26:24 +030021void amp_ctrl_get(struct amp_ctrl *ctrl);
Andrei Emeltchenkofa4ebc62012-10-05 16:56:55 +030022struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id);
Andrei Emeltchenko52c0d6e2012-09-27 17:26:12 +030023struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id);
24void amp_ctrl_list_flush(struct amp_mgr *mgr);
25
Andrei Emeltchenko3161ae12012-09-27 17:26:11 +030026struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
Andrei Emeltchenkoa0c234f2012-10-05 16:56:56 +030027 u8 remote_id, bool out);
Andrei Emeltchenko3161ae12012-09-27 17:26:11 +030028
Andrei Emeltchenko5a349182012-09-27 17:26:18 +030029int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type);
30
Andrei Emeltchenko903e4542012-09-27 17:26:09 +030031void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr);
32void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle);
33void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr);
Andrei Emeltchenko9495b2e2012-09-27 17:26:22 +030034void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
35 struct hci_conn *hcon);
Andrei Emeltchenkoa02226d2012-09-27 17:26:19 +030036void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
37 struct hci_conn *hcon);
Andrei Emeltchenkodffa3872012-09-27 17:26:23 +030038void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
39 struct hci_conn *hcon);
Arron Wang244bc372015-07-24 17:12:55 +080040
41#if IS_ENABLED(CONFIG_BT_HS)
42void amp_create_logical_link(struct l2cap_chan *chan);
43void amp_disconnect_logical_link(struct hci_chan *hchan);
44#else
45static inline void amp_create_logical_link(struct l2cap_chan *chan)
46{
47}
48
49static inline void amp_disconnect_logical_link(struct hci_chan *hchan)
50{
51}
52#endif
53
Andrei Emeltchenko93c284e2012-09-27 17:26:20 +030054void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
55void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
Andrei Emeltchenkocf70ff22012-10-31 15:46:36 +020056void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);
Andrei Emeltchenko5ce66b52012-10-31 15:46:30 +020057void amp_create_logical_link(struct l2cap_chan *chan);
Andrei Emeltchenko419e08c2012-10-31 15:46:34 +020058void amp_disconnect_logical_link(struct hci_chan *hchan);
Andrei Emeltchenko606e2a12012-10-31 15:46:31 +020059void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason);
Andrei Emeltchenko903e4542012-09-27 17:26:09 +030060
61#endif /* __AMP_H */