From bce0b7e580bd23523ab23857ba70bc77e57b5abe Mon Sep 17 00:00:00 2001 From: Mat Martineau Date: Thu, 17 May 2012 20:53:48 -0700 Subject: [PATCH] --- yaml --- r: 314403 b: refs/heads/master c: c9e3d5e00408c96f82b88a8de5d54f7a1343b110 h: refs/heads/master i: 314401: 88a81a4b2169ec910ebbc08299a895c37a4ad67d 314399: 45dffa281cddbeab00870c0bcb119fab7ed339e7 v: v3 --- [refs] | 2 +- trunk/net/bluetooth/l2cap_core.c | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index e520c3401879..8cc71c3f4778 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fcd289df8892268ec0783588e0d7e0346fd6a1cd +refs/heads/master: c9e3d5e00408c96f82b88a8de5d54f7a1343b110 diff --git a/trunk/net/bluetooth/l2cap_core.c b/trunk/net/bluetooth/l2cap_core.c index 5e4a881a6e19..8ea9ec648bfd 100644 --- a/trunk/net/bluetooth/l2cap_core.c +++ b/trunk/net/bluetooth/l2cap_core.c @@ -920,15 +920,23 @@ static void l2cap_send_sframe(struct l2cap_chan *chan, l2cap_do_send(chan, skb); } -static inline void l2cap_send_rr_or_rnr(struct l2cap_chan *chan, u32 control) +static void l2cap_send_rr_or_rnr(struct l2cap_chan *chan, bool poll) { - 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); - } else - control |= __set_ctrl_super(chan, L2CAP_SUPER_RR); + struct l2cap_ctrl control; + + BT_DBG("chan %p, poll %d", chan, poll); + + memset(&control, 0, sizeof(control)); + control.sframe = 1; + control.poll = poll; - control |= __set_reqseq(chan, chan->buffer_seq); + if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) + control.super = L2CAP_SUPER_RNR; + else + control.super = L2CAP_SUPER_RR; + + control.reqseq = chan->buffer_seq; + l2cap_send_sframe(chan, &control); } static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan)