xref: /wlan-driver/qca-wifi-host-cmn/umac/mlo_mgr/inc/wlan_mlo_t2lm.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for any
5*5113495bSYour Name  * purpose with or without fee is hereby granted, provided that the above
6*5113495bSYour Name  * copyright notice and this permission notice appear in all copies.
7*5113495bSYour Name  *
8*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*5113495bSYour Name  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*5113495bSYour Name  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*5113495bSYour Name  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*5113495bSYour Name  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*5113495bSYour Name  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*5113495bSYour Name  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*5113495bSYour Name  */
16*5113495bSYour Name 
17*5113495bSYour Name /**
18*5113495bSYour Name  * DOC: contains T2LM APIs
19*5113495bSYour Name  */
20*5113495bSYour Name 
21*5113495bSYour Name #ifndef _WLAN_MLO_T2LM_H_
22*5113495bSYour Name #define _WLAN_MLO_T2LM_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include <wlan_cmn_ieee80211.h>
25*5113495bSYour Name #include <wlan_mlo_mgr_public_structs.h>
26*5113495bSYour Name #ifdef WMI_AP_SUPPORT
27*5113495bSYour Name #include <wlan_cmn.h>
28*5113495bSYour Name #endif
29*5113495bSYour Name 
30*5113495bSYour Name struct mlo_vdev_host_tid_to_link_map_resp;
31*5113495bSYour Name struct wlan_mlo_dev_context;
32*5113495bSYour Name 
33*5113495bSYour Name /* Max T2LM TIDS count */
34*5113495bSYour Name #define T2LM_MAX_NUM_TIDS 8
35*5113495bSYour Name 
36*5113495bSYour Name #ifdef WMI_AP_SUPPORT
37*5113495bSYour Name /* Max no. of Preferred links */
38*5113495bSYour Name #define MAX_PREFERRED_LINKS 4
39*5113495bSYour Name #endif
40*5113495bSYour Name 
41*5113495bSYour Name /* Max T2LM callback handlers */
42*5113495bSYour Name #define MAX_T2LM_HANDLERS 50
43*5113495bSYour Name 
44*5113495bSYour Name #define T2LM_EXPECTED_DURATION_MAX_VALUE 0xFFFFFF
45*5113495bSYour Name 
46*5113495bSYour Name /* Mapping switch time represented as bits 10 to 25 of the TSF value */
47*5113495bSYour Name #define WLAN_T2LM_MAPPING_SWITCH_TSF_BITS 0x3FFFC00
48*5113495bSYour Name 
49*5113495bSYour Name /* There is a delay involved to receive and process the beacon/probe response
50*5113495bSYour Name  * T2LM IE from AP. To match mapping switch timer expiry in both AP and STA,
51*5113495bSYour Name  * advance timer expiry in STA by 100ms (= 98 * 1024 / 1000 = 100).
52*5113495bSYour Name  */
53*5113495bSYour Name #define WLAN_T2LM_MAPPING_SWITCH_TIME_DELAY 98
54*5113495bSYour Name 
55*5113495bSYour Name /**
56*5113495bSYour Name  * enum wlan_t2lm_direction - Indicates the direction for which TID-to-link
57*5113495bSYour Name  * mapping is available.
58*5113495bSYour Name  *
59*5113495bSYour Name  * @WLAN_T2LM_DL_DIRECTION: Downlink
60*5113495bSYour Name  * @WLAN_T2LM_UL_DIRECTION: Uplink
61*5113495bSYour Name  * @WLAN_T2LM_BIDI_DIRECTION: Both downlink and uplink
62*5113495bSYour Name  * @WLAN_T2LM_MAX_DIRECTION: Max direction, this is used only internally
63*5113495bSYour Name  * @WLAN_T2LM_INVALID_DIRECTION: Invalid, this is used only internally to check
64*5113495bSYour Name  *                               if the mapping present in wlan_t2lm_info
65*5113495bSYour Name  *                               structure is valid or not.
66*5113495bSYour Name  */
67*5113495bSYour Name enum wlan_t2lm_direction {
68*5113495bSYour Name 	WLAN_T2LM_DL_DIRECTION,
69*5113495bSYour Name 	WLAN_T2LM_UL_DIRECTION,
70*5113495bSYour Name 	WLAN_T2LM_BIDI_DIRECTION,
71*5113495bSYour Name 	WLAN_T2LM_MAX_DIRECTION,
72*5113495bSYour Name 	WLAN_T2LM_INVALID_DIRECTION,
73*5113495bSYour Name };
74*5113495bSYour Name 
75*5113495bSYour Name #ifdef WMI_AP_SUPPORT
76*5113495bSYour Name /**
77*5113495bSYour Name  * enum wlan_link_band_caps - Represents the band capability of
78*5113495bSYour Name  * a link.
79*5113495bSYour Name  *
80*5113495bSYour Name  * @WLAN_LINK_BAND_INVALID: Invalid band
81*5113495bSYour Name  * @WLAN_LINK_BAND_2GHZ: 2GHz link
82*5113495bSYour Name  * @WLAN_LINK_BAND_5GHZ: 5GHz link
83*5113495bSYour Name  * @WLAN_LINK_BAND_5GHZ_LOW: 5GHz Low band link
84*5113495bSYour Name  * @WLAN_LINK_BAND_5GHZ_HIGH: 5GHz High band link
85*5113495bSYour Name  * @WLAN_LINK_BAND_6GHZ: 6GHz link
86*5113495bSYour Name  * @WLAN_LINK_BAND_6GHZ_LOW: 6GHz Low band link
87*5113495bSYour Name  * @WLAN_LINK_BAND_6GHZ_HIGH: 6GHz High band link
88*5113495bSYour Name  */
89*5113495bSYour Name enum wlan_link_band_caps {
90*5113495bSYour Name 	WLAN_LINK_BAND_INVALID = 0,
91*5113495bSYour Name 	WLAN_LINK_BAND_2GHZ = 1,
92*5113495bSYour Name 	WLAN_LINK_BAND_5GHZ = 2,
93*5113495bSYour Name 	WLAN_LINK_BAND_5GHZ_LOW = 3,
94*5113495bSYour Name 	WLAN_LINK_BAND_5GHZ_HIGH = 4,
95*5113495bSYour Name 	WLAN_LINK_BAND_6GHZ = 5,
96*5113495bSYour Name 	WLAN_LINK_BAND_6GHZ_LOW = 6,
97*5113495bSYour Name 	WLAN_LINK_BAND_6GHZ_HIGH = 7,
98*5113495bSYour Name };
99*5113495bSYour Name 
100*5113495bSYour Name /**
101*5113495bSYour Name  * struct wlan_link_preference - Preferred link structure
102*5113495bSYour Name  * @num_pref_links: non-zero values indicate that preferred link order
103*5113495bSYour Name  * is present.
104*5113495bSYour Name  * @pref_order: Preferred links in order.it is in form of hardware link id.
105*5113495bSYour Name  * @timeout: timeout values for all the access categories.
106*5113495bSYour Name  * @tlt_characterization_params: Bitmask to select Tx-Link Tuple from ordered
107*5113495bSYour Name  *  list.
108*5113495bSYour Name  *  Bit 0-15: Each bit maps to the corresponding Link ID
109*5113495bSYour Name  *  Bit 16-31: Reserved
110*5113495bSYour Name  * @qualifier_flags: u32 flags to check that link order is
111*5113495bSYour Name  * for TLT or link preference. Bit definition for the flags.
112*5113495bSYour Name  * Bit 0: TLT bit
113*5113495bSYour Name  * Bit 1: Preferred Link bit
114*5113495bSYour Name  * Bit 2-31: Reserved
115*5113495bSYour Name  */
116*5113495bSYour Name struct wlan_link_preference {
117*5113495bSYour Name 	uint8_t num_pref_links;
118*5113495bSYour Name 	uint8_t pref_order[MAX_PREFERRED_LINKS];
119*5113495bSYour Name 	uint32_t timeout[WIFI_AC_MAX];
120*5113495bSYour Name 	uint32_t tlt_characterization_params;
121*5113495bSYour Name 	uint32_t qualifier_flags;
122*5113495bSYour Name };
123*5113495bSYour Name 
124*5113495bSYour Name /**
125*5113495bSYour Name  * struct wlan_t2lm_of_tids - TID-to-link mapping for a given direction
126*5113495bSYour Name  * @direction: direction from 'enum wlan_t2lm_direction'
127*5113495bSYour Name  * @t2lm_provisioned_links: Link mapping for all the TIDs. Represented as
128*5113495bSYour Name  *                          bitmap of type wlan_link_band_caps enum.
129*5113495bSYour Name  */
130*5113495bSYour Name struct wlan_t2lm_of_tids {
131*5113495bSYour Name 	enum wlan_t2lm_direction direction;
132*5113495bSYour Name 	uint16_t t2lm_provisioned_links[T2LM_MAX_NUM_TIDS];
133*5113495bSYour Name };
134*5113495bSYour Name 
135*5113495bSYour Name /**
136*5113495bSYour Name  * struct wlan_preferred_links - Preferred link structure
137*5113495bSYour Name  * @peer_mld_mac_addr: STA MLD macaddr
138*5113495bSYour Name  * @num_t2lm_of_tids: non-zero value indicates that this structure is
139*5113495bSYour Name  * carrying the TID-to-link mapping.It indicates for how many directions,
140*5113495bSYour Name  * the TID-to-link mapping is present.
141*5113495bSYour Name  * @homogeneous_mapping: non-zero value indicates the provided mapping
142*5113495bSYour Name  * is homogeneous.
143*5113495bSYour Name  * @t2lm: Valid TID-to-link mapping for the directions
144*5113495bSYour Name  * @num_pref_links: non-zero values indicate that preferred link order is
145*5113495bSYour Name  * present.
146*5113495bSYour Name  * @preffered_link_order: Preferred links in order.
147*5113495bSYour Name  * The links will be represented interms of wlan_link_band_caps enum.
148*5113495bSYour Name  * @timeout: Timeout values for all the access categories.
149*5113495bSYour Name  */
150*5113495bSYour Name struct wlan_preferred_links {
151*5113495bSYour Name 	uint8_t peer_mld_mac_addr[6];
152*5113495bSYour Name 	uint8_t num_t2lm_of_tids;
153*5113495bSYour Name 	int8_t homogeneous_mapping;
154*5113495bSYour Name 	struct wlan_t2lm_of_tids t2lm[WLAN_T2LM_MAX_DIRECTION];
155*5113495bSYour Name 	uint8_t num_pref_links;
156*5113495bSYour Name 	enum wlan_link_band_caps preffered_link_order[MAX_PREFERRED_LINKS];
157*5113495bSYour Name 	uint32_t timeout[WIFI_AC_MAX];
158*5113495bSYour Name };
159*5113495bSYour Name #endif
160*5113495bSYour Name 
161*5113495bSYour Name /**
162*5113495bSYour Name  * struct wlan_t2lm_info - TID-to-Link mapping information for the frames
163*5113495bSYour Name  * transmitted on the uplink, downlink and bidirectional.
164*5113495bSYour Name  *
165*5113495bSYour Name  * @direction:  0 - Downlink, 1 - uplink 2 - Both uplink and downlink
166*5113495bSYour Name  * @default_link_mapping: value 1 indicates the default T2LM, where all the TIDs
167*5113495bSYour Name  *                        are mapped to all the links.
168*5113495bSYour Name  *                        value 0 indicates the preferred T2LM mapping
169*5113495bSYour Name  * @mapping_switch_time_present: Indicates if mapping switch time field present
170*5113495bSYour Name  *                               in the T2LM IE
171*5113495bSYour Name  * @expected_duration_present: Indicates if expected duration present in the
172*5113495bSYour Name  *                             T2LM IE
173*5113495bSYour Name  * @mapping_switch_time: Mapping switch time of this T2LM IE
174*5113495bSYour Name  * @expected_duration: Expected duration of this T2LM IE
175*5113495bSYour Name  * @ieee_link_map_tid: Indicates ieee link id mapping of all the TIDS
176*5113495bSYour Name  * @hw_link_map_tid: Indicates hw link id mapping of all the TIDS
177*5113495bSYour Name  * @timer_started: flag to check if T2LM timer is started for this T2LM IE
178*5113495bSYour Name  * @link_mapping_size: value 1 indicates the length of Link Mapping Of TIDn
179*5113495bSYour Name  *                     field is 1 octet, value 0 indicates the length of the
180*5113495bSYour Name  *                     Link Mapping of TIDn field is 2 octets
181*5113495bSYour Name  */
182*5113495bSYour Name struct wlan_t2lm_info {
183*5113495bSYour Name 	enum wlan_t2lm_direction direction;
184*5113495bSYour Name 	bool default_link_mapping;
185*5113495bSYour Name 	bool mapping_switch_time_present;
186*5113495bSYour Name 	bool expected_duration_present;
187*5113495bSYour Name 	uint16_t mapping_switch_time;
188*5113495bSYour Name 	uint32_t expected_duration;
189*5113495bSYour Name 	uint16_t ieee_link_map_tid[T2LM_MAX_NUM_TIDS];
190*5113495bSYour Name 	uint16_t hw_link_map_tid[T2LM_MAX_NUM_TIDS];
191*5113495bSYour Name 	bool timer_started;
192*5113495bSYour Name 	bool link_mapping_size;
193*5113495bSYour Name };
194*5113495bSYour Name 
195*5113495bSYour Name /**
196*5113495bSYour Name  * enum wlan_t2lm_category - T2LM category
197*5113495bSYour Name  *
198*5113495bSYour Name  * @WLAN_T2LM_CATEGORY_NONE: none
199*5113495bSYour Name  * @WLAN_T2LM_CATEGORY_REQUEST: T2LM request
200*5113495bSYour Name  * @WLAN_T2LM_CATEGORY_RESPONSE: T2LM response
201*5113495bSYour Name  * @WLAN_T2LM_CATEGORY_TEARDOWN: T2LM teardown
202*5113495bSYour Name  * @WLAN_T2LM_CATEGORY_INVALID: Invalid
203*5113495bSYour Name  */
204*5113495bSYour Name enum wlan_t2lm_category {
205*5113495bSYour Name 	WLAN_T2LM_CATEGORY_NONE = 0,
206*5113495bSYour Name 	WLAN_T2LM_CATEGORY_REQUEST = 1,
207*5113495bSYour Name 	WLAN_T2LM_CATEGORY_RESPONSE = 2,
208*5113495bSYour Name 	WLAN_T2LM_CATEGORY_TEARDOWN = 3,
209*5113495bSYour Name 	WLAN_T2LM_CATEGORY_INVALID,
210*5113495bSYour Name };
211*5113495bSYour Name 
212*5113495bSYour Name /**
213*5113495bSYour Name  * enum wlan_t2lm_tx_status - Status code applicable for the T2LM frames
214*5113495bSYour Name  * transmitted by the current peer.
215*5113495bSYour Name  *
216*5113495bSYour Name  * @WLAN_T2LM_TX_STATUS_NONE: Status code is not applicable
217*5113495bSYour Name  * @WLAN_T2LM_TX_STATUS_SUCCESS: AP/STA successfully transmitted the T2LM frame
218*5113495bSYour Name  * @WLAN_T2LM_TX_STATUS_FAILURE: Tx failure received from the FW.
219*5113495bSYour Name  * @WLAN_T2LM_TX_STATUS_RX_TIMEOUT: T2LM response frame not received from the
220*5113495bSYour Name  *                              peer for the transmitted T2LM request frame.
221*5113495bSYour Name  * @WLAN_T2LM_TX_STATUS_INVALID: Invalid status code
222*5113495bSYour Name  */
223*5113495bSYour Name enum wlan_t2lm_tx_status {
224*5113495bSYour Name 	WLAN_T2LM_TX_STATUS_NONE = 0,
225*5113495bSYour Name 	WLAN_T2LM_TX_STATUS_SUCCESS = 1,
226*5113495bSYour Name 	WLAN_T2LM_TX_STATUS_FAILURE = 2,
227*5113495bSYour Name 	WLAN_T2LM_TX_STATUS_RX_TIMEOUT = 3,
228*5113495bSYour Name 	WLAN_T2LM_TX_STATUS_INVALID,
229*5113495bSYour Name };
230*5113495bSYour Name 
231*5113495bSYour Name /**
232*5113495bSYour Name  * enum wlan_t2lm_resp_frm_type - T2LM status corresponds to T2LM response frame
233*5113495bSYour Name  *
234*5113495bSYour Name  * @WLAN_T2LM_RESP_TYPE_SUCCESS: T2LM mapping provided in the T2LM request is
235*5113495bSYour Name  *                       accepted either by the AP or STA
236*5113495bSYour Name  * @WLAN_T2LM_RESP_TYPE_DENIED_TID_TO_LINK_MAPPING: T2LM Request denied because
237*5113495bSYour Name  *                       the requested TID-to-link mapping is unacceptable.
238*5113495bSYour Name  * @WLAN_T2LM_RESP_TYPE_PREFERRED_TID_TO_LINK_MAPPING: T2LM Request rejected and
239*5113495bSYour Name  *                       preferred TID-to-link mapping is suggested.
240*5113495bSYour Name  * @WLAN_T2LM_RESP_TYPE_INVALID: Status code is not applicable.
241*5113495bSYour Name  */
242*5113495bSYour Name enum wlan_t2lm_resp_frm_type {
243*5113495bSYour Name 	WLAN_T2LM_RESP_TYPE_SUCCESS = 0,
244*5113495bSYour Name 	WLAN_T2LM_RESP_TYPE_DENIED_TID_TO_LINK_MAPPING = 133,
245*5113495bSYour Name 	WLAN_T2LM_RESP_TYPE_PREFERRED_TID_TO_LINK_MAPPING = 134,
246*5113495bSYour Name 	WLAN_T2LM_RESP_TYPE_INVALID,
247*5113495bSYour Name };
248*5113495bSYour Name 
249*5113495bSYour Name /**
250*5113495bSYour Name  * enum wlan_t2lm_enable - TID-to-link negotiation supported by the mlo peer
251*5113495bSYour Name  *
252*5113495bSYour Name  * @WLAN_T2LM_NOT_SUPPORTED: T2LM is not supported by the MLD
253*5113495bSYour Name  * @WLAN_T2LM_MAP_ALL_TIDS_TO_SAME_LINK_SET: MLD only supports the mapping of
254*5113495bSYour Name  *    all TIDs to the same link set.
255*5113495bSYour Name  * @WLAN_T2LM_MAP_RESERVED: reserved value
256*5113495bSYour Name  * @WLAN_T2LM_MAP_EACH_TID_TO_SAME_OR_DIFFERENET_LINK_SET: MLD supports the
257*5113495bSYour Name  *    mapping of each TID to the same or different link set (Disjoint mapping).
258*5113495bSYour Name  * @WLAN_T2LM_ENABLE_INVALID: invalid
259*5113495bSYour Name  */
260*5113495bSYour Name enum wlan_t2lm_enable {
261*5113495bSYour Name 	WLAN_T2LM_NOT_SUPPORTED = 0,
262*5113495bSYour Name 	WLAN_T2LM_MAP_ALL_TIDS_TO_SAME_LINK_SET = 1,
263*5113495bSYour Name 	WLAN_T2LM_MAP_RESERVED = 2,
264*5113495bSYour Name 	WLAN_T2LM_MAP_EACH_TID_TO_SAME_OR_DIFFERENET_LINK_SET = 3,
265*5113495bSYour Name 	WLAN_T2LM_ENABLE_INVALID,
266*5113495bSYour Name };
267*5113495bSYour Name 
268*5113495bSYour Name /**
269*5113495bSYour Name  * struct wlan_prev_t2lm_negotiated_info - Previous successful T2LM negotiation
270*5113495bSYour Name  * is saved here.
271*5113495bSYour Name  *
272*5113495bSYour Name  * @dialog_token: Save the dialog token used in T2LM request and response frame.
273*5113495bSYour Name  * @t2lm_info: Provides the TID to LINK mapping information
274*5113495bSYour Name  * @link_preference: Provides the preferred link information
275*5113495bSYour Name  */
276*5113495bSYour Name struct wlan_prev_t2lm_negotiated_info {
277*5113495bSYour Name 	uint16_t dialog_token;
278*5113495bSYour Name 	struct wlan_t2lm_info t2lm_info[WLAN_T2LM_MAX_DIRECTION];
279*5113495bSYour Name #ifdef WMI_AP_SUPPORT
280*5113495bSYour Name 	struct wlan_link_preference link_preference;
281*5113495bSYour Name #endif
282*5113495bSYour Name };
283*5113495bSYour Name 
284*5113495bSYour Name /**
285*5113495bSYour Name  * struct wlan_t2lm_onging_negotiation_info - Current ongoing T2LM negotiation
286*5113495bSYour Name  * (information about transmitted T2LM request/response frame)
287*5113495bSYour Name  *
288*5113495bSYour Name  * @category: T2LM category as T2LM request frame
289*5113495bSYour Name  * @dialog_token: Save the dialog token used in T2LM request and response frame.
290*5113495bSYour Name  * @t2lm_info: Provides the TID-to-link mapping info for UL/DL/BiDi
291*5113495bSYour Name  * @t2lm_tx_status: Status code corresponds to the transmitted T2LM frames
292*5113495bSYour Name  * @t2lm_resp_type: T2LM status corresponds to T2LM response frame.
293*5113495bSYour Name  * @link_preference: Provides the preferred link information
294*5113495bSYour Name  * @t2lm_info_present: It will show the t2lm_info present or not
295*5113495bSYour Name  * @pref_link_present: It will show the preference link is present or not
296*5113495bSYour Name  * @ml_grp_id: MLO Group id which it belongs to
297*5113495bSYour Name  */
298*5113495bSYour Name struct wlan_t2lm_onging_negotiation_info {
299*5113495bSYour Name 	enum wlan_t2lm_category category;
300*5113495bSYour Name 	uint8_t dialog_token;
301*5113495bSYour Name 	struct wlan_t2lm_info t2lm_info[WLAN_T2LM_MAX_DIRECTION];
302*5113495bSYour Name 	enum wlan_t2lm_tx_status t2lm_tx_status;
303*5113495bSYour Name 	enum wlan_t2lm_resp_frm_type t2lm_resp_type;
304*5113495bSYour Name #ifdef WMI_AP_SUPPORT
305*5113495bSYour Name 	struct wlan_link_preference link_preference;
306*5113495bSYour Name 	bool t2lm_info_present;
307*5113495bSYour Name 	bool pref_link_present;
308*5113495bSYour Name 	uint8_t ml_grp_id;
309*5113495bSYour Name #endif
310*5113495bSYour Name };
311*5113495bSYour Name 
312*5113495bSYour Name /**
313*5113495bSYour Name  * struct wlan_mlo_peer_t2lm_policy - TID-to-link mapping information
314*5113495bSYour Name  *
315*5113495bSYour Name  * @self_gen_dialog_token: self generated dialog token used to send T2LM request
316*5113495bSYour Name  *                         frame;
317*5113495bSYour Name  * @t2lm_enable_val: TID-to-link enable value supported by this peer.
318*5113495bSYour Name  * @t2lm_negotiated_info: Previous successful T2LM negotiation is saved here.
319*5113495bSYour Name  * @ongoing_tid_to_link_mapping: This has the ongoing TID-to-link mapping info
320*5113495bSYour Name  *                               transmitted by this peer to the connected peer.
321*5113495bSYour Name  */
322*5113495bSYour Name struct wlan_mlo_peer_t2lm_policy {
323*5113495bSYour Name 	uint8_t self_gen_dialog_token;
324*5113495bSYour Name 	enum wlan_t2lm_enable t2lm_enable_val;
325*5113495bSYour Name 	struct wlan_prev_t2lm_negotiated_info t2lm_negotiated_info;
326*5113495bSYour Name 	struct wlan_t2lm_onging_negotiation_info ongoing_tid_to_link_mapping;
327*5113495bSYour Name };
328*5113495bSYour Name 
329*5113495bSYour Name /**
330*5113495bSYour Name  * struct wlan_mlo_t2lm_ie - T2LM information
331*5113495bSYour Name  *
332*5113495bSYour Name  * @disabled_link_bitmap: Bitmap of disabled links. This is used to update the
333*5113495bSYour Name  *                        disabled link field of RNR IE
334*5113495bSYour Name  * @t2lm: T2LM info structure
335*5113495bSYour Name  */
336*5113495bSYour Name struct wlan_mlo_t2lm_ie {
337*5113495bSYour Name 	uint16_t disabled_link_bitmap;
338*5113495bSYour Name 	struct wlan_t2lm_info t2lm;
339*5113495bSYour Name };
340*5113495bSYour Name 
341*5113495bSYour Name /*
342*5113495bSYour Name  * In a beacon or probe response frame, at max two T2LM IEs can be present
343*5113495bSYour Name  * first one to represent the already existing mapping and the other one
344*5113495bSYour Name  * represents the new T2LM mapping that is yet to establish.
345*5113495bSYour Name  */
346*5113495bSYour Name #define WLAN_MAX_T2LM_IE 2
347*5113495bSYour Name /**
348*5113495bSYour Name  * struct wlan_t2lm_timer - T2LM timer information
349*5113495bSYour Name  *
350*5113495bSYour Name  * @t2lm_timer: T2LM timer
351*5113495bSYour Name  * @timer_interval: T2LM Timer value
352*5113495bSYour Name  * @timer_started: T2LM timer started or not
353*5113495bSYour Name  * @timer_out_time: T2LM timer target out time
354*5113495bSYour Name  * @t2lm_dev_lock: lock to access struct
355*5113495bSYour Name  */
356*5113495bSYour Name struct wlan_t2lm_timer {
357*5113495bSYour Name 	qdf_timer_t t2lm_timer;
358*5113495bSYour Name 	uint32_t timer_interval;
359*5113495bSYour Name 	uint32_t timer_out_time;
360*5113495bSYour Name 	bool timer_started;
361*5113495bSYour Name #ifdef WLAN_MLO_USE_SPINLOCK
362*5113495bSYour Name 	qdf_spinlock_t t2lm_dev_lock;
363*5113495bSYour Name #else
364*5113495bSYour Name 	qdf_mutex_t t2lm_dev_lock;
365*5113495bSYour Name #endif
366*5113495bSYour Name };
367*5113495bSYour Name 
368*5113495bSYour Name struct wlan_mlo_dev_context;
369*5113495bSYour Name 
370*5113495bSYour Name /**
371*5113495bSYour Name  * typedef wlan_mlo_t2lm_link_update_handler - T2LM handler API to notify the
372*5113495bSYour Name  * link update.
373*5113495bSYour Name  * @vdev: Pointer to vdev context
374*5113495bSYour Name  * @t2lm: Pointer to wlan_t2lm_info
375*5113495bSYour Name  *
376*5113495bSYour Name  * Return: QDF_STATUS
377*5113495bSYour Name  */
378*5113495bSYour Name typedef QDF_STATUS (*wlan_mlo_t2lm_link_update_handler)(
379*5113495bSYour Name 					struct wlan_objmgr_vdev *vdev,
380*5113495bSYour Name 					struct wlan_t2lm_info *t2lm);
381*5113495bSYour Name 
382*5113495bSYour Name /**
383*5113495bSYour Name  * struct wlan_t2lm_context - T2LM IE information
384*5113495bSYour Name  *
385*5113495bSYour Name  * @established_t2lm: Indicates the already established broadcast T2LM IE
386*5113495bSYour Name  *                    advertised by the AP in beacon/probe response frames.
387*5113495bSYour Name  *                    In this T2LM IE, expected duration flag is set to 1 and
388*5113495bSYour Name  *                    mapping switch time present flag is set to 0 when the
389*5113495bSYour Name  *                    mapping is non-default.
390*5113495bSYour Name  * @upcoming_t2lm: Indicates the new broadcast T2LM IE advertised by the AP in
391*5113495bSYour Name  *                 beacon/probe response frames. STA needs to use this mapping
392*5113495bSYour Name  *                 when expected duration in the established T2LM is expires.
393*5113495bSYour Name  * @t2lm_timer: T2LM timer information
394*5113495bSYour Name  * @t2lm_dev_lock: t2lm dev context lock
395*5113495bSYour Name  * @tsf: time sync func value received via beacon
396*5113495bSYour Name  * @link_update_handler: handler to update T2LM link
397*5113495bSYour Name  * @is_valid_handler: T2LM handler is valid or not
398*5113495bSYour Name  * @mst_start_tsf: calculated mapping switch start tsf
399*5113495bSYour Name  * @mst_end_tsf: calculated mapping switch end tsf
400*5113495bSYour Name  * @link_update_callback_index: Link update callback index. This callback is
401*5113495bSYour Name  *                              invoked as part of mapping switch time and
402*5113495bSYour Name  *                              expected duration expiry.
403*5113495bSYour Name  */
404*5113495bSYour Name struct wlan_t2lm_context {
405*5113495bSYour Name 	struct wlan_mlo_t2lm_ie established_t2lm;
406*5113495bSYour Name 	struct wlan_mlo_t2lm_ie upcoming_t2lm;
407*5113495bSYour Name 	struct wlan_t2lm_timer t2lm_timer;
408*5113495bSYour Name #ifdef WLAN_MLO_USE_SPINLOCK
409*5113495bSYour Name 	qdf_spinlock_t t2lm_dev_lock;
410*5113495bSYour Name #else
411*5113495bSYour Name 	qdf_mutex_t t2lm_dev_lock;
412*5113495bSYour Name #endif
413*5113495bSYour Name 	uint64_t tsf;
414*5113495bSYour Name 	wlan_mlo_t2lm_link_update_handler
415*5113495bSYour Name 		link_update_handler[MAX_T2LM_HANDLERS];
416*5113495bSYour Name 	bool is_valid_handler[MAX_T2LM_HANDLERS];
417*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
418*5113495bSYour Name 	uint64_t mst_start_tsf;
419*5113495bSYour Name 	uint64_t mst_end_tsf;
420*5113495bSYour Name #endif
421*5113495bSYour Name 	int link_update_callback_index;
422*5113495bSYour Name };
423*5113495bSYour Name 
424*5113495bSYour Name #ifdef WLAN_FEATURE_11BE
425*5113495bSYour Name 
426*5113495bSYour Name #define t2lm_alert(format, args...) \
427*5113495bSYour Name 	QDF_TRACE_FATAL(QDF_MODULE_ID_T2LM, format, ## args)
428*5113495bSYour Name 
429*5113495bSYour Name #define t2lm_err(format, args...) \
430*5113495bSYour Name 	QDF_TRACE_ERROR(QDF_MODULE_ID_T2LM, format, ## args)
431*5113495bSYour Name 
432*5113495bSYour Name #define t2lm_warn(format, args...) \
433*5113495bSYour Name 	QDF_TRACE_WARN(QDF_MODULE_ID_T2LM, format, ## args)
434*5113495bSYour Name 
435*5113495bSYour Name #define t2lm_info(format, args...) \
436*5113495bSYour Name 	QDF_TRACE_INFO(QDF_MODULE_ID_T2LM, format, ## args)
437*5113495bSYour Name 
438*5113495bSYour Name #define t2lm_debug(format, args...) \
439*5113495bSYour Name 	QDF_TRACE_DEBUG(QDF_MODULE_ID_T2LM, format, ## args)
440*5113495bSYour Name 
441*5113495bSYour Name #define t2lm_rl_debug(format, args...) \
442*5113495bSYour Name 	QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_T2LM, format, ## args)
443*5113495bSYour Name 
444*5113495bSYour Name #define WLAN_T2LM_MAX_NUM_LINKS 16
445*5113495bSYour Name 
446*5113495bSYour Name #ifdef WLAN_MLO_USE_SPINLOCK
447*5113495bSYour Name /**
448*5113495bSYour Name  * t2lm_dev_lock_create - Create T2LM device mutex/spinlock
449*5113495bSYour Name  * @t2lm_ctx: T2LM context
450*5113495bSYour Name  *
451*5113495bSYour Name  * Creates mutex/spinlock
452*5113495bSYour Name  *
453*5113495bSYour Name  * Return: void
454*5113495bSYour Name  */
455*5113495bSYour Name static inline void
t2lm_dev_lock_create(struct wlan_t2lm_context * t2lm_ctx)456*5113495bSYour Name t2lm_dev_lock_create(struct wlan_t2lm_context *t2lm_ctx)
457*5113495bSYour Name {
458*5113495bSYour Name 	qdf_spinlock_create(&t2lm_ctx->t2lm_dev_lock);
459*5113495bSYour Name }
460*5113495bSYour Name 
461*5113495bSYour Name /**
462*5113495bSYour Name  * t2lm_dev_lock_destroy - Destroy T2LM mutex/spinlock
463*5113495bSYour Name  * @t2lm_ctx: T2LM context
464*5113495bSYour Name  *
465*5113495bSYour Name  * Destroy mutex/spinlock
466*5113495bSYour Name  *
467*5113495bSYour Name  * Return: void
468*5113495bSYour Name  */
469*5113495bSYour Name static inline void
t2lm_dev_lock_destroy(struct wlan_t2lm_context * t2lm_ctx)470*5113495bSYour Name t2lm_dev_lock_destroy(struct wlan_t2lm_context *t2lm_ctx)
471*5113495bSYour Name {
472*5113495bSYour Name 	qdf_spinlock_destroy(&t2lm_ctx->t2lm_dev_lock);
473*5113495bSYour Name }
474*5113495bSYour Name 
475*5113495bSYour Name /**
476*5113495bSYour Name  * t2lm_dev_lock_acquire - acquire T2LM mutex/spinlock
477*5113495bSYour Name  * @t2lm_ctx: T2LM context
478*5113495bSYour Name  *
479*5113495bSYour Name  * acquire mutex/spinlock
480*5113495bSYour Name  *
481*5113495bSYour Name  * return: void
482*5113495bSYour Name  */
483*5113495bSYour Name static inline
t2lm_dev_lock_acquire(struct wlan_t2lm_context * t2lm_ctx)484*5113495bSYour Name void t2lm_dev_lock_acquire(struct wlan_t2lm_context *t2lm_ctx)
485*5113495bSYour Name {
486*5113495bSYour Name 	qdf_spin_lock_bh(&t2lm_ctx->t2lm_dev_lock);
487*5113495bSYour Name }
488*5113495bSYour Name 
489*5113495bSYour Name /**
490*5113495bSYour Name  * t2lm_dev_lock_release - release T2LM dev mutex/spinlock
491*5113495bSYour Name  * @t2lm_ctx: T2LM context
492*5113495bSYour Name  *
493*5113495bSYour Name  * release mutex/spinlock
494*5113495bSYour Name  *
495*5113495bSYour Name  * return: void
496*5113495bSYour Name  */
497*5113495bSYour Name static inline
t2lm_dev_lock_release(struct wlan_t2lm_context * t2lm_ctx)498*5113495bSYour Name void t2lm_dev_lock_release(struct wlan_t2lm_context *t2lm_ctx)
499*5113495bSYour Name {
500*5113495bSYour Name 	qdf_spin_unlock_bh(&t2lm_ctx->t2lm_dev_lock);
501*5113495bSYour Name }
502*5113495bSYour Name #else /* WLAN_MLO_USE_SPINLOCK */
503*5113495bSYour Name static inline
t2lm_dev_lock_create(struct wlan_t2lm_context * t2lm_ctx)504*5113495bSYour Name void t2lm_dev_lock_create(struct wlan_t2lm_context *t2lm_ctx)
505*5113495bSYour Name {
506*5113495bSYour Name 	qdf_mutex_create(&t2lm_ctx->t2lm_dev_lock);
507*5113495bSYour Name }
508*5113495bSYour Name 
509*5113495bSYour Name static inline
t2lm_dev_lock_destroy(struct wlan_t2lm_context * t2lm_ctx)510*5113495bSYour Name void t2lm_dev_lock_destroy(struct wlan_t2lm_context *t2lm_ctx)
511*5113495bSYour Name {
512*5113495bSYour Name 	qdf_mutex_destroy(&t2lm_ctx->t2lm_dev_lock);
513*5113495bSYour Name }
514*5113495bSYour Name 
t2lm_dev_lock_acquire(struct wlan_t2lm_context * t2lm_ctx)515*5113495bSYour Name static inline void t2lm_dev_lock_acquire(struct wlan_t2lm_context *t2lm_ctx)
516*5113495bSYour Name {
517*5113495bSYour Name 	qdf_mutex_acquire(&t2lm_ctx->t2lm_dev_lock);
518*5113495bSYour Name }
519*5113495bSYour Name 
t2lm_dev_lock_release(struct wlan_t2lm_context * t2lm_ctx)520*5113495bSYour Name static inline void t2lm_dev_lock_release(struct wlan_t2lm_context *t2lm_ctx)
521*5113495bSYour Name {
522*5113495bSYour Name 	qdf_mutex_release(&t2lm_ctx->t2lm_dev_lock);
523*5113495bSYour Name }
524*5113495bSYour Name #endif
525*5113495bSYour Name 
526*5113495bSYour Name /**
527*5113495bSYour Name  * wlan_register_t2lm_link_update_notify_handler() - API to register the
528*5113495bSYour Name  * handlers to receive link update notification
529*5113495bSYour Name  * @handler: handler for T2LM link update
530*5113495bSYour Name  * @mldev: Pointer to mlo context
531*5113495bSYour Name  *
532*5113495bSYour Name  * Return: Index on which handler is registered
533*5113495bSYour Name  */
534*5113495bSYour Name int wlan_register_t2lm_link_update_notify_handler(
535*5113495bSYour Name 		wlan_mlo_t2lm_link_update_handler handler,
536*5113495bSYour Name 		struct wlan_mlo_dev_context *mldev);
537*5113495bSYour Name 
538*5113495bSYour Name /**
539*5113495bSYour Name  * wlan_unregister_t2lm_link_update_notify_handler() - API to unregister the
540*5113495bSYour Name  * T2LM related handlers
541*5113495bSYour Name  * @mldev: Pointer to mlo context
542*5113495bSYour Name  * @index: Index on which the handler was registered
543*5113495bSYour Name  *
544*5113495bSYour Name  * Return: None
545*5113495bSYour Name  */
546*5113495bSYour Name void wlan_unregister_t2lm_link_update_notify_handler(
547*5113495bSYour Name 		struct wlan_mlo_dev_context *mldev, uint8_t index);
548*5113495bSYour Name 
549*5113495bSYour Name /**
550*5113495bSYour Name  * wlan_mlo_dev_t2lm_notify_link_update() - API to call the registered handlers
551*5113495bSYour Name  * when there is a link update happens using T2LM
552*5113495bSYour Name  * @vdev: Pointer to vdev
553*5113495bSYour Name  * @t2lm: Pointer to T2LM info
554*5113495bSYour Name  *
555*5113495bSYour Name  * Return: QDF_STATUS
556*5113495bSYour Name  */
557*5113495bSYour Name QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update(
558*5113495bSYour Name 		struct wlan_objmgr_vdev *vdev,
559*5113495bSYour Name 		struct wlan_t2lm_info *t2lm);
560*5113495bSYour Name 
561*5113495bSYour Name /**
562*5113495bSYour Name  * wlan_mlo_parse_t2lm_ie() - API to parse the T2LM IE
563*5113495bSYour Name  * @t2lm: Pointer to T2LM structure
564*5113495bSYour Name  * @ie: Pointer to T2LM IE
565*5113495bSYour Name  * @frame_len: Action Frame length
566*5113495bSYour Name  *
567*5113495bSYour Name  * Return: QDF_STATUS
568*5113495bSYour Name  */
569*5113495bSYour Name QDF_STATUS wlan_mlo_parse_t2lm_ie(
570*5113495bSYour Name 	struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie,
571*5113495bSYour Name 	uint32_t frame_len);
572*5113495bSYour Name 
573*5113495bSYour Name /**
574*5113495bSYour Name  * wlan_mlo_add_t2lm_ie() - API to add TID-to-link mapping IE
575*5113495bSYour Name  * @frm: Pointer to buffer
576*5113495bSYour Name  * @t2lm: Pointer to t2lm mapping structure
577*5113495bSYour Name  * @vdev: Pointer to vdev structure
578*5113495bSYour Name  *
579*5113495bSYour Name  * Return: Updated frame pointer
580*5113495bSYour Name  */
581*5113495bSYour Name uint8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
582*5113495bSYour Name 			      struct wlan_t2lm_onging_negotiation_info *t2lm,
583*5113495bSYour Name 			      struct wlan_objmgr_vdev *vdev);
584*5113495bSYour Name 
585*5113495bSYour Name /**
586*5113495bSYour Name  * wlan_mlo_vdev_tid_to_link_map_event() - API to process the revceived T2LM
587*5113495bSYour Name  * event.
588*5113495bSYour Name  * @psoc: psoc object
589*5113495bSYour Name  * @event: Pointer to received T2LM info
590*5113495bSYour Name  *
591*5113495bSYour Name  * Return: QDF_STATUS
592*5113495bSYour Name  */
593*5113495bSYour Name QDF_STATUS wlan_mlo_vdev_tid_to_link_map_event(
594*5113495bSYour Name 			struct wlan_objmgr_psoc *psoc,
595*5113495bSYour Name 			struct mlo_vdev_host_tid_to_link_map_resp *event);
596*5113495bSYour Name 
597*5113495bSYour Name /**
598*5113495bSYour Name  * wlan_mlo_parse_t2lm_action_frame() - API to parse T2LM action frame
599*5113495bSYour Name  * @t2lm: Pointer to T2LM structure
600*5113495bSYour Name  * @action_frm: Pointer to action frame
601*5113495bSYour Name  * @frame_len: Action frame length
602*5113495bSYour Name  * @category: T2LM action frame category
603*5113495bSYour Name  *
604*5113495bSYour Name  * Return: 0 - success, else failure
605*5113495bSYour Name  */
606*5113495bSYour Name int wlan_mlo_parse_t2lm_action_frame(
607*5113495bSYour Name 		struct wlan_t2lm_onging_negotiation_info *t2lm,
608*5113495bSYour Name 		struct wlan_action_frame *action_frm,
609*5113495bSYour Name 		uint32_t frame_len,
610*5113495bSYour Name 		enum wlan_t2lm_category category);
611*5113495bSYour Name 
612*5113495bSYour Name /**
613*5113495bSYour Name  * wlan_mlo_add_t2lm_action_frame() - API to add T2LM action frame
614*5113495bSYour Name  * @frm: Pointer to a frame to add T2LM IE
615*5113495bSYour Name  * @args: T2LM action frame related info
616*5113495bSYour Name  * @buf: Pointer to T2LM IE values
617*5113495bSYour Name  * @category: T2LM action frame category
618*5113495bSYour Name  *
619*5113495bSYour Name  * Return: Pointer to the updated frame buffer
620*5113495bSYour Name  */
621*5113495bSYour Name uint8_t *wlan_mlo_add_t2lm_action_frame(
622*5113495bSYour Name 		uint8_t *frm, struct wlan_action_frame_args *args,
623*5113495bSYour Name 		uint8_t *buf, enum wlan_t2lm_category category);
624*5113495bSYour Name 
625*5113495bSYour Name /**
626*5113495bSYour Name  * wlan_mlo_parse_bcn_prbresp_t2lm_ie() - API to parse the T2LM IE from beacon/
627*5113495bSYour Name  * probe response frame
628*5113495bSYour Name  * @t2lm_ctx: T2LM context
629*5113495bSYour Name  * @ie: Pointer to T2LM IE
630*5113495bSYour Name  * @frame_len: Frame length
631*5113495bSYour Name  *
632*5113495bSYour Name  * Return: QDF_STATUS
633*5113495bSYour Name  */
634*5113495bSYour Name QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
635*5113495bSYour Name 		struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie,
636*5113495bSYour Name 		uint32_t frame_len);
637*5113495bSYour Name 
638*5113495bSYour Name /**
639*5113495bSYour Name  * wlan_mlo_parse_t2lm_info() - Parse T2LM IE fields
640*5113495bSYour Name  * @ie: Pointer to T2LM IE
641*5113495bSYour Name  * @t2lm: Pointer to T2LM structure
642*5113495bSYour Name  *
643*5113495bSYour Name  * Return: QDF_STATUS
644*5113495bSYour Name  */
645*5113495bSYour Name QDF_STATUS wlan_mlo_parse_t2lm_info(uint8_t *ie,
646*5113495bSYour Name 				    struct wlan_t2lm_info *t2lm);
647*5113495bSYour Name 
648*5113495bSYour Name /**
649*5113495bSYour Name  * wlan_mlo_add_t2lm_info_ie() - Add T2LM IE for UL/DL/Bidirection
650*5113495bSYour Name  * @frm: Pointer to buffer
651*5113495bSYour Name  * @t2lm: Pointer to t2lm mapping structure
652*5113495bSYour Name  * @vdev: Pointer to vdev structure
653*5113495bSYour Name  *
654*5113495bSYour Name  * Return: Updated frame pointer
655*5113495bSYour Name  */
656*5113495bSYour Name uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm,
657*5113495bSYour Name 				   struct wlan_objmgr_vdev *vdev);
658*5113495bSYour Name 
659*5113495bSYour Name /**
660*5113495bSYour Name  * wlan_mlo_t2lm_timer_init() - API to initialize t2lm timer
661*5113495bSYour Name  * @vdev: Pointer to vdev
662*5113495bSYour Name  *
663*5113495bSYour Name  * Return: qdf status
664*5113495bSYour Name  */
665*5113495bSYour Name QDF_STATUS
666*5113495bSYour Name wlan_mlo_t2lm_timer_init(struct wlan_objmgr_vdev *vdev);
667*5113495bSYour Name 
668*5113495bSYour Name /**
669*5113495bSYour Name  * wlan_mlo_t2lm_timer_deinit() - API to deinit t2lm timer
670*5113495bSYour Name  * @vdev: Pointer to vdev
671*5113495bSYour Name  *
672*5113495bSYour Name  * Return: qdf status
673*5113495bSYour Name  */
674*5113495bSYour Name QDF_STATUS
675*5113495bSYour Name wlan_mlo_t2lm_timer_deinit(struct wlan_objmgr_vdev *vdev);
676*5113495bSYour Name 
677*5113495bSYour Name /**
678*5113495bSYour Name  * wlan_mlo_t2lm_timer_start() - API to start T2LM timer
679*5113495bSYour Name  * @vdev: Pointer to vdev
680*5113495bSYour Name  * @interval: T2LM timer interval
681*5113495bSYour Name  *
682*5113495bSYour Name  * Return: qdf status
683*5113495bSYour Name  */
684*5113495bSYour Name QDF_STATUS
685*5113495bSYour Name wlan_mlo_t2lm_timer_start(struct wlan_objmgr_vdev *vdev,
686*5113495bSYour Name 			  uint32_t interval);
687*5113495bSYour Name 
688*5113495bSYour Name /**
689*5113495bSYour Name  * wlan_mlo_t2lm_timer_stop() - API to stop TID-to-link mapping timer
690*5113495bSYour Name  * @vdev: Pointer to vdev
691*5113495bSYour Name  *
692*5113495bSYour Name  * Return: qdf status
693*5113495bSYour Name  */
694*5113495bSYour Name QDF_STATUS
695*5113495bSYour Name wlan_mlo_t2lm_timer_stop(struct wlan_objmgr_vdev *vdev);
696*5113495bSYour Name 
697*5113495bSYour Name /**
698*5113495bSYour Name  * wlan_mlo_t2lm_timer_expiry_handler() - API to handle t2lm timer expiry
699*5113495bSYour Name  * @vdev: Pointer to vdev structure
700*5113495bSYour Name  *
701*5113495bSYour Name  * Return: none
702*5113495bSYour Name  */
703*5113495bSYour Name void
704*5113495bSYour Name wlan_mlo_t2lm_timer_expiry_handler(void *vdev);
705*5113495bSYour Name 
706*5113495bSYour Name /**
707*5113495bSYour Name  * wlan_handle_t2lm_timer() - API to handle TID-to-link mapping timer
708*5113495bSYour Name  * @vdev: Pointer to vdev
709*5113495bSYour Name  *
710*5113495bSYour Name  * Return: qdf status
711*5113495bSYour Name  */
712*5113495bSYour Name QDF_STATUS
713*5113495bSYour Name wlan_handle_t2lm_timer(struct wlan_objmgr_vdev *vdev);
714*5113495bSYour Name 
715*5113495bSYour Name #ifndef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
716*5113495bSYour Name /**
717*5113495bSYour Name  * wlan_mlo_t2lm_register_link_update_notify_handler() - API to register a T2LM
718*5113495bSYour Name  * callback that needs to be invoked on mapping switch time expiry and expected
719*5113495bSYour Name  * duration expiry.
720*5113495bSYour Name  * @ml_dev: Pointer MLO dev context
721*5113495bSYour Name  *
722*5113495bSYour Name  * Return: QDF_STATUS
723*5113495bSYour Name  */
724*5113495bSYour Name QDF_STATUS wlan_mlo_t2lm_register_link_update_notify_handler(
725*5113495bSYour Name 		struct wlan_mlo_dev_context *ml_dev);
726*5113495bSYour Name #else
727*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_t2lm_register_link_update_notify_handler(struct wlan_mlo_dev_context * ml_dev)728*5113495bSYour Name wlan_mlo_t2lm_register_link_update_notify_handler(struct wlan_mlo_dev_context *ml_dev)
729*5113495bSYour Name {
730*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
731*5113495bSYour Name }
732*5113495bSYour Name #endif
733*5113495bSYour Name 
734*5113495bSYour Name /**
735*5113495bSYour Name  * wlan_process_bcn_prbrsp_t2lm_ie() - API to process the received T2LM IE from
736*5113495bSYour Name  * beacon/probe response.
737*5113495bSYour Name  * @vdev: Pointer to vdev
738*5113495bSYour Name  * @rx_t2lm_ie: Received T2LM IE
739*5113495bSYour Name  * @tsf: Local TSF value
740*5113495bSYour Name  *
741*5113495bSYour Name  * Return QDF_STATUS
742*5113495bSYour Name  */
743*5113495bSYour Name QDF_STATUS wlan_process_bcn_prbrsp_t2lm_ie(struct wlan_objmgr_vdev *vdev,
744*5113495bSYour Name 					   struct wlan_t2lm_context *rx_t2lm_ie,
745*5113495bSYour Name 					   uint64_t tsf);
746*5113495bSYour Name 
747*5113495bSYour Name /**
748*5113495bSYour Name  * wlan_send_tid_to_link_mapping() - API to send T2LM info received from beacon,
749*5113495bSYour Name  * probe response or action frame to FW.
750*5113495bSYour Name  *
751*5113495bSYour Name  * @vdev: Pointer to vdev
752*5113495bSYour Name  * @t2lm: T2LM info
753*5113495bSYour Name  *
754*5113495bSYour Name  * Return QDF_STATUS
755*5113495bSYour Name  */
756*5113495bSYour Name QDF_STATUS wlan_send_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
757*5113495bSYour Name 					 struct wlan_t2lm_info *t2lm);
758*5113495bSYour Name 
759*5113495bSYour Name /**
760*5113495bSYour Name  * wlan_get_t2lm_mapping_status() - API to get T2LM info
761*5113495bSYour Name  * @vdev: Pointer to vdev
762*5113495bSYour Name  * @t2lm: T2LM info
763*5113495bSYour Name  *
764*5113495bSYour Name  * Return: QDF_STATUS
765*5113495bSYour Name  */
766*5113495bSYour Name QDF_STATUS wlan_get_t2lm_mapping_status(struct wlan_objmgr_vdev *vdev,
767*5113495bSYour Name 					struct wlan_t2lm_info *t2lm);
768*5113495bSYour Name 
769*5113495bSYour Name /**
770*5113495bSYour Name  * wlan_send_peer_level_tid_to_link_mapping() - API to send peer level T2LM info
771*5113495bSYour Name  * negotiated using action frames to FW.
772*5113495bSYour Name  *
773*5113495bSYour Name  * @vdev: Pointer to vdev
774*5113495bSYour Name  * @peer: pointer to peer
775*5113495bSYour Name  *
776*5113495bSYour Name  * Return QDF_STATUS
777*5113495bSYour Name  */
778*5113495bSYour Name QDF_STATUS
779*5113495bSYour Name wlan_send_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
780*5113495bSYour Name 					 struct wlan_objmgr_peer *peer);
781*5113495bSYour Name #else
wlan_mlo_parse_t2lm_ie(struct wlan_t2lm_onging_negotiation_info * t2lm,uint8_t * ie,uint32_t frame_len)782*5113495bSYour Name static inline QDF_STATUS wlan_mlo_parse_t2lm_ie(
783*5113495bSYour Name 	struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie,
784*5113495bSYour Name 	uint32_t frame_len)
785*5113495bSYour Name {
786*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
787*5113495bSYour Name }
788*5113495bSYour Name 
789*5113495bSYour Name static inline
wlan_mlo_add_t2lm_ie(uint8_t * frm,struct wlan_t2lm_onging_negotiation_info * t2lm,struct wlan_objmgr_vdev * vdev)790*5113495bSYour Name int8_t *wlan_mlo_add_t2lm_ie(uint8_t *frm,
791*5113495bSYour Name 			     struct wlan_t2lm_onging_negotiation_info *t2lm,
792*5113495bSYour Name 			     struct wlan_objmgr_vdev *vdev)
793*5113495bSYour Name {
794*5113495bSYour Name 	return frm;
795*5113495bSYour Name }
796*5113495bSYour Name 
797*5113495bSYour Name static inline
wlan_mlo_parse_t2lm_action_frame(struct wlan_t2lm_onging_negotiation_info * t2lm,struct wlan_action_frame * action_frm,uint32_t frame_len,enum wlan_t2lm_category category)798*5113495bSYour Name int wlan_mlo_parse_t2lm_action_frame(
799*5113495bSYour Name 		struct wlan_t2lm_onging_negotiation_info *t2lm,
800*5113495bSYour Name 		struct wlan_action_frame *action_frm,
801*5113495bSYour Name 		uint32_t frame_len,
802*5113495bSYour Name 		enum wlan_t2lm_category category)
803*5113495bSYour Name {
804*5113495bSYour Name 	return 0;
805*5113495bSYour Name }
806*5113495bSYour Name 
807*5113495bSYour Name static inline
wlan_mlo_add_t2lm_action_frame(uint8_t * frm,struct wlan_action_frame_args * args,uint8_t * buf,enum wlan_t2lm_category category)808*5113495bSYour Name uint8_t *wlan_mlo_add_t2lm_action_frame(
809*5113495bSYour Name 		uint8_t *frm, struct wlan_action_frame_args *args,
810*5113495bSYour Name 		uint8_t *buf, enum wlan_t2lm_category category)
811*5113495bSYour Name {
812*5113495bSYour Name 	return frm;
813*5113495bSYour Name }
814*5113495bSYour Name 
815*5113495bSYour Name static inline
wlan_mlo_parse_bcn_prbresp_t2lm_ie(struct wlan_t2lm_context * t2lm_ctx,uint8_t * ie,uint32_t frame_len)816*5113495bSYour Name QDF_STATUS wlan_mlo_parse_bcn_prbresp_t2lm_ie(
817*5113495bSYour Name 		struct wlan_t2lm_context *t2lm_ctx, uint8_t *ie,
818*5113495bSYour Name 		uint32_t frame_len)
819*5113495bSYour Name {
820*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
821*5113495bSYour Name }
822*5113495bSYour Name 
823*5113495bSYour Name static inline
wlan_mlo_parse_t2lm_info(uint8_t * ie,struct wlan_t2lm_info * t2lm)824*5113495bSYour Name QDF_STATUS wlan_mlo_parse_t2lm_info(uint8_t *ie,
825*5113495bSYour Name 				    struct wlan_t2lm_info *t2lm)
826*5113495bSYour Name {
827*5113495bSYour Name 	return QDF_STATUS_E_FAILURE;
828*5113495bSYour Name }
829*5113495bSYour Name 
830*5113495bSYour Name static inline
wlan_mlo_add_t2lm_info_ie(uint8_t * frm,struct wlan_t2lm_info * t2lm,struct wlan_objmgr_vdev * vdev)831*5113495bSYour Name uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm,
832*5113495bSYour Name 				   struct wlan_objmgr_vdev *vdev)
833*5113495bSYour Name {
834*5113495bSYour Name 	return frm;
835*5113495bSYour Name }
836*5113495bSYour Name 
837*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_t2lm_timer_init(struct wlan_objmgr_vdev * vdev)838*5113495bSYour Name wlan_mlo_t2lm_timer_init(struct wlan_objmgr_vdev *vdev)
839*5113495bSYour Name {
840*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
841*5113495bSYour Name }
842*5113495bSYour Name 
843*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_t2lm_timer_deinit(struct wlan_objmgr_vdev * vdev)844*5113495bSYour Name wlan_mlo_t2lm_timer_deinit(struct wlan_objmgr_vdev *vdev)
845*5113495bSYour Name {
846*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
847*5113495bSYour Name }
848*5113495bSYour Name 
849*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_t2lm_timer_start(struct wlan_objmgr_vdev * vdev,uint32_t interval)850*5113495bSYour Name wlan_mlo_t2lm_timer_start(struct wlan_objmgr_vdev *vdev,
851*5113495bSYour Name 			  uint32_t interval)
852*5113495bSYour Name {
853*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
854*5113495bSYour Name }
855*5113495bSYour Name 
856*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_t2lm_timer_stop(struct wlan_objmgr_vdev * vdev)857*5113495bSYour Name wlan_mlo_t2lm_timer_stop(struct wlan_objmgr_vdev *vdev)
858*5113495bSYour Name {
859*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
860*5113495bSYour Name }
861*5113495bSYour Name 
862*5113495bSYour Name static inline void
wlan_mlo_t2lm_timer_expiry_handler(void * vdev)863*5113495bSYour Name wlan_mlo_t2lm_timer_expiry_handler(void *vdev)
864*5113495bSYour Name {}
865*5113495bSYour Name 
866*5113495bSYour Name static inline QDF_STATUS
wlan_handle_t2lm_timer(struct wlan_objmgr_vdev * vdev)867*5113495bSYour Name wlan_handle_t2lm_timer(struct wlan_objmgr_vdev *vdev)
868*5113495bSYour Name {
869*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
870*5113495bSYour Name }
871*5113495bSYour Name 
872*5113495bSYour Name static inline
wlan_mlo_t2lm_register_link_update_notify_handler(struct wlan_mlo_dev_context * ml_dev)873*5113495bSYour Name QDF_STATUS wlan_mlo_t2lm_register_link_update_notify_handler(
874*5113495bSYour Name 		struct wlan_mlo_dev_context *ml_dev)
875*5113495bSYour Name {
876*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
877*5113495bSYour Name }
878*5113495bSYour Name 
879*5113495bSYour Name static inline QDF_STATUS
wlan_process_bcn_prbrsp_t2lm_ie(struct wlan_objmgr_vdev * vdev,struct wlan_t2lm_context * rx_t2lm_ie,uint64_t tsf)880*5113495bSYour Name wlan_process_bcn_prbrsp_t2lm_ie(struct wlan_objmgr_vdev *vdev,
881*5113495bSYour Name 				struct wlan_t2lm_context *rx_t2lm_ie,
882*5113495bSYour Name 				uint64_t tsf)
883*5113495bSYour Name {
884*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
885*5113495bSYour Name }
886*5113495bSYour Name 
887*5113495bSYour Name static inline
wlan_register_t2lm_link_update_notify_handler(wlan_mlo_t2lm_link_update_handler handler,struct wlan_mlo_dev_context * mldev)888*5113495bSYour Name int wlan_register_t2lm_link_update_notify_handler(
889*5113495bSYour Name 		wlan_mlo_t2lm_link_update_handler handler,
890*5113495bSYour Name 		struct wlan_mlo_dev_context *mldev)
891*5113495bSYour Name {
892*5113495bSYour Name 	return 0;
893*5113495bSYour Name }
894*5113495bSYour Name 
895*5113495bSYour Name static inline
wlan_unregister_t2lm_link_update_notify_handler(struct wlan_mlo_dev_context * mldev,uint8_t index)896*5113495bSYour Name void wlan_unregister_t2lm_link_update_notify_handler(
897*5113495bSYour Name 		struct wlan_mlo_dev_context *mldev, uint8_t index)
898*5113495bSYour Name {
899*5113495bSYour Name }
900*5113495bSYour Name 
wlan_mlo_dev_t2lm_notify_link_update(struct wlan_objmgr_vdev * vdev,struct wlan_t2lm_info * t2lm)901*5113495bSYour Name static inline QDF_STATUS wlan_mlo_dev_t2lm_notify_link_update(
902*5113495bSYour Name 		struct wlan_objmgr_vdev *vdev,
903*5113495bSYour Name 		struct wlan_t2lm_info *t2lm)
904*5113495bSYour Name {
905*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
906*5113495bSYour Name }
907*5113495bSYour Name 
908*5113495bSYour Name static inline
wlan_send_tid_to_link_mapping(struct wlan_objmgr_vdev * vdev,struct wlan_t2lm_info * t2lm)909*5113495bSYour Name QDF_STATUS wlan_send_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
910*5113495bSYour Name 					 struct wlan_t2lm_info *t2lm)
911*5113495bSYour Name {
912*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
913*5113495bSYour Name }
914*5113495bSYour Name 
915*5113495bSYour Name static inline QDF_STATUS
wlan_send_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer)916*5113495bSYour Name wlan_send_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
917*5113495bSYour Name 					 struct wlan_objmgr_peer *peer)
918*5113495bSYour Name {
919*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
920*5113495bSYour Name }
921*5113495bSYour Name #endif /* WLAN_FEATURE_11BE */
922*5113495bSYour Name 
923*5113495bSYour Name #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_11BE_MLO_ADV_FEATURE)
924*5113495bSYour Name /**
925*5113495bSYour Name  * wlan_clear_peer_level_tid_to_link_mapping() - API to clear peer level T2LM
926*5113495bSYour Name  * info negotiated using action frames to FW.
927*5113495bSYour Name  *
928*5113495bSYour Name  * @vdev: Pointer to vdev
929*5113495bSYour Name  *
930*5113495bSYour Name  * Return: none
931*5113495bSYour Name  */
932*5113495bSYour Name void
933*5113495bSYour Name wlan_clear_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev);
934*5113495bSYour Name 
935*5113495bSYour Name /**
936*5113495bSYour Name  * wlan_mlo_link_disable_request_handler() - API to handle mlo link disable
937*5113495bSYour Name  * request handler.
938*5113495bSYour Name  *
939*5113495bSYour Name  * @psoc: Pointer to psoc
940*5113495bSYour Name  * @evt_params: MLO Link disable request params
941*5113495bSYour Name  *
942*5113495bSYour Name  * Return QDF_STATUS
943*5113495bSYour Name  */
944*5113495bSYour Name QDF_STATUS
945*5113495bSYour Name wlan_mlo_link_disable_request_handler(struct wlan_objmgr_psoc *psoc,
946*5113495bSYour Name 				      void *evt_params);
947*5113495bSYour Name #else
948*5113495bSYour Name static inline void
wlan_clear_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev * vdev)949*5113495bSYour Name wlan_clear_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev)
950*5113495bSYour Name {
951*5113495bSYour Name }
952*5113495bSYour Name 
953*5113495bSYour Name static inline QDF_STATUS
wlan_mlo_link_disable_request_handler(struct wlan_objmgr_psoc * psoc,void * evt_params)954*5113495bSYour Name wlan_mlo_link_disable_request_handler(struct wlan_objmgr_psoc *psoc,
955*5113495bSYour Name 				      void *evt_params)
956*5113495bSYour Name {
957*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
958*5113495bSYour Name }
959*5113495bSYour Name #endif
960*5113495bSYour Name #endif /* _WLAN_MLO_T2LM_H_ */
961