aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--net/bluetooth/l2cap.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 0f4e4234c5fa..07ae4ccfffbd 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -56,6 +56,7 @@ struct l2cap_options {
56 __u16 flush_to; 56 __u16 flush_to;
57 __u8 mode; 57 __u8 mode;
58 __u8 fcs; 58 __u8 fcs;
59 __u16 txwin_size;
59}; 60};
60 61
61#define L2CAP_CONNINFO 0x02 62#define L2CAP_CONNINFO 0x02
@@ -339,6 +340,7 @@ struct l2cap_pinfo {
339 340
340 __u8 ident; 341 __u8 ident;
341 342
343 __u8 tx_win;
342 __u8 remote_tx_win; 344 __u8 remote_tx_win;
343 __u8 remote_max_tx; 345 __u8 remote_max_tx;
344 __u16 retrans_timeout; 346 __u16 retrans_timeout;
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index c6bc1b9ed657..530079649b43 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -782,6 +782,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
782 pi->omtu = l2cap_pi(parent)->omtu; 782 pi->omtu = l2cap_pi(parent)->omtu;
783 pi->mode = l2cap_pi(parent)->mode; 783 pi->mode = l2cap_pi(parent)->mode;
784 pi->fcs = l2cap_pi(parent)->fcs; 784 pi->fcs = l2cap_pi(parent)->fcs;
785 pi->tx_win = l2cap_pi(parent)->tx_win;
785 pi->sec_level = l2cap_pi(parent)->sec_level; 786 pi->sec_level = l2cap_pi(parent)->sec_level;
786 pi->role_switch = l2cap_pi(parent)->role_switch; 787 pi->role_switch = l2cap_pi(parent)->role_switch;
787 pi->force_reliable = l2cap_pi(parent)->force_reliable; 788 pi->force_reliable = l2cap_pi(parent)->force_reliable;
@@ -790,6 +791,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
790 pi->omtu = 0; 791 pi->omtu = 0;
791 pi->mode = L2CAP_MODE_BASIC; 792 pi->mode = L2CAP_MODE_BASIC;
792 pi->fcs = L2CAP_FCS_CRC16; 793 pi->fcs = L2CAP_FCS_CRC16;
794 pi->tx_win = L2CAP_DEFAULT_TX_WINDOW;
793 pi->sec_level = BT_SECURITY_LOW; 795 pi->sec_level = BT_SECURITY_LOW;
794 pi->role_switch = 0; 796 pi->role_switch = 0;
795 pi->force_reliable = 0; 797 pi->force_reliable = 0;
@@ -1782,6 +1784,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
1782 opts.flush_to = l2cap_pi(sk)->flush_to; 1784 opts.flush_to = l2cap_pi(sk)->flush_to;
1783 opts.mode = l2cap_pi(sk)->mode; 1785 opts.mode = l2cap_pi(sk)->mode;
1784 opts.fcs = l2cap_pi(sk)->fcs; 1786 opts.fcs = l2cap_pi(sk)->fcs;
1787 opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win;
1785 1788
1786 len = min_t(unsigned int, sizeof(opts), optlen); 1789 len = min_t(unsigned int, sizeof(opts), optlen);
1787 if (copy_from_user((char *) &opts, optval, len)) { 1790 if (copy_from_user((char *) &opts, optval, len)) {
@@ -1793,6 +1796,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
1793 l2cap_pi(sk)->omtu = opts.omtu; 1796 l2cap_pi(sk)->omtu = opts.omtu;
1794 l2cap_pi(sk)->mode = opts.mode; 1797 l2cap_pi(sk)->mode = opts.mode;
1795 l2cap_pi(sk)->fcs = opts.fcs; 1798 l2cap_pi(sk)->fcs = opts.fcs;
1799 l2cap_pi(sk)->tx_win = (__u8)opts.txwin_size;
1796 break; 1800 break;
1797 1801
1798 case L2CAP_LM: 1802 case L2CAP_LM:
@@ -1907,6 +1911,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
1907 opts.flush_to = l2cap_pi(sk)->flush_to; 1911 opts.flush_to = l2cap_pi(sk)->flush_to;
1908 opts.mode = l2cap_pi(sk)->mode; 1912 opts.mode = l2cap_pi(sk)->mode;
1909 opts.fcs = l2cap_pi(sk)->fcs; 1913 opts.fcs = l2cap_pi(sk)->fcs;
1914 opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win;
1910 1915
1911 len = min_t(unsigned int, len, sizeof(opts)); 1916 len = min_t(unsigned int, len, sizeof(opts));
1912 if (copy_to_user(optval, (char *) &opts, len)) 1917 if (copy_to_user(optval, (char *) &opts, len))
@@ -2324,7 +2329,7 @@ done:
2324 2329
2325 case L2CAP_MODE_ERTM: 2330 case L2CAP_MODE_ERTM:
2326 rfc.mode = L2CAP_MODE_ERTM; 2331 rfc.mode = L2CAP_MODE_ERTM;
2327 rfc.txwin_size = L2CAP_DEFAULT_TX_WINDOW; 2332 rfc.txwin_size = pi->tx_win;
2328 rfc.max_transmit = max_transmit; 2333 rfc.max_transmit = max_transmit;
2329 rfc.retrans_timeout = 0; 2334 rfc.retrans_timeout = 0;
2330 rfc.monitor_timeout = 0; 2335 rfc.monitor_timeout = 0;