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.h69
1 files changed, 36 insertions, 33 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7a215a7f9e39..c34b1c126363 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -284,6 +284,25 @@ struct srej_list {
284 284
285struct l2cap_chan { 285struct l2cap_chan {
286 struct sock *sk; 286 struct sock *sk;
287
288 struct l2cap_conn *conn;
289
290 __le16 psm;
291 __u16 dcid;
292 __u16 scid;
293
294 __u16 imtu;
295 __u16 omtu;
296 __u16 flush_to;
297 __u8 mode;
298
299 __le16 sport;
300
301 __u8 sec_level;
302 __u8 role_switch;
303 __u8 force_reliable;
304 __u8 flushable;
305
287 __u8 ident; 306 __u8 ident;
288 307
289 __u8 conf_req[64]; 308 __u8 conf_req[64];
@@ -291,6 +310,15 @@ struct l2cap_chan {
291 __u8 num_conf_req; 310 __u8 num_conf_req;
292 __u8 num_conf_rsp; 311 __u8 num_conf_rsp;
293 312
313 __u8 fcs;
314
315 __u8 tx_win;
316 __u8 max_tx;
317 __u16 retrans_timeout;
318 __u16 monitor_timeout;
319 __u16 mps;
320
321 __u8 conf_state;
294 __u16 conn_state; 322 __u16 conn_state;
295 323
296 __u8 next_tx_seq; 324 __u8 next_tx_seq;
@@ -360,32 +388,6 @@ struct l2cap_conn {
360 388
361struct l2cap_pinfo { 389struct l2cap_pinfo {
362 struct bt_sock bt; 390 struct bt_sock bt;
363 __le16 psm;
364 __u16 dcid;
365 __u16 scid;
366
367 __u16 imtu;
368 __u16 omtu;
369 __u16 flush_to;
370 __u8 mode;
371
372 __u8 fcs;
373 __u8 sec_level;
374 __u8 role_switch;
375 __u8 force_reliable;
376 __u8 flushable;
377
378 __u8 conf_state;
379
380 __u8 tx_win;
381 __u8 max_tx;
382 __u16 retrans_timeout;
383 __u16 monitor_timeout;
384 __u16 mps;
385
386 __le16 sport;
387
388 struct l2cap_conn *conn;
389 struct l2cap_chan *chan; 391 struct l2cap_chan *chan;
390}; 392};
391 393
@@ -439,21 +441,20 @@ static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
439#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) 441#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START)
440 442
441extern int disable_ertm; 443extern int disable_ertm;
442extern const struct proto_ops l2cap_sock_ops;
443extern struct bt_sock_list l2cap_sk_list; 444extern struct bt_sock_list l2cap_sk_list;
444 445
445int l2cap_init_sockets(void); 446int l2cap_init_sockets(void);
446void l2cap_cleanup_sockets(void); 447void l2cap_cleanup_sockets(void);
447 448
448void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data); 449void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
449void __l2cap_connect_rsp_defer(struct sock *sk); 450void __l2cap_connect_rsp_defer(struct l2cap_chan *chan);
450int __l2cap_wait_ack(struct sock *sk); 451int __l2cap_wait_ack(struct sock *sk);
451 452
452struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len); 453struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
453struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len); 454struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
454struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen); 455struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len, u16 control, u16 sdulen);
455int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); 456int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
456void l2cap_do_send(struct sock *sk, struct sk_buff *skb); 457void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb);
457void l2cap_streaming_send(struct l2cap_chan *chan); 458void l2cap_streaming_send(struct l2cap_chan *chan);
458int l2cap_ertm_send(struct l2cap_chan *chan); 459int l2cap_ertm_send(struct l2cap_chan *chan);
459 460
@@ -465,7 +466,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent);
465struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, 466struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
466 int proto, gfp_t prio); 467 int proto, gfp_t prio);
467void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err); 468void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err);
469struct l2cap_chan *l2cap_chan_alloc(struct sock *sk);
468void l2cap_chan_del(struct l2cap_chan *chan, int err); 470void l2cap_chan_del(struct l2cap_chan *chan, int err);
469int l2cap_do_connect(struct sock *sk); 471void l2cap_chan_free(struct l2cap_chan *chan);
472int l2cap_chan_connect(struct l2cap_chan *chan);
470 473
471#endif /* __L2CAP_H */ 474#endif /* __L2CAP_H */