1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2022-2023 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 TID to Link mapping related functionality
19*5113495bSYour Name */
20*5113495bSYour Name #ifndef _WLAN_T2LM_API_H_
21*5113495bSYour Name #define _WLAN_T2LM_API_H_
22*5113495bSYour Name
23*5113495bSYour Name #include "lim_types.h"
24*5113495bSYour Name #include "lim_utils.h"
25*5113495bSYour Name #include "lim_send_sme_rsp_messages.h"
26*5113495bSYour Name #include "parser_api.h"
27*5113495bSYour Name #include "lim_send_messages.h"
28*5113495bSYour Name
29*5113495bSYour Name /* T2LM IE Length =
30*5113495bSYour Name * Size of header (2 bytes) +
31*5113495bSYour Name * Length (1 bytes) + t2lm mapping control (2 bytes) +
32*5113495bSYour Name * mapping switch time (2 bytes) + expected duration (3 bytes) +
33*5113495bSYour Name * link mapping of tids (16 bytes)
34*5113495bSYour Name */
35*5113495bSYour Name #define T2LM_IE_ACTION_FRAME_MAX_LEN 26
36*5113495bSYour Name
37*5113495bSYour Name /**
38*5113495bSYour Name * struct t2lm_event_data - TID to Link mapping event data
39*5113495bSYour Name * @status: qdf status used to indicate if t2lm action frame status
40*5113495bSYour Name * @data: event data
41*5113495bSYour Name */
42*5113495bSYour Name struct t2lm_event_data {
43*5113495bSYour Name QDF_STATUS status;
44*5113495bSYour Name void *data;
45*5113495bSYour Name };
46*5113495bSYour Name
47*5113495bSYour Name /**
48*5113495bSYour Name * enum wlan_t2lm_evt: T2LM manager events
49*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_RX_REQ:Handle T2LM request frame received from AP
50*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_TX_RESP:Handle T2LM response frame sent to AP
51*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_TX_REQ:Handle T2LM request frame sent by STA
52*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_RX_RESP:Handle T2LM response frame received from AP
53*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN:Handle received teardown frame event
54*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN:Handle sending teardown frame event
55*5113495bSYour Name * @WLAN_T2LM_EV_ACTION_FRAME_MAX: Maximum T2LM action frame event value
56*5113495bSYour Name */
57*5113495bSYour Name enum wlan_t2lm_evt {
58*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_RX_REQ = 0,
59*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_TX_RESP = 1,
60*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_TX_REQ = 2,
61*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_RX_RESP = 3,
62*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN = 4,
63*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN = 5,
64*5113495bSYour Name WLAN_T2LM_EV_ACTION_FRAME_MAX = 6,
65*5113495bSYour Name };
66*5113495bSYour Name
67*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO
68*5113495bSYour Name /**
69*5113495bSYour Name * t2lm_deliver_event - Handler to deliver T2LM event
70*5113495bSYour Name * @vdev: vdev pointer
71*5113495bSYour Name * @peer: pointer to peer
72*5113495bSYour Name * @event: T2LM event
73*5113495bSYour Name * @event_data: T2LM event data pointer
74*5113495bSYour Name * @frame_len: Received T2LM Frame length
75*5113495bSYour Name * @dialog_token: Dialog token
76*5113495bSYour Name *
77*5113495bSYour Name * This api will be called from lim layers, to process T2LM event
78*5113495bSYour Name *
79*5113495bSYour Name * Return: qdf_status
80*5113495bSYour Name */
81*5113495bSYour Name QDF_STATUS t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
82*5113495bSYour Name struct wlan_objmgr_peer *peer,
83*5113495bSYour Name enum wlan_t2lm_evt event,
84*5113495bSYour Name void *event_data,
85*5113495bSYour Name uint32_t frame_len,
86*5113495bSYour Name uint8_t *dialog_token);
87*5113495bSYour Name
88*5113495bSYour Name /**
89*5113495bSYour Name * t2lm_handle_rx_req - Handler for parsing T2LM action frame
90*5113495bSYour Name * @vdev: vdev pointer
91*5113495bSYour Name * @peer: pointer to peer
92*5113495bSYour Name * @event_data: T2LM event data pointer
93*5113495bSYour Name * @frame_len: Received Frame length
94*5113495bSYour Name * @token: Dialog token
95*5113495bSYour Name *
96*5113495bSYour Name * This api will be called from lim layers, after T2LM action frame
97*5113495bSYour Name * is received, the api will parse the T2LM request frame.
98*5113495bSYour Name *
99*5113495bSYour Name * Return: qdf_status
100*5113495bSYour Name */
101*5113495bSYour Name QDF_STATUS t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
102*5113495bSYour Name struct wlan_objmgr_peer *peer,
103*5113495bSYour Name void *event_data, uint32_t frame_len,
104*5113495bSYour Name uint8_t *token);
105*5113495bSYour Name
106*5113495bSYour Name /**
107*5113495bSYour Name * t2lm_handle_tx_resp - Handler for populating T2LM action frame
108*5113495bSYour Name * @vdev: vdev pointer
109*5113495bSYour Name * @event_data: T2LM event data pointer
110*5113495bSYour Name * @token: Dialog token
111*5113495bSYour Name *
112*5113495bSYour Name * This api will be called to populate T2LM response action frame.
113*5113495bSYour Name *
114*5113495bSYour Name * Return: qdf_status
115*5113495bSYour Name */
116*5113495bSYour Name QDF_STATUS t2lm_handle_tx_resp(struct wlan_objmgr_vdev *vdev,
117*5113495bSYour Name void *event_data, uint8_t *token);
118*5113495bSYour Name
119*5113495bSYour Name /**
120*5113495bSYour Name * t2lm_handle_tx_req - Handler for populating T2LM action frame
121*5113495bSYour Name * @vdev: vdev pointer
122*5113495bSYour Name * @peer: pointer to peer
123*5113495bSYour Name * @event_data: T2LM event data pointer
124*5113495bSYour Name * @token: Dialog token
125*5113495bSYour Name *
126*5113495bSYour Name * This api will be called to populate T2LM request action frame.
127*5113495bSYour Name *
128*5113495bSYour Name * Return: qdf_status
129*5113495bSYour Name */
130*5113495bSYour Name QDF_STATUS t2lm_handle_tx_req(struct wlan_objmgr_vdev *vdev,
131*5113495bSYour Name struct wlan_objmgr_peer *peer,
132*5113495bSYour Name void *event_data, uint8_t *token);
133*5113495bSYour Name
134*5113495bSYour Name /**
135*5113495bSYour Name * t2lm_handle_rx_resp - Handler for parsing T2LM action frame
136*5113495bSYour Name * @vdev: vdev pointer
137*5113495bSYour Name * @peer: peer pointer
138*5113495bSYour Name * @event_data: T2LM event data pointer
139*5113495bSYour Name * @frame_len: Frame length
140*5113495bSYour Name * @token: Dialog token
141*5113495bSYour Name *
142*5113495bSYour Name * This api will be called to parsing T2LM response action frame.
143*5113495bSYour Name *
144*5113495bSYour Name * Return: qdf_status
145*5113495bSYour Name */
146*5113495bSYour Name QDF_STATUS t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
147*5113495bSYour Name struct wlan_objmgr_peer *peer,
148*5113495bSYour Name void *event_data, uint32_t frame_len,
149*5113495bSYour Name uint8_t *token);
150*5113495bSYour Name
151*5113495bSYour Name /**
152*5113495bSYour Name * t2lm_handle_rx_teardown - Handler for parsing T2LM action frame
153*5113495bSYour Name * @vdev: vdev pointer
154*5113495bSYour Name * @peer: peer pointer
155*5113495bSYour Name * @event_data: T2LM event data pointer
156*5113495bSYour Name *
157*5113495bSYour Name * This api will be called to parsing T2LM teardown action frame.
158*5113495bSYour Name *
159*5113495bSYour Name * Return: qdf_status
160*5113495bSYour Name */
161*5113495bSYour Name QDF_STATUS t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
162*5113495bSYour Name struct wlan_objmgr_peer *peer,
163*5113495bSYour Name void *event_data);
164*5113495bSYour Name
165*5113495bSYour Name /**
166*5113495bSYour Name * t2lm_handle_tx_teardown - Handler for populating T2LM action frame
167*5113495bSYour Name * @vdev: vdev pointer
168*5113495bSYour Name * @event_data: T2LM event data pointer
169*5113495bSYour Name *
170*5113495bSYour Name * This api will be called to populate T2LM teardown action frame.
171*5113495bSYour Name *
172*5113495bSYour Name * Return: qdf_status
173*5113495bSYour Name */
174*5113495bSYour Name QDF_STATUS t2lm_handle_tx_teardown(struct wlan_objmgr_vdev *vdev,
175*5113495bSYour Name void *event_data);
176*5113495bSYour Name
177*5113495bSYour Name /**
178*5113495bSYour Name * wlan_t2lm_validate_candidate - Validate candidate based on T2LM IE
179*5113495bSYour Name * @cm_ctx: connection manager context pointer
180*5113495bSYour Name * @scan_entry: scan entry pointer
181*5113495bSYour Name *
182*5113495bSYour Name * This api will be called to validate candidate based on T2LM IE received
183*5113495bSYour Name * in beacon or probe response
184*5113495bSYour Name *
185*5113495bSYour Name * Return: qdf_status
186*5113495bSYour Name */
187*5113495bSYour Name
188*5113495bSYour Name QDF_STATUS
189*5113495bSYour Name wlan_t2lm_validate_candidate(struct cnx_mgr *cm_ctx,
190*5113495bSYour Name struct scan_cache_entry *scan_entry);
191*5113495bSYour Name /**
192*5113495bSYour Name * wlan_t2lm_deliver_event() - TID-to-link-mapping event handler
193*5113495bSYour Name * @vdev: vdev object
194*5113495bSYour Name * @peer: pointer to peer
195*5113495bSYour Name * @event: T2LM event
196*5113495bSYour Name * @event_data: T2LM event data
197*5113495bSYour Name * @frame_len: received T2LM frame len
198*5113495bSYour Name * @dialog_token: Dialog token
199*5113495bSYour Name *
200*5113495bSYour Name * Return: QDF_STATUS
201*5113495bSYour Name */
202*5113495bSYour Name QDF_STATUS wlan_t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
203*5113495bSYour Name struct wlan_objmgr_peer *peer,
204*5113495bSYour Name enum wlan_t2lm_evt event,
205*5113495bSYour Name void *event_data,
206*5113495bSYour Name uint32_t frame_len,
207*5113495bSYour Name uint8_t *dialog_token);
208*5113495bSYour Name
209*5113495bSYour Name /**
210*5113495bSYour Name * wlan_t2lm_clear_ongoing_negotiation - Clear ongoing
211*5113495bSYour Name * negotiation peer level TID-to-link-mapping.
212*5113495bSYour Name * @peer: pointer to peer
213*5113495bSYour Name *
214*5113495bSYour Name * Return: none
215*5113495bSYour Name */
216*5113495bSYour Name void
217*5113495bSYour Name wlan_t2lm_clear_ongoing_negotiation(struct wlan_objmgr_peer *peer);
218*5113495bSYour Name
219*5113495bSYour Name /**
220*5113495bSYour Name * wlan_t2lm_clear_peer_negotiation - Clear previously
221*5113495bSYour Name * negotiated peer level TID-to-link-mapping.
222*5113495bSYour Name * @peer: pointer to peer
223*5113495bSYour Name *
224*5113495bSYour Name * Return: none
225*5113495bSYour Name */
226*5113495bSYour Name void
227*5113495bSYour Name wlan_t2lm_clear_peer_negotiation(struct wlan_objmgr_peer *peer);
228*5113495bSYour Name
229*5113495bSYour Name /**
230*5113495bSYour Name * wlan_t2lm_clear_all_tid_mapping - Clear all tid mapping
231*5113495bSYour Name * @vdev: pointer to vdev
232*5113495bSYour Name *
233*5113495bSYour Name * This api will clear peer level and beacon t2lm mapping.
234*5113495bSYour Name * Return: none
235*5113495bSYour Name */
236*5113495bSYour Name void
237*5113495bSYour Name wlan_t2lm_clear_all_tid_mapping(struct wlan_objmgr_vdev *vdev);
238*5113495bSYour Name
239*5113495bSYour Name /**
240*5113495bSYour Name * wlan_populate_link_disable_t2lm_frame - Populate link disable t2lm frame
241*5113495bSYour Name * @vdev: pointer to vdev
242*5113495bSYour Name * @params: link disable params
243*5113495bSYour Name *
244*5113495bSYour Name * Return: none
245*5113495bSYour Name */
246*5113495bSYour Name QDF_STATUS
247*5113495bSYour Name wlan_populate_link_disable_t2lm_frame(struct wlan_objmgr_vdev *vdev,
248*5113495bSYour Name struct mlo_link_disable_request_evt_params *params);
249*5113495bSYour Name
250*5113495bSYour Name /**
251*5113495bSYour Name * wlan_update_t2lm_mapping - Update t2lm mapping to fw
252*5113495bSYour Name * @vdev: pointer to vdev
253*5113495bSYour Name * @rx_t2lm: received t2lm mapping from beacon
254*5113495bSYour Name * @tsf: timing sync function value
255*5113495bSYour Name *
256*5113495bSYour Name * Return: qdf status
257*5113495bSYour Name */
258*5113495bSYour Name QDF_STATUS wlan_update_t2lm_mapping(
259*5113495bSYour Name struct wlan_objmgr_vdev *vdev,
260*5113495bSYour Name struct wlan_t2lm_context *rx_t2lm,
261*5113495bSYour Name uint64_t tsf);
262*5113495bSYour Name
263*5113495bSYour Name /**
264*5113495bSYour Name * wlan_t2lm_init_default_mapping - Initialize t2lm to default mapping
265*5113495bSYour Name * @t2lm_ctx: t2lm ctx stored in ml dev ctx
266*5113495bSYour Name *
267*5113495bSYour Name * Return: qdf status
268*5113495bSYour Name */
269*5113495bSYour Name QDF_STATUS
270*5113495bSYour Name wlan_t2lm_init_default_mapping(struct wlan_t2lm_context *t2lm_ctx);
271*5113495bSYour Name
272*5113495bSYour Name #else
273*5113495bSYour Name static inline QDF_STATUS
wlan_t2lm_init_default_mapping(struct wlan_t2lm_context * t2lm_ctx)274*5113495bSYour Name wlan_t2lm_init_default_mapping(struct wlan_t2lm_context *t2lm_ctx)
275*5113495bSYour Name {
276*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
277*5113495bSYour Name }
278*5113495bSYour Name
wlan_update_t2lm_mapping(struct wlan_objmgr_vdev * vdev,struct wlan_t2lm_context * rx_t2lm,uint64_t tsf)279*5113495bSYour Name static inline QDF_STATUS wlan_update_t2lm_mapping(
280*5113495bSYour Name struct wlan_objmgr_vdev *vdev,
281*5113495bSYour Name struct wlan_t2lm_context *rx_t2lm,
282*5113495bSYour Name uint64_t tsf)
283*5113495bSYour Name {
284*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
285*5113495bSYour Name }
286*5113495bSYour Name
287*5113495bSYour Name static inline QDF_STATUS
wlan_populate_link_disable_t2lm_frame(struct wlan_objmgr_vdev * vdev,struct mlo_link_disable_request_evt_params * params)288*5113495bSYour Name wlan_populate_link_disable_t2lm_frame(struct wlan_objmgr_vdev *vdev,
289*5113495bSYour Name struct mlo_link_disable_request_evt_params *params)
290*5113495bSYour Name {
291*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
292*5113495bSYour Name }
293*5113495bSYour Name
294*5113495bSYour Name static inline QDF_STATUS
t2lm_handle_rx_req(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer,void * event_data,uint32_t frame_len,uint8_t * token)295*5113495bSYour Name t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
296*5113495bSYour Name struct wlan_objmgr_peer *peer,
297*5113495bSYour Name void *event_data, uint32_t frame_len, uint8_t *token)
298*5113495bSYour Name {
299*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
300*5113495bSYour Name }
301*5113495bSYour Name
302*5113495bSYour Name static inline QDF_STATUS
t2lm_handle_tx_resp(struct wlan_objmgr_vdev * vdev,void * event_data,uint8_t * token)303*5113495bSYour Name t2lm_handle_tx_resp(struct wlan_objmgr_vdev *vdev,
304*5113495bSYour Name void *event_data, uint8_t *token)
305*5113495bSYour Name {
306*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
307*5113495bSYour Name }
308*5113495bSYour Name
309*5113495bSYour Name static inline QDF_STATUS
t2lm_handle_tx_req(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer,void * event_data,uint8_t * token)310*5113495bSYour Name t2lm_handle_tx_req(struct wlan_objmgr_vdev *vdev,
311*5113495bSYour Name struct wlan_objmgr_peer *peer,
312*5113495bSYour Name void *event_data, uint8_t *token)
313*5113495bSYour Name {
314*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
315*5113495bSYour Name }
316*5113495bSYour Name
317*5113495bSYour Name static inline QDF_STATUS
t2lm_handle_rx_resp(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer,void * event_data,uint32_t frame_len,uint8_t * token)318*5113495bSYour Name t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
319*5113495bSYour Name struct wlan_objmgr_peer *peer,
320*5113495bSYour Name void *event_data, uint32_t frame_len, uint8_t *token)
321*5113495bSYour Name {
322*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
323*5113495bSYour Name }
324*5113495bSYour Name
325*5113495bSYour Name static inline QDF_STATUS
t2lm_handle_rx_teardown(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer,void * event_data)326*5113495bSYour Name t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
327*5113495bSYour Name struct wlan_objmgr_peer *peer,
328*5113495bSYour Name void *event_data)
329*5113495bSYour Name {
330*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
331*5113495bSYour Name }
332*5113495bSYour Name
333*5113495bSYour Name static inline QDF_STATUS
t2lm_handle_tx_teardown(struct wlan_objmgr_vdev * vdev,void * event_data)334*5113495bSYour Name t2lm_handle_tx_teardown(struct wlan_objmgr_vdev *vdev,
335*5113495bSYour Name void *event_data)
336*5113495bSYour Name {
337*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
338*5113495bSYour Name }
339*5113495bSYour Name
340*5113495bSYour Name static inline QDF_STATUS
wlan_t2lm_validate_candidate(struct cnx_mgr * cm_ctx,struct scan_cache_entry * scan_entry)341*5113495bSYour Name wlan_t2lm_validate_candidate(struct cnx_mgr *cm_ctx,
342*5113495bSYour Name struct scan_cache_entry *scan_entry)
343*5113495bSYour Name {
344*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
345*5113495bSYour Name }
346*5113495bSYour Name
347*5113495bSYour Name static inline void
wlan_t2lm_clear_ongoing_negotiation(struct wlan_objmgr_peer * peer)348*5113495bSYour Name wlan_t2lm_clear_ongoing_negotiation(struct wlan_objmgr_peer *peer)
349*5113495bSYour Name {}
350*5113495bSYour Name
351*5113495bSYour Name static inline void
wlan_t2lm_clear_peer_negotiation(struct wlan_objmgr_peer * peer)352*5113495bSYour Name wlan_t2lm_clear_peer_negotiation(struct wlan_objmgr_peer *peer)
353*5113495bSYour Name {}
354*5113495bSYour Name
355*5113495bSYour Name static inline void
wlan_t2lm_clear_all_tid_mapping(struct wlan_objmgr_vdev * vdev)356*5113495bSYour Name wlan_t2lm_clear_all_tid_mapping(struct wlan_objmgr_vdev *vdev)
357*5113495bSYour Name {}
358*5113495bSYour Name
359*5113495bSYour Name static inline
wlan_t2lm_deliver_event(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer,enum wlan_t2lm_evt event,void * event_data,uint32_t frame_len,uint8_t * dialog_token)360*5113495bSYour Name QDF_STATUS wlan_t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
361*5113495bSYour Name struct wlan_objmgr_peer *peer,
362*5113495bSYour Name enum wlan_t2lm_evt event,
363*5113495bSYour Name void *event_data,
364*5113495bSYour Name uint32_t frame_len,
365*5113495bSYour Name uint8_t *dialog_token)
366*5113495bSYour Name {
367*5113495bSYour Name return QDF_STATUS_E_NOSUPPORT;
368*5113495bSYour Name }
369*5113495bSYour Name #endif
370*5113495bSYour Name #endif
371