wlan_mlo_t2lm.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. /*
  2. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: contains T2LM APIs
  18. */
  19. #ifndef _WLAN_MLO_T2LM_H_
  20. #define _WLAN_MLO_T2LM_H_
  21. #include <wlan_cmn_ieee80211.h>
  22. #include <wlan_mlo_mgr_public_structs.h>
  23. struct mlo_vdev_host_tid_to_link_map_resp;
  24. struct wlan_mlo_dev_context;
  25. /* Max T2LM TIDS count */
  26. #define T2LM_MAX_NUM_TIDS 8
  27. /* Max T2LM callback handlers */
  28. #define MAX_T2LM_HANDLERS 50
  29. #define T2LM_EXPECTED_DURATION_MAX_VALUE 0xFFFFFF
  30. /**
  31. * enum wlan_t2lm_direction - Indicates the direction for which TID-to-link
  32. * mapping is available.
  33. *
  34. * @WLAN_T2LM_DL_DIRECTION: Downlink
  35. * @WLAN_T2LM_UL_DIRECTION: Uplink
  36. * @WLAN_T2LM_BIDI_DIRECTION: Both downlink and uplink
  37. * @WLAN_T2LM_MAX_DIRECTION: Max direction, this is used only internally
  38. * @WLAN_T2LM_INVALID_DIRECTION: Invalid, this is used only internally to check
  39. * if the mapping present in wlan_t2lm_info
  40. * structure is valid or not.
  41. */
  42. enum wlan_t2lm_direction {
  43. WLAN_T2LM_DL_DIRECTION,
  44. WLAN_T2LM_UL_DIRECTION,
  45. WLAN_T2LM_BIDI_DIRECTION,
  46. WLAN_T2LM_MAX_DIRECTION,
  47. WLAN_T2LM_INVALID_DIRECTION,
  48. };
  49. /**
  50. * struct wlan_t2lm_info - TID-to-Link mapping information for the frames
  51. * transmitted on the uplink, downlink and bidirectional.
  52. *
  53. * @direction: 0 - Downlink, 1 - uplink 2 - Both uplink and downlink
  54. * @default_link_mapping: value 1 indicates the default T2LM, where all the TIDs
  55. * are mapped to all the links.
  56. * value 0 indicates the preferred T2LM mapping
  57. * @mapping_switch_time_present: Indicates if mapping switch time field present
  58. * in the T2LM IE
  59. * @expected_duration_present: Indicates if expected duration present in the
  60. * T2LM IE
  61. * @mapping_switch_time: Mapping switch time of this T2LM IE
  62. * @expected_duration: Expected duration of this T2LM IE
  63. * @ieee_link_map_tid: Indicates ieee link id mapping of all the TIDS
  64. * @hw_link_map_tid: Indicates hw link id mapping of all the TIDS
  65. * @timer_started: flag to check if T2LM timer is started for this T2LM IE
  66. */
  67. struct wlan_t2lm_info {
  68. enum wlan_t2lm_direction direction;
  69. bool default_link_mapping;
  70. bool mapping_switch_time_present;
  71. bool expected_duration_present;
  72. uint16_t mapping_switch_time;
  73. uint32_t expected_duration;
  74. uint16_t ieee_link_map_tid[T2LM_MAX_NUM_TIDS];
  75. uint16_t hw_link_map_tid[T2LM_MAX_NUM_TIDS];
  76. bool timer_started;
  77. };
  78. /**
  79. * enum wlan_t2lm_category - T2LM category
  80. *
  81. * @WLAN_T2LM_CATEGORY_NONE: none
  82. * @WLAN_T2LM_CATEGORY_REQUEST: T2LM request
  83. * @WLAN_T2LM_CATEGORY_RESPONSE: T2LM response
  84. * @WLAN_T2LM_CATEGORY_TEARDOWN: T2LM teardown
  85. * @WLAN_T2LM_CATEGORY_INVALID: Invalid
  86. */
  87. enum wlan_t2lm_category {
  88. WLAN_T2LM_CATEGORY_NONE = 0,
  89. WLAN_T2LM_CATEGORY_REQUEST = 1,
  90. WLAN_T2LM_CATEGORY_RESPONSE = 2,
  91. WLAN_T2LM_CATEGORY_TEARDOWN = 3,
  92. WLAN_T2LM_CATEGORY_INVALID,
  93. };
  94. /**
  95. * enum wlan_t2lm_tx_status - Status code applicable for the T2LM frames
  96. * transmitted by the current peer.
  97. *
  98. * @WLAN_T2LM_TX_STATUS_NONE: Status code is not applicable
  99. * @WLAN_T2LM_TX_STATUS_SUCCESS: AP/STA successfully transmitted the T2LM frame
  100. * @WLAN_T2LM_TX_STATUS_FAILURE: Tx failure received from the FW.
  101. * @WLAN_T2LM_TX_STATUS_RX_TIMEOUT: T2LM response frame not received from the
  102. * peer for the transmitted T2LM request frame.
  103. * @WLAN_T2LM_TX_STATUS_INVALID: Invalid status code
  104. */
  105. enum wlan_t2lm_tx_status {
  106. WLAN_T2LM_TX_STATUS_NONE = 0,
  107. WLAN_T2LM_TX_STATUS_SUCCESS = 1,
  108. WLAN_T2LM_TX_STATUS_FAILURE = 2,
  109. WLAN_T2LM_TX_STATUS_RX_TIMEOUT = 3,
  110. WLAN_T2LM_TX_STATUS_INVALID,
  111. };
  112. /**
  113. * enum wlan_t2lm_resp_frm_type - T2LM status corresponds to T2LM response frame
  114. *
  115. * @WLAN_T2LM_RESP_TYPE_SUCCESS: T2LM mapping provided in the T2LM request is
  116. * accepted either by the AP or STA
  117. * @WLAN_T2LM_RESP_TYPE_DENIED_TID_TO_LINK_MAPPING: T2LM Request denied because
  118. * the requested TID-to-link mapping is unacceptable.
  119. * @WLAN_T2LM_RESP_TYPE_PREFERRED_TID_TO_LINK_MAPPING: T2LM Request rejected and
  120. * preferred TID-to-link mapping is suggested.
  121. * @WLAN_T2LM_RESP_TYPE_INVALID: Status code is not applicable.
  122. */
  123. enum wlan_t2lm_resp_frm_type {
  124. WLAN_T2LM_RESP_TYPE_SUCCESS = 0,
  125. WLAN_T2LM_RESP_TYPE_DENIED_TID_TO_LINK_MAPPING = 133,
  126. WLAN_T2LM_RESP_TYPE_PREFERRED_TID_TO_LINK_MAPPING = 134,
  127. WLAN_T2LM_RESP_TYPE_INVALID,
  128. };
  129. /**
  130. * enum wlan_t2lm_enable - TID-to-link negotiation supported by the mlo peer
  131. *
  132. * @WLAN_T2LM_NOT_SUPPORTED: T2LM is not supported by the MLD
  133. * @WLAN_T2LM_MAP_ALL_TIDS_TO_SAME_LINK_SET: MLD only supports the mapping of
  134. * all TIDs to the same link set.
  135. * @WLAN_T2LM_MAP_RESERVED: reserved value
  136. * @WLAN_T2LM_MAP_EACH_TID_TO_SAME_OR_DIFFERENET_LINK_SET: MLD supports the
  137. * mapping of each TID to the same or different link set (Disjoint mapping).
  138. * @WLAN_T2LM_ENABLE_INVALID: invalid
  139. */
  140. enum wlan_t2lm_enable {
  141. WLAN_T2LM_NOT_SUPPORTED = 0,
  142. WLAN_T2LM_MAP_ALL_TIDS_TO_SAME_LINK_SET = 1,
  143. WLAN_T2LM_MAP_RESERVED = 2,
  144. WLAN_T2LM_MAP_EACH_TID_TO_SAME_OR_DIFFERENET_LINK_SET = 3,
  145. WLAN_T2LM_ENABLE_INVALID,
  146. };
  147. /**
  148. * struct wlan_prev_t2lm_negotiated_info - Previous successful T2LM negotiation
  149. * is saved here.
  150. *
  151. * @dialog_token: Save the dialog token used in T2LM request and response frame.
  152. * @t2lm_info: Provides the TID to LINK mapping information
  153. */
  154. struct wlan_prev_t2lm_negotiated_info {
  155. uint16_t dialog_token;
  156. struct wlan_t2lm_info t2lm_info[WLAN_T2LM_MAX_DIRECTION];
  157. };
  158. /**
  159. * struct wlan_t2lm_onging_negotiation_info - Current ongoing T2LM negotiation
  160. * (information about transmitted T2LM request/response frame)
  161. *
  162. * @category: T2LM category as T2LM request frame
  163. * @dialog_token: Save the dialog token used in T2LM request and response frame.
  164. * @t2lm_info: Provides the TID-to-link mapping info for UL/DL/BiDi
  165. * @t2lm_tx_status: Status code corresponds to the transmitted T2LM frames
  166. * @t2lm_resp_type: T2LM status corresponds to T2LM response frame.
  167. */
  168. struct wlan_t2lm_onging_negotiation_info {
  169. enum wlan_t2lm_category category;
  170. uint8_t dialog_token;
  171. struct wlan_t2lm_info t2lm_info[WLAN_T2LM_MAX_DIRECTION];
  172. enum wlan_t2lm_tx_status t2lm_tx_status;
  173. enum wlan_t2lm_resp_frm_type t2lm_resp_type;
  174. };
  175. /**
  176. * struct wlan_mlo_peer_t2lm_policy - TID-to-link mapping information
  177. *
  178. * @self_gen_dialog_token: self generated dialog token used to send T2LM request
  179. * frame;
  180. * @t2lm_enable_val: TID-to-link enable value supported by this peer.
  181. * @t2lm_negotiated_info: Previous successful T2LM negotiation is saved here.
  182. * @ongoing_tid_to_link_mapping: This has the ongoing TID-to-link mapping info
  183. * transmitted by this peer to the connected peer.
  184. */
  185. struct wlan_mlo_peer_t2lm_policy {
  186. uint8_t self_gen_dialog_token;
  187. enum wlan_t2lm_enable t2lm_enable_val;
  188. struct wlan_prev_t2lm_negotiated_info t2lm_negotiated_info;
  189. struct wlan_t2lm_onging_negotiation_info ongoing_tid_to_link_mapping;
  190. };
  191. /**
  192. * struct wlan_mlo_t2lm_ie - T2LM information
  193. *
  194. * @disabled_link_bitmap: Bitmap of disabled links. This is used to update the
  195. * disabled link field of RNR IE
  196. * @t2lm: T2LM info structure
  197. */
  198. struct wlan_mlo_t2lm_ie {
  199. uint16_t disabled_link_bitmap;
  200. struct wlan_t2lm_info t2lm;
  201. };
  202. /*
  203. * In a beacon or probe response frame, at max two T2LM IEs can be present
  204. * first one to represent the already existing mapping and the other one
  205. * represents the new T2LM mapping that is yet to establish.
  206. */
  207. #define WLAN_MAX_T2LM_IE 2
  208. /**
  209. * struct wlan_t2lm_timer - T2LM timer information
  210. *
  211. * @t2lm_timer: T2LM timer
  212. * @timer_interval: T2LM Timer value
  213. * @timer_started: T2LM timer started or not
  214. * @t2lm_ie_index: T2LM IE index value
  215. * @t2lm_dev_lock: lock to access struct
  216. */
  217. struct wlan_t2lm_timer {
  218. qdf_timer_t t2lm_timer;
  219. uint32_t timer_interval;
  220. bool timer_started;
  221. uint8_t t2lm_ie_index;
  222. #ifdef WLAN_MLO_USE_SPINLOCK
  223. qdf_spinlock_t t2lm_dev_lock;
  224. #else
  225. qdf_mutex_t t2lm_dev_lock;
  226. #endif
  227. };
  228. struct wlan_mlo_dev_context;
  229. /**
  230. * typedef wlan_mlo_t2lm_link_update_handler - T2LM handler API to notify the
  231. * link update.
  232. * @mldev: Pointer to mlo_dev_context
  233. * @arg: ieee_link_map
  234. *
  235. * Return: QDF_STATUS
  236. */
  237. typedef QDF_STATUS (*wlan_mlo_t2lm_link_update_handler)(
  238. struct wlan_mlo_dev_context *mldev, void *arg);
  239. /**
  240. * struct wlan_t2lm_context - T2LM IE information
  241. *
  242. * @num_of_t2lm_ie: Number of T2LM IE
  243. * @t2lm_ie: T2LM IE information
  244. * @t2lm_timer: T2LM timer information
  245. * @t2lm_dev_lock: t2lm dev context lock
  246. * @tsf: time sync func value received via beacon
  247. * @link_update_handler: handler to update T2LM link
  248. * @is_valid_handler: T2LM handler is valid or not
  249. */
  250. struct wlan_t2lm_context {
  251. uint8_t num_of_t2lm_ie;
  252. struct wlan_mlo_t2lm_ie t2lm_ie[WLAN_MAX_T2LM_IE];
  253. struct wlan_t2lm_timer t2lm_timer;
  254. #ifdef WLAN_MLO_USE_SPINLOCK
  255. qdf_spinlock_t t2lm_dev_lock;
  256. #else
  257. qdf_mutex_t t2lm_dev_lock;
  258. #endif
  259. uint64_t tsf;
  260. wlan_mlo_t2lm_link_update_handler
  261. link_update_handler[MAX_T2LM_HANDLERS];
  262. bool is_valid_handler[MAX_T2LM_HANDLERS];
  263. };
  264. #ifdef WLAN_FEATURE_11BE
  265. #define t2lm_alert(format, args...) \
  266. QDF_TRACE_FATAL(QDF_MODULE_ID_T2LM, format, ## args)
  267. #define t2lm_err(format, args...) \
  268. QDF_TRACE_ERROR(QDF_MODULE_ID_T2LM, format, ## args)
  269. #define t2lm_warn(format, args...) \
  270. QDF_TRACE_WARN(QDF_MODULE_ID_T2LM, format, ## args)
  271. #define t2lm_info(format, args...) \
  272. QDF_TRACE_INFO(QDF_MODULE_ID_T2LM, format, ## args)
  273. #define t2lm_debug(format, args...) \
  274. QDF_TRACE_DEBUG(QDF_MODULE_ID_T2LM, format, ## args)
  275. #define t2lm_rl_debug(format, args...) \
  276. QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_T2LM, format, ## args)
  277. #define WLAN_T2LM_MAX_NUM_LINKS 16
  278. #ifdef WLAN_MLO_USE_SPINLOCK
  279. /**
  280. * t2lm_dev_lock_create - Create T2LM device mutex/spinlock
  281. * @t2lm_ctx: T2LM context
  282. *
  283. * Creates mutex/spinlock
  284. *
  285. * Return: void
  286. */
  287. static inline void
  288. t2lm_dev_lock_create(struct wlan_t2lm_context *t2lm_ctx)
  289. {
  290. qdf_spinlock_create(&t2lm_ctx->t2lm_dev_lock);
  291. }
  292. /**
  293. * t2lm_dev_lock_destroy - Destroy T2LM mutex/spinlock
  294. * @t2lm_ctx: T2LM context
  295. *
  296. * Destroy mutex/spinlock
  297. *
  298. * Return: void
  299. */
  300. static inline void
  301. t2lm_dev_lock_destroy(struct wlan_t2lm_context *t2lm_ctx)
  302. {
  303. qdf_spinlock_destroy(&t2lm_ctx->t2lm_dev_lock);
  304. }
  305. /**
  306. * t2lm_dev_lock_acquire - acquire T2LM mutex/spinlock
  307. * @t2lm_ctx: T2LM context
  308. *
  309. * acquire mutex/spinlock
  310. *
  311. * return: void
  312. */
  313. static inline
  314. void t2lm_dev_lock_acquire(struct wlan_t2lm_context *t2lm_ctx)
  315. {
  316. qdf_spin_lock_bh(&t2lm_ctx->t2lm_dev_lock);
  317. }
  318. /**
  319. * t2lm_dev_lock_release - release T2LM dev mutex/spinlock
  320. * @t2lm_ctx: T2LM context
  321. *
  322. * release mutex/spinlock
  323. *
  324. * return: void
  325. */
  326. static inline
  327. void t2lm_dev_lock_release(struct wlan_t2lm_context *t2lm_ctx)
  328. {
  329. qdf_spin_unlock_bh(&t2lm_ctx->t2lm_dev_lock);
  330. }
  331. #else /* WLAN_MLO_USE_SPINLOCK */
  332. static inline
  333. void t2lm_dev_lock_create(struct wlan_t2lm_context *t2lm_ctx)
  334. {
  335. qdf_mutex_create(&t2lm_ctx->t2lm_dev_lock);
  336. }
  337. static inline
  338. void t2lm_dev_lock_destroy(struct wlan_t2lm_context *t2lm_ctx)
  339. {
  340. qdf_mutex_destroy(&t2lm_ctx->t2lm_dev_lock);
  341. }
  342. static inline void t2lm_dev_lock_acquire(struct wlan_t2lm_context *t2lm_ctx)
  343. {
  344. qdf_mutex_acquire(&t2lm_ctx->t2lm_dev_lock);
  345. }
  346. static inline void t2lm_dev_lock_release(struct wlan_t2lm_context *t2lm_ctx)
  347. {
  348. qdf_mutex_release(&t2lm_ctx->t2lm_dev_lock);
  349. }
  350. #endif
  351. /**
  352. * wlan_register_t2lm_link_update_notify_handler() - API to register the
  353. * handlers to receive link update notification
  354. * @handler: handler for T2LM link update
  355. * @mldev: Pointer to mlo context
  356. *
  357. * Return: Index on which handler is registered
  358. */
  359. int wlan_register_t2lm_link_update_notify_handler(
  360. wlan_mlo_t2lm_link_update_handler handler,
  361. struct wlan_mlo_dev_context *mldev);
  362. /**
  363. * wlan_unregister_t2lm_link_update_notify_handler() - API to unregister the
  364. * T2LM related handlers
  365. * @mldev: Pointer to mlo context
  366. * @index: Index on which the handler was registered
  367. *
  368. * Return: None
  369. */
  370. void wlan_unregister_t2lm_link_update_notify_handler(
  371. struct wlan_mlo_dev_context *mldev, uint8_t index);
  372. /**
  373. * wlan_mlo_dev_t2lm_notify_link_update() - API to call the registered handlers
  374. * when there is a link update happens using T2LM
  375. * @mldev: Pointer to mlo context
  376. *
  377. * Return: QDF_STATUS
  378. */
  379. QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update(
  380. struct wlan_mlo_dev_context *mldev);
  381. /**
  382. * wlan_mlo_parse_t2lm_ie() - API to parse the T2LM IE
  383. * @t2lm: Pointer to T2LM structure
  384. * @ie: Pointer to T2LM IE
  385. *
  386. * Return: QDF_STATUS
  387. */
  388. QDF_STATUS wlan_mlo_parse_t2lm_ie(
  389. struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie);
  390. /**
  391. * wlan_mlo_add_t2lm_ie() - API to add TID-to-link mapping IE
  392. * @frm: Pointer to buffer
  393. * @t2lm: Pointer to t2lm mapping structure
  394. *
  395. * Return: Updated frame pointer
  396. */
  397. uint8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
  398. struct wlan_t2lm_onging_negotiation_info *t2lm);
  399. /**
  400. * wlan_mlo_vdev_tid_to_link_map_event() - API to process the revceived T2LM
  401. * event.
  402. * @psoc: psoc object
  403. * @event: Pointer to received T2LM info
  404. *
  405. * Return: QDF_STATUS
  406. */
  407. QDF_STATUS wlan_mlo_vdev_tid_to_link_map_event(
  408. struct wlan_objmgr_psoc *psoc,
  409. struct mlo_vdev_host_tid_to_link_map_resp *event);
  410. /**
  411. * wlan_mlo_parse_t2lm_action_frame() - API to parse T2LM action frame
  412. * @t2lm: Pointer to T2LM structure
  413. * @action_frm: Pointer to action frame
  414. * @category: T2LM action frame category
  415. *
  416. * Return: 0 - success, else failure
  417. */
  418. int wlan_mlo_parse_t2lm_action_frame(
  419. struct wlan_t2lm_onging_negotiation_info *t2lm,
  420. struct wlan_action_frame *action_frm,
  421. enum wlan_t2lm_category category);
  422. /**
  423. * wlan_mlo_add_t2lm_action_frame() - API to add T2LM action frame
  424. * @frm: Pointer to a frame to add T2LM IE
  425. * @args: T2LM action frame related info
  426. * @buf: Pointer to T2LM IE values
  427. * @category: T2LM action frame category
  428. *
  429. * Return: Pointer to the updated frame buffer
  430. */
  431. uint8_t *wlan_mlo_add_t2lm_action_frame(
  432. uint8_t *frm, struct wlan_action_frame_args *args,
  433. uint8_t *buf, enum wlan_t2lm_category category);
  434. /**
  435. * wlan_mlo_parse_bcn_prbresp_t2lm_ie() - API to parse the T2LM IE from beacon/
  436. * probe response frame
  437. * @t2lm_ctx: T2LM context
  438. * @ie: Pointer to T2LM IE
  439. *
  440. * Return: QDF_STATUS
  441. */
  442. QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
  443. struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie);
  444. /**
  445. * wlan_mlo_add_t2lm_info_ie() - Add T2LM IE for UL/DL/Bidirection
  446. * @frm: Pointer to buffer
  447. * @t2lm: Pointer to t2lm mapping structure
  448. *
  449. * Return: Updated frame pointer
  450. */
  451. uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm);
  452. /**
  453. * wlan_mlo_t2lm_timer_init() - API to initialize t2lm timer
  454. * @vdev: Pointer to vdev
  455. *
  456. * Return: qdf status
  457. */
  458. QDF_STATUS
  459. wlan_mlo_t2lm_timer_init(struct wlan_objmgr_vdev *vdev);
  460. /**
  461. * wlan_mlo_t2lm_timer_deinit() - API to deinit t2lm timer
  462. * @vdev: Pointer to vdev
  463. *
  464. * Return: qdf status
  465. */
  466. QDF_STATUS
  467. wlan_mlo_t2lm_timer_deinit(struct wlan_objmgr_vdev *vdev);
  468. /**
  469. * wlan_mlo_t2lm_timer_start() - API to start T2LM timer
  470. * @vdev: Pointer to vdev
  471. * @interval: T2LM timer interval
  472. * @t2lm_ie_index: T2LM IE index
  473. *
  474. * Return: qdf status
  475. */
  476. QDF_STATUS
  477. wlan_mlo_t2lm_timer_start(struct wlan_objmgr_vdev *vdev,
  478. uint32_t interval, uint8_t t2lm_ie_index);
  479. /**
  480. * wlan_mlo_t2lm_timer_stop() - API to stop TID-to-link mapping timer
  481. * @vdev: Pointer to vdev
  482. *
  483. * Return: qdf status
  484. */
  485. QDF_STATUS
  486. wlan_mlo_t2lm_timer_stop(struct wlan_objmgr_vdev *vdev);
  487. /**
  488. * wlan_mlo_t2lm_timer_expiry_handler() - API to handle t2lm timer expiry
  489. * @vdev: Pointer to vdev structure
  490. *
  491. * Return: none
  492. */
  493. void
  494. wlan_mlo_t2lm_timer_expiry_handler(void *vdev);
  495. /**
  496. * wlan_handle_t2lm_timer() - API to handle TID-to-link mapping timer
  497. * @vdev: Pointer to vdev
  498. * @ie_idx: ie index value
  499. *
  500. * Return: qdf status
  501. */
  502. QDF_STATUS
  503. wlan_handle_t2lm_timer(struct wlan_objmgr_vdev *vdev, uint8_t ie_idx);
  504. /**
  505. * wlan_process_bcn_prbrsp_t2lm_ie() - API to process the received T2LM IE from
  506. * beacon/probe response.
  507. * @vdev: Pointer to vdev
  508. * @rx_t2lm_ie: Received T2LM IE
  509. * @tsf: Local TSF value
  510. *
  511. * Return QDF_STATUS
  512. */
  513. QDF_STATUS wlan_process_bcn_prbrsp_t2lm_ie(struct wlan_objmgr_vdev *vdev,
  514. struct wlan_t2lm_context *rx_t2lm_ie,
  515. uint64_t tsf);
  516. #else
  517. static inline QDF_STATUS wlan_mlo_parse_t2lm_ie(
  518. struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie)
  519. {
  520. return QDF_STATUS_E_FAILURE;
  521. }
  522. static inline
  523. int8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
  524. struct wlan_t2lm_onging_negotiation_info *t2lm)
  525. {
  526. return frm;
  527. }
  528. static inline
  529. int wlan_mlo_parse_t2lm_action_frame(
  530. struct wlan_t2lm_onging_negotiation_info *t2lm,
  531. struct wlan_action_frame *action_frm,
  532. enum wlan_t2lm_category category)
  533. {
  534. return 0;
  535. }
  536. static inline
  537. uint8_t *wlan_mlo_add_t2lm_action_frame(
  538. uint8_t *frm, struct wlan_action_frame_args *args,
  539. uint8_t *buf, enum wlan_t2lm_category category)
  540. {
  541. return frm;
  542. }
  543. static inline
  544. QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
  545. struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie)
  546. {
  547. return QDF_STATUS_E_FAILURE;
  548. }
  549. static inline
  550. uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm)
  551. {
  552. return frm;
  553. }
  554. static inline QDF_STATUS
  555. wlan_mlo_t2lm_timer_init(struct wlan_objmgr_vdev *vdev)
  556. {
  557. return QDF_STATUS_E_NOSUPPORT;
  558. }
  559. static inline QDF_STATUS
  560. wlan_mlo_t2lm_timer_deinit(struct wlan_objmgr_vdev *vdev)
  561. {
  562. return QDF_STATUS_E_NOSUPPORT;
  563. }
  564. static inline QDF_STATUS
  565. wlan_mlo_t2lm_timer_start(struct wlan_objmgr_vdev *vdev,
  566. uint32_t interval, uint8_t t2lm_ie_index)
  567. {
  568. return QDF_STATUS_E_NOSUPPORT;
  569. }
  570. static inline QDF_STATUS
  571. wlan_mlo_t2lm_timer_stop(struct wlan_objmgr_vdev *vdev)
  572. {
  573. return QDF_STATUS_E_NOSUPPORT;
  574. }
  575. static inline void
  576. wlan_mlo_t2lm_timer_expiry_handler(void *vdev)
  577. {}
  578. static inline QDF_STATUS
  579. wlan_handle_t2lm_timer(struct wlan_objmgr_vdev *vdev, uint8_t ie_idx)
  580. {
  581. return QDF_STATUS_E_NOSUPPORT;
  582. }
  583. static inline QDF_STATUS
  584. wlan_process_bcn_prbrsp_t2lm_ie(struct wlan_objmgr_vdev *vdev,
  585. struct wlan_t2lm_context *rx_t2lm_ie,
  586. uint64_t tsf)
  587. {
  588. return QDF_STATUS_SUCCESS;
  589. }
  590. static inline
  591. int wlan_register_t2lm_link_update_notify_handler(
  592. wlan_mlo_t2lm_link_update_handler handler,
  593. struct wlan_mlo_dev_context *mldev)
  594. {
  595. return 0;
  596. }
  597. static inline
  598. void wlan_unregister_t2lm_link_update_notify_handler(
  599. struct wlan_mlo_dev_context *mldev, uint8_t index)
  600. {
  601. }
  602. static inline QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update(
  603. struct wlan_mlo_dev_context *mldev)
  604. {
  605. return QDF_STATUS_SUCCESS;
  606. }
  607. #endif /* WLAN_FEATURE_11BE */
  608. #endif /* _WLAN_MLO_T2LM_H_ */