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>
This commit is contained in:

committed by
Gustavo F. Padovan

parent
88843ab06b
commit
836be93421
@@ -381,6 +381,7 @@ struct l2cap_chan {
|
||||
__u8 fcs;
|
||||
|
||||
__u16 tx_win;
|
||||
__u16 tx_win_max;
|
||||
__u8 max_tx;
|
||||
__u16 retrans_timeout;
|
||||
__u16 monitor_timeout;
|
||||
@@ -543,6 +544,22 @@ enum {
|
||||
L2CAP_DEFAULT_ACK_TO);
|
||||
#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
|
||||
|
||||
static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2)
|
||||
{
|
||||
int offset;
|
||||
|
||||
offset = (seq1 - seq2) % (chan->tx_win_max + 1);
|
||||
if (offset < 0)
|
||||
offset += (chan->tx_win_max + 1);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq)
|
||||
{
|
||||
return (seq + 1) % (chan->tx_win_max + 1);
|
||||
}
|
||||
|
||||
static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
|
||||
{
|
||||
int sub;
|
||||
|
Reference in New Issue
Block a user