aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMat Martineau <mathewm@codeaurora.org>2012-05-17 23:53:48 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-04 23:34:04 -0400
commitc9e3d5e00408c96f82b88a8de5d54f7a1343b110 (patch)
tree929010c9c54992313c74edf96fcec8d7e0f9b9ea
parentfcd289df8892268ec0783588e0d7e0346fd6a1cd (diff)
Bluetooth: Use new header structures in l2cap_send_rr_or_rnr
struct l2cap_ctrl is now used, and the sframe is now sent directly rather than depending on a separate call. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r--net/bluetooth/l2cap_core.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 5e4a881a6e19..8ea9ec648bfd 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -920,15 +920,23 @@ static void l2cap_send_sframe(struct l2cap_chan *chan,
920 l2cap_do_send(chan, skb); 920 l2cap_do_send(chan, skb);
921} 921}
922 922
923static inline void l2cap_send_rr_or_rnr(struct l2cap_chan *chan, u32 control) 923static void l2cap_send_rr_or_rnr(struct l2cap_chan *chan, bool poll)
924{ 924{
925 if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) { 925 struct l2cap_ctrl control;
926 control |= __set_ctrl_super(chan, L2CAP_SUPER_RNR); 926
927 set_bit(CONN_RNR_SENT, &chan->conn_state); 927 BT_DBG("chan %p, poll %d", chan, poll);
928 } else 928
929 control |= __set_ctrl_super(chan, L2CAP_SUPER_RR); 929 memset(&control, 0, sizeof(control));
930 control.sframe = 1;
931 control.poll = poll;
930 932
931 control |= __set_reqseq(chan, chan->buffer_seq); 933 if (test_bit(CONN_LOCAL_BUSY, &chan->conn_state))
934 control.super = L2CAP_SUPER_RNR;
935 else
936 control.super = L2CAP_SUPER_RR;
937
938 control.reqseq = chan->buffer_seq;
939 l2cap_send_sframe(chan, &control);
932} 940}
933 941
934static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan) 942static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan)