hci_sync.c (34a718bc86f908de8ef79affaff6a3de7b95759c) hci_sync.c (68253f3cd715e819bc4bff2b0e6b21234e259d56)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2021 Intel Corporation
6 */
7
8#include <linux/property.h>

--- 5049 unchanged lines hidden (view full) ---

5058}
5059
5060/* This function resume scan and reset paused flag */
5061static int hci_resume_scan_sync(struct hci_dev *hdev)
5062{
5063 if (!hdev->scanning_paused)
5064 return 0;
5065
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2021 Intel Corporation
6 */
7
8#include <linux/property.h>

--- 5049 unchanged lines hidden (view full) ---

5058}
5059
5060/* This function resume scan and reset paused flag */
5061static int hci_resume_scan_sync(struct hci_dev *hdev)
5062{
5063 if (!hdev->scanning_paused)
5064 return 0;
5065
5066 hdev->scanning_paused = false;
5067
5066 hci_update_scan_sync(hdev);
5067
5068 /* Reset passive scanning to normal */
5069 hci_update_passive_scan_sync(hdev);
5070
5068 hci_update_scan_sync(hdev);
5069
5070 /* Reset passive scanning to normal */
5071 hci_update_passive_scan_sync(hdev);
5072
5071 hdev->scanning_paused = false;
5072
5073 return 0;
5074}
5075
5076/* This function performs the HCI suspend procedures in the follow order:
5077 *
5078 * Restore event mask
5079 * Clear event filter
5080 * Update passive scanning (normal duty cycle)
5081 * Resume Directed Advertising/Advertising
5082 * Resume discovery (active scanning/inquiry)
5083 */
5084int hci_resume_sync(struct hci_dev *hdev)
5085{
5086 /* If not marked as suspended there nothing to do */
5087 if (!hdev->suspended)
5088 return 0;
5089
5090 hdev->suspended = false;
5073 return 0;
5074}
5075
5076/* This function performs the HCI suspend procedures in the follow order:
5077 *
5078 * Restore event mask
5079 * Clear event filter
5080 * Update passive scanning (normal duty cycle)
5081 * Resume Directed Advertising/Advertising
5082 * Resume discovery (active scanning/inquiry)
5083 */
5084int hci_resume_sync(struct hci_dev *hdev)
5085{
5086 /* If not marked as suspended there nothing to do */
5087 if (!hdev->suspended)
5088 return 0;
5089
5090 hdev->suspended = false;
5091 hdev->scanning_paused = false;
5092
5093 /* Restore event mask */
5094 hci_set_event_mask_sync(hdev);
5095
5096 /* Clear any event filters and restore scan state */
5097 hci_clear_event_filter_sync(hdev);
5098
5099 /* Resume scanning */

--- 302 unchanged lines hidden ---
5091
5092 /* Restore event mask */
5093 hci_set_event_mask_sync(hdev);
5094
5095 /* Clear any event filters and restore scan state */
5096 hci_clear_event_filter_sync(hdev);
5097
5098 /* Resume scanning */

--- 302 unchanged lines hidden ---