提交 44651b85 编写于 作者: G Gustavo F. Padovan 提交者: Marcel Holtmann

Bluetooth: Don't set control bits to zero first

We can set the SAR bits in the control field directly.
Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: NJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 01760bdd
......@@ -1636,16 +1636,15 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
__skb_queue_tail(&sar_queue, skb);
len -= pi->remote_mps;
size += pi->remote_mps;
control = 0;
while (len > 0) {
size_t buflen;
if (len > pi->remote_mps) {
control |= L2CAP_SDU_CONTINUE;
control = L2CAP_SDU_CONTINUE;
buflen = pi->remote_mps;
} else {
control |= L2CAP_SDU_END;
control = L2CAP_SDU_END;
buflen = len;
}
......@@ -1658,7 +1657,6 @@ static inline int l2cap_sar_segment_sdu(struct sock *sk, struct msghdr *msg, siz
__skb_queue_tail(&sar_queue, skb);
len -= buflen;
size += buflen;
control = 0;
}
skb_queue_splice_tail(&sar_queue, TX_QUEUE(sk));
if (sk->sk_send_head == NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册