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