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.h50
1 files changed, 47 insertions, 3 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7ed8e356425a..7588ef44ebaf 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -32,13 +32,14 @@
32/* L2CAP defaults */ 32/* L2CAP defaults */
33#define L2CAP_DEFAULT_MTU 672 33#define L2CAP_DEFAULT_MTU 672
34#define L2CAP_DEFAULT_MIN_MTU 48 34#define L2CAP_DEFAULT_MIN_MTU 48
35#define L2CAP_DEFAULT_FLUSH_TO 0xffff 35#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
36#define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF
36#define L2CAP_DEFAULT_TX_WINDOW 63 37#define L2CAP_DEFAULT_TX_WINDOW 63
37#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF 38#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF
38#define L2CAP_DEFAULT_MAX_TX 3 39#define L2CAP_DEFAULT_MAX_TX 3
39#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ 40#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */
40#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 41#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
41#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 42#define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */
42#define L2CAP_DEFAULT_ACK_TO 200 43#define L2CAP_DEFAULT_ACK_TO 200
43#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF 44#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF
44#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF 45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF
@@ -51,6 +52,8 @@
51#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) 52#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000)
52#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) 53#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000)
53#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) 54#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000)
55#define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000)
56#define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000)
54 57
55#define L2CAP_A2MP_DEFAULT_MTU 670 58#define L2CAP_A2MP_DEFAULT_MTU 670
56 59
@@ -433,6 +436,8 @@ struct l2cap_chan {
433 struct sock *sk; 436 struct sock *sk;
434 437
435 struct l2cap_conn *conn; 438 struct l2cap_conn *conn;
439 struct hci_conn *hs_hcon;
440 struct hci_chan *hs_hchan;
436 struct kref kref; 441 struct kref kref;
437 442
438 __u8 state; 443 __u8 state;
@@ -476,6 +481,12 @@ struct l2cap_chan {
476 unsigned long conn_state; 481 unsigned long conn_state;
477 unsigned long flags; 482 unsigned long flags;
478 483
484 __u8 remote_amp_id;
485 __u8 local_amp_id;
486 __u8 move_id;
487 __u8 move_state;
488 __u8 move_role;
489
479 __u16 next_tx_seq; 490 __u16 next_tx_seq;
480 __u16 expected_ack_seq; 491 __u16 expected_ack_seq;
481 __u16 expected_tx_seq; 492 __u16 expected_tx_seq;
@@ -538,6 +549,7 @@ struct l2cap_ops {
538 void (*state_change) (struct l2cap_chan *chan, 549 void (*state_change) (struct l2cap_chan *chan,
539 int state); 550 int state);
540 void (*ready) (struct l2cap_chan *chan); 551 void (*ready) (struct l2cap_chan *chan);
552 void (*defer) (struct l2cap_chan *chan);
541 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 553 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
542 unsigned long len, int nb); 554 unsigned long len, int nb);
543}; 555};
@@ -599,7 +611,7 @@ enum {
599 CONF_MTU_DONE, 611 CONF_MTU_DONE,
600 CONF_MODE_DONE, 612 CONF_MODE_DONE,
601 CONF_CONNECT_PEND, 613 CONF_CONNECT_PEND,
602 CONF_NO_FCS_RECV, 614 CONF_RECV_NO_FCS,
603 CONF_STATE2_DEVICE, 615 CONF_STATE2_DEVICE,
604 CONF_EWS_RECV, 616 CONF_EWS_RECV,
605 CONF_LOC_CONF_PEND, 617 CONF_LOC_CONF_PEND,
@@ -640,6 +652,9 @@ enum {
640enum { 652enum {
641 L2CAP_RX_STATE_RECV, 653 L2CAP_RX_STATE_RECV,
642 L2CAP_RX_STATE_SREJ_SENT, 654 L2CAP_RX_STATE_SREJ_SENT,
655 L2CAP_RX_STATE_MOVE,
656 L2CAP_RX_STATE_WAIT_P,
657 L2CAP_RX_STATE_WAIT_F,
643}; 658};
644 659
645enum { 660enum {
@@ -670,6 +685,25 @@ enum {
670 L2CAP_EV_RECV_FRAME, 685 L2CAP_EV_RECV_FRAME,
671}; 686};
672 687
688enum {
689 L2CAP_MOVE_ROLE_NONE,
690 L2CAP_MOVE_ROLE_INITIATOR,
691 L2CAP_MOVE_ROLE_RESPONDER,
692};
693
694enum {
695 L2CAP_MOVE_STABLE,
696 L2CAP_MOVE_WAIT_REQ,
697 L2CAP_MOVE_WAIT_RSP,
698 L2CAP_MOVE_WAIT_RSP_SUCCESS,
699 L2CAP_MOVE_WAIT_CONFIRM,
700 L2CAP_MOVE_WAIT_CONFIRM_RSP,
701 L2CAP_MOVE_WAIT_LOGICAL_COMP,
702 L2CAP_MOVE_WAIT_LOGICAL_CFM,
703 L2CAP_MOVE_WAIT_LOCAL_BUSY,
704 L2CAP_MOVE_WAIT_PREPARE,
705};
706
673void l2cap_chan_hold(struct l2cap_chan *c); 707void l2cap_chan_hold(struct l2cap_chan *c);
674void l2cap_chan_put(struct l2cap_chan *c); 708void l2cap_chan_put(struct l2cap_chan *c);
675 709
@@ -745,6 +779,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan)
745{ 779{
746} 780}
747 781
782static inline void l2cap_chan_no_defer(struct l2cap_chan *chan)
783{
784}
785
748extern bool disable_ertm; 786extern bool disable_ertm;
749 787
750int l2cap_init_sockets(void); 788int l2cap_init_sockets(void);
@@ -767,6 +805,12 @@ int l2cap_chan_check_security(struct l2cap_chan *chan);
767void l2cap_chan_set_defaults(struct l2cap_chan *chan); 805void l2cap_chan_set_defaults(struct l2cap_chan *chan);
768int l2cap_ertm_init(struct l2cap_chan *chan); 806int l2cap_ertm_init(struct l2cap_chan *chan);
769void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 807void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
808void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
770void l2cap_chan_del(struct l2cap_chan *chan, int err); 809void l2cap_chan_del(struct l2cap_chan *chan, int err);
810void l2cap_send_conn_req(struct l2cap_chan *chan);
811void l2cap_move_start(struct l2cap_chan *chan);
812void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
813 u8 status);
814void __l2cap_physical_cfm(struct l2cap_chan *chan, int result);
771 815
772#endif /* __L2CAP_H */ 816#endif /* __L2CAP_H */