Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314396
b: refs/heads/master
c: e31f763
h: refs/heads/master
v: v3
  • Loading branch information
Mat Martineau authored and Johan Hedberg committed Jun 5, 2012
1 parent 3e020ce commit 07221a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 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: 61aa4f5b9f43b21668aec51da2df3e9ed5f4226d
refs/heads/master: e31f76337257616aca0ea15abee271513b17426c
40 changes: 19 additions & 21 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,18 +1760,6 @@ static int l2cap_ertm_send(struct l2cap_chan *chan)
return sent;
}

static int l2cap_retransmit_frames(struct l2cap_chan *chan)
{
int ret;

if (!skb_queue_empty(&chan->tx_q))
chan->tx_send_head = chan->tx_q.next;

chan->next_tx_seq = chan->expected_ack_seq;
ret = l2cap_ertm_send(chan);
return ret;
}

static void l2cap_send_ack(struct l2cap_chan *chan)
{
struct l2cap_ctrl control;
Expand Down Expand Up @@ -4195,25 +4183,35 @@ static int l2cap_check_fcs(struct l2cap_chan *chan, struct sk_buff *skb)

static inline void l2cap_send_i_or_rr_or_rnr(struct l2cap_chan *chan)
{
u32 control = 0;
struct l2cap_ctrl control;

chan->frames_sent = 0;
BT_DBG("chan %p", chan);

control |= __set_reqseq(chan, chan->buffer_seq);
memset(&control, 0, sizeof(control));
control.sframe = 1;
control.final = 1;
control.reqseq = chan->buffer_seq;
set_bit(CONN_SEND_FBIT, &chan->conn_state);

if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) {
control |= __set_ctrl_super(chan, L2CAP_SUPER_RNR);
set_bit(CONN_RNR_SENT, &chan->conn_state);
control.super = L2CAP_SUPER_RNR;
l2cap_send_sframe(chan, &control);
}

if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state))
l2cap_retransmit_frames(chan);
if (test_and_clear_bit(CONN_REMOTE_BUSY, &chan->conn_state) &&
chan->unacked_frames > 0)
__set_retrans_timer(chan);

/* Send pending iframes */
l2cap_ertm_send(chan);

if (!test_bit(CONN_LOCAL_BUSY, &chan->conn_state) &&
chan->frames_sent == 0) {
control |= __set_ctrl_super(chan, L2CAP_SUPER_RR);
test_bit(CONN_SEND_FBIT, &chan->conn_state)) {
/* F-bit wasn't sent in an s-frame or i-frame yet, so
* send it now.
*/
control.super = L2CAP_SUPER_RR;
l2cap_send_sframe(chan, &control);
}
}

Expand Down

0 comments on commit 07221a9

Please sign in to comment.