amp.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. Copyright (c) 2011,2012 Intel Corp.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License version 2 and
  5. only version 2 as published by the Free Software Foundation.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. */
  11. #ifndef __AMP_H
  12. #define __AMP_H
  13. struct amp_ctrl {
  14. struct list_head list;
  15. struct kref kref;
  16. __u8 id;
  17. __u16 assoc_len_so_far;
  18. __u16 assoc_rem_len;
  19. __u16 assoc_len;
  20. __u8 *assoc;
  21. };
  22. int amp_ctrl_put(struct amp_ctrl *ctrl);
  23. void amp_ctrl_get(struct amp_ctrl *ctrl);
  24. struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id);
  25. struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id);
  26. void amp_ctrl_list_flush(struct amp_mgr *mgr);
  27. struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
  28. u8 remote_id, bool out);
  29. int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type);
  30. void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr);
  31. void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle);
  32. void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr);
  33. void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
  34. struct hci_conn *hcon);
  35. void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
  36. struct hci_conn *hcon);
  37. void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
  38. struct hci_conn *hcon);
  39. #if IS_ENABLED(CONFIG_BT_HS)
  40. void amp_create_logical_link(struct l2cap_chan *chan);
  41. void amp_disconnect_logical_link(struct hci_chan *hchan);
  42. #else
  43. static inline void amp_create_logical_link(struct l2cap_chan *chan)
  44. {
  45. }
  46. static inline void amp_disconnect_logical_link(struct hci_chan *hchan)
  47. {
  48. }
  49. #endif
  50. void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
  51. void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
  52. void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);
  53. void amp_create_logical_link(struct l2cap_chan *chan);
  54. void amp_disconnect_logical_link(struct hci_chan *hchan);
  55. void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason);
  56. #endif /* __AMP_H */