2
Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved.
3
Copyright (c) 2011,2012 Intel Corp.
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License version 2 and
7
only version 2 as published by the Free Software Foundation.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
18
#include <net/bluetooth/l2cap.h>
20
#define A2MP_FEAT_EXT 0x8000
25
READ_LOC_AMP_ASSOC_FINAL,
26
WRITE_REMOTE_AMP_ASSOC,
30
struct list_head list;
31
struct l2cap_conn *l2cap_conn;
32
struct l2cap_chan *a2mp_chan;
33
struct l2cap_chan *bredr_chan;
40
struct list_head amp_ctrls;
41
struct mutex amp_ctrls_lock;
51
/* A2MP command codes */
52
#define A2MP_COMMAND_REJ 0x01
58
#define A2MP_DISCOVER_REQ 0x02
59
struct a2mp_discov_req {
70
#define A2MP_DISCOVER_RSP 0x03
71
struct a2mp_discov_rsp {
77
#define A2MP_CHANGE_NOTIFY 0x04
78
#define A2MP_CHANGE_RSP 0x05
80
#define A2MP_GETINFO_REQ 0x06
81
struct a2mp_info_req {
85
#define A2MP_GETINFO_RSP 0x07
86
struct a2mp_info_rsp {
96
#define A2MP_GETAMPASSOC_REQ 0x08
97
struct a2mp_amp_assoc_req {
101
#define A2MP_GETAMPASSOC_RSP 0x09
102
struct a2mp_amp_assoc_rsp {
108
#define A2MP_CREATEPHYSLINK_REQ 0x0A
109
#define A2MP_DISCONNPHYSLINK_REQ 0x0C
110
struct a2mp_physlink_req {
116
#define A2MP_CREATEPHYSLINK_RSP 0x0B
117
#define A2MP_DISCONNPHYSLINK_RSP 0x0D
118
struct a2mp_physlink_rsp {
124
/* A2MP response status */
125
#define A2MP_STATUS_SUCCESS 0x00
126
#define A2MP_STATUS_INVALID_CTRL_ID 0x01
127
#define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02
128
#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02
129
#define A2MP_STATUS_COLLISION_OCCURED 0x03
130
#define A2MP_STATUS_DISCONN_REQ_RECVD 0x04
131
#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
132
#define A2MP_STATUS_SECURITY_VIOLATION 0x06
134
extern struct list_head amp_mgr_list;
135
extern struct mutex amp_mgr_list_lock;
137
struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr);
138
int amp_mgr_put(struct amp_mgr *mgr);
139
u8 __next_ident(struct amp_mgr *mgr);
140
struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
141
struct sk_buff *skb);
142
struct amp_mgr *amp_mgr_lookup_by_state(u8 state);
143
void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data);
144
void a2mp_discover_amp(struct l2cap_chan *chan);
145
void a2mp_send_getinfo_rsp(struct hci_dev *hdev);
146
void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status);
147
void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status);
148
void a2mp_send_create_phy_link_rsp(struct hci_dev *hdev, u8 status);
150
#endif /* __A2MP_H */