]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/net/bluetooth/a2mp.h
Bluetooth: A2MP: Handling fixed channels
[mirror_ubuntu-artful-kernel.git] / include / net / bluetooth / a2mp.h
CommitLineData
9740e49d
AE
1/*
2 Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved.
3 Copyright (c) 2011,2012 Intel Corp.
4
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.
8
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.
13*/
14
15#ifndef __A2MP_H
16#define __A2MP_H
17
8598d064
AE
18#define A2MP_FEAT_EXT 0x8000
19
9740e49d
AE
20struct amp_mgr {
21 struct l2cap_conn *l2cap_conn;
22 struct l2cap_chan *a2mp_chan;
23 struct kref kref;
24 __u8 ident;
25 __u8 handle;
26 unsigned long flags;
27};
28
f6d3c6e7
AE
29struct a2mp_cmd {
30 __u8 code;
31 __u8 ident;
32 __le16 len;
33 __u8 data[0];
34} __packed;
35
b9058fb6
AE
36/* A2MP command codes */
37#define A2MP_COMMAND_REJ 0x01
38struct a2mp_cmd_rej {
39 __le16 reason;
40 __u8 data[0];
41} __packed;
42
43#define A2MP_DISCOVER_REQ 0x02
44struct a2mp_discov_req {
45 __le16 mtu;
46 __le16 ext_feat;
47} __packed;
48
49struct a2mp_cl {
50 __u8 id;
51 __u8 type;
52 __u8 status;
53} __packed;
54
55#define A2MP_DISCOVER_RSP 0x03
56struct a2mp_discov_rsp {
57 __le16 mtu;
58 __le16 ext_feat;
59 struct a2mp_cl cl[0];
60} __packed;
61
62#define A2MP_CHANGE_NOTIFY 0x04
63#define A2MP_CHANGE_RSP 0x05
64
65#define A2MP_GETINFO_REQ 0x06
66struct a2mp_info_req {
67 __u8 id;
68} __packed;
69
70#define A2MP_GETINFO_RSP 0x07
71struct a2mp_info_rsp {
72 __u8 id;
73 __u8 status;
74 __le32 total_bw;
75 __le32 max_bw;
76 __le32 min_latency;
77 __le16 pal_cap;
78 __le16 assoc_size;
79} __packed;
80
81#define A2MP_GETAMPASSOC_REQ 0x08
82struct a2mp_amp_assoc_req {
83 __u8 id;
84} __packed;
85
86#define A2MP_GETAMPASSOC_RSP 0x09
87struct a2mp_amp_assoc_rsp {
88 __u8 id;
89 __u8 status;
90 __u8 amp_assoc[0];
91} __packed;
92
93#define A2MP_CREATEPHYSLINK_REQ 0x0A
94#define A2MP_DISCONNPHYSLINK_REQ 0x0C
95struct a2mp_physlink_req {
96 __u8 local_id;
97 __u8 remote_id;
98 __u8 amp_assoc[0];
99} __packed;
100
101#define A2MP_CREATEPHYSLINK_RSP 0x0B
102#define A2MP_DISCONNPHYSLINK_RSP 0x0D
103struct a2mp_physlink_rsp {
104 __u8 local_id;
105 __u8 remote_id;
106 __u8 status;
107} __packed;
108
e7af522e
AE
109/* A2MP response status */
110#define A2MP_STATUS_SUCCESS 0x00
111#define A2MP_STATUS_INVALID_CTRL_ID 0x01
112#define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02
113#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02
114#define A2MP_STATUS_COLLISION_OCCURED 0x03
115#define A2MP_STATUS_DISCONN_REQ_RECVD 0x04
116#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
117#define A2MP_STATUS_SECURITY_VIOLATION 0x06
118
9740e49d
AE
119void amp_mgr_get(struct amp_mgr *mgr);
120int amp_mgr_put(struct amp_mgr *mgr);
121
122#endif /* __A2MP_H */