aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index ce67d0ff486f..0408a93570d6 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -507,7 +507,7 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
507 if (acl->state == BT_CONNECTED && 507 if (acl->state == BT_CONNECTED &&
508 (sco->state == BT_OPEN || sco->state == BT_CLOSED)) { 508 (sco->state == BT_OPEN || sco->state == BT_CLOSED)) {
509 acl->power_save = 1; 509 acl->power_save = 1;
510 hci_conn_enter_active_mode(acl); 510 hci_conn_enter_active_mode(acl, BT_POWER_FORCE_ACTIVE_ON);
511 511
512 if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl->pend)) { 512 if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl->pend)) {
513 /* defer SCO setup until mode change completed */ 513 /* defer SCO setup until mode change completed */
@@ -688,7 +688,7 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role)
688EXPORT_SYMBOL(hci_conn_switch_role); 688EXPORT_SYMBOL(hci_conn_switch_role);
689 689
690/* Enter active mode */ 690/* Enter active mode */
691void hci_conn_enter_active_mode(struct hci_conn *conn) 691void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
692{ 692{
693 struct hci_dev *hdev = conn->hdev; 693 struct hci_dev *hdev = conn->hdev;
694 694
@@ -697,7 +697,10 @@ void hci_conn_enter_active_mode(struct hci_conn *conn)
697 if (test_bit(HCI_RAW, &hdev->flags)) 697 if (test_bit(HCI_RAW, &hdev->flags))
698 return; 698 return;
699 699
700 if (conn->mode != HCI_CM_SNIFF || !conn->power_save) 700 if (conn->mode != HCI_CM_SNIFF)
701 goto timer;
702
703 if (!conn->power_save && !force_active)
701 goto timer; 704 goto timer;
702 705
703 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) { 706 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) {