Bluetooth: Add new auto_conn value matching mgmt action 0x00
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 2 Jul 2014 14:37:27 +0000 (17:37 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:57 +0000 (17:42 +0200)
The 0x00 action value of mgmt means "scan and report" but do not
connect. This is different from HCI_AUTO_CONN_DISABLED so we need a new
value for it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c

index 2091e0013b8c946b45aaf10e913e0494a5225cc7..f4a2f50f30b56a1974259ca9269c131830b30460 100644 (file)
@@ -449,6 +449,7 @@ struct hci_conn_params {
 
        enum {
                HCI_AUTO_CONN_DISABLED,
+               HCI_AUTO_CONN_REPORT,
                HCI_AUTO_CONN_ALWAYS,
                HCI_AUTO_CONN_LINK_LOSS,
        } auto_connect;
index 7e46a7c6092f2f488f6e6120c810f1dd41ab511f..a3cd0bbd3518d930a3bc508c3501320a62080ad0 100644 (file)
@@ -3547,6 +3547,7 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
 
        switch (auto_connect) {
        case HCI_AUTO_CONN_DISABLED:
+       case HCI_AUTO_CONN_REPORT:
        case HCI_AUTO_CONN_LINK_LOSS:
                hci_pend_le_conn_del(hdev, addr, addr_type);
                break;
index 29850e76ea3cbf12f525250b3a98c09d4804dc16..f7217f9eda038dc6558bc01c2f591044a44d4f0c 100644 (file)
@@ -5034,7 +5034,7 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,
        if (cp->action)
                auto_conn = HCI_AUTO_CONN_ALWAYS;
        else
-               auto_conn = HCI_AUTO_CONN_DISABLED;
+               auto_conn = HCI_AUTO_CONN_REPORT;
 
        /* If the connection parameters don't exist for this device,
         * they will be created and configured with defaults.