aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-04-13 14:57:03 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-04-27 17:51:35 -0400
commit47d1ec6161da2c7b9dbc56a5200fa26b17d5fdc1 (patch)
tree7f7c5288d420cf84cf38ba55ca36bcc052066e92 /net/bluetooth/l2cap_sock.c
parent4343478f3a4806394136d8141b2e451aa5443f03 (diff)
Bluetooth: Move more vars to struct l2cap_chan
In this commit all ERTM and Streaming Mode specific vars. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 612955679b34..4ba15b3b2e6a 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -403,9 +403,9 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
403 opts.omtu = l2cap_pi(sk)->omtu; 403 opts.omtu = l2cap_pi(sk)->omtu;
404 opts.flush_to = l2cap_pi(sk)->flush_to; 404 opts.flush_to = l2cap_pi(sk)->flush_to;
405 opts.mode = l2cap_pi(sk)->mode; 405 opts.mode = l2cap_pi(sk)->mode;
406 opts.fcs = l2cap_pi(sk)->fcs; 406 opts.fcs = chan->fcs;
407 opts.max_tx = l2cap_pi(sk)->max_tx; 407 opts.max_tx = chan->max_tx;
408 opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win; 408 opts.txwin_size = (__u16)chan->tx_win;
409 409
410 len = min_t(unsigned int, len, sizeof(opts)); 410 len = min_t(unsigned int, len, sizeof(opts));
411 if (copy_to_user(optval, (char *) &opts, len)) 411 if (copy_to_user(optval, (char *) &opts, len))
@@ -551,9 +551,9 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
551 opts.omtu = l2cap_pi(sk)->omtu; 551 opts.omtu = l2cap_pi(sk)->omtu;
552 opts.flush_to = l2cap_pi(sk)->flush_to; 552 opts.flush_to = l2cap_pi(sk)->flush_to;
553 opts.mode = l2cap_pi(sk)->mode; 553 opts.mode = l2cap_pi(sk)->mode;
554 opts.fcs = l2cap_pi(sk)->fcs; 554 opts.fcs = chan->fcs;
555 opts.max_tx = l2cap_pi(sk)->max_tx; 555 opts.max_tx = chan->max_tx;
556 opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win; 556 opts.txwin_size = (__u16)chan->tx_win;
557 557
558 len = min_t(unsigned int, sizeof(opts), optlen); 558 len = min_t(unsigned int, sizeof(opts), optlen);
559 if (copy_from_user((char *) &opts, optval, len)) { 559 if (copy_from_user((char *) &opts, optval, len)) {
@@ -583,9 +583,9 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
583 583
584 l2cap_pi(sk)->imtu = opts.imtu; 584 l2cap_pi(sk)->imtu = opts.imtu;
585 l2cap_pi(sk)->omtu = opts.omtu; 585 l2cap_pi(sk)->omtu = opts.omtu;
586 l2cap_pi(sk)->fcs = opts.fcs; 586 chan->fcs = opts.fcs;
587 l2cap_pi(sk)->max_tx = opts.max_tx; 587 chan->max_tx = opts.max_tx;
588 l2cap_pi(sk)->tx_win = (__u8)opts.txwin_size; 588 chan->tx_win = (__u8)opts.txwin_size;
589 break; 589 break;
590 590
591 case L2CAP_LM: 591 case L2CAP_LM:
@@ -764,7 +764,8 @@ static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct ms
764 /* Entire SDU fits into one PDU */ 764 /* Entire SDU fits into one PDU */
765 if (len <= pi->chan->remote_mps) { 765 if (len <= pi->chan->remote_mps) {
766 control = L2CAP_SDU_UNSEGMENTED; 766 control = L2CAP_SDU_UNSEGMENTED;
767 skb = l2cap_create_iframe_pdu(sk, msg, len, control, 0); 767 skb = l2cap_create_iframe_pdu(pi->chan, msg, len,
768 control, 0);
768 if (IS_ERR(skb)) { 769 if (IS_ERR(skb)) {
769 err = PTR_ERR(skb); 770 err = PTR_ERR(skb);
770 goto done; 771 goto done;
@@ -998,9 +999,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent)
998 pi->omtu = l2cap_pi(parent)->omtu; 999 pi->omtu = l2cap_pi(parent)->omtu;
999 chan->conf_state = pchan->conf_state; 1000 chan->conf_state = pchan->conf_state;
1000 pi->mode = l2cap_pi(parent)->mode; 1001 pi->mode = l2cap_pi(parent)->mode;
1001 pi->fcs = l2cap_pi(parent)->fcs; 1002 chan->fcs = pchan->fcs;
1002 pi->max_tx = l2cap_pi(parent)->max_tx; 1003 chan->max_tx = pchan->max_tx;
1003 pi->tx_win = l2cap_pi(parent)->tx_win; 1004 chan->tx_win = pchan->tx_win;
1004 chan->sec_level = pchan->sec_level; 1005 chan->sec_level = pchan->sec_level;
1005 chan->role_switch = pchan->role_switch; 1006 chan->role_switch = pchan->role_switch;
1006 chan->force_reliable = pchan->force_reliable; 1007 chan->force_reliable = pchan->force_reliable;
@@ -1014,9 +1015,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent)
1014 } else { 1015 } else {
1015 pi->mode = L2CAP_MODE_BASIC; 1016 pi->mode = L2CAP_MODE_BASIC;
1016 } 1017 }
1017 pi->max_tx = L2CAP_DEFAULT_MAX_TX; 1018 chan->max_tx = L2CAP_DEFAULT_MAX_TX;
1018 pi->fcs = L2CAP_FCS_CRC16; 1019 chan->fcs = L2CAP_FCS_CRC16;
1019 pi->tx_win = L2CAP_DEFAULT_TX_WINDOW; 1020 chan->tx_win = L2CAP_DEFAULT_TX_WINDOW;
1020 chan->sec_level = BT_SECURITY_LOW; 1021 chan->sec_level = BT_SECURITY_LOW;
1021 chan->role_switch = 0; 1022 chan->role_switch = 0;
1022 chan->force_reliable = 0; 1023 chan->force_reliable = 0;