Bluetooth: distinguish the interface about LE scan set state 87/98787/3
authorHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 21 Nov 2016 00:49:40 +0000 (09:49 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Mon, 21 Nov 2016 01:07:52 +0000 (10:07 +0900)
Actually, it has the function both "BR/EDR" discovery set state function and
"LE" discovery set state function. So, it is better to distinguish the "LE"
discovery set state function for "LE" scenario.

Change-Id: I7694a58a793b7ecef5c57a85563c99ca0cefd1cf
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
net/bluetooth/hci_core.c
net/bluetooth/mgmt.c

index a6b0819..c599077 100644 (file)
@@ -1095,7 +1095,9 @@ void hci_discovery_set_state(struct hci_dev *hdev, int state)
 
        switch (state) {
        case DISCOVERY_STOPPED:
+#ifndef CONFIG_TIZEN_WIP
                hci_update_background_scan(hdev);
+#endif
 
                if (old_state != DISCOVERY_STARTING)
                        mgmt_discovering(hdev, 0);
@@ -2903,7 +2905,11 @@ static void le_scan_disable_work_complete(struct hci_dev *hdev, u8 status,
        switch (hdev->discovery.type) {
        case DISCOV_TYPE_LE:
                hci_dev_lock(hdev);
+#ifdef CONFIG_TIZEN_WIP
+               hci_le_discovery_set_state(hdev, DISCOVERY_STOPPED);
+#else
                hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+#endif
                hci_dev_unlock(hdev);
                break;
 
@@ -2922,7 +2928,11 @@ static void le_scan_disable_work_complete(struct hci_dev *hdev, u8 status,
                err = hci_req_run(&req, inquiry_complete);
                if (err) {
                        BT_ERR("Inquiry request failed: err %d", err);
+#ifdef CONFIG_TIZEN_WIP
+                       hci_le_discovery_set_state(hdev, DISCOVERY_STOPPED);
+#else
                        hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+#endif
                }
 
                hci_dev_unlock(hdev);
index ff281a7..e2ae0fd 100644 (file)
@@ -1443,6 +1443,11 @@ static int clean_up_hci_state(struct hci_dev *hdev)
        if (!err && discov_stopped)
                hci_discovery_set_state(hdev, DISCOVERY_STOPPING);
 
+#ifdef CONFIG_TIZEN_WIP
+       if (!err && discov_stopped)
+               hci_le_discovery_set_state(hdev, DISCOVERY_STOPPING);
+#endif
+
        return err;
 }