Skip to content

Commit 76e20da

Browse files
fdanis-ossVudentz
authored andcommitted
Revert "Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()"
This reverts commit c9d84da. It replaces in L2CAP calls to msecs_to_jiffies() to secs_to_jiffies() and updates the constants accordingly. But the constants are also used in LCAP Configure Request and L2CAP Configure Response which expect values in milliseconds. This may prevent correct usage of L2CAP channel. To fix it, keep those constants in milliseconds and so revert this change. Fixes: c9d84da ("Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()") Signed-off-by: Frédéric Danis <frederic.danis@collabora.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent e878540 commit 76e20da

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

include/net/bluetooth/l2cap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
#define L2CAP_DEFAULT_TX_WINDOW 63
3939
#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF
4040
#define L2CAP_DEFAULT_MAX_TX 3
41-
#define L2CAP_DEFAULT_RETRANS_TO 2 /* seconds */
42-
#define L2CAP_DEFAULT_MONITOR_TO 12 /* seconds */
41+
#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */
42+
#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
4343
#define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */
4444
#define L2CAP_DEFAULT_ACK_TO 200
4545
#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF

net/bluetooth/l2cap_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static void __set_retrans_timer(struct l2cap_chan *chan)
282282
if (!delayed_work_pending(&chan->monitor_timer) &&
283283
chan->retrans_timeout) {
284284
l2cap_set_timer(chan, &chan->retrans_timer,
285-
secs_to_jiffies(chan->retrans_timeout));
285+
msecs_to_jiffies(chan->retrans_timeout));
286286
}
287287
}
288288

@@ -291,7 +291,7 @@ static void __set_monitor_timer(struct l2cap_chan *chan)
291291
__clear_retrans_timer(chan);
292292
if (chan->monitor_timeout) {
293293
l2cap_set_timer(chan, &chan->monitor_timer,
294-
secs_to_jiffies(chan->monitor_timeout));
294+
msecs_to_jiffies(chan->monitor_timeout));
295295
}
296296
}
297297

0 commit comments

Comments
 (0)