wlan_mlo_t2lm.h 21 KB

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