wmi_unified_twt_param.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. /*
  2. * Copyright (c) 2018-2021 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. * This file contains the API definitions for the TWT WMI APIs.
  20. */
  21. #ifndef _WMI_UNIFIED_TWT_PARAM_H_
  22. #define _WMI_UNIFIED_TWT_PARAM_H_
  23. /* enum WMI_TWT_ROLE - role specified in ext conf in wmi_twt_enable/disable_cmd
  24. * WMI_TWT_ROLE_REQUESTOR: TWT role is requestor
  25. * WMI_TWT_ROLE_RESPONDER: TWT role is responder
  26. */
  27. enum WMI_TWT_ROLE {
  28. WMI_TWT_ROLE_REQUESTOR,
  29. WMI_TWT_ROLE_RESPONDER,
  30. };
  31. /* enum WMI_TWT_OPERATION - specified in ext conf in wmi_twt_enable/disable_cmd
  32. * WMI_TWT_OPERATION_INDIVIDUAL: Individual TWT operation
  33. * WMI_TWT_OPERATION_BROADCAST: Broadcast TWT operation
  34. */
  35. enum WMI_TWT_OPERATION {
  36. WMI_TWT_OPERATION_INDIVIDUAL,
  37. WMI_TWT_OPERATION_BROADCAST,
  38. };
  39. /**
  40. * @pdev_id: pdev_id for identifying the MAC.
  41. * @sta_cong_timer_ms: STA TWT congestion timer TO value in terms of ms
  42. * @mbss_support: Flag indicating if AP TWT feature supported in
  43. * MBSS mode or not.
  44. * @default_slot_size: This is the default value for the TWT slot setup
  45. * by AP (units = microseconds)
  46. * @congestion_thresh_setup: Minimum congestion required to start setting
  47. * up TWT sessions
  48. * @congestion_thresh_teardown: Minimum congestion below which TWT will be
  49. * torn down (in percent of occupied airtime)
  50. * @congestion_thresh_critical: Threshold above which TWT will not be active
  51. * (in percent of occupied airtime)
  52. * @interference_thresh_teardown: Minimum interference above that TWT
  53. * will not be active. The interference parameters use an
  54. * abstract method of evaluating interference.
  55. * The parameters are in percent, ranging from 0 for no
  56. * interference, to 100 for interference extreme enough
  57. * to completely block the signal of interest.
  58. * @interference_thresh_setup: Minimum interference below that TWT session
  59. * can be setup. The interference parameters use an
  60. * abstract method of evaluating interference.
  61. * The parameters are in percent, ranging from 0 for no
  62. * interference, to 100 for interference extreme enough
  63. * to completely block the signal of interest.
  64. * @min_no_sta_setup: Minimum no of STA required to start TWT setup
  65. * @min_no_sta_teardown: Minimum no of STA below which TWT will be torn down
  66. * @no_of_bcast_mcast_slots: Number of default slot sizes reserved for
  67. * BCAST/MCAST delivery
  68. * @min_no_twt_slots: Minimum no of available slots for TWT to be operational
  69. * @max_no_sta_twt: Max no of STA with which TWT is possible
  70. * (must be <= the wmi_resource_config's twt_ap_sta_count value)
  71. * * The below interval parameters have units of milliseconds.
  72. * @mode_check_interval: Interval between two successive check to decide the
  73. * mode of TWT. (units = milliseconds)
  74. * @add_sta_slot_interval: Interval between decisions making to create
  75. * TWT slots for STAs. (units = milliseconds)
  76. * @remove_sta_slot_interval: Inrerval between decisions making to remove TWT
  77. * slot of STAs. (units = milliseconds)
  78. * @twt_role: values from enum WMI_TWT_ROLE.
  79. * @twt_oper: values from enum WMI_TWT_OPERATION.
  80. * @ext_conf_present: If requestor/responder extend config is present.
  81. * @b_twt_enable: Enable or disable broadcast TWT.
  82. * @b_twt_legacy_mbss_enable: Enable or disable legacy MBSSID TWT.
  83. * @b_twt_ax_mbss_enable: Enable or disable 11AX MBSSID TWT.
  84. */
  85. struct wmi_twt_enable_param {
  86. uint32_t pdev_id;
  87. uint32_t sta_cong_timer_ms;
  88. uint32_t mbss_support;
  89. uint32_t default_slot_size;
  90. uint32_t congestion_thresh_setup;
  91. uint32_t congestion_thresh_teardown;
  92. uint32_t congestion_thresh_critical;
  93. uint32_t interference_thresh_teardown;
  94. uint32_t interference_thresh_setup;
  95. uint32_t min_no_sta_setup;
  96. uint32_t min_no_sta_teardown;
  97. uint32_t no_of_bcast_mcast_slots;
  98. uint32_t min_no_twt_slots;
  99. uint32_t max_no_sta_twt;
  100. uint32_t mode_check_interval;
  101. uint32_t add_sta_slot_interval;
  102. uint32_t remove_sta_slot_interval;
  103. enum WMI_TWT_ROLE twt_role;
  104. enum WMI_TWT_OPERATION twt_oper;
  105. bool ext_conf_present;
  106. uint32_t b_twt_enable:1,
  107. b_twt_legacy_mbss_enable:1,
  108. b_twt_ax_mbss_enable:1;
  109. };
  110. /* status code of enabling TWT
  111. * WMI_ENABLE_TWT_STATUS_OK: enabling TWT successfully completed
  112. * WMI_ENABLE_TWT_STATUS_ALREADY_ENABLED: TWT already enabled
  113. * WMI_ENABLE_TWT_STATUS_NOT_READY: FW not ready for enabling TWT
  114. * WMI_ENABLE_TWT_INVALID_PARAM: invalid parameters
  115. * WMI_ENABLE_TWT_STATUS_UNKNOWN_ERROR: enabling TWT failed with an
  116. * unknown reason
  117. */
  118. enum WMI_HOST_ENABLE_TWT_STATUS {
  119. WMI_HOST_ENABLE_TWT_STATUS_OK,
  120. WMI_HOST_ENABLE_TWT_STATUS_ALREADY_ENABLED,
  121. WMI_HOST_ENABLE_TWT_STATUS_NOT_READY,
  122. WMI_HOST_ENABLE_TWT_INVALID_PARAM,
  123. WMI_HOST_ENABLE_TWT_STATUS_UNKNOWN_ERROR,
  124. };
  125. /**
  126. * struct wmi_twt_enable_complete_event_param:
  127. * @pdev_is: pdev_id for identifying the MAC.
  128. * @status: From enum WMI_HOST_ENABLE_TWT_STATUS
  129. */
  130. struct wmi_twt_enable_complete_event_param {
  131. uint32_t pdev_id;
  132. uint32_t status;
  133. };
  134. /**
  135. * struct wmi_twt_disable_param:
  136. * @pdev_id: pdev_id for identifying the MAC.
  137. * @ext_conf_present: If requestor/responder extend config is present.
  138. * @twt_role: values from enum WMI_TWT_ROLE.
  139. * @twt_oper: values from enum WMI_TWT_OPERATION.
  140. */
  141. struct wmi_twt_disable_param {
  142. uint32_t pdev_id;
  143. bool ext_conf_present;
  144. enum WMI_TWT_ROLE twt_role;
  145. enum WMI_TWT_OPERATION twt_oper;
  146. };
  147. /**
  148. * struct wmi_twt_disable_complete_event:
  149. * @pdev_id: pdev_id for identifying the MAC.
  150. */
  151. struct wmi_twt_disable_complete_event {
  152. uint32_t pdev_id;
  153. };
  154. /* TWT event types
  155. * refer to wmi_unified.h enum wmi_twt_session_stats_type
  156. */
  157. enum host_twt_session_stats_type {
  158. HOST_TWT_SESSION_SETUP = 1,
  159. HOST_TWT_SESSION_TEARDOWN = 2,
  160. HOST_TWT_SESSION_UPDATE = 3,
  161. };
  162. /**
  163. * struct wmi_host_twt_session_stats_info:
  164. * @vdev_id: id of VDEV for twt session
  165. * @peer_mac: MAC address of node
  166. * @event_type: Indicates TWT session type (SETUP/TEARDOWN/UPDATE)
  167. * @flow_id: TWT flow identifier established with TWT peer
  168. * @bcast: If this is a broacast TWT session
  169. * @trig: If the TWT session is trigger enabled
  170. * @announ: If the flow type is announced/unannounced
  171. * @protection: If the TWT protection field is set
  172. * @info_frame_disabled: If the TWT Information frame is disabled
  173. * @dialog_id: Dialog_id of current session
  174. * @wake_dura_us: wake duration in us
  175. * @wake_intvl_us: wake time interval in us
  176. * @sp_offset_us: Time until initial TWT SP occurs
  177. * @sp_tsf_us_lo: TWT wake time TSF in usecs lower bits - 31:0
  178. * @sp_tsf_us_hi: TWT wake time TSF in usecs higher bits - 63:32
  179. */
  180. struct wmi_host_twt_session_stats_info {
  181. uint32_t vdev_id;
  182. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  183. uint32_t event_type;
  184. uint32_t flow_id:16,
  185. bcast:1,
  186. trig:1,
  187. announ:1,
  188. protection:1,
  189. info_frame_disabled:1;
  190. uint32_t dialog_id;
  191. uint32_t wake_dura_us;
  192. uint32_t wake_intvl_us;
  193. uint32_t sp_offset_us;
  194. uint32_t sp_tsf_us_lo;
  195. uint32_t sp_tsf_us_hi;
  196. };
  197. /**
  198. * struct wmi_twt_session_stats_event:
  199. * @pdev_id: pdev_id for identifying the MAC.
  200. * @num_sessions: number of TWT sessions
  201. * @twt_sessions: received TWT sessions
  202. */
  203. struct wmi_twt_session_stats_event_param {
  204. uint32_t pdev_id;
  205. uint32_t num_sessions;
  206. };
  207. /* from IEEE 802.11ah section 9.4.2.200 */
  208. enum WMI_HOST_TWT_COMMAND {
  209. WMI_HOST_TWT_COMMAND_REQUEST_TWT = 0,
  210. WMI_HOST_TWT_COMMAND_SUGGEST_TWT = 1,
  211. WMI_HOST_TWT_COMMAND_DEMAND_TWT = 2,
  212. WMI_HOST_TWT_COMMAND_TWT_GROUPING = 3,
  213. WMI_HOST_TWT_COMMAND_ACCEPT_TWT = 4,
  214. WMI_HOST_TWT_COMMAND_ALTERNATE_TWT = 5,
  215. WMI_HOST_TWT_COMMAND_DICTATE_TWT = 6,
  216. WMI_HOST_TWT_COMMAND_REJECT_TWT = 7,
  217. };
  218. /**
  219. * struct wmi_twt_add_dialog_param -
  220. * @vdev_id: VDEV identifier
  221. * @peer_macaddr: peer MAC address when vdev is AP VDEV
  222. * @dialog_id: diaglog_id (TWT dialog ID)
  223. * This dialog ID must be unique within its vdev.
  224. * @wake_intvl_us: TWT Wake Interval in units of us
  225. * @wake_intvl_mantis: TWT Wake Interval Mantissa
  226. * - wake_intvl_mantis must be <= 0xFFFF
  227. * - wake_intvl_us must be divided evenly by wake_intvl_mantis,
  228. * i.e., wake_intvl_us % wake_intvl_mantis == 0
  229. * - the quotient of wake_intvl_us/wake_intvl_mantis must be
  230. * 2 to N-th(0<=N<=31) power,
  231. * i.e., wake_intvl_us/wake_intvl_mantis == 2^N, 0<=N<=31
  232. * @min_wake_intvl_us: Min tolerance limit of TWT wake interval
  233. * @max_wake_intvl_us: Max tolerance limit of TWT wake interval
  234. * @wake_dura_us: TWT Wake Duration in units of us, must be <= 0xFFFF
  235. * wake_dura_us must be divided evenly by 256,
  236. * i.e., wake_dura_us % 256 == 0
  237. * @min_wake_dura_us: Min tolerance limit of TWT wake duration.
  238. * @max_wake_dura_us: Max tolerance limit of TWT wake duration.
  239. * @sp_offset_us: this long time after TWT setup the 1st SP will start.
  240. * @twt_cmd: cmd from enum WMI_HOST_TWT_COMMAND
  241. * @flag_bcast: 0 means Individual TWT,
  242. * 1 means Broadcast TWT
  243. * @flag_trigger: 0 means non-Trigger-enabled TWT,
  244. * 1 means means Trigger-enabled TWT
  245. * @flag_flow_type: 0 means announced TWT,
  246. * 1 means un-announced TWT
  247. * @flag_protection: 0 means TWT protection is required,
  248. * 1 means TWT protection is not required
  249. * @b_twt_id0: 0 means BTWT recommendation will not be used
  250. * 1 means BTWT recommendation will be used
  251. * @flag_reserved: unused bits
  252. * @b_twt_recommendation: defines types of frames tx during bTWT SP
  253. * @b_twt_persistence: Countdown VAL frames to param update/teardown
  254. */
  255. struct wmi_twt_add_dialog_param {
  256. uint32_t vdev_id;
  257. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  258. uint32_t dialog_id;
  259. uint32_t wake_intvl_us;
  260. uint32_t wake_intvl_mantis;
  261. uint32_t min_wake_intvl_us;
  262. uint32_t max_wake_intvl_us;
  263. uint32_t wake_dura_us;
  264. uint32_t min_wake_dura_us;
  265. uint32_t max_wake_dura_us;
  266. uint32_t sp_offset_us;
  267. enum WMI_HOST_TWT_COMMAND twt_cmd;
  268. uint32_t
  269. flag_bcast:1,
  270. flag_trigger:1,
  271. flag_flow_type:1,
  272. flag_protection:1,
  273. flag_b_twt_id0:1,
  274. flag_reserved:11,
  275. b_twt_persistence:8,
  276. b_twt_recommendation:3;
  277. };
  278. /* enum - status code of adding TWT dialog
  279. * WMI_HOST_ADD_TWT_STATUS_OK: adding TWT dialog successfully completed
  280. * WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED: TWT not enabled
  281. * WMI_HOST_ADD_TWT_STATUS_USED_DIALOG_ID: TWT dialog ID is already used
  282. * WMI_HOST_ADD_TWT_STATUS_INVALID_PARAM: invalid parameters
  283. * WMI_HOST_ADD_TWT_STATUS_NOT_READY: FW not ready
  284. * WMI_HOST_ADD_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  285. * WMI_HOST_ADD_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  286. * request/response frame
  287. * WMI_HOST_ADD_TWT_STATUS_NO_RESPONSE: peer AP did not send the response frame
  288. * WMI_HOST_ADD_TWT_STATUS_DENIED: AP did not accept the request
  289. * WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR: adding TWT dialog failed with
  290. * an unknown reason
  291. */
  292. enum WMI_HOST_ADD_TWT_STATUS {
  293. WMI_HOST_ADD_TWT_STATUS_OK,
  294. WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED,
  295. WMI_HOST_ADD_TWT_STATUS_USED_DIALOG_ID,
  296. WMI_HOST_ADD_TWT_STATUS_INVALID_PARAM,
  297. WMI_HOST_ADD_TWT_STATUS_NOT_READY,
  298. WMI_HOST_ADD_TWT_STATUS_NO_RESOURCE,
  299. WMI_HOST_ADD_TWT_STATUS_NO_ACK,
  300. WMI_HOST_ADD_TWT_STATUS_NO_RESPONSE,
  301. WMI_HOST_ADD_TWT_STATUS_DENIED,
  302. WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR,
  303. };
  304. /**
  305. * struct wmi_twt_add_dialog_additional_params -
  306. * @twt_cmd: TWT command
  307. * @bcast: 0 means Individual TWT
  308. * 1 means Broadcast TWT
  309. * @trig_en: 0 means non-Trigger-enabled TWT
  310. * 1 means Trigger-enabled TWT
  311. * @announce: 0 means announced TWT
  312. * 1 means un-announced TWT
  313. * @protection: 0 means TWT protection is required
  314. * 1 means TWT protection is not required
  315. * @b_twt_id0: 0 means non-0 B-TWT ID or I-TWT
  316. * 1 means B-TWT ID 0
  317. * @info_frame_disabled: 0 means TWT Information frame is enabled
  318. * 1 means TWT Information frame is disabled
  319. * @wake_dura_us: wake duration in us
  320. * @wake_intvl_us: wake time interval in us
  321. * @sp_offset_us: Time until initial TWT SP occurs
  322. * @sp_tsf_us_lo: TWT service period tsf in usecs lower bits - 31:0
  323. * @sp_tsf_us_hi: TWT service period tsf in usecs higher bits - 63:32
  324. */
  325. struct wmi_twt_add_dialog_additional_params {
  326. uint32_t twt_cmd:8,
  327. bcast:1,
  328. trig_en:1,
  329. announce:1,
  330. protection:1,
  331. b_twt_id0:1,
  332. info_frame_disabled:1;
  333. uint32_t wake_dur_us;
  334. uint32_t wake_intvl_us;
  335. uint32_t sp_offset_us;
  336. uint32_t sp_tsf_us_lo;
  337. uint32_t sp_tsf_us_hi;
  338. };
  339. /**
  340. * struct wmi_twt_add_dialog_complete_param -
  341. * @vdev_id: VDEV identifier
  342. * @peer_macaddr: Peer mac address
  343. * @dialog_id: TWT dialog ID
  344. * @status: refer to WMI_HOST_ADD_TWT_STATUS enum
  345. * @num_additional_twt_params: no of additional_twt_params available
  346. */
  347. struct wmi_twt_add_dialog_complete_event_param {
  348. uint32_t vdev_id;
  349. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  350. uint32_t dialog_id;
  351. uint32_t status;
  352. uint32_t num_additional_twt_params;
  353. };
  354. /**
  355. * struct wmi_twt_del_dialog_param -
  356. * @vdev_id: VDEV identifier
  357. * @peer_macaddr: Peer mac address
  358. * @dialog_id: TWT dialog ID
  359. * @b_twt_persistence: persistence val for b-twt
  360. */
  361. struct wmi_twt_del_dialog_param {
  362. uint32_t vdev_id;
  363. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  364. uint32_t dialog_id;
  365. #ifdef WLAN_SUPPORT_BCAST_TWT
  366. uint32_t b_twt_persistence;
  367. #endif
  368. };
  369. /* status code of deleting TWT dialog
  370. * WMI_HOST_DEL_TWT_STATUS_OK: deleting TWT dialog successfully completed
  371. * WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  372. * WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM: invalid parameters
  373. * WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  374. * this dialog
  375. * WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  376. * WMI_HOST_DEL_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the request/response
  377. * frame
  378. * WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR: deleting TWT dialog failed with an
  379. * unknown reason
  380. */
  381. enum WMI_HOST_DEL_TWT_STATUS {
  382. WMI_HOST_DEL_TWT_STATUS_OK,
  383. WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  384. WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM,
  385. WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY,
  386. WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE,
  387. WMI_HOST_DEL_TWT_STATUS_NO_ACK,
  388. WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR,
  389. };
  390. /**
  391. * struct wmi_twt_del_dialog_complete_event_param -
  392. * @vdev_id: VDEV identifier
  393. * @peer_macaddr: Peer mac address
  394. * @dialog_id: TWT dialog ID
  395. * @b_twt_persistence: persistence val for b-twt
  396. * @status: refer to WMI_HOST_DEL_TWT_STATUS enum
  397. */
  398. struct wmi_twt_del_dialog_complete_event_param {
  399. uint32_t vdev_id;
  400. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  401. uint32_t dialog_id;
  402. #ifdef WLAN_SUPPORT_BCAST_TWT
  403. uint32_t b_twt_persistence;
  404. #endif
  405. uint32_t status;
  406. };
  407. /**
  408. * struct wmi_twt_pause_dialog_cmd_param -
  409. * @vdev_id: VDEV identifier
  410. * @peer_macaddr: Peer mac address
  411. * @dialog_id: TWT dialog ID
  412. */
  413. struct wmi_twt_pause_dialog_cmd_param {
  414. uint32_t vdev_id;
  415. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  416. uint32_t dialog_id;
  417. };
  418. /**
  419. * struct wmi_twt_nudge_dialog_cmd_param -
  420. * @vdev_id: VDEV identifier
  421. * @peer_macaddr: Peer mac address
  422. * @dialog_id: TWT dialog ID
  423. * @suspend_duration: TWT suspend duration in microseconds
  424. * @next_twt_size: next TWT size
  425. */
  426. struct wmi_twt_nudge_dialog_cmd_param {
  427. uint32_t vdev_id;
  428. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  429. uint32_t dialog_id;
  430. uint32_t suspend_duration;
  431. uint32_t next_twt_size;
  432. };
  433. /* enum WMI_HOST_PAUSE_TWT_STATUS - status code of pausing TWT dialog
  434. * WMI_HOST_PAUSE_TWT_STATUS_OK: pausing TWT dialog successfully completed
  435. * WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  436. * WMI_HOST_PAUSE_TWT_STATUS_INVALID_PARAM: invalid parameters
  437. * WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  438. * this dialog
  439. * WMI_HOST_PAUSE_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  440. * WMI_HOST_PAUSE_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  441. * request/response frame
  442. * WMI_HOST_PAUSE_TWT_STATUS_UNKNOWN_ERROR: pausing TWT dialog failed with an
  443. * unknown reason
  444. * WMI_HOST_PAUSE_TWT_STATUS_ALREADY_PAUSED: TWT dialog already in paused state
  445. */
  446. enum WMI_HOST_PAUSE_TWT_STATUS {
  447. WMI_HOST_PAUSE_TWT_STATUS_OK,
  448. WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  449. WMI_HOST_PAUSE_TWT_STATUS_INVALID_PARAM,
  450. WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_BUSY,
  451. WMI_HOST_PAUSE_TWT_STATUS_NO_RESOURCE,
  452. WMI_HOST_PAUSE_TWT_STATUS_NO_ACK,
  453. WMI_HOST_PAUSE_TWT_STATUS_UNKNOWN_ERROR,
  454. WMI_HOST_PAUSE_TWT_STATUS_ALREADY_PAUSED,
  455. };
  456. /**
  457. * struct wmi_twt_pause_dialog_complete_event_param -
  458. * @vdev_id: VDEV identifier
  459. * @peer_macaddr: Peer mac address
  460. * @dialog_id: TWT dialog ID
  461. * @status: refer to WMI_HOST_PAUSE_TWT_STATUS
  462. */
  463. struct wmi_twt_pause_dialog_complete_event_param {
  464. uint32_t vdev_id;
  465. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  466. uint32_t dialog_id;
  467. enum WMI_HOST_PAUSE_TWT_STATUS status;
  468. };
  469. /* enum WMI_HOST_NUDGE_TWT_STATUS - status code of nudge TWT dialog
  470. * WMI_HOST_NUDGE_TWT_STATUS_OK: nudge TWT dialog successfully completed
  471. * WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  472. * WMI_HOST_NUDGE_TWT_STATUS_INVALID_PARAM: invalid parameters
  473. * WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  474. * this dialog
  475. * WMI_HOST_NUDGE_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  476. * WMI_HOST_NUDGE_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  477. * request/response frame
  478. * WMI_HOST_NUDGE_TWT_STATUS_UNKNOWN_ERROR: nudge TWT dialog failed with an
  479. * unknown reason
  480. */
  481. enum WMI_HOST_NUDGE_TWT_STATUS {
  482. WMI_HOST_NUDGE_TWT_STATUS_OK,
  483. WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  484. WMI_HOST_NUDGE_TWT_STATUS_INVALID_PARAM,
  485. WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_BUSY,
  486. WMI_HOST_NUDGE_TWT_STATUS_NO_RESOURCE,
  487. WMI_HOST_NUDGE_TWT_STATUS_NO_ACK,
  488. WMI_HOST_NUDGE_TWT_STATUS_UNKNOWN_ERROR,
  489. };
  490. /**
  491. * struct wmi_twt_nudge_dialog_complete_event_param -
  492. * @vdev_id: VDEV identifier
  493. * @peer_macaddr: Peer mac address
  494. * @dialog_id: TWT dialog ID
  495. * @status: refer to WMI_HOST_PAUSE_TWT_STATUS
  496. * @next_twt_tsf_us_lo: TSF lower bits (31:0) of next wake time
  497. * @next_twt_tsf_us_hi: TSF higher bits (32:63) of next wake time
  498. */
  499. struct wmi_twt_nudge_dialog_complete_event_param {
  500. uint32_t vdev_id;
  501. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  502. uint32_t dialog_id;
  503. enum WMI_HOST_NUDGE_TWT_STATUS status;
  504. uint32_t next_twt_tsf_us_lo;
  505. uint32_t next_twt_tsf_us_hi;
  506. };
  507. /**
  508. * struct wmi_twt_resume_dialog_cmd_param -
  509. * @vdev_id: VDEV identifier
  510. * @peer_macaddr: Peer mac address
  511. * @dialog_id: TWT dialog ID
  512. * @sp_offset_us: this long time after TWT resumed the 1st SP will start
  513. * @next_twt_size: Next TWT subfield Size.
  514. * Refer IEEE 802.11ax section "9.4.1.60 TWT Information field"
  515. */
  516. struct wmi_twt_resume_dialog_cmd_param {
  517. uint32_t vdev_id;
  518. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  519. uint32_t dialog_id;
  520. uint32_t sp_offset_us;
  521. uint32_t next_twt_size;
  522. };
  523. /* enum WMI_HOST_RESUME_TWT_STATUS - status code of resuming TWT dialog
  524. * WMI_HOST_RESUME_TWT_STATUS_OK: resuming TWT dialog successfully completed
  525. * WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  526. * WMI_HOST_RESUME_TWT_STATUS_INVALID_PARAM: invalid parameters
  527. * WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  528. * this dialog
  529. * WMI_HOST_RESUME_TWT_STATUS_NOT_PAUSED: dialog not paused currently
  530. * WMI_HOST_RESUME_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  531. * WMI_HOST_RESUME_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  532. * request/response frame
  533. * WMI_HOST_RESUME_TWT_STATUS_UNKNOWN_ERROR: resuming TWT dialog failed with an
  534. * unknown reason
  535. */
  536. enum WMI_HOST_RESUME_TWT_STATUS {
  537. WMI_HOST_RESUME_TWT_STATUS_OK,
  538. WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  539. WMI_HOST_RESUME_TWT_STATUS_INVALID_PARAM,
  540. WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_BUSY,
  541. WMI_HOST_RESUME_TWT_STATUS_NOT_PAUSED,
  542. WMI_HOST_RESUME_TWT_STATUS_NO_RESOURCE,
  543. WMI_HOST_RESUME_TWT_STATUS_NO_ACK,
  544. WMI_HOST_RESUME_TWT_STATUS_UNKNOWN_ERROR,
  545. };
  546. /**
  547. * struct wmi_twt_resume_dialog_complete_event_param -
  548. * @vdev_id: VDEV identifier
  549. * @peer_macaddr: Peer mac address
  550. * @dialog_id: TWT dialog ID
  551. * @status: refer to WMI_HOST_RESUME_TWT_STATUS
  552. */
  553. struct wmi_twt_resume_dialog_complete_event_param {
  554. uint32_t vdev_id;
  555. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  556. uint32_t dialog_id;
  557. uint32_t status;
  558. };
  559. /**
  560. * struct wmi_twt_notify_event_param -
  561. * @vdev_id: VDEV identifier
  562. */
  563. struct wmi_twt_notify_event_param {
  564. uint32_t vdev_id;
  565. };
  566. #ifdef WLAN_SUPPORT_BCAST_TWT
  567. /**
  568. * struct wmi_twt_btwt_invite_sta_cmd_param -
  569. * @vdev_id: VDEV identifier
  570. * @peer_macaddr: Peer mac address
  571. * @dialog_id: TWT dialog ID
  572. */
  573. struct wmi_twt_btwt_invite_sta_cmd_param {
  574. uint32_t vdev_id;
  575. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  576. uint32_t dialog_id;
  577. };
  578. /* enum WMI_HOST_INVITATION_TWT_BTWT_STATUS - status code of TWT Invitation
  579. * dialog
  580. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_OK: BTWT invitation successfully
  581. * completed
  582. * WMI_HOST_INVITATION_TWT_TWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
  583. * exists
  584. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_INVALID_PARAM: invalid parameters
  585. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
  586. * handling this dialog
  587. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
  588. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  589. * request/response frame
  590. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_UNKNOWN_ERROR: BTWT invitation failed
  591. * with an unknown reason
  592. */
  593. enum WMI_HOST_INVITATION_TWT_BTWT_STATUS {
  594. WMI_HOST_INVITATION_TWT_BTWT_STATUS_OK,
  595. WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
  596. WMI_HOST_INVITATION_TWT_BTWT_STATUS_INVALID_PARAM,
  597. WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_BUSY,
  598. WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_RESOURCE,
  599. WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_ACK,
  600. WMI_HOST_INVITATION_TWT_BTWT_STATUS_UNKNOWN_ERROR,
  601. };
  602. /**
  603. * struct wmi_twt_btwt_invite_sta_complete_event_param -
  604. * @vdev_id: VDEV identifier
  605. * @peer_macaddr: Peer mac address
  606. * @dialog_id: BTWT dialog ID
  607. * @status: refer to WMI_HOST_INVITATION_TWT_BTWT_STATUS
  608. */
  609. struct wmi_twt_btwt_invite_sta_complete_event_param {
  610. uint32_t vdev_id;
  611. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  612. uint32_t dialog_id;
  613. uint32_t status;
  614. };
  615. /**
  616. * struct wmi_twt_btwt_remove_sta_cmd_param -
  617. * @vdev_id: VDEV identifier
  618. * @peer_macaddr: Peer mac address
  619. * @dialog_id: BTWT dialog ID
  620. */
  621. struct wmi_twt_btwt_remove_sta_cmd_param {
  622. uint32_t vdev_id;
  623. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  624. uint32_t dialog_id;
  625. };
  626. /* enum WMI_HOST_KICKOFF_TWT_BTWT_STATUS - status code of resuming TWT dialog
  627. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_OK: TWT kickoff successfully completed
  628. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
  629. * exists
  630. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_INVALID_PARAM: invalid parameters
  631. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
  632. * handling this dialog
  633. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NOT_PAUSED: Dialog not currently paused
  634. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
  635. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  636. * request/response frame
  637. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_UNKNOWN_ERROR: BTWT kickoff failed with an
  638. * unknown reason
  639. */
  640. enum WMI_HOST_KICKOFF_TWT_BTWT_STATUS {
  641. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_OK,
  642. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
  643. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_INVALID_PARAM,
  644. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_BUSY,
  645. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NOT_PAUSED,
  646. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_RESOURCE,
  647. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_ACK,
  648. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_UNKNOWN_ERROR,
  649. };
  650. /**
  651. * struct wmi_twt_btwt_remove_sta_complete_event_param -
  652. * @vdev_id: VDEV identifier
  653. * @peer_macaddr: Peer mac address
  654. * @dialog_id: BTWT dialog ID
  655. * @status: refer to WMI_HOST_KICKOFF_TWT_BTWT_STATUS
  656. */
  657. struct wmi_twt_btwt_remove_sta_complete_event_param {
  658. uint32_t vdev_id;
  659. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  660. uint32_t dialog_id;
  661. uint32_t status;
  662. };
  663. #endif
  664. #endif /* _WMI_UNIFIED_TWT_PARAM_H_ */