Skip to content

Commit d1c4a17

Browse files
Gustavo F. Padovanholtmann
authored andcommitted
Bluetooth: Enable L2CAP Extended features by default
Change the enable_ertm param to disable_ertm and default value to 0. That means that L2CAP Extended features are enabled by default now. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 893ef97 commit d1c4a17

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

net/bluetooth/l2cap.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
#define VERSION "2.15"
5959

60-
static int enable_ertm = 0;
60+
static int disable_ertm = 0;
6161

6262
static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN;
6363
static u8 l2cap_fixed_chan[8] = { 0x02, };
@@ -464,7 +464,7 @@ static void l2cap_do_start(struct sock *sk)
464464
static inline int l2cap_mode_supported(__u8 mode, __u32 feat_mask)
465465
{
466466
u32 local_feat_mask = l2cap_feat_mask;
467-
if (enable_ertm)
467+
if (!disable_ertm)
468468
local_feat_mask |= L2CAP_FEAT_ERTM | L2CAP_FEAT_STREAMING;
469469

470470
switch (mode) {
@@ -903,7 +903,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
903903
} else {
904904
pi->imtu = L2CAP_DEFAULT_MTU;
905905
pi->omtu = 0;
906-
if (enable_ertm && sk->sk_type == SOCK_STREAM) {
906+
if (!disable_ertm && sk->sk_type == SOCK_STREAM) {
907907
pi->mode = L2CAP_MODE_ERTM;
908908
pi->conf_state |= L2CAP_CONF_STATE2_DEVICE;
909909
} else {
@@ -1160,7 +1160,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
11601160
break;
11611161
case L2CAP_MODE_ERTM:
11621162
case L2CAP_MODE_STREAMING:
1163-
if (enable_ertm)
1163+
if (!disable_ertm)
11641164
break;
11651165
/* fall through */
11661166
default:
@@ -1226,7 +1226,7 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
12261226
break;
12271227
case L2CAP_MODE_ERTM:
12281228
case L2CAP_MODE_STREAMING:
1229-
if (enable_ertm)
1229+
if (!disable_ertm)
12301230
break;
12311231
/* fall through */
12321232
default:
@@ -1986,7 +1986,7 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
19861986
break;
19871987
case L2CAP_MODE_ERTM:
19881988
case L2CAP_MODE_STREAMING:
1989-
if (enable_ertm)
1989+
if (!disable_ertm)
19901990
break;
19911991
/* fall through */
19921992
default:
@@ -3302,7 +3302,7 @@ static inline int l2cap_information_req(struct l2cap_conn *conn, struct l2cap_cm
33023302
struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf;
33033303
rsp->type = cpu_to_le16(L2CAP_IT_FEAT_MASK);
33043304
rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS);
3305-
if (enable_ertm)
3305+
if (!disable_ertm)
33063306
feat_mask |= L2CAP_FEAT_ERTM | L2CAP_FEAT_STREAMING
33073307
| L2CAP_FEAT_FCS;
33083308
put_unaligned_le32(feat_mask, rsp->data);
@@ -4850,8 +4850,8 @@ EXPORT_SYMBOL(l2cap_load);
48504850
module_init(l2cap_init);
48514851
module_exit(l2cap_exit);
48524852

4853-
module_param(enable_ertm, bool, 0644);
4854-
MODULE_PARM_DESC(enable_ertm, "Enable enhanced retransmission mode");
4853+
module_param(disable_ertm, bool, 0644);
4854+
MODULE_PARM_DESC(disable_ertm, "Disable enhanced retransmission mode");
48554855

48564856
MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
48574857
MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);

0 commit comments

Comments
 (0)