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.
Showing the changes to include (2 of 10 files). Show all
Unified · Split
| @@ -523,7 +523,6 @@ struct hci_dev { · 522 unmodified lines | ||
| 523 | 523 | bool advertising_paused; |
| 524 | 524 | |
| 525 | 525 | struct notifier_block suspend_notifier; |
| 526 | − struct work_struct suspend_prepare; | |
| 527 | 526 | enum suspended_state suspend_state_next; |
| 528 | 527 | enum suspended_state suspend_state; |
| 529 | 528 | bool scanning_paused; |
| @@ -532,9 +531,6 @@ struct hci_dev { · 2 unmodified lines | ||
| 532 | 531 | bdaddr_t wake_addr; |
| 533 | 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 | 534 | struct hci_conn_hash conn_hash; |
| 539 | 535 | |
| 540 | 536 | struct list_head mgmt_pending; |
| @@ -92,3 +92,6 @@ int hci_set_powered_sync(struct hci_dev *hdev, u8 val); · 91 unmodified lines | ||
| 92 | 92 | |
| 93 | 93 | int hci_start_discovery_sync(struct hci_dev *hdev); |
| 94 | 94 | int hci_stop_discovery_sync(struct hci_dev *hdev); |
| 95 | + | |
| 96 | +int hci_suspend_sync(struct hci_dev *hdev); | |
| 97 | +int hci_resume_sync(struct hci_dev *hdev); | |