1 /* SPDX-License-Identifier: GPL-2.0-only */
3 Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved.
4 Copyright (c) 2011,2012 Intel Corp.
11 #include <net/bluetooth/l2cap.h>
16 READ_LOC_AMP_ASSOC_FINAL,
17 WRITE_REMOTE_AMP_ASSOC,
21 struct list_head list;
22 struct l2cap_conn *l2cap_conn;
23 struct l2cap_chan *a2mp_chan;
24 struct l2cap_chan *bredr_chan;
31 struct list_head amp_ctrls;
32 struct mutex amp_ctrls_lock;
42 /* A2MP command codes */
43 #define A2MP_COMMAND_REJ 0x01
49 #define A2MP_DISCOVER_REQ 0x02
50 struct a2mp_discov_req {
61 #define A2MP_DISCOVER_RSP 0x03
62 struct a2mp_discov_rsp {
68 #define A2MP_CHANGE_NOTIFY 0x04
69 #define A2MP_CHANGE_RSP 0x05
71 #define A2MP_GETINFO_REQ 0x06
72 struct a2mp_info_req {
76 #define A2MP_GETINFO_RSP 0x07
77 struct a2mp_info_rsp {
87 #define A2MP_GETAMPASSOC_REQ 0x08
88 struct a2mp_amp_assoc_req {
92 #define A2MP_GETAMPASSOC_RSP 0x09
93 struct a2mp_amp_assoc_rsp {
99 #define A2MP_CREATEPHYSLINK_REQ 0x0A
100 #define A2MP_DISCONNPHYSLINK_REQ 0x0C
101 struct a2mp_physlink_req {
107 #define A2MP_CREATEPHYSLINK_RSP 0x0B
108 #define A2MP_DISCONNPHYSLINK_RSP 0x0D
109 struct a2mp_physlink_rsp {
115 /* A2MP response status */
116 #define A2MP_STATUS_SUCCESS 0x00
117 #define A2MP_STATUS_INVALID_CTRL_ID 0x01
118 #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02
119 #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02
120 #define A2MP_STATUS_COLLISION_OCCURED 0x03
121 #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04
122 #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
123 #define A2MP_STATUS_SECURITY_VIOLATION 0x06
125 struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr);
127 #if IS_ENABLED(CONFIG_BT_HS)
128 int amp_mgr_put(struct amp_mgr *mgr);
129 struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
130 struct sk_buff *skb);
131 void a2mp_discover_amp(struct l2cap_chan *chan);
133 static inline int amp_mgr_put(struct amp_mgr *mgr)
138 static inline struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
144 static inline void a2mp_discover_amp(struct l2cap_chan *chan)
149 void a2mp_send_getinfo_rsp(struct hci_dev *hdev);
150 void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status);
151 void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status);
152 void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status);
154 #endif /* __A2MP_H */