wlan_p2p_public_struct.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. /*
  2. * Copyright (c) 2017-2018 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_ps_params - P2P powersave related params
  27. * @opp_ps: opportunistic power save
  28. * @ctwindow: CT window
  29. * @count: count
  30. * @duration: duration
  31. * @interval: interval
  32. * @single_noa_duration: single shot noa duration
  33. * @ps_selection: power save selection
  34. * @session_id: session id
  35. */
  36. struct p2p_ps_params {
  37. uint8_t opp_ps;
  38. uint32_t ctwindow;
  39. uint8_t count;
  40. uint32_t duration;
  41. uint32_t interval;
  42. uint32_t single_noa_duration;
  43. uint8_t ps_selection;
  44. uint8_t session_id;
  45. };
  46. /**
  47. * struct p2p_roc_req - P2P roc request
  48. * @vdev_id: Vdev id on which this request has come
  49. * @chan: Chan for which this RoC has been requested
  50. * @phy_mode: PHY mode
  51. * @duration: Duration for the RoC
  52. */
  53. struct p2p_roc_req {
  54. uint32_t vdev_id;
  55. uint32_t chan;
  56. uint32_t phy_mode;
  57. uint32_t duration;
  58. };
  59. /**
  60. * enum p2p_roc_event - P2P RoC event
  61. * @ROC_EVENT_READY_ON_CHAN: RoC has started now
  62. * @ROC_EVENT_COMPLETED: RoC has been completed
  63. * @ROC_EVENT_INAVLID: Invalid event
  64. */
  65. enum p2p_roc_event {
  66. ROC_EVENT_READY_ON_CHAN = 0,
  67. ROC_EVENT_COMPLETED,
  68. ROC_EVENT_INAVLID,
  69. };
  70. /**
  71. * struct p2p_event - p2p event
  72. * @vdev_id: Vdev id
  73. * @roc_event: RoC event
  74. * @cookie: Cookie which is given to supplicant for this roc req
  75. * @chan: Chan for which this RoC has been requested
  76. * @duration: Duration for the RoC
  77. */
  78. struct p2p_event {
  79. uint32_t vdev_id;
  80. enum p2p_roc_event roc_event;
  81. uint64_t cookie;
  82. uint32_t chan;
  83. uint32_t duration;
  84. };
  85. /**
  86. * struct p2p_rx_mgmt_frame - rx mgmt frame structure
  87. * @frame_len: Frame length
  88. * @rx_chan: RX channel
  89. * @vdev_id: Vdev id
  90. * @frm_type: Frame type
  91. * @rx_rssi: RX rssi
  92. * @buf: Buffer address
  93. */
  94. struct p2p_rx_mgmt_frame {
  95. uint32_t frame_len;
  96. uint32_t rx_chan;
  97. uint32_t vdev_id;
  98. uint32_t frm_type;
  99. uint32_t rx_rssi;
  100. uint8_t buf[1];
  101. };
  102. /**
  103. * struct p2p_tx_cnf - tx confirm structure
  104. * @vdev_id: Vdev id
  105. * @action_cookie: TX cookie for this action frame
  106. * @buf_len: Frame length
  107. * @status: TX status
  108. * @buf: Buffer address
  109. */
  110. struct p2p_tx_cnf {
  111. uint32_t vdev_id;
  112. uint64_t action_cookie;
  113. uint32_t buf_len;
  114. uint32_t status;
  115. uint8_t *buf;
  116. };
  117. /**
  118. * struct p2p_mgmt_tx - p2p mgmt tx structure
  119. * @vdev_id: Vdev id
  120. * @chan: Chan for which this RoC has been requested
  121. * @wait: Duration for the RoC
  122. * @len: Length of tx buffer
  123. * @no_cck: Required cck or not
  124. * @dont_wait_for_ack: Wait for ack or not
  125. * @off_chan: Off channel tx or not
  126. * @buf: TX buffer
  127. */
  128. struct p2p_mgmt_tx {
  129. uint32_t vdev_id;
  130. uint32_t chan;
  131. uint32_t wait;
  132. uint32_t len;
  133. uint32_t no_cck;
  134. uint32_t dont_wait_for_ack;
  135. uint32_t off_chan;
  136. const uint8_t *buf;
  137. };
  138. /**
  139. * struct p2p_set_mac_filter
  140. * @vdev_id: Vdev id
  141. * @mac: mac addr
  142. * @freq: frequency
  143. * @set: set or clear
  144. */
  145. struct p2p_set_mac_filter {
  146. uint32_t vdev_id;
  147. uint8_t mac[QDF_MAC_ADDR_SIZE];
  148. uint32_t freq;
  149. bool set;
  150. };
  151. /**
  152. * struct p2p_set_mac_filter_evt
  153. * @vdev_id: Vdev id
  154. * @status: target reported result of set mac addr filter
  155. */
  156. struct p2p_set_mac_filter_evt {
  157. uint32_t vdev_id;
  158. uint32_t status;
  159. };
  160. /**
  161. * struct p2p_ps_config
  162. * @vdev_id: Vdev id
  163. * @opp_ps: Opportunistic power save
  164. * @ct_window: CT window
  165. * @count: Count
  166. * @duration: Duration
  167. * @interval: Interval
  168. * @single_noa_duration: Single shot noa duration
  169. * @ps_selection: power save selection
  170. */
  171. struct p2p_ps_config {
  172. uint32_t vdev_id;
  173. uint32_t opp_ps;
  174. uint32_t ct_window;
  175. uint32_t count;
  176. uint32_t duration;
  177. uint32_t interval;
  178. uint32_t single_noa_duration;
  179. uint32_t ps_selection;
  180. };
  181. /**
  182. * struct p2p_lo_start - p2p listen offload start
  183. * @vdev_id: Vdev id
  184. * @ctl_flags: Control flag
  185. * @freq: P2P listen frequency
  186. * @period: Listen offload period
  187. * @interval: Listen offload interval
  188. * @count: Number listen offload intervals
  189. * @dev_types_len: Device types length
  190. * @probe_resp_len: Probe response template length
  191. * @device_types: Device types
  192. * @probe_resp_tmplt: Probe response template
  193. */
  194. struct p2p_lo_start {
  195. uint32_t vdev_id;
  196. uint32_t ctl_flags;
  197. uint32_t freq;
  198. uint32_t period;
  199. uint32_t interval;
  200. uint32_t count;
  201. uint32_t dev_types_len;
  202. uint32_t probe_resp_len;
  203. uint8_t *device_types;
  204. uint8_t *probe_resp_tmplt;
  205. };
  206. /**
  207. * struct p2p_lo_event
  208. * @vdev_id: vdev id
  209. * @reason_code: reason code
  210. */
  211. struct p2p_lo_event {
  212. uint32_t vdev_id;
  213. uint32_t reason_code;
  214. };
  215. /**
  216. * struct noa_descriptor - noa descriptor
  217. * @type_count: 255: continuous schedule, 0: reserved
  218. * @duration: Absent period duration in micro seconds
  219. * @interval: Absent period interval in micro seconds
  220. * @start_time: 32 bit tsf time when in starts
  221. */
  222. struct noa_descriptor {
  223. uint32_t type_count;
  224. uint32_t duration;
  225. uint32_t interval;
  226. uint32_t start_time;
  227. };
  228. /**
  229. * struct p2p_noa_info - p2p noa information
  230. * @index: identifies instance of NOA su element
  231. * @opps_ps: opps ps state of the AP
  232. * @ct_window: ct window in TUs
  233. * @vdev_id: vdev id
  234. * @num_descriptors: number of NOA descriptors
  235. * @noa_desc: noa descriptors
  236. */
  237. struct p2p_noa_info {
  238. uint32_t index;
  239. uint32_t opps_ps;
  240. uint32_t ct_window;
  241. uint32_t vdev_id;
  242. uint32_t num_desc;
  243. struct noa_descriptor noa_desc[P2P_MAX_NOA_DESC];
  244. };
  245. /**
  246. * struct p2p_protocol_callbacks - callback to non-converged driver
  247. * @is_mgmt_protected: func to get 11w mgmt protection status
  248. */
  249. struct p2p_protocol_callbacks {
  250. bool (*is_mgmt_protected)(uint32_t vdev_id, const uint8_t *peer_addr);
  251. };
  252. #endif /* _WLAN_P2P_PUBLIC_STRUCT_H_ */