aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/l2cap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r--include/net/bluetooth/l2cap.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7c695bfd853..636724b203e 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -1,6 +1,8 @@
1/* 1/*
2 BlueZ - Bluetooth protocol stack for Linux 2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated 3 Copyright (C) 2000-2001 Qualcomm Incorporated
4 Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org>
5 Copyright (C) 2010 Google Inc.
4 6
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 7 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6 8
@@ -129,31 +131,31 @@ struct l2cap_conninfo {
129struct l2cap_hdr { 131struct l2cap_hdr {
130 __le16 len; 132 __le16 len;
131 __le16 cid; 133 __le16 cid;
132} __attribute__ ((packed)); 134} __packed;
133#define L2CAP_HDR_SIZE 4 135#define L2CAP_HDR_SIZE 4
134 136
135struct l2cap_cmd_hdr { 137struct l2cap_cmd_hdr {
136 __u8 code; 138 __u8 code;
137 __u8 ident; 139 __u8 ident;
138 __le16 len; 140 __le16 len;
139} __attribute__ ((packed)); 141} __packed;
140#define L2CAP_CMD_HDR_SIZE 4 142#define L2CAP_CMD_HDR_SIZE 4
141 143
142struct l2cap_cmd_rej { 144struct l2cap_cmd_rej {
143 __le16 reason; 145 __le16 reason;
144} __attribute__ ((packed)); 146} __packed;
145 147
146struct l2cap_conn_req { 148struct l2cap_conn_req {
147 __le16 psm; 149 __le16 psm;
148 __le16 scid; 150 __le16 scid;
149} __attribute__ ((packed)); 151} __packed;
150 152
151struct l2cap_conn_rsp { 153struct l2cap_conn_rsp {
152 __le16 dcid; 154 __le16 dcid;
153 __le16 scid; 155 __le16 scid;
154 __le16 result; 156 __le16 result;
155 __le16 status; 157 __le16 status;
156} __attribute__ ((packed)); 158} __packed;
157 159
158/* channel indentifier */ 160/* channel indentifier */
159#define L2CAP_CID_SIGNALING 0x0001 161#define L2CAP_CID_SIGNALING 0x0001
@@ -177,14 +179,14 @@ struct l2cap_conf_req {
177 __le16 dcid; 179 __le16 dcid;
178 __le16 flags; 180 __le16 flags;
179 __u8 data[0]; 181 __u8 data[0];
180} __attribute__ ((packed)); 182} __packed;
181 183
182struct l2cap_conf_rsp { 184struct l2cap_conf_rsp {
183 __le16 scid; 185 __le16 scid;
184 __le16 flags; 186 __le16 flags;
185 __le16 result; 187 __le16 result;
186 __u8 data[0]; 188 __u8 data[0];
187} __attribute__ ((packed)); 189} __packed;
188 190
189#define L2CAP_CONF_SUCCESS 0x0000 191#define L2CAP_CONF_SUCCESS 0x0000
190#define L2CAP_CONF_UNACCEPT 0x0001 192#define L2CAP_CONF_UNACCEPT 0x0001
@@ -195,7 +197,7 @@ struct l2cap_conf_opt {
195 __u8 type; 197 __u8 type;
196 __u8 len; 198 __u8 len;
197 __u8 val[0]; 199 __u8 val[0];
198} __attribute__ ((packed)); 200} __packed;
199#define L2CAP_CONF_OPT_SIZE 2 201#define L2CAP_CONF_OPT_SIZE 2
200 202
201#define L2CAP_CONF_HINT 0x80 203#define L2CAP_CONF_HINT 0x80
@@ -216,7 +218,7 @@ struct l2cap_conf_rfc {
216 __le16 retrans_timeout; 218 __le16 retrans_timeout;
217 __le16 monitor_timeout; 219 __le16 monitor_timeout;
218 __le16 max_pdu_size; 220 __le16 max_pdu_size;
219} __attribute__ ((packed)); 221} __packed;
220 222
221#define L2CAP_MODE_BASIC 0x00 223#define L2CAP_MODE_BASIC 0x00
222#define L2CAP_MODE_RETRANS 0x01 224#define L2CAP_MODE_RETRANS 0x01
@@ -227,22 +229,22 @@ struct l2cap_conf_rfc {
227struct l2cap_disconn_req { 229struct l2cap_disconn_req {
228 __le16 dcid; 230 __le16 dcid;
229 __le16 scid; 231 __le16 scid;
230} __attribute__ ((packed)); 232} __packed;
231 233
232struct l2cap_disconn_rsp { 234struct l2cap_disconn_rsp {
233 __le16 dcid; 235 __le16 dcid;
234 __le16 scid; 236 __le16 scid;
235} __attribute__ ((packed)); 237} __packed;
236 238
237struct l2cap_info_req { 239struct l2cap_info_req {
238 __le16 type; 240 __le16 type;
239} __attribute__ ((packed)); 241} __packed;
240 242
241struct l2cap_info_rsp { 243struct l2cap_info_rsp {
242 __le16 type; 244 __le16 type;
243 __le16 result; 245 __le16 result;
244 __u8 data[0]; 246 __u8 data[0];
245} __attribute__ ((packed)); 247} __packed;
246 248
247/* info type */ 249/* info type */
248#define L2CAP_IT_CL_MTU 0x0001 250#define L2CAP_IT_CL_MTU 0x0001
@@ -287,6 +289,11 @@ struct l2cap_conn {
287 struct l2cap_chan_list chan_list; 289 struct l2cap_chan_list chan_list;
288}; 290};
289 291
292struct sock_del_list {
293 struct sock *sk;
294 struct list_head list;
295};
296
290#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 297#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01
291#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 298#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04
292#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 299#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08
@@ -353,7 +360,6 @@ struct l2cap_pinfo {
353 360
354 __le16 sport; 361 __le16 sport;
355 362
356 spinlock_t send_lock;
357 struct timer_list retrans_timer; 363 struct timer_list retrans_timer;
358 struct timer_list monitor_timer; 364 struct timer_list monitor_timer;
359 struct timer_list ack_timer; 365 struct timer_list ack_timer;