Bluetooth: GAP: Dont allow role switch when there is another ACL
The scatternet scenarios are difficult to be handled in SOC. This change not to allow role switch during outgoing ACL connections will avoid scatternet scenarios. CRs-fixed: 392836 Change-Id: I5769b71879ea951755e115424fb2b5b504e95784 Signed-off-by: Mallikarjuna GB <gbmalli@codeaurora.org>
This commit is contained in:
committed by
Iliyan Malchev
parent
deba57a4a7
commit
dd30df71f5
@@ -206,6 +206,13 @@ void hci_le_remove_dev_white_list(struct hci_dev *hdev, bdaddr_t *dst)
|
||||
}
|
||||
EXPORT_SYMBOL(hci_le_remove_dev_white_list);
|
||||
|
||||
static inline bool is_role_switch_possible(struct hci_dev *hdev)
|
||||
{
|
||||
if (hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECTED))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void hci_acl_connect(struct hci_conn *conn)
|
||||
{
|
||||
struct hci_dev *hdev = conn->hdev;
|
||||
@@ -241,7 +248,8 @@ void hci_acl_connect(struct hci_conn *conn)
|
||||
}
|
||||
|
||||
cp.pkt_type = cpu_to_le16(conn->pkt_type);
|
||||
if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER))
|
||||
if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER)
|
||||
&& is_role_switch_possible(hdev))
|
||||
cp.role_switch = 0x01;
|
||||
else
|
||||
cp.role_switch = 0x00;
|
||||
|
||||
Reference in New Issue
Block a user