aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_sock.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2011-10-11 06:37:42 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-13 15:44:26 -0400
commit6327eb980d2ff0c96363b81cb0ce580165cb81b8 (patch)
treea6351655b16aa61dfa26543fb3a47b54f0321827 /net/bluetooth/l2cap_sock.c
parent669bb3962bd7f781879222eeb7263d527551dd5e (diff)
Bluetooth: EWS: extended window size option support
Adds support for extended window size (EWS) config option. We enable EWS feature in L2CAP Info RSP when hs enabled. EWS option is included in L2CAP Config Req if tx_win (which is set via socket) bigger then standard default value (63) && hs enabled && remote side supports EWS feature. Using EWS selects extended control field in L2CAP. Code partly based on Qualcomm and Atheros patches sent upstream a year ago. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/l2cap_sock.c')
-rw-r--r--net/bluetooth/l2cap_sock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 48ad8ba492a5..836d12e66a38 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -331,7 +331,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
331 opts.mode = chan->mode; 331 opts.mode = chan->mode;
332 opts.fcs = chan->fcs; 332 opts.fcs = chan->fcs;
333 opts.max_tx = chan->max_tx; 333 opts.max_tx = chan->max_tx;
334 opts.txwin_size = (__u16)chan->tx_win; 334 opts.txwin_size = chan->tx_win;
335 335
336 len = min_t(unsigned int, len, sizeof(opts)); 336 len = min_t(unsigned int, len, sizeof(opts));
337 if (copy_to_user(optval, (char *) &opts, len)) 337 if (copy_to_user(optval, (char *) &opts, len))
@@ -501,7 +501,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
501 opts.mode = chan->mode; 501 opts.mode = chan->mode;
502 opts.fcs = chan->fcs; 502 opts.fcs = chan->fcs;
503 opts.max_tx = chan->max_tx; 503 opts.max_tx = chan->max_tx;
504 opts.txwin_size = (__u16)chan->tx_win; 504 opts.txwin_size = chan->tx_win;
505 505
506 len = min_t(unsigned int, sizeof(opts), optlen); 506 len = min_t(unsigned int, sizeof(opts), optlen);
507 if (copy_from_user((char *) &opts, optval, len)) { 507 if (copy_from_user((char *) &opts, optval, len)) {
@@ -509,7 +509,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
509 break; 509 break;
510 } 510 }
511 511
512 if (opts.txwin_size > L2CAP_DEFAULT_TX_WINDOW) { 512 if (opts.txwin_size > L2CAP_DEFAULT_EXT_WINDOW) {
513 err = -EINVAL; 513 err = -EINVAL;
514 break; 514 break;
515 } 515 }
@@ -533,7 +533,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
533 chan->omtu = opts.omtu; 533 chan->omtu = opts.omtu;
534 chan->fcs = opts.fcs; 534 chan->fcs = opts.fcs;
535 chan->max_tx = opts.max_tx; 535 chan->max_tx = opts.max_tx;
536 chan->tx_win = (__u8)opts.txwin_size; 536 chan->tx_win = opts.txwin_size;
537 break; 537 break;
538 538
539 case L2CAP_LM: 539 case L2CAP_LM: