hci_sync.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * BlueZ - Bluetooth protocol stack for Linux
  4. *
  5. * Copyright (C) 2021 Intel Corporation
  6. */
  7. typedef int (*hci_cmd_sync_work_func_t)(struct hci_dev *hdev, void *data);
  8. typedef void (*hci_cmd_sync_work_destroy_t)(struct hci_dev *hdev, void *data,
  9. int err);
  10. struct hci_cmd_sync_work_entry {
  11. struct list_head list;
  12. hci_cmd_sync_work_func_t func;
  13. void *data;
  14. hci_cmd_sync_work_destroy_t destroy;
  15. };
  16. struct adv_info;
  17. /* Function with sync suffix shall not be called with hdev->lock held as they
  18. * wait the command to complete and in the meantime an event could be received
  19. * which could attempt to acquire hdev->lock causing a deadlock.
  20. */
  21. struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
  22. const void *param, u32 timeout);
  23. struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
  24. const void *param, u32 timeout);
  25. struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
  26. const void *param, u8 event, u32 timeout);
  27. struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
  28. const void *param, u8 event, u32 timeout,
  29. struct sock *sk);
  30. int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
  31. const void *param, u32 timeout);
  32. int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
  33. const void *param, u8 event, u32 timeout,
  34. struct sock *sk);
  35. void hci_cmd_sync_init(struct hci_dev *hdev);
  36. void hci_cmd_sync_clear(struct hci_dev *hdev);
  37. void hci_cmd_sync_cancel(struct hci_dev *hdev, int err);
  38. void __hci_cmd_sync_cancel(struct hci_dev *hdev, int err);
  39. int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
  40. void *data, hci_cmd_sync_work_destroy_t destroy);
  41. int hci_update_eir_sync(struct hci_dev *hdev);
  42. int hci_update_class_sync(struct hci_dev *hdev);
  43. int hci_update_eir_sync(struct hci_dev *hdev);
  44. int hci_update_class_sync(struct hci_dev *hdev);
  45. int hci_update_name_sync(struct hci_dev *hdev);
  46. int hci_write_ssp_mode_sync(struct hci_dev *hdev, u8 mode);
  47. int hci_get_random_address(struct hci_dev *hdev, bool require_privacy,
  48. bool use_rpa, struct adv_info *adv_instance,
  49. u8 *own_addr_type, bdaddr_t *rand_addr);
  50. int hci_update_random_address_sync(struct hci_dev *hdev, bool require_privacy,
  51. bool rpa, u8 *own_addr_type);
  52. int hci_update_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance);
  53. int hci_update_adv_data_sync(struct hci_dev *hdev, u8 instance);
  54. int hci_update_adv_data(struct hci_dev *hdev, u8 instance);
  55. int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
  56. bool force);
  57. int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance);
  58. int hci_start_ext_adv_sync(struct hci_dev *hdev, u8 instance);
  59. int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance);
  60. int hci_enable_advertising_sync(struct hci_dev *hdev);
  61. int hci_enable_advertising(struct hci_dev *hdev);
  62. int hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len,
  63. u8 *data, u32 flags, u16 min_interval,
  64. u16 max_interval, u16 sync_interval);
  65. int hci_remove_advertising_sync(struct hci_dev *hdev, struct sock *sk,
  66. u8 instance, bool force);
  67. int hci_disable_advertising_sync(struct hci_dev *hdev);
  68. int hci_clear_adv_instance_sync(struct hci_dev *hdev, struct sock *sk,
  69. u8 instance, bool force);
  70. int hci_update_passive_scan_sync(struct hci_dev *hdev);
  71. int hci_update_passive_scan(struct hci_dev *hdev);
  72. int hci_read_rssi_sync(struct hci_dev *hdev, __le16 handle);
  73. int hci_read_tx_power_sync(struct hci_dev *hdev, __le16 handle, u8 type);
  74. int hci_write_sc_support_sync(struct hci_dev *hdev, u8 val);
  75. int hci_read_clock_sync(struct hci_dev *hdev, struct hci_cp_read_clock *cp);
  76. int hci_write_fast_connectable_sync(struct hci_dev *hdev, bool enable);
  77. int hci_update_scan_sync(struct hci_dev *hdev);
  78. int hci_update_scan(struct hci_dev *hdev);
  79. int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul);
  80. int hci_remove_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance,
  81. struct sock *sk);
  82. int hci_remove_ext_adv_instance(struct hci_dev *hdev, u8 instance);
  83. struct sk_buff *hci_read_local_oob_data_sync(struct hci_dev *hdev, bool ext,
  84. struct sock *sk);
  85. int hci_reset_sync(struct hci_dev *hdev);
  86. int hci_dev_open_sync(struct hci_dev *hdev);
  87. int hci_dev_close_sync(struct hci_dev *hdev);
  88. int hci_powered_update_sync(struct hci_dev *hdev);
  89. int hci_set_powered_sync(struct hci_dev *hdev, u8 val);
  90. int hci_update_discoverable_sync(struct hci_dev *hdev);
  91. int hci_update_discoverable(struct hci_dev *hdev);
  92. int hci_update_connectable_sync(struct hci_dev *hdev);
  93. int hci_start_discovery_sync(struct hci_dev *hdev);
  94. int hci_stop_discovery_sync(struct hci_dev *hdev);
  95. int hci_suspend_sync(struct hci_dev *hdev);
  96. int hci_resume_sync(struct hci_dev *hdev);
  97. struct hci_conn;
  98. int hci_abort_conn_sync(struct hci_dev *hdev, struct hci_conn *conn, u8 reason);
  99. int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn);
  100. int hci_le_remove_cig_sync(struct hci_dev *hdev, u8 handle);
  101. int hci_le_terminate_big_sync(struct hci_dev *hdev, u8 handle, u8 reason);
  102. int hci_le_big_terminate_sync(struct hci_dev *hdev, u8 handle);
  103. int hci_le_pa_terminate_sync(struct hci_dev *hdev, u16 handle);