msft.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2020 Google Corporation
  4. */
  5. #define MSFT_FEATURE_MASK_BREDR_RSSI_MONITOR BIT(0)
  6. #define MSFT_FEATURE_MASK_LE_CONN_RSSI_MONITOR BIT(1)
  7. #define MSFT_FEATURE_MASK_LE_ADV_RSSI_MONITOR BIT(2)
  8. #define MSFT_FEATURE_MASK_LE_ADV_MONITOR BIT(3)
  9. #define MSFT_FEATURE_MASK_CURVE_VALIDITY BIT(4)
  10. #define MSFT_FEATURE_MASK_CONCURRENT_ADV_MONITOR BIT(5)
  11. #if IS_ENABLED(CONFIG_BT_MSFTEXT)
  12. bool msft_monitor_supported(struct hci_dev *hdev);
  13. void msft_register(struct hci_dev *hdev);
  14. void msft_unregister(struct hci_dev *hdev);
  15. void msft_do_open(struct hci_dev *hdev);
  16. void msft_do_close(struct hci_dev *hdev);
  17. void msft_vendor_evt(struct hci_dev *hdev, void *data, struct sk_buff *skb);
  18. __u64 msft_get_features(struct hci_dev *hdev);
  19. int msft_add_monitor_pattern(struct hci_dev *hdev, struct adv_monitor *monitor);
  20. int msft_remove_monitor(struct hci_dev *hdev, struct adv_monitor *monitor);
  21. void msft_req_add_set_filter_enable(struct hci_request *req, bool enable);
  22. int msft_set_filter_enable(struct hci_dev *hdev, bool enable);
  23. int msft_suspend_sync(struct hci_dev *hdev);
  24. int msft_resume_sync(struct hci_dev *hdev);
  25. bool msft_curve_validity(struct hci_dev *hdev);
  26. #else
  27. static inline bool msft_monitor_supported(struct hci_dev *hdev)
  28. {
  29. return false;
  30. }
  31. static inline void msft_register(struct hci_dev *hdev) {}
  32. static inline void msft_unregister(struct hci_dev *hdev) {}
  33. static inline void msft_do_open(struct hci_dev *hdev) {}
  34. static inline void msft_do_close(struct hci_dev *hdev) {}
  35. static inline void msft_vendor_evt(struct hci_dev *hdev, void *data,
  36. struct sk_buff *skb) {}
  37. static inline __u64 msft_get_features(struct hci_dev *hdev) { return 0; }
  38. static inline int msft_add_monitor_pattern(struct hci_dev *hdev,
  39. struct adv_monitor *monitor)
  40. {
  41. return -EOPNOTSUPP;
  42. }
  43. static inline int msft_remove_monitor(struct hci_dev *hdev,
  44. struct adv_monitor *monitor)
  45. {
  46. return -EOPNOTSUPP;
  47. }
  48. static inline void msft_req_add_set_filter_enable(struct hci_request *req,
  49. bool enable) {}
  50. static inline int msft_set_filter_enable(struct hci_dev *hdev, bool enable)
  51. {
  52. return -EOPNOTSUPP;
  53. }
  54. static inline int msft_suspend_sync(struct hci_dev *hdev)
  55. {
  56. return -EOPNOTSUPP;
  57. }
  58. static inline int msft_resume_sync(struct hci_dev *hdev)
  59. {
  60. return -EOPNOTSUPP;
  61. }
  62. static inline bool msft_curve_validity(struct hci_dev *hdev)
  63. {
  64. return false;
  65. }
  66. #endif