[Bluetooth] Add RFCOMM role switch support

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

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by Marcel Holtmann and committed by David S. Miller 300b9397 7c2660b0

+5
+5
net/bluetooth/rfcomm/core.c
··· 1150 1150 1151 1151 static void rfcomm_dlc_accept(struct rfcomm_dlc *d) 1152 1152 { 1153 + struct sock *sk = d->session->sock->sk; 1154 + 1153 1155 BT_DBG("dlc %p", d); 1154 1156 1155 1157 rfcomm_send_ua(d->session, d->dlci); ··· 1160 1158 d->state = BT_CONNECTED; 1161 1159 d->state_change(d, 0); 1162 1160 rfcomm_dlc_unlock(d); 1161 + 1162 + if (d->link_mode & RFCOMM_LM_MASTER) 1163 + hci_conn_switch_role(l2cap_pi(sk)->conn->hcon, 0x00); 1163 1164 1164 1165 rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); 1165 1166 }