Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314399
b: refs/heads/master
c: bed68bd
h: refs/heads/master
i:
  314397: 06c245d
  314395: 3e020ce
  314391: 86ba0c6
  314383: a7f760f
  314367: 6de2581
v: v3
  • Loading branch information
Mat Martineau authored and Johan Hedberg committed Jun 5, 2012
1 parent 302217d commit 45dffa2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1fbd4c19a5c4d4f490d70e73745cf2cf0dc1955
refs/heads/master: bed68bde7ebdb591cc67921261307626c8f37936
56 changes: 53 additions & 3 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2239,17 +2239,67 @@ int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,

static void l2cap_send_srej(struct l2cap_chan *chan, u16 txseq)
{
/* Placeholder */
struct l2cap_ctrl control;
u16 seq;

BT_DBG("chan %p, txseq %d", chan, txseq);

memset(&control, 0, sizeof(control));
control.sframe = 1;
control.super = L2CAP_SUPER_SREJ;

for (seq = chan->expected_tx_seq; seq != txseq;
seq = __next_seq(chan, seq)) {
if (!l2cap_ertm_seq_in_queue(&chan->srej_q, seq)) {
control.reqseq = seq;
l2cap_send_sframe(chan, &control);
l2cap_seq_list_append(&chan->srej_list, seq);
}
}

chan->expected_tx_seq = __next_seq(chan, txseq);
}

static void l2cap_send_srej_tail(struct l2cap_chan *chan)
{
/* Placeholder */
struct l2cap_ctrl control;

BT_DBG("chan %p", chan);

if (chan->srej_list.tail == L2CAP_SEQ_LIST_CLEAR)
return;

memset(&control, 0, sizeof(control));
control.sframe = 1;
control.super = L2CAP_SUPER_SREJ;
control.reqseq = chan->srej_list.tail;
l2cap_send_sframe(chan, &control);
}

static void l2cap_send_srej_list(struct l2cap_chan *chan, u16 txseq)
{
/* Placeholder */
struct l2cap_ctrl control;
u16 initial_head;
u16 seq;

BT_DBG("chan %p, txseq %d", chan, txseq);

memset(&control, 0, sizeof(control));
control.sframe = 1;
control.super = L2CAP_SUPER_SREJ;

/* Capture initial list head to allow only one pass through the list. */
initial_head = chan->srej_list.head;

do {
seq = l2cap_seq_list_pop(&chan->srej_list);
if (seq == txseq || seq == L2CAP_SEQ_LIST_CLEAR)
break;

control.reqseq = seq;
l2cap_send_sframe(chan, &control);
l2cap_seq_list_append(&chan->srej_list, seq);
} while (chan->srej_list.head != initial_head);
}

static void l2cap_process_reqseq(struct l2cap_chan *chan, u16 reqseq)
Expand Down

0 comments on commit 45dffa2

Please sign in to comment.