^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) Copyright (c) 2011,2012 Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef __AMP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define __AMP_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct amp_ctrl {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct kref kref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) __u8 id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) __u16 assoc_len_so_far;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) __u16 assoc_rem_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) __u16 assoc_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __u8 *assoc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) int amp_ctrl_put(struct amp_ctrl *ctrl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) void amp_ctrl_get(struct amp_ctrl *ctrl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) void amp_ctrl_list_flush(struct amp_mgr *mgr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u8 remote_id, bool out);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct hci_conn *hcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct hci_conn *hcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct hci_conn *hcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #if IS_ENABLED(CONFIG_BT_HS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) void amp_create_logical_link(struct l2cap_chan *chan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) void amp_disconnect_logical_link(struct hci_chan *hchan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) static inline void amp_create_logical_link(struct l2cap_chan *chan)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) static inline void amp_disconnect_logical_link(struct hci_chan *hchan)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) void amp_create_logical_link(struct l2cap_chan *chan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) void amp_disconnect_logical_link(struct hci_chan *hchan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #endif /* __AMP_H */