diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-05-01 15:15:37 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-05-10 03:28:47 -0400 |
commit | f0946ccfc7da403a46b7ff7cb2e3deffac108742 (patch) | |
tree | 60cc96a3cbaceed122b7b2e9940eafe747112643 /net/bluetooth | |
parent | 9e917af13d59182f95bbb5483dc0c4254dfb7944 (diff) |
Bluetooth: Move set of P-bit to l2cap_send_sframe()
Abstract the send of of P-bit and avoids code duplication like we
did with the setting of F-bit.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 0a739ef167c2..852c1400d069 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -357,6 +357,11 @@ static inline int l2cap_send_sframe(struct l2cap_pinfo *pi, u16 control) | |||
357 | pi->conn_state &= ~L2CAP_CONN_SEND_FBIT; | 357 | pi->conn_state &= ~L2CAP_CONN_SEND_FBIT; |
358 | } | 358 | } |
359 | 359 | ||
360 | if (pi->conn_state & L2CAP_CONN_SEND_PBIT) { | ||
361 | control |= L2CAP_CTRL_POLL; | ||
362 | pi->conn_state &= ~L2CAP_CONN_SEND_PBIT; | ||
363 | } | ||
364 | |||
360 | skb = bt_skb_alloc(count, GFP_ATOMIC); | 365 | skb = bt_skb_alloc(count, GFP_ATOMIC); |
361 | if (!skb) | 366 | if (!skb) |
362 | return -ENOMEM; | 367 | return -ENOMEM; |
@@ -3364,10 +3369,6 @@ static void l2cap_send_srejframe(struct sock *sk, u8 tx_seq) | |||
3364 | while (tx_seq != pi->expected_tx_seq) { | 3369 | while (tx_seq != pi->expected_tx_seq) { |
3365 | control = L2CAP_SUPER_SELECT_REJECT; | 3370 | control = L2CAP_SUPER_SELECT_REJECT; |
3366 | control |= pi->expected_tx_seq << L2CAP_CTRL_REQSEQ_SHIFT; | 3371 | control |= pi->expected_tx_seq << L2CAP_CTRL_REQSEQ_SHIFT; |
3367 | if (pi->conn_state & L2CAP_CONN_SEND_PBIT) { | ||
3368 | control |= L2CAP_CTRL_POLL; | ||
3369 | pi->conn_state &= ~L2CAP_CONN_SEND_PBIT; | ||
3370 | } | ||
3371 | l2cap_send_sframe(pi, control); | 3372 | l2cap_send_sframe(pi, control); |
3372 | 3373 | ||
3373 | new = kzalloc(sizeof(struct srej_list), GFP_ATOMIC); | 3374 | new = kzalloc(sizeof(struct srej_list), GFP_ATOMIC); |