wlan_p2p_public_struct.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*
  2. * Copyright (c) 2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Contains p2p public data structure definations
  20. */
  21. #ifndef _WLAN_P2P_PUBLIC_STRUCT_H_
  22. #define _WLAN_P2P_PUBLIC_STRUCT_H_
  23. #include <qdf_types.h>
  24. #define P2P_MAX_NOA_DESC 4
  25. /**
  26. * struct p2p_roc_req - P2P roc request
  27. * @vdev_id: Vdev id on which this request has come
  28. * @chan: Chan for which this RoC has been requested
  29. * @phy_mode: PHY mode
  30. * @duration: Duration for the RoC
  31. */
  32. struct p2p_roc_req {
  33. uint32_t vdev_id;
  34. uint32_t chan;
  35. uint32_t phy_mode;
  36. uint32_t duration;
  37. };
  38. /**
  39. * enum p2p_roc_event - P2P RoC event
  40. * @ROC_EVENT_READY_ON_CHAN: RoC has started now
  41. * @ROC_EVENT_COMPLETED: RoC has been completed
  42. * @ROC_EVENT_INAVLID: Invalid event
  43. */
  44. enum p2p_roc_event {
  45. ROC_EVENT_READY_ON_CHAN = 0,
  46. ROC_EVENT_COMPLETED,
  47. ROC_EVENT_INAVLID,
  48. };
  49. /**
  50. * struct p2p_event - p2p event
  51. * @vdev_id: Vdev id
  52. * @roc_event: RoC event
  53. * @cookie: Cookie which is given to supplicant for this roc req
  54. * @chan: Chan for which this RoC has been requested
  55. * @duration: Duration for the RoC
  56. */
  57. struct p2p_event {
  58. uint32_t vdev_id;
  59. enum p2p_roc_event roc_event;
  60. uint64_t cookie;
  61. uint32_t chan;
  62. uint32_t duration;
  63. };
  64. /**
  65. * struct p2p_rx_mgmt_frame - rx mgmt frame structure
  66. * @frame_len: Frame length
  67. * @rx_chan: RX channel
  68. * @vdev_id: Vdev id
  69. * @frm_type: Frame type
  70. * @rx_rssi: RX rssi
  71. * @buf: Buffer address
  72. */
  73. struct p2p_rx_mgmt_frame {
  74. uint32_t frame_len;
  75. uint32_t rx_chan;
  76. uint32_t vdev_id;
  77. uint32_t frm_type;
  78. uint32_t rx_rssi;
  79. uint8_t buf[1];
  80. };
  81. /**
  82. * struct p2p_tx_cnf - tx confirm structure
  83. * @vdev_id: Vdev id
  84. * @action_cookie: TX cookie for this action frame
  85. * @buf_len: Frame length
  86. * @status: TX status
  87. * @buf: Buffer address
  88. */
  89. struct p2p_tx_cnf {
  90. uint32_t vdev_id;
  91. uint64_t action_cookie;
  92. uint32_t buf_len;
  93. uint32_t status;
  94. uint8_t *buf;
  95. };
  96. /**
  97. * struct p2p_mgmt_tx - p2p mgmt tx structure
  98. * @vdev_id: Vdev id
  99. * @chan: Chan for which this RoC has been requested
  100. * @wait: Duration for the RoC
  101. * @len: Length of tx buffer
  102. * @no_cck: Required cck or not
  103. * @dont_wait_for_ack: Wait for ack or not
  104. * @off_chan: Off channel tx or not
  105. * @buf: TX buffer
  106. */
  107. struct p2p_mgmt_tx {
  108. uint32_t vdev_id;
  109. uint32_t chan;
  110. uint32_t wait;
  111. uint32_t len;
  112. uint32_t no_cck;
  113. uint32_t dont_wait_for_ack;
  114. uint32_t off_chan;
  115. const uint8_t *buf;
  116. };
  117. /**
  118. * struct p2p_ps_config
  119. * @vdev_id: Vdev id
  120. * @opp_ps: Opportunistic power save
  121. * @ct_window: CT window
  122. * @count: Count
  123. * @duration: Duration
  124. * @interval: Interval
  125. * @single_noa_duration: Single shot noa duration
  126. * @ps_selection: power save selection
  127. */
  128. struct p2p_ps_config {
  129. uint32_t vdev_id;
  130. uint32_t opp_ps;
  131. uint32_t ct_window;
  132. uint32_t count;
  133. uint32_t duration;
  134. uint32_t interval;
  135. uint32_t single_noa_duration;
  136. uint32_t ps_selection;
  137. };
  138. /**
  139. * struct p2p_lo_start - p2p listen offload start
  140. * @vdev_id: Vdev id
  141. * @ctl_flags: Control flag
  142. * @freq: P2P listen frequency
  143. * @period: Listen offload period
  144. * @interval: Listen offload interval
  145. * @count: Number listen offload intervals
  146. * @dev_types_len: Device types length
  147. * @probe_resp_len: Probe response template length
  148. * @device_types: Device types
  149. * @probe_resp_tmplt: Probe response template
  150. */
  151. struct p2p_lo_start {
  152. uint32_t vdev_id;
  153. uint32_t ctl_flags;
  154. uint32_t freq;
  155. uint32_t period;
  156. uint32_t interval;
  157. uint32_t count;
  158. uint32_t dev_types_len;
  159. uint32_t probe_resp_len;
  160. uint8_t *device_types;
  161. uint8_t *probe_resp_tmplt;
  162. };
  163. /**
  164. * struct p2p_lo_event
  165. * @vdev_id: vdev id
  166. * @reason_code: reason code
  167. */
  168. struct p2p_lo_event {
  169. uint32_t vdev_id;
  170. uint32_t reason_code;
  171. };
  172. /**
  173. * struct noa_descriptor - noa descriptor
  174. * @type_count: 255: continuous schedule, 0: reserved
  175. * @duration: Absent period duration in micro seconds
  176. * @interval: Absent period interval in micro seconds
  177. * @start_time: 32 bit tsf time when in starts
  178. */
  179. struct noa_descriptor {
  180. uint32_t type_count;
  181. uint32_t duration;
  182. uint32_t interval;
  183. uint32_t start_time;
  184. };
  185. /**
  186. * struct p2p_noa_info - p2p noa information
  187. * @index: identifies instance of NOA su element
  188. * @opps_ps: opps ps state of the AP
  189. * @ct_window: ct window in TUs
  190. * @vdev_id: vdev id
  191. * @num_descriptors: number of NOA descriptors
  192. * @noa_desc: noa descriptors
  193. */
  194. struct p2p_noa_info {
  195. uint32_t index;
  196. uint32_t opps_ps;
  197. uint32_t ct_window;
  198. uint32_t vdev_id;
  199. uint32_t num_desc;
  200. struct noa_descriptor noa_desc[P2P_MAX_NOA_DESC];
  201. };
  202. #endif /* _WLAN_P2P_PUBLIC_STRUCT_H_ */