aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-16 04:56:09 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-16 05:58:04 -0400
commitf99353cf9c061bc1700b6a49ee98cae93e28207b (patch)
tree1fb994259b433cdba4c2ea8d4f34d61bb200b551 /net
parentf8218dc6605a7b2af843f9ff5d66229a4a0b1c45 (diff)
Bluetooth: Fix trying to initiate connections when acting as LE slave
When we have at least one LE slave connection most (probably all) controllers will refuse to initiate any new connections. To avoid unnecessary failures simply check for this situation up-front and skip the connection attempt. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_event.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c68b93e11686..e54db7f0590b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4246,6 +4246,12 @@ static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr,
4246 if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type)) 4246 if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type))
4247 return; 4247 return;
4248 4248
4249 /* Most controller will fail if we try to create new connections
4250 * while we have an existing one in slave role.
4251 */
4252 if (hdev->conn_hash.le_num_slave > 0)
4253 return;
4254
4249 /* If we're connectable, always connect any ADV_DIRECT_IND event */ 4255 /* If we're connectable, always connect any ADV_DIRECT_IND event */
4250 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) && 4256 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags) &&
4251 adv_type == LE_ADV_DIRECT_IND) 4257 adv_type == LE_ADV_DIRECT_IND)