Skip to content

Commit 9104e94

Browse files
makeshidanieldegrasse
authored andcommitted
Bluetooth: Classic: L2CAP: Set default value for BR timer timeout
When peer monitor and retransmission timeout are zero, set them to the default values. This ensures that the monitor timeout is always a valid value to avoid the L2CAP BR timer work queue hang. Signed-off-by: Make Shi <make.shi@nxp.com>
1 parent 2bdc3e2 commit 9104e94

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

subsys/bluetooth/host/classic/l2cap_br.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4034,6 +4034,14 @@ static uint16_t l2cap_br_conf_opt_ret_fc(struct bt_l2cap_chan *chan, struct net_
40344034
opt_ret_fc->tx_windows_size = CONFIG_BT_L2CAP_MAX_WINDOW_SIZE;
40354035
}
40364036

4037+
if (monitor_timeout == 0) {
4038+
monitor_timeout = CONFIG_BT_L2CAP_BR_MONITOR_TIMEOUT;
4039+
}
4040+
4041+
if (retransmission_timeout == 0) {
4042+
retransmission_timeout = CONFIG_BT_L2CAP_BR_RET_TIMEOUT;
4043+
}
4044+
40374045
opt_ret_fc->retransmission_timeout = sys_cpu_to_le16(retransmission_timeout);
40384046
opt_ret_fc->monitor_timeout = sys_cpu_to_le16(monitor_timeout);
40394047

0 commit comments

Comments
 (0)