blob: 8848f8158ae45d61013b5373ce4d882969178c25 [file] [log] [blame]
Andrei Emeltchenko903e4542012-09-27 17:26:09 +03001/*
2 Copyright (c) 2011,2012 Intel Corp.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2 and
6 only version 2 as published by the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12*/
13
14#ifndef __AMP_H
15#define __AMP_H
16
Andrei Emeltchenko52c0d6e2012-09-27 17:26:12 +030017struct amp_ctrl {
18 struct list_head list;
19 struct kref kref;
20 __u8 id;
21 __u16 assoc_len_so_far;
22 __u16 assoc_rem_len;
23 __u16 assoc_len;
24 __u8 *assoc;
25};
26
27int amp_ctrl_put(struct amp_ctrl *ctrl);
Andrei Emeltchenko0b26ab92012-09-27 17:26:24 +030028void amp_ctrl_get(struct amp_ctrl *ctrl);
Andrei Emeltchenkofa4ebc62012-10-05 16:56:55 +030029struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id);
Andrei Emeltchenko52c0d6e2012-09-27 17:26:12 +030030struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id);
31void amp_ctrl_list_flush(struct amp_mgr *mgr);
32
Andrei Emeltchenko3161ae12012-09-27 17:26:11 +030033struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
Andrei Emeltchenkoa0c234f2012-10-05 16:56:56 +030034 u8 remote_id, bool out);
Andrei Emeltchenko3161ae12012-09-27 17:26:11 +030035
Andrei Emeltchenko5a349182012-09-27 17:26:18 +030036int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type);
37
Andrei Emeltchenko903e4542012-09-27 17:26:09 +030038void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr);
39void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle);
40void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr);
Andrei Emeltchenko9495b2e2012-09-27 17:26:22 +030041void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
42 struct hci_conn *hcon);
Andrei Emeltchenkoa02226d2012-09-27 17:26:19 +030043void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
44 struct hci_conn *hcon);
Andrei Emeltchenkodffa3872012-09-27 17:26:23 +030045void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
46 struct hci_conn *hcon);
Arron Wang244bc372015-07-24 17:12:55 +080047
48#if IS_ENABLED(CONFIG_BT_HS)
49void amp_create_logical_link(struct l2cap_chan *chan);
50void amp_disconnect_logical_link(struct hci_chan *hchan);
51#else
52static inline void amp_create_logical_link(struct l2cap_chan *chan)
53{
54}
55
56static inline void amp_disconnect_logical_link(struct hci_chan *hchan)
57{
58}
59#endif
60
Andrei Emeltchenko93c284e2012-09-27 17:26:20 +030061void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
62void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
Andrei Emeltchenkocf70ff22012-10-31 15:46:36 +020063void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);
Andrei Emeltchenko5ce66b52012-10-31 15:46:30 +020064void amp_create_logical_link(struct l2cap_chan *chan);
Andrei Emeltchenko419e08c2012-10-31 15:46:34 +020065void amp_disconnect_logical_link(struct hci_chan *hchan);
Andrei Emeltchenko606e2a12012-10-31 15:46:31 +020066void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason);
Andrei Emeltchenko903e4542012-09-27 17:26:09 +030067
68#endif /* __AMP_H */