1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Bluez header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to Android. It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __L2CAP_H
20#define __L2CAP_H
21#ifdef __cplusplus
22#endif
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <sys/socket.h>
25#define L2CAP_DEFAULT_MTU 672
26#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
27struct sockaddr_l2 {
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 sa_family_t l2_family;
30 unsigned short l2_psm;
31 bdaddr_t l2_bdaddr;
32 unsigned short l2_cid;
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34};
35#define L2CAP_OPTIONS 0x01
36struct l2cap_options {
37 uint16_t omtu;
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 uint16_t imtu;
40 uint16_t flush_to;
41 uint8_t mode;
42 uint8_t fcs;
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 uint8_t max_tx;
45 uint16_t txwin_size;
46};
47#define L2CAP_CONNINFO 0x02
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49struct l2cap_conninfo {
50 uint16_t hci_handle;
51 uint8_t dev_class[3];
52};
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define L2CAP_LM 0x03
55#define L2CAP_LM_MASTER 0x0001
56#define L2CAP_LM_AUTH 0x0002
57#define L2CAP_LM_ENCRYPT 0x0004
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define L2CAP_LM_TRUSTED 0x0008
60#define L2CAP_LM_RELIABLE 0x0010
61#define L2CAP_LM_SECURE 0x0020
62#define L2CAP_COMMAND_REJ 0x01
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define L2CAP_CONN_REQ 0x02
65#define L2CAP_CONN_RSP 0x03
66#define L2CAP_CONF_REQ 0x04
67#define L2CAP_CONF_RSP 0x05
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define L2CAP_DISCONN_REQ 0x06
70#define L2CAP_DISCONN_RSP 0x07
71#define L2CAP_ECHO_REQ 0x08
72#define L2CAP_ECHO_RSP 0x09
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define L2CAP_INFO_REQ 0x0a
75#define L2CAP_INFO_RSP 0x0b
76typedef struct {
77 uint16_t len;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 uint16_t cid;
80} __attribute__ ((packed)) l2cap_hdr;
81#define L2CAP_HDR_SIZE 4
82typedef struct {
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 uint8_t code;
85 uint8_t ident;
86 uint16_t len;
87} __attribute__ ((packed)) l2cap_cmd_hdr;
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#define L2CAP_CMD_HDR_SIZE 4
90typedef struct {
91 uint16_t reason;
92} __attribute__ ((packed)) l2cap_cmd_rej;
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94#define L2CAP_CMD_REJ_SIZE 2
95typedef struct {
96 uint16_t psm;
97 uint16_t scid;
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99} __attribute__ ((packed)) l2cap_conn_req;
100#define L2CAP_CONN_REQ_SIZE 4
101typedef struct {
102 uint16_t dcid;
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 uint16_t scid;
105 uint16_t result;
106 uint16_t status;
107} __attribute__ ((packed)) l2cap_conn_rsp;
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define L2CAP_CONN_RSP_SIZE 8
110#define L2CAP_CR_SUCCESS 0x0000
111#define L2CAP_CR_PEND 0x0001
112#define L2CAP_CR_BAD_PSM 0x0002
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define L2CAP_CR_SEC_BLOCK 0x0003
115#define L2CAP_CR_NO_MEM 0x0004
116#define L2CAP_CS_NO_INFO 0x0000
117#define L2CAP_CS_AUTHEN_PEND 0x0001
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define L2CAP_CS_AUTHOR_PEND 0x0002
120typedef struct {
121 uint16_t dcid;
122 uint16_t flags;
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 uint8_t data[0];
125} __attribute__ ((packed)) l2cap_conf_req;
126#define L2CAP_CONF_REQ_SIZE 4
127typedef struct {
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 uint16_t scid;
130 uint16_t flags;
131 uint16_t result;
132 uint8_t data[0];
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134} __attribute__ ((packed)) l2cap_conf_rsp;
135#define L2CAP_CONF_RSP_SIZE 6
136#define L2CAP_CONF_SUCCESS 0x0000
137#define L2CAP_CONF_UNACCEPT 0x0001
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139#define L2CAP_CONF_REJECT 0x0002
140#define L2CAP_CONF_UNKNOWN 0x0003
141typedef struct {
142 uint8_t type;
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 uint8_t len;
145 uint8_t val[0];
146} __attribute__ ((packed)) l2cap_conf_opt;
147#define L2CAP_CONF_OPT_SIZE 2
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149#define L2CAP_CONF_MTU 0x01
150#define L2CAP_CONF_FLUSH_TO 0x02
151#define L2CAP_CONF_QOS 0x03
152#define L2CAP_CONF_RFC 0x04
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154#define L2CAP_CONF_FCS 0x05
155#define L2CAP_CONF_MAX_SIZE 22
156#define L2CAP_MODE_BASIC 0x00
157#define L2CAP_MODE_RETRANS 0x01
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159#define L2CAP_MODE_FLOWCTL 0x02
160#define L2CAP_MODE_ERTM 0x03
161#define L2CAP_MODE_STREAMING 0x04
162typedef struct {
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 uint16_t dcid;
165 uint16_t scid;
166} __attribute__ ((packed)) l2cap_disconn_req;
167#define L2CAP_DISCONN_REQ_SIZE 4
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169typedef struct {
170 uint16_t dcid;
171 uint16_t scid;
172} __attribute__ ((packed)) l2cap_disconn_rsp;
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174#define L2CAP_DISCONN_RSP_SIZE 4
175typedef struct {
176 uint16_t type;
177} __attribute__ ((packed)) l2cap_info_req;
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179#define L2CAP_INFO_REQ_SIZE 2
180typedef struct {
181 uint16_t type;
182 uint16_t result;
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 uint8_t data[0];
185} __attribute__ ((packed)) l2cap_info_rsp;
186#define L2CAP_INFO_RSP_SIZE 4
187#define L2CAP_IT_CL_MTU 0x0001
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189#define L2CAP_IT_FEAT_MASK 0x0002
190#define L2CAP_IR_SUCCESS 0x0000
191#define L2CAP_IR_NOTSUPP 0x0001
192#ifdef __cplusplus
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194#endif
195#endif
196
197