Thomas Gleixner | 97fb5e8 | 2019-05-29 07:17:58 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrei Emeltchenko | 903e454 | 2012-09-27 17:26:09 +0300 | [diff] [blame] | 2 | /* |
| 3 | Copyright (c) 2011,2012 Intel Corp. |
| 4 | |
Andrei Emeltchenko | 903e454 | 2012-09-27 17:26:09 +0300 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __AMP_H |
| 8 | #define __AMP_H |
| 9 | |
Andrei Emeltchenko | 52c0d6e | 2012-09-27 17:26:12 +0300 | [diff] [blame] | 10 | struct 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 | |
| 20 | int amp_ctrl_put(struct amp_ctrl *ctrl); |
Andrei Emeltchenko | 0b26ab9 | 2012-09-27 17:26:24 +0300 | [diff] [blame] | 21 | void amp_ctrl_get(struct amp_ctrl *ctrl); |
Andrei Emeltchenko | fa4ebc6 | 2012-10-05 16:56:55 +0300 | [diff] [blame] | 22 | struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); |
Andrei Emeltchenko | 52c0d6e | 2012-09-27 17:26:12 +0300 | [diff] [blame] | 23 | struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); |
| 24 | void amp_ctrl_list_flush(struct amp_mgr *mgr); |
| 25 | |
Andrei Emeltchenko | 3161ae1 | 2012-09-27 17:26:11 +0300 | [diff] [blame] | 26 | struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, |
Andrei Emeltchenko | a0c234f | 2012-10-05 16:56:56 +0300 | [diff] [blame] | 27 | u8 remote_id, bool out); |
Andrei Emeltchenko | 3161ae1 | 2012-09-27 17:26:11 +0300 | [diff] [blame] | 28 | |
Andrei Emeltchenko | 5a34918 | 2012-09-27 17:26:18 +0300 | [diff] [blame] | 29 | int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); |
| 30 | |
Andrei Emeltchenko | 903e454 | 2012-09-27 17:26:09 +0300 | [diff] [blame] | 31 | void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); |
| 32 | void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); |
| 33 | void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); |
Andrei Emeltchenko | 9495b2e | 2012-09-27 17:26:22 +0300 | [diff] [blame] | 34 | void amp_read_loc_assoc_final_data(struct hci_dev *hdev, |
| 35 | struct hci_conn *hcon); |
Andrei Emeltchenko | a02226d | 2012-09-27 17:26:19 +0300 | [diff] [blame] | 36 | void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, |
| 37 | struct hci_conn *hcon); |
Andrei Emeltchenko | dffa387 | 2012-09-27 17:26:23 +0300 | [diff] [blame] | 38 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, |
| 39 | struct hci_conn *hcon); |
Arron Wang | 244bc37 | 2015-07-24 17:12:55 +0800 | [diff] [blame] | 40 | |
| 41 | #if IS_ENABLED(CONFIG_BT_HS) |
| 42 | void amp_create_logical_link(struct l2cap_chan *chan); |
| 43 | void amp_disconnect_logical_link(struct hci_chan *hchan); |
| 44 | #else |
| 45 | static inline void amp_create_logical_link(struct l2cap_chan *chan) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | static inline void amp_disconnect_logical_link(struct hci_chan *hchan) |
| 50 | { |
| 51 | } |
| 52 | #endif |
| 53 | |
Andrei Emeltchenko | 93c284e | 2012-09-27 17:26:20 +0300 | [diff] [blame] | 54 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); |
| 55 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); |
Andrei Emeltchenko | cf70ff2 | 2012-10-31 15:46:36 +0200 | [diff] [blame] | 56 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); |
Andrei Emeltchenko | 5ce66b5 | 2012-10-31 15:46:30 +0200 | [diff] [blame] | 57 | void amp_create_logical_link(struct l2cap_chan *chan); |
Andrei Emeltchenko | 419e08c | 2012-10-31 15:46:34 +0200 | [diff] [blame] | 58 | void amp_disconnect_logical_link(struct hci_chan *hchan); |
Andrei Emeltchenko | 606e2a1 | 2012-10-31 15:46:31 +0200 | [diff] [blame] | 59 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); |
Andrei Emeltchenko | 903e454 | 2012-09-27 17:26:09 +0300 | [diff] [blame] | 60 | |
| 61 | #endif /* __AMP_H */ |