History

Bluetooth: hci_sync: Rework hci_suspend_notifier

This makes hci_suspend_notifier use the hci_*_sync which can be executed synchronously which is allowed in the suspend_notifier and simplifies a lot of the handling since the status of each command can be checked inline so no other work need to be scheduled thus can be performed without using of a state machine.

Luiz Augusto von Dentz committed 5 years ago

Commit 182ee451 parent d0b137010 files · +650 −638Browse files

Showing the changes to include (2 of 10 files). Show all

Unified · Split

2 files
  1. include/net/bluetooth/hci_core.h +0 −4
  2. include/net/bluetooth/hci_sync.h +3 −0
include/net/bluetooth/hci_core.h+0−4
@@ -523,7 +523,6 @@ struct hci_dev { · 522 unmodified lines
523 bool advertising_paused;523 bool advertising_paused;
524 524
525 struct notifier_block suspend_notifier;525 struct notifier_block suspend_notifier;
526 struct work_struct suspend_prepare;
527 enum suspended_state suspend_state_next;526 enum suspended_state suspend_state_next;
528 enum suspended_state suspend_state;527 enum suspended_state suspend_state;
529 bool scanning_paused;528 bool scanning_paused;
@@ -532,9 +531,6 @@ struct hci_dev { · 2 unmodified lines
532 bdaddr_t wake_addr;531 bdaddr_t wake_addr;
533 u8 wake_addr_type;532 u8 wake_addr_type;
534 533
535 wait_queue_head_t suspend_wait_q;
536 DECLARE_BITMAP(suspend_tasks, __SUSPEND_NUM_TASKS);
537
538 struct hci_conn_hash conn_hash;534 struct hci_conn_hash conn_hash;
539 535
540 struct list_head mgmt_pending;536 struct list_head mgmt_pending;
include/net/bluetooth/hci_sync.h+3−0
@@ -92,3 +92,6 @@ int hci_set_powered_sync(struct hci_dev *hdev, u8 val); · 91 unmodified lines
92 92
93int hci_start_discovery_sync(struct hci_dev *hdev);93int hci_start_discovery_sync(struct hci_dev *hdev);
94int hci_stop_discovery_sync(struct hci_dev *hdev);94int hci_stop_discovery_sync(struct hci_dev *hdev);
95
96int hci_suspend_sync(struct hci_dev *hdev);
97int hci_resume_sync(struct hci_dev *hdev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t