Commit 9104e941 authored by Make Shi's avatar Make Shi Committed by Daniel DeGrasse
Browse files

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: default avatarMake Shi <make.shi@nxp.com>
parent 2bdc3e23
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -4034,6 +4034,14 @@ static uint16_t l2cap_br_conf_opt_ret_fc(struct bt_l2cap_chan *chan, struct net_
			opt_ret_fc->tx_windows_size = CONFIG_BT_L2CAP_MAX_WINDOW_SIZE;
		}

		if (monitor_timeout == 0) {
			monitor_timeout = CONFIG_BT_L2CAP_BR_MONITOR_TIMEOUT;
		}

		if (retransmission_timeout == 0) {
			retransmission_timeout = CONFIG_BT_L2CAP_BR_RET_TIMEOUT;
		}

		opt_ret_fc->retransmission_timeout = sys_cpu_to_le16(retransmission_timeout);
		opt_ret_fc->monitor_timeout = sys_cpu_to_le16(monitor_timeout);