aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMat Martineau <mathewm@codeaurora.org>2012-04-25 19:36:14 -0400
committerGustavo Padovan <gustavo@padovan.org>2012-05-09 00:40:47 -0400
commit3ce3514f5d0f90c7d856e8b0f26c6da393bbeba0 (patch)
tree0a32866b6d59bbfae27765a4c905c260501a2adc /net
parent5a364bd399d23fe6244de8f84c46f249b763c723 (diff)
Bluetooth: Remove duplicate structure members from bt_skb_cb
These values are now in the nested l2cap_ctrl struct. Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo@padovan.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_core.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 4b6d11c199b5..62ef7c335163 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1620,7 +1620,7 @@ static void l2cap_drop_acked_frames(struct l2cap_chan *chan)
1620 1620
1621 while ((skb = skb_peek(&chan->tx_q)) && 1621 while ((skb = skb_peek(&chan->tx_q)) &&
1622 chan->unacked_frames) { 1622 chan->unacked_frames) {
1623 if (bt_cb(skb)->tx_seq == chan->expected_ack_seq) 1623 if (bt_cb(skb)->control.txseq == chan->expected_ack_seq)
1624 break; 1624 break;
1625 1625
1626 skb = skb_dequeue(&chan->tx_q); 1626 skb = skb_dequeue(&chan->tx_q);
@@ -1667,21 +1667,21 @@ static void l2cap_retransmit_one_frame(struct l2cap_chan *chan, u16 tx_seq)
1667 if (!skb) 1667 if (!skb)
1668 return; 1668 return;
1669 1669
1670 while (bt_cb(skb)->tx_seq != tx_seq) { 1670 while (bt_cb(skb)->control.txseq != tx_seq) {
1671 if (skb_queue_is_last(&chan->tx_q, skb)) 1671 if (skb_queue_is_last(&chan->tx_q, skb))
1672 return; 1672 return;
1673 1673
1674 skb = skb_queue_next(&chan->tx_q, skb); 1674 skb = skb_queue_next(&chan->tx_q, skb);
1675 } 1675 }
1676 1676
1677 if (chan->remote_max_tx && 1677 if (bt_cb(skb)->control.retries == chan->remote_max_tx &&
1678 bt_cb(skb)->retries == chan->remote_max_tx) { 1678 chan->remote_max_tx) {
1679 l2cap_send_disconn_req(chan->conn, chan, ECONNABORTED); 1679 l2cap_send_disconn_req(chan->conn, chan, ECONNABORTED);
1680 return; 1680 return;
1681 } 1681 }
1682 1682
1683 tx_skb = skb_clone(skb, GFP_ATOMIC); 1683 tx_skb = skb_clone(skb, GFP_ATOMIC);
1684 bt_cb(skb)->retries++; 1684 bt_cb(skb)->control.retries++;
1685 1685
1686 control = __get_control(chan, tx_skb->data + L2CAP_HDR_SIZE); 1686 control = __get_control(chan, tx_skb->data + L2CAP_HDR_SIZE);
1687 control &= __get_sar_mask(chan); 1687 control &= __get_sar_mask(chan);
@@ -1716,15 +1716,15 @@ static int l2cap_ertm_send(struct l2cap_chan *chan)
1716 1716
1717 while ((skb = chan->tx_send_head) && (!l2cap_tx_window_full(chan))) { 1717 while ((skb = chan->tx_send_head) && (!l2cap_tx_window_full(chan))) {
1718 1718
1719 if (chan->remote_max_tx && 1719 if (bt_cb(skb)->control.retries == chan->remote_max_tx &&
1720 bt_cb(skb)->retries == chan->remote_max_tx) { 1720 chan->remote_max_tx) {
1721 l2cap_send_disconn_req(chan->conn, chan, ECONNABORTED); 1721 l2cap_send_disconn_req(chan->conn, chan, ECONNABORTED);
1722 break; 1722 break;
1723 } 1723 }
1724 1724
1725 tx_skb = skb_clone(skb, GFP_ATOMIC); 1725 tx_skb = skb_clone(skb, GFP_ATOMIC);
1726 1726
1727 bt_cb(skb)->retries++; 1727 bt_cb(skb)->control.retries++;
1728 1728
1729 control = __get_control(chan, tx_skb->data + L2CAP_HDR_SIZE); 1729 control = __get_control(chan, tx_skb->data + L2CAP_HDR_SIZE);
1730 control &= __get_sar_mask(chan); 1730 control &= __get_sar_mask(chan);
@@ -1748,11 +1748,11 @@ static int l2cap_ertm_send(struct l2cap_chan *chan)
1748 1748
1749 __set_retrans_timer(chan); 1749 __set_retrans_timer(chan);
1750 1750
1751 bt_cb(skb)->tx_seq = chan->next_tx_seq; 1751 bt_cb(skb)->control.txseq = chan->next_tx_seq;
1752 1752
1753 chan->next_tx_seq = __next_seq(chan, chan->next_tx_seq); 1753 chan->next_tx_seq = __next_seq(chan, chan->next_tx_seq);
1754 1754
1755 if (bt_cb(skb)->retries == 1) { 1755 if (bt_cb(skb)->control.retries == 1) {
1756 chan->unacked_frames++; 1756 chan->unacked_frames++;
1757 1757
1758 if (!nsent++) 1758 if (!nsent++)
@@ -1978,7 +1978,7 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
1978 if (chan->fcs == L2CAP_FCS_CRC16) 1978 if (chan->fcs == L2CAP_FCS_CRC16)
1979 put_unaligned_le16(0, skb_put(skb, L2CAP_FCS_SIZE)); 1979 put_unaligned_le16(0, skb_put(skb, L2CAP_FCS_SIZE));
1980 1980
1981 bt_cb(skb)->retries = 0; 1981 bt_cb(skb)->control.retries = 0;
1982 return skb; 1982 return skb;
1983} 1983}
1984 1984
@@ -3950,19 +3950,19 @@ static int l2cap_add_to_srej_queue(struct l2cap_chan *chan, struct sk_buff *skb,
3950 struct sk_buff *next_skb; 3950 struct sk_buff *next_skb;
3951 int tx_seq_offset, next_tx_seq_offset; 3951 int tx_seq_offset, next_tx_seq_offset;
3952 3952
3953 bt_cb(skb)->tx_seq = tx_seq; 3953 bt_cb(skb)->control.txseq = tx_seq;
3954 bt_cb(skb)->sar = sar; 3954 bt_cb(skb)->control.sar = sar;
3955 3955
3956 next_skb = skb_peek(&chan->srej_q); 3956 next_skb = skb_peek(&chan->srej_q);
3957 3957
3958 tx_seq_offset = __seq_offset(chan, tx_seq, chan->buffer_seq); 3958 tx_seq_offset = __seq_offset(chan, tx_seq, chan->buffer_seq);
3959 3959
3960 while (next_skb) { 3960 while (next_skb) {
3961 if (bt_cb(next_skb)->tx_seq == tx_seq) 3961 if (bt_cb(next_skb)->control.txseq == tx_seq)
3962 return -EINVAL; 3962 return -EINVAL;
3963 3963
3964 next_tx_seq_offset = __seq_offset(chan, 3964 next_tx_seq_offset = __seq_offset(chan,
3965 bt_cb(next_skb)->tx_seq, chan->buffer_seq); 3965 bt_cb(next_skb)->control.txseq, chan->buffer_seq);
3966 3966
3967 if (next_tx_seq_offset > tx_seq_offset) { 3967 if (next_tx_seq_offset > tx_seq_offset) {
3968 __skb_queue_before(&chan->srej_q, next_skb, skb); 3968 __skb_queue_before(&chan->srej_q, next_skb, skb);
@@ -4134,11 +4134,11 @@ static void l2cap_check_srej_gap(struct l2cap_chan *chan, u16 tx_seq)
4134 !test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) { 4134 !test_bit(CONN_LOCAL_BUSY, &chan->conn_state)) {
4135 int err; 4135 int err;
4136 4136
4137 if (bt_cb(skb)->tx_seq != tx_seq) 4137 if (bt_cb(skb)->control.txseq != tx_seq)
4138 break; 4138 break;
4139 4139
4140 skb = skb_dequeue(&chan->srej_q); 4140 skb = skb_dequeue(&chan->srej_q);
4141 control = __set_ctrl_sar(chan, bt_cb(skb)->sar); 4141 control = __set_ctrl_sar(chan, bt_cb(skb)->control.sar);
4142 err = l2cap_reassemble_sdu(chan, skb, control); 4142 err = l2cap_reassemble_sdu(chan, skb, control);
4143 4143
4144 if (err < 0) { 4144 if (err < 0) {
@@ -4309,8 +4309,8 @@ expected:
4309 chan->expected_tx_seq = __next_seq(chan, chan->expected_tx_seq); 4309 chan->expected_tx_seq = __next_seq(chan, chan->expected_tx_seq);
4310 4310
4311 if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) { 4311 if (test_bit(CONN_SREJ_SENT, &chan->conn_state)) {
4312 bt_cb(skb)->tx_seq = tx_seq; 4312 bt_cb(skb)->control.txseq = tx_seq;
4313 bt_cb(skb)->sar = sar; 4313 bt_cb(skb)->control.sar = sar;
4314 __skb_queue_tail(&chan->srej_q, skb); 4314 __skb_queue_tail(&chan->srej_q, skb);
4315 return 0; 4315 return 0;
4316 } 4316 }