blob: e312ab3be4893acb515de4e8ac45f9826516488e [file] [log] [blame]
Andrei Emeltchenkobe218712010-12-01 16:58:26 +02001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 BlueZ - Bluetooth protocol stack for Linux
Srinivas Krovvidi10734192011-12-29 07:29:11 +05303 Copyright (c) 2000-2001, 2010-2012 Code Aurora Forum. All rights reserved.
Gustavo F. Padovance5706b2010-07-13 11:57:11 -03004 Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org>
Gustavo F. Padovan5d8868f2010-07-16 16:18:39 -03005 Copyright (C) 2010 Google Inc.
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 2 as
11 published by the Free Software Foundation;
12
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
16 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
Andrei Emeltchenkobe218712010-12-01 16:58:26 +020017 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
18 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21
Andrei Emeltchenkobe218712010-12-01 16:58:26 +020022 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
23 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 SOFTWARE IS DISCLAIMED.
25*/
26
27#ifndef __L2CAP_H
28#define __L2CAP_H
29
30/* L2CAP defaults */
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -070031#define L2CAP_DEFAULT_MTU 672
Gustavo F. Padovanf2fcfcd2009-07-04 15:06:24 -030032#define L2CAP_DEFAULT_MIN_MTU 48
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070033#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xffff
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -070034#define L2CAP_DEFAULT_FLUSH_TO 0xffff
Srinivas Krovvidi10734192011-12-29 07:29:11 +053035#define L2CAP_MAX_FLUSH_TO 0x7ff
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -030036#define L2CAP_DEFAULT_TX_WINDOW 63
Gustavo F. Padovane90bac02009-08-20 22:26:00 -030037#define L2CAP_DEFAULT_MAX_TX 3
Mat Martineaufa235562010-08-05 15:54:20 -070038#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */
Gustavo F. Padovane90bac02009-08-20 22:26:00 -030039#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#define L2CAP_DEFAULT_MAX_PDU_SIZE 1482 /* Sized for AMP or BR/EDR */
Gustavo F. Padovanc1b4f432010-05-01 16:15:39 -030041#define L2CAP_DEFAULT_ACK_TO 200
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042#define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */
43#define L2CAP_MAX_ERTM_QUEUED 5
44#define L2CAP_MIN_ERTM_QUEUED 2
Linus Torvalds1da177e2005-04-16 15:20:36 -070045
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046#define L2CAP_A2MP_DEFAULT_MTU 670
47
48#define L2CAP_TX_WIN_MAX_ENHANCED 0x3f
49#define L2CAP_TX_WIN_MAX_EXTENDED 0x3fff
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#define L2CAP_LE_DEFAULT_MTU 23
Marcel Holtmann4e8402a2007-10-20 13:37:56 +020051
52#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
Peter Krystad4d977232012-02-07 15:00:37 -080054#define L2CAP_MOVE_TIMEOUT (4*HZ) /* 4 seconds */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#define L2CAP_MOVE_ERTX_TIMEOUT (60*HZ) /* 60 seconds */
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57/* L2CAP socket address */
58struct sockaddr_l2 {
59 sa_family_t l2_family;
Al Viro8e036fc2007-07-29 00:16:36 -070060 __le16 l2_psm;
Linus Torvalds1da177e2005-04-16 15:20:36 -070061 bdaddr_t l2_bdaddr;
Marcel Holtmannf29972d2009-02-12 05:07:45 +010062 __le16 l2_cid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063};
64
65/* L2CAP socket options */
66#define L2CAP_OPTIONS 0x01
67struct l2cap_options {
68 __u16 omtu;
69 __u16 imtu;
70 __u16 flush_to;
71 __u8 mode;
Gustavo F. Padovanfcc203c2009-08-20 22:26:02 -030072 __u8 fcs;
Gustavo F. Padovan68d7f0c2010-05-01 16:15:41 -030073 __u8 max_tx;
Gustavo F. Padovan14b5aa72010-05-01 16:15:40 -030074 __u16 txwin_size;
Linus Torvalds1da177e2005-04-16 15:20:36 -070075};
76
77#define L2CAP_CONNINFO 0x02
78struct l2cap_conninfo {
79 __u16 hci_handle;
80 __u8 dev_class[3];
81};
82
83#define L2CAP_LM 0x03
84#define L2CAP_LM_MASTER 0x0001
85#define L2CAP_LM_AUTH 0x0002
86#define L2CAP_LM_ENCRYPT 0x0004
87#define L2CAP_LM_TRUSTED 0x0008
88#define L2CAP_LM_RELIABLE 0x0010
89#define L2CAP_LM_SECURE 0x0020
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070090#define L2CAP_LM_FLUSHABLE 0x0040
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
92/* L2CAP command codes */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070093#define L2CAP_COMMAND_REJ 0x01
94#define L2CAP_CONN_REQ 0x02
95#define L2CAP_CONN_RSP 0x03
96#define L2CAP_CONF_REQ 0x04
97#define L2CAP_CONF_RSP 0x05
98#define L2CAP_DISCONN_REQ 0x06
99#define L2CAP_DISCONN_RSP 0x07
100#define L2CAP_ECHO_REQ 0x08
101#define L2CAP_ECHO_RSP 0x09
102#define L2CAP_INFO_REQ 0x0a
103#define L2CAP_INFO_RSP 0x0b
Mat Martineau38094c72011-11-02 16:18:31 -0700104#define L2CAP_CREATE_CHAN_REQ 0x0c
105#define L2CAP_CREATE_CHAN_RSP 0x0d
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700106#define L2CAP_MOVE_CHAN_REQ 0x0e
107#define L2CAP_MOVE_CHAN_RSP 0x0f
108#define L2CAP_MOVE_CHAN_CFM 0x10
Mat Martineau38094c72011-11-02 16:18:31 -0700109#define L2CAP_MOVE_CHAN_CFM_RSP 0x11
Claudio Takahasi3300d9a2011-02-11 19:28:54 -0200110#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
111#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700112
113/* L2CAP feature mask */
114#define L2CAP_FEAT_FLOWCTL 0x00000001
115#define L2CAP_FEAT_RETRANS 0x00000002
116#define L2CAP_FEAT_ERTM 0x00000008
117#define L2CAP_FEAT_STREAMING 0x00000010
118#define L2CAP_FEAT_FCS 0x00000020
119#define L2CAP_FEAT_FIXED_CHAN 0x00000080
Andrei Emeltchenkoa8583932011-09-16 16:26:30 +0300120#define L2CAP_FEAT_EXT_WINDOW 0x00000100
121#define L2CAP_FEAT_UCD 0x00000200
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700122
123/* L2CAP checksum option */
124#define L2CAP_FCS_NONE 0x00
125#define L2CAP_FCS_CRC16 0x01
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126
Mat Martineaud835ac02011-11-02 16:18:33 -0700127/* L2CAP fixed channels */
128#define L2CAP_FC_L2CAP 0x02
129#define L2CAP_FC_A2MP 0x08
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -0300130
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700131/* L2CAP Control Field */
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -0300132#define L2CAP_CTRL_SAR 0xC000
133#define L2CAP_CTRL_REQSEQ 0x3F00
134#define L2CAP_CTRL_TXSEQ 0x007E
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -0300135#define L2CAP_CTRL_FINAL 0x0080
136#define L2CAP_CTRL_POLL 0x0010
137#define L2CAP_CTRL_SUPERVISE 0x000C
138#define L2CAP_CTRL_FRAME_TYPE 0x0001 /* I- or S-Frame */
139
140#define L2CAP_CTRL_TXSEQ_SHIFT 1
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700141#define L2CAP_CTRL_SUPERVISE_SHIFT 2
142#define L2CAP_CTRL_POLL_SHIFT 4
143#define L2CAP_CTRL_FINAL_SHIFT 7
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -0300144#define L2CAP_CTRL_REQSEQ_SHIFT 8
Gustavo F. Padovan8f171542009-08-20 22:26:03 -0300145#define L2CAP_CTRL_SAR_SHIFT 14
Andrei Emeltchenko57253fd2011-10-11 13:37:43 +0300146
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700147#define L2CAP_EXT_CTRL_SAR 0x00030000
148#define L2CAP_EXT_CTRL_REQSEQ 0x0000FFFC
149#define L2CAP_EXT_CTRL_TXSEQ 0xFFFC0000
150#define L2CAP_EXT_CTRL_FINAL 0x00000002
151#define L2CAP_EXT_CTRL_POLL 0x00040000
152#define L2CAP_EXT_CTRL_SUPERVISE 0x00030000
153#define L2CAP_EXT_CTRL_FRAME_TYPE 0x00000001 /* I- or S-Frame */
Andrei Emeltchenko57253fd2011-10-11 13:37:43 +0300154
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700155#define L2CAP_EXT_CTRL_FINAL_SHIFT 1
156#define L2CAP_EXT_CTRL_REQSEQ_SHIFT 2
157#define L2CAP_EXT_CTRL_SAR_SHIFT 16
158#define L2CAP_EXT_CTRL_SUPERVISE_SHIFT 16
159#define L2CAP_EXT_CTRL_POLL_SHIFT 18
160#define L2CAP_EXT_CTRL_TXSEQ_SHIFT 18
Andrei Emeltchenko57253fd2011-10-11 13:37:43 +0300161
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700162/* L2CAP Supervisory Frame Types */
163#define L2CAP_SFRAME_RR 0x00
164#define L2CAP_SFRAME_REJ 0x01
165#define L2CAP_SFRAME_RNR 0x02
166#define L2CAP_SFRAME_SREJ 0x03
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -0300167
168/* L2CAP Segmentation and Reassembly */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700169#define L2CAP_SAR_UNSEGMENTED 0x00
170#define L2CAP_SAR_START 0x01
171#define L2CAP_SAR_END 0x02
172#define L2CAP_SAR_CONTINUE 0x03
Gustavo F. Padovan1c2acff2009-08-20 22:25:57 -0300173
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174/* L2CAP ERTM / Streaming extra field lengths */
175#define L2CAP_SDULEN_SIZE 2
176#define L2CAP_FCS_SIZE 2
Ilia Kolomisnkye2fd3182011-07-10 08:47:44 +0300177
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178/* L2CAP structures */
179struct l2cap_hdr {
Al Viro8e036fc2007-07-29 00:16:36 -0700180 __le16 len;
181 __le16 cid;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300182} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183#define L2CAP_HDR_SIZE 4
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700184#define L2CAP_ENHANCED_HDR_SIZE 6
185#define L2CAP_EXTENDED_HDR_SIZE 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186
187struct l2cap_cmd_hdr {
188 __u8 code;
189 __u8 ident;
Al Viro8e036fc2007-07-29 00:16:36 -0700190 __le16 len;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300191} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192#define L2CAP_CMD_HDR_SIZE 4
193
194struct l2cap_cmd_rej {
Al Viro8e036fc2007-07-29 00:16:36 -0700195 __le16 reason;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300196} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197
198struct l2cap_conn_req {
Al Viro8e036fc2007-07-29 00:16:36 -0700199 __le16 psm;
200 __le16 scid;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300201} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202
203struct l2cap_conn_rsp {
Al Viro8e036fc2007-07-29 00:16:36 -0700204 __le16 dcid;
205 __le16 scid;
206 __le16 result;
207 __le16 status;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300208} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
Gustavo F. Padovan8db4dc42009-04-20 01:31:05 -0300210/* channel indentifier */
211#define L2CAP_CID_SIGNALING 0x0001
212#define L2CAP_CID_CONN_LESS 0x0002
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700213#define L2CAP_CID_A2MP 0x0003
Ville Tervoacd7d372011-02-10 22:38:49 -0300214#define L2CAP_CID_LE_DATA 0x0004
215#define L2CAP_CID_LE_SIGNALING 0x0005
216#define L2CAP_CID_SMP 0x0006
Gustavo F. Padovan8db4dc42009-04-20 01:31:05 -0300217#define L2CAP_CID_DYN_START 0x0040
218#define L2CAP_CID_DYN_END 0xffff
219
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220/* connect result */
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700221#define L2CAP_CR_SUCCESS 0x0000
222#define L2CAP_CR_PEND 0x0001
223#define L2CAP_CR_BAD_PSM 0x0002
224#define L2CAP_CR_SEC_BLOCK 0x0003
225#define L2CAP_CR_NO_MEM 0x0004
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226
227/* connect status */
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700228#define L2CAP_CS_NO_INFO 0x0000
229#define L2CAP_CS_AUTHEN_PEND 0x0001
230#define L2CAP_CS_AUTHOR_PEND 0x0002
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
232struct l2cap_conf_req {
Al Viro8e036fc2007-07-29 00:16:36 -0700233 __le16 dcid;
234 __le16 flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235 __u8 data[0];
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300236} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
238struct l2cap_conf_rsp {
Al Viro8e036fc2007-07-29 00:16:36 -0700239 __le16 scid;
240 __le16 flags;
241 __le16 result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 __u8 data[0];
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300243} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244
Marcel Holtmann5dee9e72007-05-24 14:27:19 +0200245#define L2CAP_CONF_SUCCESS 0x0000
246#define L2CAP_CONF_UNACCEPT 0x0001
247#define L2CAP_CONF_REJECT 0x0002
248#define L2CAP_CONF_UNKNOWN 0x0003
Andrei Emeltchenko0e8b2072011-10-17 14:35:32 +0300249#define L2CAP_CONF_PENDING 0x0004
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700250#define L2CAP_CONF_FLOW_SPEC_REJECT 0x0005
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
252struct l2cap_conf_opt {
253 __u8 type;
254 __u8 len;
255 __u8 val[0];
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300256} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257#define L2CAP_CONF_OPT_SIZE 2
258
Gustavo F. Padovan589d2742009-04-20 01:31:07 -0300259#define L2CAP_CONF_HINT 0x80
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700260#define L2CAP_CONF_MASK 0x7f
Gustavo F. Padovan589d2742009-04-20 01:31:07 -0300261
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262#define L2CAP_CONF_MTU 0x01
263#define L2CAP_CONF_FLUSH_TO 0x02
264#define L2CAP_CONF_QOS 0x03
265#define L2CAP_CONF_RFC 0x04
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700266#define L2CAP_CONF_FCS 0x05
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700267#define L2CAP_CONF_EXT_FS 0x06
268#define L2CAP_CONF_EXT_WINDOW 0x07
269
270/* QOS Service type */
271#define L2CAP_SERVICE_NO_TRAFFIC 0x00
272#define L2CAP_SERVICE_BEST_EFFORT 0x01
273#define L2CAP_SERVICE_GUARANTEED 0x02
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274
275#define L2CAP_CONF_MAX_SIZE 22
276
Marcel Holtmann6464f352007-10-20 13:39:51 +0200277struct l2cap_conf_rfc {
278 __u8 mode;
279 __u8 txwin_size;
280 __u8 max_transmit;
281 __le16 retrans_timeout;
282 __le16 monitor_timeout;
283 __le16 max_pdu_size;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300284} __packed;
Marcel Holtmann6464f352007-10-20 13:39:51 +0200285
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700286struct l2cap_conf_ext_fs {
287 __u8 id;
288 __u8 type;
289 __le16 max_sdu;
290 __le32 sdu_arr_time;
291 __le32 acc_latency;
292 __le32 flush_to;
293} __packed;
294
295struct l2cap_conf_prm {
296 __u8 fcs;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700297 __le32 flush_to;
298};
299
Marcel Holtmann6464f352007-10-20 13:39:51 +0200300#define L2CAP_MODE_BASIC 0x00
301#define L2CAP_MODE_RETRANS 0x01
302#define L2CAP_MODE_FLOWCTL 0x02
Marcel Holtmann47ec1dcd2009-05-02 18:57:55 -0700303#define L2CAP_MODE_ERTM 0x03
Marcel Holtmannc6b03cf2009-05-02 22:31:10 -0700304#define L2CAP_MODE_STREAMING 0x04
Marcel Holtmann6464f352007-10-20 13:39:51 +0200305
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306struct l2cap_disconn_req {
Al Viro8e036fc2007-07-29 00:16:36 -0700307 __le16 dcid;
308 __le16 scid;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300309} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700310
311struct l2cap_disconn_rsp {
Al Viro8e036fc2007-07-29 00:16:36 -0700312 __le16 dcid;
313 __le16 scid;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300314} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315
316struct l2cap_info_req {
Al Viro8e036fc2007-07-29 00:16:36 -0700317 __le16 type;
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300318} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319
320struct l2cap_info_rsp {
Al Viro8e036fc2007-07-29 00:16:36 -0700321 __le16 type;
322 __le16 result;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323 __u8 data[0];
Gustavo F. Padovan66c853c2010-07-19 02:00:13 -0300324} __packed;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325
Mat Martineau38094c72011-11-02 16:18:31 -0700326struct l2cap_create_chan_req {
327 __le16 psm;
328 __le16 scid;
329 __u8 amp_id;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700330} __attribute__ ((packed));
Mat Martineau38094c72011-11-02 16:18:31 -0700331
332struct l2cap_create_chan_rsp {
333 __le16 dcid;
334 __le16 scid;
335 __le16 result;
336 __le16 status;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700337} __attribute__ ((packed));
338
339#define L2CAP_CREATE_CHAN_SUCCESS (0x0000)
340#define L2CAP_CREATE_CHAN_PENDING (0x0001)
341#define L2CAP_CREATE_CHAN_REFUSED_PSM (0x0002)
342#define L2CAP_CREATE_CHAN_REFUSED_SECURITY (0x0003)
343#define L2CAP_CREATE_CHAN_REFUSED_RESOURCES (0x0004)
344#define L2CAP_CREATE_CHAN_REFUSED_CONTROLLER (0x0005)
345
346#define L2CAP_CREATE_CHAN_STATUS_NONE (0x0000)
347#define L2CAP_CREATE_CHAN_STATUS_AUTHENTICATION (0x0001)
348#define L2CAP_CREATE_CHAN_STATUS_AUTHORIZATION (0x0002)
Mat Martineau38094c72011-11-02 16:18:31 -0700349
350struct l2cap_move_chan_req {
351 __le16 icid;
352 __u8 dest_amp_id;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700353} __attribute__ ((packed));
Mat Martineau38094c72011-11-02 16:18:31 -0700354
355struct l2cap_move_chan_rsp {
356 __le16 icid;
357 __le16 result;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700358} __attribute__ ((packed));
Mat Martineau38094c72011-11-02 16:18:31 -0700359
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700360#define L2CAP_MOVE_CHAN_SUCCESS (0x0000)
361#define L2CAP_MOVE_CHAN_PENDING (0x0001)
362#define L2CAP_MOVE_CHAN_REFUSED_CONTROLLER (0x0002)
363#define L2CAP_MOVE_CHAN_REFUSED_SAME_ID (0x0003)
364#define L2CAP_MOVE_CHAN_REFUSED_CONFIG (0x0004)
365#define L2CAP_MOVE_CHAN_REFUSED_COLLISION (0x0005)
366#define L2CAP_MOVE_CHAN_REFUSED_NOT_ALLOWED (0x0006)
Mat Martineau38094c72011-11-02 16:18:31 -0700367
368struct l2cap_move_chan_cfm {
369 __le16 icid;
370 __le16 result;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700371} __attribute__ ((packed));
Mat Martineau38094c72011-11-02 16:18:31 -0700372
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700373#define L2CAP_MOVE_CHAN_CONFIRMED (0x0000)
374#define L2CAP_MOVE_CHAN_UNCONFIRMED (0x0001)
Mat Martineau38094c72011-11-02 16:18:31 -0700375
376struct l2cap_move_chan_cfm_rsp {
377 __le16 icid;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700378} __attribute__ ((packed));
379
380struct l2cap_amp_signal_work {
381 struct work_struct work;
382 struct l2cap_cmd_hdr cmd;
383 struct l2cap_conn *conn;
384 struct sk_buff *skb;
385 u8 *data;
386};
387
388struct l2cap_resegment_work {
389 struct work_struct work;
390 struct sock *sk;
391};
392
393struct l2cap_logical_link_work {
394 struct work_struct work;
395 struct hci_chan *chan;
396 u8 status;
397};
Mat Martineau38094c72011-11-02 16:18:31 -0700398
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399/* info type */
400#define L2CAP_IT_CL_MTU 0x0001
401#define L2CAP_IT_FEAT_MASK 0x0002
Marcel Holtmanne1027a72009-02-09 09:18:02 +0100402#define L2CAP_IT_FIXED_CHAN 0x0003
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403
404/* info result */
405#define L2CAP_IR_SUCCESS 0x0000
406#define L2CAP_IR_NOTSUPP 0x0001
407
Claudio Takahaside731152011-02-11 19:28:55 -0200408struct l2cap_conn_param_update_req {
409 __le16 min;
410 __le16 max;
411 __le16 latency;
412 __le16 to_multiplier;
413} __packed;
414
415struct l2cap_conn_param_update_rsp {
416 __le16 result;
417} __packed;
418
419/* Connection Parameters result */
420#define L2CAP_CONN_PARAM_ACCEPTED 0x0000
421#define L2CAP_CONN_PARAM_REJECTED 0x0001
422
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700423/* ----- L2CAP connections ----- */
424struct l2cap_chan_list {
425 struct sock *head;
426 rwlock_t lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427};
428
429struct l2cap_conn {
430 struct hci_conn *hcon;
431
432 bdaddr_t *dst;
433 bdaddr_t *src;
434
435 unsigned int mtu;
436
Marcel Holtmann4e8402a2007-10-20 13:37:56 +0200437 __u32 feat_mask;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700438 __u8 fc_mask;
439 struct amp_mgr *mgr;
Marcel Holtmann4e8402a2007-10-20 13:37:56 +0200440
441 __u8 info_state;
442 __u8 info_ident;
443
444 struct timer_list info_timer;
445
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446 spinlock_t lock;
447
448 struct sk_buff *rx_skb;
449 __u32 rx_len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450 __u8 tx_ident;
451
Marcel Holtmann2950f212009-02-12 14:02:50 +0100452 __u8 disc_reason;
453
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700454 struct l2cap_chan_list chan_list;
455};
456
457struct sock_del_list {
458 struct sock *sk;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459 struct list_head list;
460};
461
Marcel Holtmann4e8402a2007-10-20 13:37:56 +0200462#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01
Marcel Holtmann984947d2009-02-06 23:35:19 +0100463#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04
464#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700466/* ----- L2CAP channel and socket info ----- */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700468#define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue)
469#define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700471struct l2cap_seq_list {
472 __u16 head;
473 __u16 tail;
474 __u16 size;
475 __u16 mask;
476 __u16 *list;
477};
Gustavo F. Padovan89bc5002011-06-03 00:19:47 -0300478
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479struct l2cap_pinfo {
480 struct bt_sock bt;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481 __le16 psm;
482 __u16 dcid;
483 __u16 scid;
484
485 __u16 imtu;
486 __u16 omtu;
487 __u16 flush_to;
488 __u8 mode;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700489 __u8 fixed_channel;
490 __u8 num_conf_req;
491 __u8 num_conf_rsp;
Brian Gix20de7cf2012-02-02 14:56:51 -0800492 __u8 incoming;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700494 __u8 fcs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 __u8 sec_level;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700496 __u8 role_switch;
497 __u8 force_reliable;
498 __u8 flushable;
499 __u8 force_active;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500
501 __u8 conf_req[64];
502 __u8 conf_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700503 __u8 conf_ident;
504 __u16 conf_state;
505 __u8 conn_state;
506 __u8 tx_state;
507 __u8 rx_state;
508 __u8 reconf_state;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700510 __u8 amp_id;
511 __u8 amp_move_id;
512 __u8 amp_move_state;
513 __u8 amp_move_role;
514 __u8 amp_move_cmd_ident;
515 __u16 amp_move_reqseq;
516 __u16 amp_move_event;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517
Andrei Emeltchenkofb45de72011-10-11 13:37:47 +0300518 __u16 next_tx_seq;
519 __u16 expected_ack_seq;
520 __u16 expected_tx_seq;
Andrei Emeltchenko0b209fa2011-10-11 13:37:46 +0300521 __u16 buffer_seq;
Andrei Emeltchenkofb45de72011-10-11 13:37:47 +0300522 __u16 srej_save_reqseq;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700523 __u16 last_acked_seq;
524 __u32 frames_sent;
Andrei Emeltchenkofb45de72011-10-11 13:37:47 +0300525 __u16 unacked_frames;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526 __u8 retry_count;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700527 __u16 srej_queue_next;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 __u16 sdu_len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700529 struct sk_buff *sdu;
Mat Martineau84084a32011-07-22 14:54:00 -0700530 struct sk_buff *sdu_last_frag;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700531 atomic_t ertm_queued;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700533 __u8 ident;
534
535 __u16 tx_win;
536 __u16 tx_win_max;
Mat Martineauda318242012-06-22 11:36:18 -0700537 __u16 ack_win;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700538 __u8 max_tx;
539 __u8 amp_pref;
Andrei Emeltchenko6327eb92011-10-11 13:37:42 +0300540 __u16 remote_tx_win;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541 __u8 remote_max_tx;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700542 __u8 extended_control;
543 __u16 retrans_timeout;
544 __u16 monitor_timeout;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545 __u16 remote_mps;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700546 __u16 mps;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700548 __le16 sport;
Andrei Emeltchenko5a9e7052011-10-13 16:18:53 +0300549
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700550 struct delayed_work retrans_work;
551 struct delayed_work monitor_work;
552 struct delayed_work ack_work;
553 struct work_struct tx_work;
554 struct sk_buff_head tx_queue;
555 struct sk_buff_head srej_queue;
556 struct l2cap_seq_list srej_list;
557 struct l2cap_seq_list retrans_list;
558 struct hci_conn *ampcon;
559 struct hci_chan *ampchan;
560 struct l2cap_conn *conn;
561 struct l2cap_conf_prm local_conf;
562 struct l2cap_conf_prm remote_conf;
563 struct l2cap_conf_ext_fs local_fs;
564 struct l2cap_conf_ext_fs remote_fs;
565 struct sock *next_c;
566 struct sock *prev_c;
Gustavo F. Padovan80808e42011-05-16 17:24:37 -0300567};
568
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700569#define L2CAP_CONF_REQ_SENT 0x0001
570#define L2CAP_CONF_INPUT_DONE 0x0002
571#define L2CAP_CONF_OUTPUT_DONE 0x0004
572#define L2CAP_CONF_MTU_DONE 0x0008
573#define L2CAP_CONF_MODE_DONE 0x0010
574#define L2CAP_CONF_CONNECT_PEND 0x0020
575#define L2CAP_CONF_NO_FCS_RECV 0x0040
576#define L2CAP_CONF_STATE2_DEVICE 0x0080
577#define L2CAP_CONF_EXT_WIN_RECV 0x0100
578#define L2CAP_CONF_LOCKSTEP 0x0200
579#define L2CAP_CONF_LOCKSTEP_PEND 0x0400
580#define L2CAP_CONF_PEND_SENT 0x0800
581#define L2CAP_CONF_EFS_RECV 0x1000
Marcel Holtmann861d6882007-10-20 13:37:06 +0200582
Gustavo F. Padovanf2fcfcd2009-07-04 15:06:24 -0300583#define L2CAP_CONF_MAX_CONF_REQ 2
584#define L2CAP_CONF_MAX_CONF_RSP 2
585
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700586#define L2CAP_RECONF_NONE 0x00
587#define L2CAP_RECONF_INT 0x01
588#define L2CAP_RECONF_ACC 0x02
Gustavo F. Padovane90bac02009-08-20 22:26:00 -0300589
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700590#define L2CAP_CONN_SREJ_ACT 0x01
591#define L2CAP_CONN_REJ_ACT 0x02
592#define L2CAP_CONN_REMOTE_BUSY 0x04
593#define L2CAP_CONN_LOCAL_BUSY 0x08
594#define L2CAP_CONN_SEND_FBIT 0x10
595#define L2CAP_CONN_SENT_RNR 0x20
Andrei Emeltchenkod57b0e82011-10-11 14:04:31 +0300596
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700597#define L2CAP_SEQ_LIST_CLEAR 0xFFFF
598#define L2CAP_SEQ_LIST_TAIL 0x8000
Ulisses Furquim371fd832011-12-21 20:02:36 -0200599
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700600#define L2CAP_ERTM_TX_STATE_XMIT 0x01
601#define L2CAP_ERTM_TX_STATE_WAIT_F 0x02
Ulisses Furquim371fd832011-12-21 20:02:36 -0200602
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700603#define L2CAP_ERTM_RX_STATE_RECV 0x01
604#define L2CAP_ERTM_RX_STATE_SREJ_SENT 0x02
605#define L2CAP_ERTM_RX_STATE_AMP_MOVE 0x03
606#define L2CAP_ERTM_RX_STATE_WAIT_P_FLAG 0x04
607#define L2CAP_ERTM_RX_STATE_WAIT_P_FLAG_RECONFIGURE 0x05
608#define L2CAP_ERTM_RX_STATE_WAIT_F_FLAG 0x06
Andrei Emeltchenkoc03b3552012-02-21 12:54:56 +0200609
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700610#define L2CAP_ERTM_TXSEQ_EXPECTED 0x00
611#define L2CAP_ERTM_TXSEQ_EXPECTED_SREJ 0x01
612#define L2CAP_ERTM_TXSEQ_UNEXPECTED 0x02
613#define L2CAP_ERTM_TXSEQ_UNEXPECTED_SREJ 0x03
614#define L2CAP_ERTM_TXSEQ_DUPLICATE 0x04
615#define L2CAP_ERTM_TXSEQ_DUPLICATE_SREJ 0x05
616#define L2CAP_ERTM_TXSEQ_INVALID 0x06
617#define L2CAP_ERTM_TXSEQ_INVALID_IGNORE 0x07
Andrei Emeltchenkoc03b3552012-02-21 12:54:56 +0200618
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700619#define L2CAP_ERTM_EVENT_DATA_REQUEST 0x01
620#define L2CAP_ERTM_EVENT_LOCAL_BUSY_DETECTED 0x02
621#define L2CAP_ERTM_EVENT_LOCAL_BUSY_CLEAR 0x03
622#define L2CAP_ERTM_EVENT_RECV_REQSEQ_AND_FBIT 0x04
623#define L2CAP_ERTM_EVENT_RECV_FBIT 0x05
624#define L2CAP_ERTM_EVENT_RETRANS_TIMER_EXPIRES 0x06
625#define L2CAP_ERTM_EVENT_MONITOR_TIMER_EXPIRES 0x07
626#define L2CAP_ERTM_EVENT_EXPLICIT_POLL 0x08
627#define L2CAP_ERTM_EVENT_RECV_IFRAME 0x09
628#define L2CAP_ERTM_EVENT_RECV_RR 0x0a
629#define L2CAP_ERTM_EVENT_RECV_REJ 0x0b
630#define L2CAP_ERTM_EVENT_RECV_RNR 0x0c
631#define L2CAP_ERTM_EVENT_RECV_SREJ 0x0d
632#define L2CAP_ERTM_EVENT_RECV_FRAME 0x0e
Gustavo F. Padovanc2ec9c12011-12-20 10:57:26 -0200633
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700634#define L2CAP_AMP_MOVE_NONE 0
635#define L2CAP_AMP_MOVE_INITIATOR 1
636#define L2CAP_AMP_MOVE_RESPONDER 2
Gustavo F. Padovanc2ec9c12011-12-20 10:57:26 -0200637
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700638#define L2CAP_AMP_STATE_STABLE 0
639#define L2CAP_AMP_STATE_WAIT_CREATE 1
640#define L2CAP_AMP_STATE_WAIT_CREATE_RSP 2
641#define L2CAP_AMP_STATE_WAIT_MOVE 3
642#define L2CAP_AMP_STATE_WAIT_MOVE_RSP 4
643#define L2CAP_AMP_STATE_WAIT_MOVE_RSP_SUCCESS 5
644#define L2CAP_AMP_STATE_WAIT_MOVE_CONFIRM 6
645#define L2CAP_AMP_STATE_WAIT_MOVE_CONFIRM_RSP 7
646#define L2CAP_AMP_STATE_WAIT_LOGICAL_COMPLETE 8
647#define L2CAP_AMP_STATE_WAIT_LOGICAL_CONFIRM 9
648#define L2CAP_AMP_STATE_WAIT_LOCAL_BUSY 10
649#define L2CAP_AMP_STATE_WAIT_PREPARE 11
650#define L2CAP_AMP_STATE_RESEGMENT 12
Szymon Janc75b93b52012-01-11 10:59:45 +0100651
Brian Gix7eaa64d2011-10-19 13:17:42 -0700652#define L2CAP_ATT_ERROR 0x01
Brian Gix8217b262012-01-31 07:56:04 -0800653#define L2CAP_ATT_MTU_REQ 0x02
654#define L2CAP_ATT_MTU_RSP 0x03
Brian Gix7eaa64d2011-10-19 13:17:42 -0700655#define L2CAP_ATT_RESPONSE_BIT 0x01
656#define L2CAP_ATT_INDICATE 0x1D
Brian Gixbcdb7e72012-06-05 13:35:39 -0700657#define L2CAP_ATT_CONFIRM 0x1E
Brian Gix7eaa64d2011-10-19 13:17:42 -0700658#define L2CAP_ATT_NOT_SUPPORTED 0x06
Szymon Janc75b93b52012-01-11 10:59:45 +0100659
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700660#define __delta_seq(x, y, pi) ((x) >= (y) ? (x) - (y) : \
661 (pi)->tx_win_max + 1 - (y) + (x))
662#define __next_seq(x, pi) ((x + 1) & ((pi)->tx_win_max))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663
Rusty Russelleb939922011-12-19 14:08:01 +0000664extern bool disable_ertm;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700665extern const struct proto_ops l2cap_sock_ops;
666extern struct bt_sock_list l2cap_sk_list;
Gustavo F. Padovanbb58f742011-02-03 20:50:35 -0200667
668int l2cap_init_sockets(void);
669void l2cap_cleanup_sockets(void);
670
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700671u8 l2cap_get_ident(struct l2cap_conn *conn);
672void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
673int l2cap_build_conf_req(struct sock *sk, void *data);
Gustavo F. Padovandcba0db2011-02-04 03:08:36 -0200674int __l2cap_wait_ack(struct sock *sk);
Gustavo F. Padovan68983252011-02-04 03:02:31 -0200675
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700676struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len);
677struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len);
678struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg,
679 size_t len, u16 sdulen, int reseg);
680int l2cap_segment_sdu(struct sock *sk, struct sk_buff_head* seg_queue,
681 struct msghdr *msg, size_t len, int reseg);
682int l2cap_resegment_queue(struct sock *sk, struct sk_buff_head *queue);
683void l2cap_do_send(struct sock *sk, struct sk_buff *skb);
684void l2cap_streaming_send(struct sock *sk);
685int l2cap_ertm_send(struct sock *sk);
686int l2cap_strm_tx(struct sock *sk, struct sk_buff_head *skbs);
687int l2cap_ertm_tx(struct sock *sk, struct bt_l2cap_control *control,
688 struct sk_buff_head *skbs, u8 event);
Gustavo F. Padovan9e4425f2011-04-18 18:38:43 -0300689
Brian Gixa94b6122012-02-23 16:07:10 -0800690int l2cap_sock_le_params_valid(struct bt_le_params *le_params);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700691void l2cap_sock_set_timer(struct sock *sk, long timeout);
692void l2cap_sock_clear_timer(struct sock *sk);
693void __l2cap_sock_close(struct sock *sk, int reason);
694void l2cap_sock_kill(struct sock *sk);
695void l2cap_sock_init(struct sock *sk, struct sock *parent);
696struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
697 int proto, gfp_t prio);
Brian Gix20de7cf2012-02-02 14:56:51 -0800698struct sock *l2cap_find_sock_by_fixed_cid_and_dir(__le16 cid, bdaddr_t *src,
699 bdaddr_t *dst, int server);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700700void l2cap_send_disconn_req(struct l2cap_conn *conn, struct sock *sk, int err);
701void l2cap_chan_del(struct sock *sk, int err);
702int l2cap_do_connect(struct sock *sk);
703int l2cap_data_channel(struct sock *sk, struct sk_buff *skb);
704void l2cap_amp_move_init(struct sock *sk);
705void l2cap_ertm_destruct(struct sock *sk);
706void l2cap_ertm_shutdown(struct sock *sk);
707void l2cap_ertm_recv_done(struct sock *sk);
708
709void l2cap_fixed_channel_config(struct sock *sk, struct l2cap_options *opt);
710
711void l2cap_recv_deferred_frame(struct sock *sk, struct sk_buff *skb);
712
713void l2cap_amp_physical_complete(int result, u8 remote_id, u8 local_id,
714 struct sock *sk);
715
716void l2cap_amp_logical_complete(int result, struct hci_conn *ampcon,
717 struct hci_chan *ampchan, struct sock *sk);
718
719void l2cap_amp_logical_destroyed(struct hci_conn *ampcon);
Gustavo F. Padovanbb58f742011-02-03 20:50:35 -0200720
Linus Torvalds1da177e2005-04-16 15:20:36 -0700721#endif /* __L2CAP_H */