Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 300b9397 authored by Marcel Holtmann's avatar Marcel Holtmann Committed by David S. Miller
Browse files

[Bluetooth] Add RFCOMM role switch support



This patch adds the support for RFCOMM role switching before the
connection is fully established.

Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 7c2660b0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1150,6 +1150,8 @@ static inline int rfcomm_check_link_mode(struct rfcomm_dlc *d)

static void rfcomm_dlc_accept(struct rfcomm_dlc *d)
{
	struct sock *sk = d->session->sock->sk;

	BT_DBG("dlc %p", d);

	rfcomm_send_ua(d->session, d->dlci);
@@ -1159,6 +1161,9 @@ static void rfcomm_dlc_accept(struct rfcomm_dlc *d)
	d->state_change(d, 0);
	rfcomm_dlc_unlock(d);

	if (d->link_mode & RFCOMM_LM_MASTER)
		hci_conn_switch_role(l2cap_pi(sk)->conn->hcon, 0x00);

	rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig);
}