a2mp.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved.
  3. Copyright (c) 2011,2012 Intel Corp.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License version 2 and
  6. only version 2 as published by the Free Software Foundation.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. */
  12. #ifndef __A2MP_H
  13. #define __A2MP_H
  14. struct amp_mgr {
  15. struct l2cap_conn *l2cap_conn;
  16. struct l2cap_chan *a2mp_chan;
  17. struct kref kref;
  18. __u8 ident;
  19. __u8 handle;
  20. unsigned long flags;
  21. };
  22. struct a2mp_cmd {
  23. __u8 code;
  24. __u8 ident;
  25. __le16 len;
  26. __u8 data[0];
  27. } __packed;
  28. /* A2MP command codes */
  29. #define A2MP_COMMAND_REJ 0x01
  30. struct a2mp_cmd_rej {
  31. __le16 reason;
  32. __u8 data[0];
  33. } __packed;
  34. #define A2MP_DISCOVER_REQ 0x02
  35. struct a2mp_discov_req {
  36. __le16 mtu;
  37. __le16 ext_feat;
  38. } __packed;
  39. struct a2mp_cl {
  40. __u8 id;
  41. __u8 type;
  42. __u8 status;
  43. } __packed;
  44. #define A2MP_DISCOVER_RSP 0x03
  45. struct a2mp_discov_rsp {
  46. __le16 mtu;
  47. __le16 ext_feat;
  48. struct a2mp_cl cl[0];
  49. } __packed;
  50. #define A2MP_CHANGE_NOTIFY 0x04
  51. #define A2MP_CHANGE_RSP 0x05
  52. #define A2MP_GETINFO_REQ 0x06
  53. struct a2mp_info_req {
  54. __u8 id;
  55. } __packed;
  56. #define A2MP_GETINFO_RSP 0x07
  57. struct a2mp_info_rsp {
  58. __u8 id;
  59. __u8 status;
  60. __le32 total_bw;
  61. __le32 max_bw;
  62. __le32 min_latency;
  63. __le16 pal_cap;
  64. __le16 assoc_size;
  65. } __packed;
  66. #define A2MP_GETAMPASSOC_REQ 0x08
  67. struct a2mp_amp_assoc_req {
  68. __u8 id;
  69. } __packed;
  70. #define A2MP_GETAMPASSOC_RSP 0x09
  71. struct a2mp_amp_assoc_rsp {
  72. __u8 id;
  73. __u8 status;
  74. __u8 amp_assoc[0];
  75. } __packed;
  76. #define A2MP_CREATEPHYSLINK_REQ 0x0A
  77. #define A2MP_DISCONNPHYSLINK_REQ 0x0C
  78. struct a2mp_physlink_req {
  79. __u8 local_id;
  80. __u8 remote_id;
  81. __u8 amp_assoc[0];
  82. } __packed;
  83. #define A2MP_CREATEPHYSLINK_RSP 0x0B
  84. #define A2MP_DISCONNPHYSLINK_RSP 0x0D
  85. struct a2mp_physlink_rsp {
  86. __u8 local_id;
  87. __u8 remote_id;
  88. __u8 status;
  89. } __packed;
  90. void amp_mgr_get(struct amp_mgr *mgr);
  91. int amp_mgr_put(struct amp_mgr *mgr);
  92. #endif /* __A2MP_H */