aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/l2cap.h
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2011-10-17 05:19:57 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-17 16:04:00 -0400
commit836be934218eb80abc5515d584c329c26951086f (patch)
treeb8ee564f2ae0dc2f34fd9b0b7c2f9fb08fa917f1 /include/net/bluetooth/l2cap.h
parent88843ab06b6f279bff1c32e4218541ac7efe2600 (diff)
Bluetooth: EWS: support extended seq numbers
Adds support for extended sequence numbers found in extended control fields. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r--include/net/bluetooth/l2cap.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 41f0906649ee..fddc82afeafc 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -381,6 +381,7 @@ struct l2cap_chan {
381 __u8 fcs; 381 __u8 fcs;
382 382
383 __u16 tx_win; 383 __u16 tx_win;
384 __u16 tx_win_max;
384 __u8 max_tx; 385 __u8 max_tx;
385 __u16 retrans_timeout; 386 __u16 retrans_timeout;
386 __u16 monitor_timeout; 387 __u16 monitor_timeout;
@@ -543,6 +544,22 @@ enum {
543 L2CAP_DEFAULT_ACK_TO); 544 L2CAP_DEFAULT_ACK_TO);
544#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer) 545#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
545 546
547static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2)
548{
549 int offset;
550
551 offset = (seq1 - seq2) % (chan->tx_win_max + 1);
552 if (offset < 0)
553 offset += (chan->tx_win_max + 1);
554
555 return offset;
556}
557
558static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq)
559{
560 return (seq + 1) % (chan->tx_win_max + 1);
561}
562
546static inline int l2cap_tx_window_full(struct l2cap_chan *ch) 563static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
547{ 564{
548 int sub; 565 int sub;