Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211418
b: refs/heads/master
c: ccbb84a
h: refs/heads/master
v: v3
  • Loading branch information
Gustavo F. Padovan committed Sep 30, 2010
1 parent 774fe16 commit 823ed1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 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: 8183b775bc5b79b6b1e250019c9dd930554dfa94
refs/heads/master: ccbb84af28594e19fd4bf27ff2828c80d03b6081
24 changes: 7 additions & 17 deletions trunk/net/bluetooth/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,33 +1441,23 @@ static inline void l2cap_do_send(struct sock *sk, struct sk_buff *skb)

static void l2cap_streaming_send(struct sock *sk)
{
struct sk_buff *skb, *tx_skb;
struct sk_buff *skb;
struct l2cap_pinfo *pi = l2cap_pi(sk);
u16 control, fcs;

while ((skb = sk->sk_send_head)) {
tx_skb = skb_clone(skb, GFP_ATOMIC);

control = get_unaligned_le16(tx_skb->data + L2CAP_HDR_SIZE);
while ((skb = skb_dequeue(TX_QUEUE(sk)))) {
control = get_unaligned_le16(skb->data + L2CAP_HDR_SIZE);
control |= pi->next_tx_seq << L2CAP_CTRL_TXSEQ_SHIFT;
put_unaligned_le16(control, tx_skb->data + L2CAP_HDR_SIZE);
put_unaligned_le16(control, skb->data + L2CAP_HDR_SIZE);

if (pi->fcs == L2CAP_FCS_CRC16) {
fcs = crc16(0, (u8 *)tx_skb->data, tx_skb->len - 2);
put_unaligned_le16(fcs, tx_skb->data + tx_skb->len - 2);
fcs = crc16(0, (u8 *)skb->data, skb->len - 2);
put_unaligned_le16(fcs, skb->data + skb->len - 2);
}

l2cap_do_send(sk, tx_skb);
l2cap_do_send(sk, skb);

pi->next_tx_seq = (pi->next_tx_seq + 1) % 64;

if (skb_queue_is_last(TX_QUEUE(sk), skb))
sk->sk_send_head = NULL;
else
sk->sk_send_head = skb_queue_next(TX_QUEUE(sk), skb);

skb = skb_dequeue(TX_QUEUE(sk));
kfree_skb(skb);
}
}

Expand Down

0 comments on commit 823ed1a

Please sign in to comment.