aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2011-10-11 06:37:50 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-13 15:45:39 -0400
commite37817353bf94a4e00faad78ffb8cc07f8556252 (patch)
tree7208edac29fabd8456c6dec8ef7ff605dd10536f /net
parent03f6715d463e6ee3e724ac64a9bedf1ad7d2b9b4 (diff)
Bluetooth: EWS: rewrite handling POLL (P) bit
Handle POLL (P) bit in L2CAP ERTM using information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index c500d1cb39a3..97aa545d66d9 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -585,7 +585,7 @@ static inline void l2cap_send_sframe(struct l2cap_chan *chan, u16 control)
585 control |= __set_ctrl_final(chan); 585 control |= __set_ctrl_final(chan);
586 586
587 if (test_and_clear_bit(CONN_SEND_PBIT, &chan->conn_state)) 587 if (test_and_clear_bit(CONN_SEND_PBIT, &chan->conn_state))
588 control |= L2CAP_CTRL_POLL; 588 control |= __set_ctrl_poll(chan);
589 589
590 skb = bt_skb_alloc(count, GFP_ATOMIC); 590 skb = bt_skb_alloc(count, GFP_ATOMIC);
591 if (!skb) 591 if (!skb)
@@ -3304,7 +3304,7 @@ static void l2cap_ertm_exit_local_busy(struct l2cap_chan *chan)
3304 goto done; 3304 goto done;
3305 3305
3306 control = __set_reqseq(chan, chan->buffer_seq); 3306 control = __set_reqseq(chan, chan->buffer_seq);
3307 control |= L2CAP_CTRL_POLL; 3307 control |= __set_ctrl_poll(chan);
3308 control |= __set_ctrl_super(chan, L2CAP_SUPER_RR); 3308 control |= __set_ctrl_super(chan, L2CAP_SUPER_RR);
3309 l2cap_send_sframe(chan, control); 3309 l2cap_send_sframe(chan, control);
3310 chan->retry_count = 1; 3310 chan->retry_count = 1;
@@ -3538,7 +3538,7 @@ static inline void l2cap_data_channel_rrframe(struct l2cap_chan *chan, u16 rx_co
3538 chan->expected_ack_seq = __get_reqseq(chan, rx_control); 3538 chan->expected_ack_seq = __get_reqseq(chan, rx_control);
3539 l2cap_drop_acked_frames(chan); 3539 l2cap_drop_acked_frames(chan);
3540 3540
3541 if (rx_control & L2CAP_CTRL_POLL) { 3541 if (__is_ctrl_poll(chan, rx_control)) {
3542 set_bit(CONN_SEND_FBIT, &chan->conn_state); 3542 set_bit(CONN_SEND_FBIT, &chan->conn_state);
3543 if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) { 3543 if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) {
3544 if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state) && 3544 if (test_bit(CONN_REMOTE_BUSY, &chan->conn_state) &&
@@ -3599,7 +3599,7 @@ static inline void l2cap_data_channel_srejframe(struct l2cap_chan *chan, u16 rx_
3599 3599
3600 clear_bit(CONN_REMOTE_BUSY, &chan->conn_state); 3600 clear_bit(CONN_REMOTE_BUSY, &chan->conn_state);
3601 3601
3602 if (rx_control & L2CAP_CTRL_POLL) { 3602 if (__is_ctrl_poll(chan, rx_control)) {
3603 chan->expected_ack_seq = tx_seq; 3603 chan->expected_ack_seq = tx_seq;
3604 l2cap_drop_acked_frames(chan); 3604 l2cap_drop_acked_frames(chan);
3605 3605
@@ -3637,17 +3637,17 @@ static inline void l2cap_data_channel_rnrframe(struct l2cap_chan *chan, u16 rx_c
3637 chan->expected_ack_seq = tx_seq; 3637 chan->expected_ack_seq = tx_seq;
3638 l2cap_drop_acked_frames(chan); 3638 l2cap_drop_acked_frames(chan);
3639 3639
3640 if (rx_control & L2CAP_CTRL_POLL) 3640 if (__is_ctrl_poll(chan, rx_control))
3641 set_bit(CONN_SEND_FBIT, &chan->conn_state); 3641 set_bit(CONN_SEND_FBIT, &chan->conn_state);
3642 3642
3643 if (!test_bit(CONN_SREJ_SENT, &chan->conn_state)) { 3643 if (!test_bit(CONN_SREJ_SENT, &chan->conn_state)) {
3644 __clear_retrans_timer(chan); 3644 __clear_retrans_timer(chan);
3645 if (rx_control & L2CAP_CTRL_POLL) 3645 if (__is_ctrl_poll(chan, rx_control))
3646 l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_FINAL); 3646 l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_FINAL);
3647 return; 3647 return;
3648 } 3648 }
3649 3649
3650 if (rx_control & L2CAP_CTRL_POLL) { 3650 if (__is_ctrl_poll(chan, rx_control)) {
3651 l2cap_send_srejtail(chan); 3651 l2cap_send_srejtail(chan);
3652 } else { 3652 } else {
3653 rx_control = __set_ctrl_super(chan, L2CAP_SUPER_RR); 3653 rx_control = __set_ctrl_super(chan, L2CAP_SUPER_RR);