mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
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>
This commit is contained in:
parent
669bb3962b
commit
6327eb980d
3 changed files with 58 additions and 9 deletions
|
@ -331,7 +331,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
|
|||
opts.mode = chan->mode;
|
||||
opts.fcs = chan->fcs;
|
||||
opts.max_tx = chan->max_tx;
|
||||
opts.txwin_size = (__u16)chan->tx_win;
|
||||
opts.txwin_size = chan->tx_win;
|
||||
|
||||
len = min_t(unsigned int, len, sizeof(opts));
|
||||
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
|
|||
opts.mode = chan->mode;
|
||||
opts.fcs = chan->fcs;
|
||||
opts.max_tx = chan->max_tx;
|
||||
opts.txwin_size = (__u16)chan->tx_win;
|
||||
opts.txwin_size = chan->tx_win;
|
||||
|
||||
len = min_t(unsigned int, sizeof(opts), optlen);
|
||||
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
|
|||
break;
|
||||
}
|
||||
|
||||
if (opts.txwin_size > L2CAP_DEFAULT_TX_WINDOW) {
|
||||
if (opts.txwin_size > L2CAP_DEFAULT_EXT_WINDOW) {
|
||||
err = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
|
|||
chan->omtu = opts.omtu;
|
||||
chan->fcs = opts.fcs;
|
||||
chan->max_tx = opts.max_tx;
|
||||
chan->tx_win = (__u8)opts.txwin_size;
|
||||
chan->tx_win = opts.txwin_size;
|
||||
break;
|
||||
|
||||
case L2CAP_LM:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue