3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2012 Intel Corporation. All rights reserved.
6 * Copyright (c) 2012 Code Aurora Forum. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 /* A2MP command codes */
35 #define A2MP_COMMAND_REJ 0x01
36 #define A2MP_DISCOVER_REQ 0x02
37 #define A2MP_DISCOVER_RSP 0x03
38 #define A2MP_CHANGE_NOTIFY 0x04
39 #define A2MP_CHANGE_RSP 0x05
40 #define A2MP_INFO_REQ 0x06
41 #define A2MP_INFO_RSP 0x07
42 #define A2MP_ASSOC_REQ 0x08
43 #define A2MP_ASSOC_RSP 0x09
44 #define A2MP_CREATE_REQ 0x0a
45 #define A2MP_CREATE_RSP 0x0b
46 #define A2MP_DISCONN_REQ 0x0c
47 #define A2MP_DISCONN_RSP 0x0d
53 } __attribute__ ((packed));
54 #define A2MP_HDR_SIZE 4
56 struct a2mp_command_rej {
58 } __attribute__ ((packed));
60 struct a2mp_discover_req {
63 } __attribute__ ((packed));
69 } __attribute__ ((packed));
71 struct a2mp_discover_rsp {
74 struct a2mp_ctrl ctrl_list[0];
75 } __attribute__ ((packed));
77 struct a2mp_info_req {
79 } __attribute__ ((packed));
81 struct a2mp_info_rsp {
89 } __attribute__ ((packed));
91 struct a2mp_assoc_req {
93 } __attribute__ ((packed));
95 struct a2mp_assoc_rsp {
98 uint8_t assoc_data[0];
99 } __attribute__ ((packed));
101 struct a2mp_create_req {
104 uint8_t assoc_data[0];
105 } __attribute__ ((packed));
107 struct a2mp_create_rsp {
111 } __attribute__ ((packed));
113 struct a2mp_disconn_req {
116 } __attribute__ ((packed));
118 struct a2mp_disconn_rsp {
122 } __attribute__ ((packed));
124 #define A2MP_COMMAND_NOT_RECOGNIZED 0x0000
126 /* AMP controller status */
127 #define AMP_CTRL_POWERED_DOWN 0x00
128 #define AMP_CTRL_BLUETOOTH_ONLY 0x01
129 #define AMP_CTRL_NO_CAPACITY 0x02
130 #define AMP_CTRL_LOW_CAPACITY 0x03
131 #define AMP_CTRL_MEDIUM_CAPACITY 0x04
132 #define AMP_CTRL_HIGH_CAPACITY 0x05
133 #define AMP_CTRL_FULL_CAPACITY 0x06
135 /* A2MP response status */
136 #define A2MP_STATUS_SUCCESS 0x00
137 #define A2MP_STATUS_INVALID_CTRL_ID 0x01
138 #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02
139 #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02
140 #define A2MP_STATUS_COLLISION_OCCURED 0x03
141 #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04
142 #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
143 #define A2MP_STATUS_SECURITY_VIOLATION 0x06
145 #define A2MP_MAC_ADDR_TYPE 1
146 #define A2MP_PREF_CHANLIST_TYPE 2
147 #define A2MP_CONNECTED_CHAN 3
148 #define A2MP_PAL_CAP_TYPE 4
149 #define A2MP_PAL_VER_INFO 5
155 } __attribute__ ((packed));
157 struct a2mp_pal_ver {
161 } __attribute__ ((packed));
163 struct a2mp_country_triplet {
166 uint8_t first_channel;
167 uint8_t num_channels;
169 } __attribute__ ((packed)) chans;
171 uint8_t reg_extension_id;
173 uint8_t coverage_class;
174 } __attribute__ ((packed)) ext;
176 } __attribute__ ((packed));
178 struct a2mp_chan_list {
179 uint8_t country_code[3];
180 struct a2mp_country_triplet triplets[0];
181 } __attribute__ ((packed));
187 #endif /* __A2MP_H */