wmi_unified_twt_param.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  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. /**
  155. * wmi_twt_ack_complete_event_param:
  156. * @vdev_id: vdev id
  157. * @peer_macaddr: peer mac address
  158. * @dialog_id: dialog id
  159. * @twt_cmd_ack: ack event to the corresponding twt command
  160. * @status: twt command status
  161. */
  162. struct wmi_twt_ack_complete_event_param {
  163. uint32_t vdev_id;
  164. struct qdf_mac_addr peer_macaddr;
  165. uint32_t dialog_id;
  166. uint32_t twt_cmd_ack;
  167. uint32_t status;
  168. };
  169. /* TWT event types
  170. * refer to wmi_unified.h enum wmi_twt_session_stats_type
  171. */
  172. enum host_twt_session_stats_type {
  173. HOST_TWT_SESSION_SETUP = 1,
  174. HOST_TWT_SESSION_TEARDOWN = 2,
  175. HOST_TWT_SESSION_UPDATE = 3,
  176. };
  177. /**
  178. * struct wmi_host_twt_session_stats_info:
  179. * @vdev_id: id of VDEV for twt session
  180. * @peer_mac: MAC address of node
  181. * @event_type: Indicates TWT session type (SETUP/TEARDOWN/UPDATE)
  182. * @flow_id: TWT flow identifier established with TWT peer
  183. * @bcast: If this is a broacast TWT session
  184. * @trig: If the TWT session is trigger enabled
  185. * @announ: If the flow type is announced/unannounced
  186. * @protection: If the TWT protection field is set
  187. * @info_frame_disabled: If the TWT Information frame is disabled
  188. * @pm_responder_bit_valid: pm responder bit is valid or not
  189. * @pm_responder_bit: pm responder value
  190. * @dialog_id: Dialog_id of current session
  191. * @wake_dura_us: wake duration in us
  192. * @wake_intvl_us: wake time interval in us
  193. * @sp_offset_us: Time until initial TWT SP occurs
  194. * @sp_tsf_us_lo: TWT wake time TSF in usecs lower bits - 31:0
  195. * @sp_tsf_us_hi: TWT wake time TSF in usecs higher bits - 63:32
  196. */
  197. struct wmi_host_twt_session_stats_info {
  198. uint32_t vdev_id;
  199. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  200. uint32_t event_type;
  201. uint32_t flow_id:16,
  202. bcast:1,
  203. trig:1,
  204. announ:1,
  205. protection:1,
  206. info_frame_disabled:1,
  207. pm_responder_bit_valid:1,
  208. pm_responder_bit:1;
  209. uint32_t dialog_id;
  210. uint32_t wake_dura_us;
  211. uint32_t wake_intvl_us;
  212. uint32_t sp_offset_us;
  213. uint32_t sp_tsf_us_lo;
  214. uint32_t sp_tsf_us_hi;
  215. };
  216. /**
  217. * struct wmi_twt_session_stats_event:
  218. * @pdev_id: pdev_id for identifying the MAC.
  219. * @num_sessions: number of TWT sessions
  220. * @twt_sessions: received TWT sessions
  221. */
  222. struct wmi_twt_session_stats_event_param {
  223. uint32_t pdev_id;
  224. uint32_t num_sessions;
  225. };
  226. /* from IEEE 802.11ah section 9.4.2.200 */
  227. enum WMI_HOST_TWT_COMMAND {
  228. WMI_HOST_TWT_COMMAND_REQUEST_TWT = 0,
  229. WMI_HOST_TWT_COMMAND_SUGGEST_TWT = 1,
  230. WMI_HOST_TWT_COMMAND_DEMAND_TWT = 2,
  231. WMI_HOST_TWT_COMMAND_TWT_GROUPING = 3,
  232. WMI_HOST_TWT_COMMAND_ACCEPT_TWT = 4,
  233. WMI_HOST_TWT_COMMAND_ALTERNATE_TWT = 5,
  234. WMI_HOST_TWT_COMMAND_DICTATE_TWT = 6,
  235. WMI_HOST_TWT_COMMAND_REJECT_TWT = 7,
  236. };
  237. /**
  238. * struct wmi_twt_add_dialog_param -
  239. * @vdev_id: VDEV identifier
  240. * @peer_macaddr: peer MAC address when vdev is AP VDEV
  241. * @dialog_id: diaglog_id (TWT dialog ID)
  242. * This dialog ID must be unique within its vdev.
  243. * @wake_intvl_us: TWT Wake Interval in units of us
  244. * @wake_intvl_mantis: TWT Wake Interval Mantissa
  245. * - wake_intvl_mantis must be <= 0xFFFF
  246. * - wake_intvl_us must be divided evenly by wake_intvl_mantis,
  247. * i.e., wake_intvl_us % wake_intvl_mantis == 0
  248. * - the quotient of wake_intvl_us/wake_intvl_mantis must be
  249. * 2 to N-th(0<=N<=31) power,
  250. * i.e., wake_intvl_us/wake_intvl_mantis == 2^N, 0<=N<=31
  251. * @min_wake_intvl_us: Min tolerance limit of TWT wake interval
  252. * @max_wake_intvl_us: Max tolerance limit of TWT wake interval
  253. * @wake_dura_us: TWT Wake Duration in units of us, must be <= 0xFFFF
  254. * wake_dura_us must be divided evenly by 256,
  255. * i.e., wake_dura_us % 256 == 0
  256. * @min_wake_dura_us: Min tolerance limit of TWT wake duration.
  257. * @max_wake_dura_us: Max tolerance limit of TWT wake duration.
  258. * @sp_offset_us: this long time after TWT setup the 1st SP will start.
  259. * @twt_cmd: cmd from enum WMI_HOST_TWT_COMMAND
  260. * @flag_bcast: 0 means Individual TWT,
  261. * 1 means Broadcast TWT
  262. * @flag_trigger: 0 means non-Trigger-enabled TWT,
  263. * 1 means means Trigger-enabled TWT
  264. * @flag_flow_type: 0 means announced TWT,
  265. * 1 means un-announced TWT
  266. * @flag_protection: 0 means TWT protection is required,
  267. * 1 means TWT protection is not required
  268. * @b_twt_id0: 0 means BTWT recommendation will not be used
  269. * 1 means BTWT recommendation will be used
  270. * @flag_reserved: unused bits
  271. * @b_twt_recommendation: defines types of frames tx during bTWT SP
  272. * @b_twt_persistence: Countdown VAL frames to param update/teardown
  273. * @wake_time_tsf: Absolute TSF value to start first TWT service period
  274. */
  275. struct wmi_twt_add_dialog_param {
  276. uint32_t vdev_id;
  277. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  278. uint32_t dialog_id;
  279. uint32_t wake_intvl_us;
  280. uint32_t wake_intvl_mantis;
  281. uint32_t min_wake_intvl_us;
  282. uint32_t max_wake_intvl_us;
  283. uint32_t wake_dura_us;
  284. uint32_t min_wake_dura_us;
  285. uint32_t max_wake_dura_us;
  286. uint32_t sp_offset_us;
  287. enum WMI_HOST_TWT_COMMAND twt_cmd;
  288. uint32_t
  289. flag_bcast:1,
  290. flag_trigger:1,
  291. flag_flow_type:1,
  292. flag_protection:1,
  293. flag_b_twt_id0:1,
  294. flag_reserved:11,
  295. b_twt_persistence:8,
  296. b_twt_recommendation:3;
  297. uint64_t wake_time_tsf;
  298. };
  299. /* enum - status code of Get stats TWT dialog
  300. * @WMI_HOST_GET_STATS_TWT_STATUS_OK: Get status TWT dialog successfully completed
  301. * @WMI_HOST_GET_STATS_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID does not exist
  302. * @WMI_HOST_GET_STATS_TWT_STATUS_INVALID_PARAM: Invalid parameters
  303. * @WMI_HOST_GET_STATS_TWT_STATUS_UNKNOWN_ERROR: Unknown error
  304. */
  305. enum WMI_HOST_GET_STATS_TWT_STATUS {
  306. WMI_HOST_GET_STATS_TWT_STATUS_OK,
  307. WMI_HOST_GET_STATS_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  308. WMI_HOST_GET_STATS_TWT_STATUS_INVALID_PARAM,
  309. WMI_HOST_GET_STATS_TWT_STATUS_UNKNOWN_ERROR,
  310. };
  311. /* enum - status code of adding TWT dialog
  312. * @WMI_HOST_ADD_TWT_STATUS_OK: adding TWT dialog successfully completed
  313. * @WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED: TWT not enabled
  314. * @WMI_HOST_ADD_TWT_STATUS_USED_DIALOG_ID: TWT dialog ID is already used
  315. * @WMI_HOST_ADD_TWT_STATUS_INVALID_PARAM: invalid parameters
  316. * @WMI_HOST_ADD_TWT_STATUS_NOT_READY: FW not ready
  317. * @WMI_HOST_ADD_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  318. * @WMI_HOST_ADD_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  319. * request/response frame
  320. * @WMI_HOST_ADD_TWT_STATUS_NO_RESPONSE: peer AP did not send the response frame
  321. * @WMI_HOST_ADD_TWT_STATUS_DENIED: AP did not accept the request
  322. * @WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR: adding TWT dialog failed with
  323. * an unknown reason
  324. * @WMI_HOST_ADD_TWT_STATUS_AP_PARAMS_NOT_IN_RANGE: peer AP wake interval,
  325. * duration not in range
  326. * @WMI_HOST_ADD_TWT_STATUS_AP_IE_VALIDATION_FAILED: peer AP IE Validation
  327. * Failed
  328. * @WMI_HOST_ADD_TWT_STATUS_ROAM_IN_PROGRESS: Roaming in progress
  329. * @WMI_HOST_ADD_TWT_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
  330. * @WMI_HOST_ADD_TWT_STATUS_SCAN_IN_PROGRESS: Scan is in progress
  331. */
  332. enum WMI_HOST_ADD_TWT_STATUS {
  333. WMI_HOST_ADD_TWT_STATUS_OK,
  334. WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED,
  335. WMI_HOST_ADD_TWT_STATUS_USED_DIALOG_ID,
  336. WMI_HOST_ADD_TWT_STATUS_INVALID_PARAM,
  337. WMI_HOST_ADD_TWT_STATUS_NOT_READY,
  338. WMI_HOST_ADD_TWT_STATUS_NO_RESOURCE,
  339. WMI_HOST_ADD_TWT_STATUS_NO_ACK,
  340. WMI_HOST_ADD_TWT_STATUS_NO_RESPONSE,
  341. WMI_HOST_ADD_TWT_STATUS_DENIED,
  342. WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR,
  343. WMI_HOST_ADD_TWT_STATUS_AP_PARAMS_NOT_IN_RANGE,
  344. WMI_HOST_ADD_TWT_STATUS_AP_IE_VALIDATION_FAILED,
  345. WMI_HOST_ADD_TWT_STATUS_ROAM_IN_PROGRESS,
  346. WMI_HOST_ADD_TWT_STATUS_CHAN_SW_IN_PROGRESS,
  347. WMI_HOST_ADD_TWT_STATUS_SCAN_IN_PROGRESS,
  348. };
  349. /**
  350. * struct wmi_twt_add_dialog_additional_params -
  351. * @twt_cmd: TWT command
  352. * @bcast: 0 means Individual TWT
  353. * 1 means Broadcast TWT
  354. * @trig_en: 0 means non-Trigger-enabled TWT
  355. * 1 means Trigger-enabled TWT
  356. * @announce: 0 means announced TWT
  357. * 1 means un-announced TWT
  358. * @protection: 0 means TWT protection is required
  359. * 1 means TWT protection is not required
  360. * @b_twt_id0: 0 means non-0 B-TWT ID or I-TWT
  361. * 1 means B-TWT ID 0
  362. * @info_frame_disabled: 0 means TWT Information frame is enabled
  363. * 1 means TWT Information frame is disabled
  364. * @pm_responder_bit_valid: 1 means responder pm mode field is valid
  365. * 0 means responder pm mode field is not valid
  366. * @pm_responder_bit: 1 means that responder set responder pm mode to 1
  367. * 0 means that responder set responder pm mode to 0
  368. * @wake_dura_us: wake duration in us
  369. * @wake_intvl_us: wake time interval in us
  370. * @sp_offset_us: Time until initial TWT SP occurs
  371. * @sp_tsf_us_lo: TWT service period tsf in usecs lower bits - 31:0
  372. * @sp_tsf_us_hi: TWT service period tsf in usecs higher bits - 63:32
  373. */
  374. struct wmi_twt_add_dialog_additional_params {
  375. uint32_t twt_cmd:8,
  376. bcast:1,
  377. trig_en:1,
  378. announce:1,
  379. protection:1,
  380. b_twt_id0:1,
  381. info_frame_disabled:1,
  382. pm_responder_bit_valid:1,
  383. pm_responder_bit:1;
  384. uint32_t wake_dur_us;
  385. uint32_t wake_intvl_us;
  386. uint32_t sp_offset_us;
  387. uint32_t sp_tsf_us_lo;
  388. uint32_t sp_tsf_us_hi;
  389. };
  390. /**
  391. * struct wmi_twt_add_dialog_complete_param -
  392. * @vdev_id: VDEV identifier
  393. * @peer_macaddr: Peer mac address
  394. * @dialog_id: TWT dialog ID
  395. * @status: refer to WMI_HOST_ADD_TWT_STATUS enum
  396. * @num_additional_twt_params: no of additional_twt_params available
  397. */
  398. struct wmi_twt_add_dialog_complete_event_param {
  399. uint32_t vdev_id;
  400. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  401. uint32_t dialog_id;
  402. uint32_t status;
  403. uint32_t num_additional_twt_params;
  404. };
  405. /**
  406. * struct wmi_twt_cap_bitmap_params -
  407. * twt_cap_bitmap: TWT capability bitmap
  408. *
  409. */
  410. struct wmi_twt_cap_bitmap_params {
  411. uint32_t twt_ack_support_cap:1;
  412. };
  413. /**
  414. * struct wmi_twt_del_dialog_param -
  415. * @vdev_id: VDEV identifier
  416. * @peer_macaddr: Peer mac address
  417. * @dialog_id: TWT dialog ID
  418. * @b_twt_persistence: persistence val for b-twt
  419. */
  420. struct wmi_twt_del_dialog_param {
  421. uint32_t vdev_id;
  422. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  423. uint32_t dialog_id;
  424. #ifdef WLAN_SUPPORT_BCAST_TWT
  425. uint32_t b_twt_persistence;
  426. #endif
  427. };
  428. /**
  429. * enum WMI_HOST_DEL_TWT_STATUS - status code of deleting TWT dialog
  430. * @WMI_HOST_DEL_TWT_STATUS_OK: deleting TWT dialog successfully completed
  431. * @WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  432. * @WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM: invalid parameters
  433. * @WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  434. * this dialog
  435. * @WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  436. * @WMI_HOST_DEL_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the request/response
  437. * frame
  438. * @WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR: deleting TWT dialog failed with an
  439. * unknown reason
  440. * @WMI_HOST_DEL_TWT_STATUS_PEER_INIT_TEARDOWN: Peer initiated TWT teardown
  441. * @WMI_HOST_DEL_TWT_STATUS_ROAMING: TWT teardown due to roaming.
  442. * @WMI_HOST_DEL_TWT_STATUS_CONCURRENCY: TWT session teardown due to
  443. * concurrent session comming up.
  444. * @WMI_HOST_DEL_TWT_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
  445. * @WMI_HOST_DEL_TWT_STATUS_SCAN_IN_PROGRESS: Scan is in progress
  446. * @WMI_HOST_DEL_TWT_STATUS_PS_DISABLE_TEARDOWN: PS disable TWT teardown
  447. */
  448. enum WMI_HOST_DEL_TWT_STATUS {
  449. WMI_HOST_DEL_TWT_STATUS_OK,
  450. WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  451. WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM,
  452. WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY,
  453. WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE,
  454. WMI_HOST_DEL_TWT_STATUS_NO_ACK,
  455. WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR,
  456. WMI_HOST_DEL_TWT_STATUS_PEER_INIT_TEARDOWN,
  457. WMI_HOST_DEL_TWT_STATUS_ROAMING,
  458. WMI_HOST_DEL_TWT_STATUS_CONCURRENCY,
  459. WMI_HOST_DEL_TWT_STATUS_CHAN_SW_IN_PROGRESS,
  460. WMI_HOST_DEL_TWT_STATUS_SCAN_IN_PROGRESS,
  461. WMI_HOST_DEL_TWT_STATUS_PS_DISABLE_TEARDOWN,
  462. };
  463. /**
  464. * struct wmi_twt_del_dialog_complete_event_param -
  465. * @vdev_id: VDEV identifier
  466. * @peer_macaddr: Peer mac address
  467. * @dialog_id: TWT dialog ID
  468. * @b_twt_persistence: persistence val for b-twt
  469. * @status: refer to WMI_HOST_DEL_TWT_STATUS enum
  470. */
  471. struct wmi_twt_del_dialog_complete_event_param {
  472. uint32_t vdev_id;
  473. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  474. uint32_t dialog_id;
  475. #ifdef WLAN_SUPPORT_BCAST_TWT
  476. uint32_t b_twt_persistence;
  477. #endif
  478. uint32_t status;
  479. };
  480. /**
  481. * struct wmi_twt_pause_dialog_cmd_param -
  482. * @vdev_id: VDEV identifier
  483. * @peer_macaddr: Peer mac address
  484. * @dialog_id: TWT dialog ID
  485. */
  486. struct wmi_twt_pause_dialog_cmd_param {
  487. uint32_t vdev_id;
  488. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  489. uint32_t dialog_id;
  490. };
  491. /**
  492. * struct wmi_twt_nudge_dialog_cmd_param -
  493. * @vdev_id: VDEV identifier
  494. * @peer_macaddr: Peer mac address
  495. * @dialog_id: TWT dialog ID
  496. * @suspend_duration: TWT suspend duration in microseconds
  497. * @next_twt_size: next TWT size
  498. */
  499. struct wmi_twt_nudge_dialog_cmd_param {
  500. uint32_t vdev_id;
  501. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  502. uint32_t dialog_id;
  503. uint32_t suspend_duration;
  504. uint32_t next_twt_size;
  505. };
  506. /* enum WMI_HOST_PAUSE_TWT_STATUS - status code of pausing TWT dialog
  507. * @WMI_HOST_PAUSE_TWT_STATUS_OK: pausing TWT dialog successfully completed
  508. * @WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  509. * @WMI_HOST_PAUSE_TWT_STATUS_INVALID_PARAM: invalid parameters
  510. * @WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  511. * this dialog
  512. * @WMI_HOST_PAUSE_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  513. * @WMI_HOST_PAUSE_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  514. * request/response frame
  515. * @WMI_HOST_PAUSE_TWT_STATUS_UNKNOWN_ERROR: pausing TWT dialog failed with an
  516. * unknown reason
  517. * @WMI_HOST_PAUSE_TWT_STATUS_ALREADY_PAUSED: TWT dialog already in paused state
  518. * @WMI_HOST_PAUSE_TWT_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
  519. * @WMI_HOST_PAUSE_TWT_STATUS_ROAM_IN_PROGRESS: Roaming is in progress
  520. * @WMI_HOST_PAUSE_TWT_STATUS_SCAN_IN_PROGRESS: Scan is in progress
  521. */
  522. enum WMI_HOST_PAUSE_TWT_STATUS {
  523. WMI_HOST_PAUSE_TWT_STATUS_OK,
  524. WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  525. WMI_HOST_PAUSE_TWT_STATUS_INVALID_PARAM,
  526. WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_BUSY,
  527. WMI_HOST_PAUSE_TWT_STATUS_NO_RESOURCE,
  528. WMI_HOST_PAUSE_TWT_STATUS_NO_ACK,
  529. WMI_HOST_PAUSE_TWT_STATUS_UNKNOWN_ERROR,
  530. WMI_HOST_PAUSE_TWT_STATUS_ALREADY_PAUSED,
  531. WMI_HOST_PAUSE_TWT_STATUS_CHAN_SW_IN_PROGRESS,
  532. WMI_HOST_PAUSE_TWT_STATUS_ROAM_IN_PROGRESS,
  533. WMI_HOST_PAUSE_TWT_STATUS_SCAN_IN_PROGRESS,
  534. };
  535. /**
  536. * struct wmi_twt_pause_dialog_complete_event_param -
  537. * @vdev_id: VDEV identifier
  538. * @peer_macaddr: Peer mac address
  539. * @dialog_id: TWT dialog ID
  540. * @status: refer to WMI_HOST_PAUSE_TWT_STATUS
  541. */
  542. struct wmi_twt_pause_dialog_complete_event_param {
  543. uint32_t vdev_id;
  544. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  545. uint32_t dialog_id;
  546. enum WMI_HOST_PAUSE_TWT_STATUS status;
  547. };
  548. /* enum WMI_HOST_NUDGE_TWT_STATUS - status code of nudge TWT dialog
  549. * @WMI_HOST_NUDGE_TWT_STATUS_OK: nudge TWT dialog successfully completed
  550. * @WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  551. * @WMI_HOST_NUDGE_TWT_STATUS_INVALID_PARAM: invalid parameters
  552. * @WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  553. * this dialog
  554. * @WMI_HOST_NUDGE_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  555. * @WMI_HOST_NUDGE_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  556. * request/response frame
  557. * @WMI_HOST_NUDGE_TWT_STATUS_UNKNOWN_ERROR: nudge TWT dialog failed with an
  558. * unknown reason
  559. * @WMI_HOST_NUDGE_TWT_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
  560. * @WMI_HOST_NUDGE_TWT_STATUS_ROAM_IN_PROGRESS: Roaming in progress
  561. * @WMI_HOST_NUDGE_TWT_STATUS_SCAN_IN_PROGRESS: Scan is in progress
  562. */
  563. enum WMI_HOST_NUDGE_TWT_STATUS {
  564. WMI_HOST_NUDGE_TWT_STATUS_OK,
  565. WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  566. WMI_HOST_NUDGE_TWT_STATUS_INVALID_PARAM,
  567. WMI_HOST_NUDGE_TWT_STATUS_DIALOG_ID_BUSY,
  568. WMI_HOST_NUDGE_TWT_STATUS_NO_RESOURCE,
  569. WMI_HOST_NUDGE_TWT_STATUS_NO_ACK,
  570. WMI_HOST_NUDGE_TWT_STATUS_UNKNOWN_ERROR,
  571. WMI_HOST_NUDGE_TWT_STATUS_CHAN_SW_IN_PROGRESS,
  572. WMI_HOST_NUDGE_TWT_STATUS_ROAM_IN_PROGRESS,
  573. WMI_HOST_NUDGE_TWT_STATUS_SCAN_IN_PROGRESS,
  574. };
  575. /**
  576. * struct wmi_twt_nudge_dialog_complete_event_param -
  577. * @vdev_id: VDEV identifier
  578. * @peer_macaddr: Peer mac address
  579. * @dialog_id: TWT dialog ID
  580. * @status: refer to WMI_HOST_PAUSE_TWT_STATUS
  581. * @next_twt_tsf_us_lo: TSF lower bits (31:0) of next wake time
  582. * @next_twt_tsf_us_hi: TSF higher bits (32:63) of next wake time
  583. */
  584. struct wmi_twt_nudge_dialog_complete_event_param {
  585. uint32_t vdev_id;
  586. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  587. uint32_t dialog_id;
  588. enum WMI_HOST_NUDGE_TWT_STATUS status;
  589. uint32_t next_twt_tsf_us_lo;
  590. uint32_t next_twt_tsf_us_hi;
  591. };
  592. /**
  593. * struct wmi_twt_resume_dialog_cmd_param -
  594. * @vdev_id: VDEV identifier
  595. * @peer_macaddr: Peer mac address
  596. * @dialog_id: TWT dialog ID
  597. * @sp_offset_us: this long time after TWT resumed the 1st SP will start
  598. * @next_twt_size: Next TWT subfield Size.
  599. * Refer IEEE 802.11ax section "9.4.1.60 TWT Information field"
  600. */
  601. struct wmi_twt_resume_dialog_cmd_param {
  602. uint32_t vdev_id;
  603. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  604. uint32_t dialog_id;
  605. uint32_t sp_offset_us;
  606. uint32_t next_twt_size;
  607. };
  608. /* enum WMI_HOST_RESUME_TWT_STATUS - status code of resuming TWT dialog
  609. * @WMI_HOST_RESUME_TWT_STATUS_OK: resuming TWT dialog successfully completed
  610. * @WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
  611. * @WMI_HOST_RESUME_TWT_STATUS_INVALID_PARAM: invalid parameters
  612. * @WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
  613. * this dialog
  614. * @WMI_HOST_RESUME_TWT_STATUS_NOT_PAUSED: dialog not paused currently
  615. * @WMI_HOST_RESUME_TWT_STATUS_NO_RESOURCE: FW resource exhausted
  616. * @WMI_HOST_RESUME_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  617. * request/response frame
  618. * @WMI_HOST_RESUME_TWT_STATUS_UNKNOWN_ERROR: resuming TWT dialog failed with an
  619. * unknown reason
  620. * @WMI_HOST_RESUME_TWT_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
  621. * @WMI_HOST_RESUME_TWT_STATUS_ROAM_IN_PROGRESS: Roaming in progress
  622. * @WMI_HOST_RESUME_TWT_STATUS_SCAN_IN_PROGRESS: Scan is in progress
  623. */
  624. enum WMI_HOST_RESUME_TWT_STATUS {
  625. WMI_HOST_RESUME_TWT_STATUS_OK,
  626. WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_NOT_EXIST,
  627. WMI_HOST_RESUME_TWT_STATUS_INVALID_PARAM,
  628. WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_BUSY,
  629. WMI_HOST_RESUME_TWT_STATUS_NOT_PAUSED,
  630. WMI_HOST_RESUME_TWT_STATUS_NO_RESOURCE,
  631. WMI_HOST_RESUME_TWT_STATUS_NO_ACK,
  632. WMI_HOST_RESUME_TWT_STATUS_UNKNOWN_ERROR,
  633. WMI_HOST_RESUME_TWT_STATUS_CHAN_SW_IN_PROGRESS,
  634. WMI_HOST_RESUME_TWT_STATUS_ROAM_IN_PROGRESS,
  635. WMI_HOST_RESUME_TWT_STATUS_SCAN_IN_PROGRESS,
  636. };
  637. /**
  638. * struct wmi_twt_resume_dialog_complete_event_param -
  639. * @vdev_id: VDEV identifier
  640. * @peer_macaddr: Peer mac address
  641. * @dialog_id: TWT dialog ID
  642. * @status: refer to WMI_HOST_RESUME_TWT_STATUS
  643. */
  644. struct wmi_twt_resume_dialog_complete_event_param {
  645. uint32_t vdev_id;
  646. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  647. uint32_t dialog_id;
  648. uint32_t status;
  649. };
  650. /**
  651. * struct wmi_twt_notify_event_param -
  652. * @vdev_id: VDEV identifier
  653. */
  654. struct wmi_twt_notify_event_param {
  655. uint32_t vdev_id;
  656. };
  657. #ifdef WLAN_SUPPORT_BCAST_TWT
  658. /**
  659. * struct wmi_twt_btwt_invite_sta_cmd_param -
  660. * @vdev_id: VDEV identifier
  661. * @peer_macaddr: Peer mac address
  662. * @dialog_id: TWT dialog ID
  663. */
  664. struct wmi_twt_btwt_invite_sta_cmd_param {
  665. uint32_t vdev_id;
  666. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  667. uint32_t dialog_id;
  668. };
  669. /* enum WMI_HOST_INVITATION_TWT_BTWT_STATUS - status code of TWT Invitation
  670. * dialog
  671. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_OK: BTWT invitation successfully
  672. * completed
  673. * WMI_HOST_INVITATION_TWT_TWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
  674. * exists
  675. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_INVALID_PARAM: invalid parameters
  676. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
  677. * handling this dialog
  678. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
  679. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  680. * request/response frame
  681. * WMI_HOST_INVITATION_TWT_BTWT_STATUS_UNKNOWN_ERROR: BTWT invitation failed
  682. * with an unknown reason
  683. */
  684. enum WMI_HOST_INVITATION_TWT_BTWT_STATUS {
  685. WMI_HOST_INVITATION_TWT_BTWT_STATUS_OK,
  686. WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
  687. WMI_HOST_INVITATION_TWT_BTWT_STATUS_INVALID_PARAM,
  688. WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_BUSY,
  689. WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_RESOURCE,
  690. WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_ACK,
  691. WMI_HOST_INVITATION_TWT_BTWT_STATUS_UNKNOWN_ERROR,
  692. };
  693. /**
  694. * struct wmi_twt_btwt_invite_sta_complete_event_param -
  695. * @vdev_id: VDEV identifier
  696. * @peer_macaddr: Peer mac address
  697. * @dialog_id: BTWT dialog ID
  698. * @status: refer to WMI_HOST_INVITATION_TWT_BTWT_STATUS
  699. */
  700. struct wmi_twt_btwt_invite_sta_complete_event_param {
  701. uint32_t vdev_id;
  702. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  703. uint32_t dialog_id;
  704. uint32_t status;
  705. };
  706. /**
  707. * struct wmi_twt_btwt_remove_sta_cmd_param -
  708. * @vdev_id: VDEV identifier
  709. * @peer_macaddr: Peer mac address
  710. * @dialog_id: BTWT dialog ID
  711. */
  712. struct wmi_twt_btwt_remove_sta_cmd_param {
  713. uint32_t vdev_id;
  714. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  715. uint32_t dialog_id;
  716. };
  717. /* enum WMI_HOST_KICKOFF_TWT_BTWT_STATUS - status code of resuming TWT dialog
  718. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_OK: TWT kickoff successfully completed
  719. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
  720. * exists
  721. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_INVALID_PARAM: invalid parameters
  722. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
  723. * handling this dialog
  724. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NOT_PAUSED: Dialog not currently paused
  725. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
  726. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
  727. * request/response frame
  728. * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_UNKNOWN_ERROR: BTWT kickoff failed with an
  729. * unknown reason
  730. */
  731. enum WMI_HOST_KICKOFF_TWT_BTWT_STATUS {
  732. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_OK,
  733. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
  734. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_INVALID_PARAM,
  735. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_BUSY,
  736. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NOT_PAUSED,
  737. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_RESOURCE,
  738. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_ACK,
  739. WMI_HOST_KICKOFF_TWT_BTWT_STATUS_UNKNOWN_ERROR,
  740. };
  741. /**
  742. * struct wmi_twt_btwt_remove_sta_complete_event_param -
  743. * @vdev_id: VDEV identifier
  744. * @peer_macaddr: Peer mac address
  745. * @dialog_id: BTWT dialog ID
  746. * @status: refer to WMI_HOST_KICKOFF_TWT_BTWT_STATUS
  747. */
  748. struct wmi_twt_btwt_remove_sta_complete_event_param {
  749. uint32_t vdev_id;
  750. uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
  751. uint32_t dialog_id;
  752. uint32_t status;
  753. };
  754. #endif
  755. /**
  756. * enum WMI_HOST_TWT_CMD_FOR_ACK_EVENT - Ack event for different TWT command
  757. * WMI_HOST_TWT_ADD_DIALOG_CMDID: Ack event for add dialog command
  758. * WMI_HOST_TWT_DEL_DIALOG_CMDID: Ack event for delete dialog command
  759. * WMI_HOST_TWT_PAUSE_DIALOG_CMDID: Ack event for pause command
  760. * WMI_HOST_TWT_RESUME_DIALOG_CMDID: Ack event for resume command
  761. * WMI_HOST_TWT_NUDGE_DIALOG_CMDID: Ack event for nudge command
  762. * WMI_HOST_TWT_UNKNOWN_CMDID: Ack event for unknown TWT command
  763. */
  764. enum WMI_HOST_TWT_CMD_FOR_ACK_EVENT {
  765. WMI_HOST_TWT_ADD_DIALOG_CMDID = 0,
  766. WMI_HOST_TWT_DEL_DIALOG_CMDID,
  767. WMI_HOST_TWT_PAUSE_DIALOG_CMDID,
  768. WMI_HOST_TWT_RESUME_DIALOG_CMDID,
  769. WMI_HOST_TWT_NUDGE_DIALOG_CMDID,
  770. WMI_HOST_TWT_UNKNOWN_CMDID,
  771. };
  772. #endif /* _WMI_UNIFIED_TWT_PARAM_H_ */