xref: /wlan-driver/qcacld-3.0/components/umac/mlme/mlo_mgr/inc/wlan_epcs_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 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 EPCS (Emergency Preparedness Communications Service)
19*5113495bSYour Name  * related functionality
20*5113495bSYour Name  */
21*5113495bSYour Name #ifndef _WLAN_EPCS_API_H_
22*5113495bSYour Name #define _WLAN_EPCS_API_H_
23*5113495bSYour Name 
24*5113495bSYour Name #include "lim_types.h"
25*5113495bSYour Name #include "lim_utils.h"
26*5113495bSYour Name #include "lim_send_sme_rsp_messages.h"
27*5113495bSYour Name #include "parser_api.h"
28*5113495bSYour Name #include "lim_send_messages.h"
29*5113495bSYour Name 
30*5113495bSYour Name #define RSVD_SHIFT_BIT 0x7
31*5113495bSYour Name #define ACI_SHIFT_BIT 0x5
32*5113495bSYour Name #define ACM_SHIFT_BIT 0x4
33*5113495bSYour Name #define AIFSN_SHIFT_BIT 0x0
34*5113495bSYour Name #define CWMAX_SHIFT_BIT 0x4
35*5113495bSYour Name #define CWMIN_SHIFT_BIT 0x0
36*5113495bSYour Name 
37*5113495bSYour Name #define RSVD_MASK 0x1
38*5113495bSYour Name #define ACI_MASK 0x3
39*5113495bSYour Name #define ACM_MASK 0x1
40*5113495bSYour Name #define AIFSN_MASK 0xf
41*5113495bSYour Name #define CWMAX_MASK 0xf
42*5113495bSYour Name #define CWMIN_MASK 0xf
43*5113495bSYour Name 
44*5113495bSYour Name #define WMM_VENDOR_HEADER_LEN 7
45*5113495bSYour Name 
46*5113495bSYour Name /**
47*5113495bSYour Name  * enum wlan_epcs_evt: EPCS manager events
48*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_RX_REQ:Handle EPCS request frame received from AP
49*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_TX_RESP:Handle EPCS response frame sent to AP
50*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_TX_REQ:Handle EPCS request frame sent by STA
51*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_RX_RESP:Handle EPCS response frame received from AP
52*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_RX_TEARDOWN:Handle received teardown frame event
53*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_TX_TEARDOWN:Handle sending teardown frame event
54*5113495bSYour Name  * @WLAN_EPCS_EV_ACTION_FRAME_MAX: Maximum EPCS action frame event value
55*5113495bSYour Name  */
56*5113495bSYour Name enum wlan_epcs_evt {
57*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_RX_REQ = 0,
58*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_TX_RESP = 1,
59*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_TX_REQ = 2,
60*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_RX_RESP = 3,
61*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_RX_TEARDOWN = 4,
62*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_TX_TEARDOWN = 5,
63*5113495bSYour Name 	WLAN_EPCS_EV_ACTION_FRAME_MAX = 6,
64*5113495bSYour Name };
65*5113495bSYour Name 
66*5113495bSYour Name #ifdef WLAN_FEATURE_11BE_MLO
67*5113495bSYour Name /**
68*5113495bSYour Name  * wlan_epcs_deliver_event() - Handler to deliver EPCS event
69*5113495bSYour Name  * @vdev: vdev pointer
70*5113495bSYour Name  * @peer: pointer to peer
71*5113495bSYour Name  * @event: EPCS event
72*5113495bSYour Name  * @event_data: EPCS event data pointer
73*5113495bSYour Name  * @len: length of data
74*5113495bSYour Name  *
75*5113495bSYour Name  * This api will be called from lim  layers, to process EPCS event
76*5113495bSYour Name  *
77*5113495bSYour Name  * Return: QDF_STATUS
78*5113495bSYour Name  */
79*5113495bSYour Name QDF_STATUS wlan_epcs_deliver_event(struct wlan_objmgr_vdev *vdev,
80*5113495bSYour Name 				   struct wlan_objmgr_peer *peer,
81*5113495bSYour Name 				   enum wlan_epcs_evt event,
82*5113495bSYour Name 				   void *event_data, uint32_t len);
83*5113495bSYour Name 
84*5113495bSYour Name /**
85*5113495bSYour Name  * wlan_epcs_set_config() - Set EPCS enable flag
86*5113495bSYour Name  * @vdev: vdev pointer
87*5113495bSYour Name  * @flag: EPCS flag
88*5113495bSYour Name  *
89*5113495bSYour Name  * This api will be called from os_if layers, to set EPCS flag
90*5113495bSYour Name  *
91*5113495bSYour Name  * Return: QDF_STATUS
92*5113495bSYour Name  */
93*5113495bSYour Name QDF_STATUS wlan_epcs_set_config(struct wlan_objmgr_vdev *vdev,
94*5113495bSYour Name 				uint8_t flag);
95*5113495bSYour Name 
96*5113495bSYour Name /**
97*5113495bSYour Name  * wlan_epcs_get_config() - Get EPCS config
98*5113495bSYour Name  * @vdev: vdev pointer
99*5113495bSYour Name  *
100*5113495bSYour Name  * This api will be called from other module
101*5113495bSYour Name  *
102*5113495bSYour Name  * Return: bool
103*5113495bSYour Name  */
104*5113495bSYour Name bool wlan_epcs_get_config(struct wlan_objmgr_vdev *vdev);
105*5113495bSYour Name 
106*5113495bSYour Name /**
107*5113495bSYour Name  * wlan_epcs_deliver_cmd() - Handler to deliver EPCS command
108*5113495bSYour Name  * @vdev: vdev pointer
109*5113495bSYour Name  * @event: EPCS event
110*5113495bSYour Name  *
111*5113495bSYour Name  * This api will be called from os_if layers, to process EPCS command
112*5113495bSYour Name  *
113*5113495bSYour Name  * Return: QDF_STATUS
114*5113495bSYour Name  */
115*5113495bSYour Name QDF_STATUS wlan_epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
116*5113495bSYour Name 				 enum wlan_epcs_evt event);
117*5113495bSYour Name #else
118*5113495bSYour Name static inline
wlan_epcs_deliver_event(struct wlan_objmgr_vdev * vdev,struct wlan_objmgr_peer * peer,enum wlan_epcs_evt event,void * event_data,uint32_t len)119*5113495bSYour Name QDF_STATUS wlan_epcs_deliver_event(struct wlan_objmgr_vdev *vdev,
120*5113495bSYour Name 				   struct wlan_objmgr_peer *peer,
121*5113495bSYour Name 				   enum wlan_epcs_evt event,
122*5113495bSYour Name 				   void *event_data, uint32_t len)
123*5113495bSYour Name {
124*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
125*5113495bSYour Name }
126*5113495bSYour Name 
127*5113495bSYour Name static inline QDF_STATUS
wlan_epcs_set_config(struct wlan_objmgr_vdev * vdev,uint8_t flag)128*5113495bSYour Name wlan_epcs_set_config(struct wlan_objmgr_vdev *vdev, uint8_t flag)
129*5113495bSYour Name {
130*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
131*5113495bSYour Name }
132*5113495bSYour Name 
wlan_epcs_get_config(struct wlan_objmgr_vdev * vdev)133*5113495bSYour Name static inline bool wlan_epcs_get_config(struct wlan_objmgr_vdev *vdev)
134*5113495bSYour Name {
135*5113495bSYour Name 	return false;
136*5113495bSYour Name }
137*5113495bSYour Name 
138*5113495bSYour Name static inline
wlan_epcs_deliver_cmd(struct wlan_objmgr_vdev * vdev,enum wlan_epcs_evt event)139*5113495bSYour Name QDF_STATUS wlan_epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
140*5113495bSYour Name 				 enum wlan_epcs_evt event)
141*5113495bSYour Name {
142*5113495bSYour Name 	return QDF_STATUS_E_NOSUPPORT;
143*5113495bSYour Name }
144*5113495bSYour Name #endif
145*5113495bSYour Name #endif
146