xref: /wlan-driver/qcacld-3.0/components/fw_offload/dispatcher/inc/wlan_fwol_public_structs.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: contains fw offload structure definitions
22*5113495bSYour Name  */
23*5113495bSYour Name 
24*5113495bSYour Name #ifndef _WLAN_FWOL_PUBLIC_STRUCTS_H_
25*5113495bSYour Name #define _WLAN_FWOL_PUBLIC_STRUCTS_H_
26*5113495bSYour Name 
27*5113495bSYour Name #include "wlan_objmgr_psoc_obj.h"
28*5113495bSYour Name #include "wlan_thermal_public_struct.h"
29*5113495bSYour Name #include "wmi_unified.h"
30*5113495bSYour Name 
31*5113495bSYour Name #ifdef WLAN_FEATURE_ELNA
32*5113495bSYour Name 
33*5113495bSYour Name /**
34*5113495bSYour Name  * enum fwol_extlna_mode - provides elna modes
35*5113495bSYour Name  * @EXTLNA_MODE_DISABLE_ELNA_BYPASS:  disables elna bypass
36*5113495bSYour Name  * @EXTLNA_MODE_ENABLE_ELNA_BYPASS:   enables elna bypass
37*5113495bSYour Name  * @EXTLNA_MODE_FIRMWARE_DEFAULT:     Reset eLNA bypass configuration,
38*5113495bSYour Name  *                                    the driver should revert to the default
39*5113495bSYour Name  *                                    configuration of eLNA bypass
40*5113495bSYour Name  */
41*5113495bSYour Name enum fwol_extlna_mode {
42*5113495bSYour Name 	EXTLNA_MODE_DISABLE_ELNA_BYPASS = 0,
43*5113495bSYour Name 	EXTLNA_MODE_ENABLE_ELNA_BYPASS,
44*5113495bSYour Name 	EXTLNA_MODE_FIRMWARE_DEFAULT,
45*5113495bSYour Name };
46*5113495bSYour Name 
47*5113495bSYour Name /**
48*5113495bSYour Name  * struct set_elna_bypass_request - set eLNA bypass request
49*5113495bSYour Name  * @vdev_id: vdev id
50*5113495bSYour Name  * @elna_mode:0 - disable eLNA bypass
51*5113495bSYour Name  *            1 - enable eLNA bypass
52*5113495bSYour Name  *            2 - firmware default
53*5113495bSYour Name  */
54*5113495bSYour Name struct set_elna_bypass_request {
55*5113495bSYour Name 	uint8_t vdev_id;
56*5113495bSYour Name 	enum fwol_extlna_mode elna_mode;
57*5113495bSYour Name };
58*5113495bSYour Name 
59*5113495bSYour Name /**
60*5113495bSYour Name  * struct get_elna_bypass_request - get eLNA bypass request
61*5113495bSYour Name  * @vdev_id: vdev id
62*5113495bSYour Name  */
63*5113495bSYour Name struct get_elna_bypass_request {
64*5113495bSYour Name 	uint8_t vdev_id;
65*5113495bSYour Name };
66*5113495bSYour Name 
67*5113495bSYour Name /**
68*5113495bSYour Name  * struct get_elna_bypass_response - get eLNA bypass response
69*5113495bSYour Name  * @vdev_id: vdev id
70*5113495bSYour Name  * @elna_mode:0 - disable eLNA bypass
71*5113495bSYour Name  *            1 - enable eLNA bypass
72*5113495bSYour Name  *            2 - firmware default
73*5113495bSYour Name  */
74*5113495bSYour Name struct get_elna_bypass_response {
75*5113495bSYour Name 	uint8_t vdev_id;
76*5113495bSYour Name 	enum fwol_extlna_mode elna_mode;
77*5113495bSYour Name };
78*5113495bSYour Name #endif
79*5113495bSYour Name 
80*5113495bSYour Name /**
81*5113495bSYour Name  * struct thermal_throttle_info - thermal throttle info from Target
82*5113495bSYour Name  * @temperature: current temperature in c Degree
83*5113495bSYour Name  * @level: target thermal level info
84*5113495bSYour Name  * @pdev_id: pdev id
85*5113495bSYour Name  * @therm_throt_levels: Number of thermal throttle levels
86*5113495bSYour Name  * @level_info: Thermal Stats for each level
87*5113495bSYour Name  */
88*5113495bSYour Name struct thermal_throttle_info {
89*5113495bSYour Name 	uint32_t temperature;
90*5113495bSYour Name 	enum thermal_throttle_level level;
91*5113495bSYour Name 	uint32_t pdev_id;
92*5113495bSYour Name 	uint32_t therm_throt_levels;
93*5113495bSYour Name 	struct thermal_throt_level_stats level_info[WMI_THERMAL_STATS_TEMP_THRESH_LEVEL_MAX];
94*5113495bSYour Name };
95*5113495bSYour Name 
96*5113495bSYour Name /**
97*5113495bSYour Name  * struct wlan_fwol_callbacks - fw offload callbacks
98*5113495bSYour Name  * @get_elna_bypass_callback: callback for get eLNA bypass
99*5113495bSYour Name  * @get_elna_bypass_context: context for get eLNA bypass
100*5113495bSYour Name  * @get_thermal_stats_callback: callback for get thermal stats
101*5113495bSYour Name  * @get_thermal_stats_context: context for get thermal stats
102*5113495bSYour Name  */
103*5113495bSYour Name struct wlan_fwol_callbacks {
104*5113495bSYour Name #ifdef WLAN_FEATURE_ELNA
105*5113495bSYour Name 	void (*get_elna_bypass_callback)(void *context,
106*5113495bSYour Name 				     struct get_elna_bypass_response *response);
107*5113495bSYour Name 	void *get_elna_bypass_context;
108*5113495bSYour Name #endif
109*5113495bSYour Name #ifdef THERMAL_STATS_SUPPORT
110*5113495bSYour Name 	void (*get_thermal_stats_callback)(void *context,
111*5113495bSYour Name 				     struct thermal_throttle_info *response);
112*5113495bSYour Name 	void *get_thermal_stats_context;
113*5113495bSYour Name #endif
114*5113495bSYour Name };
115*5113495bSYour Name 
116*5113495bSYour Name #ifdef WLAN_FEATURE_MDNS_OFFLOAD
117*5113495bSYour Name 
118*5113495bSYour Name #define MDNS_FQDN_TYPE_GENERAL	(0)
119*5113495bSYour Name /* Maximum length of FQDN string including the NULL byte */
120*5113495bSYour Name #define MAX_FQDN_LEN		(64)
121*5113495bSYour Name /* This length depends on the WMI Message and TLV Header size.
122*5113495bSYour Name  * ((WMI_SVC_MSG_MAX_SIZE - WMI_TLV_HDR_SIZE)
123*5113495bSYour Name  */
124*5113495bSYour Name #define MAX_MDNS_RESP_LEN	(512)
125*5113495bSYour Name 
126*5113495bSYour Name /**
127*5113495bSYour Name  * struct mdns_config_info - Multicast DNS configuration information
128*5113495bSYour Name  * @vdev_id: vdev id
129*5113495bSYour Name  * @enable: false - disable mdns
130*5113495bSYour Name  *          true - enable mdns
131*5113495bSYour Name  * @fqdn_type: FQDN type
132*5113495bSYour Name  * @fqdn_data: Fully Qualified Domain Name of the local network
133*5113495bSYour Name  * @fqdn_len: FQDN length
134*5113495bSYour Name  * @resource_record_count: Number Resource Records present in the answer payload
135*5113495bSYour Name  * @answer_payload_len: Length of the answer payload sent by mdnsResponder in userspace
136*5113495bSYour Name  * @answer_payload_data: Binary blob used to frame mdns response for mdns queries
137*5113495bSYour Name  */
138*5113495bSYour Name struct mdns_config_info {
139*5113495bSYour Name 	uint32_t vdev_id;
140*5113495bSYour Name 	bool enable;
141*5113495bSYour Name 	uint32_t fqdn_type;
142*5113495bSYour Name 	uint32_t fqdn_len;
143*5113495bSYour Name 	uint8_t fqdn_data[MAX_FQDN_LEN];
144*5113495bSYour Name 	uint32_t resource_record_count;
145*5113495bSYour Name 	uint32_t answer_payload_len;
146*5113495bSYour Name 	uint8_t answer_payload_data[MAX_MDNS_RESP_LEN];
147*5113495bSYour Name };
148*5113495bSYour Name #endif
149*5113495bSYour Name 
150*5113495bSYour Name /**
151*5113495bSYour Name  * struct wlan_fwol_tx_ops - structure of tx func pointers
152*5113495bSYour Name  * @set_elna_bypass: set eLNA bypass
153*5113495bSYour Name  * @get_elna_bypass: get eLNA bypass
154*5113495bSYour Name  * @reg_evt_handler: register event handler
155*5113495bSYour Name  * @unreg_evt_handler: unregister event handler
156*5113495bSYour Name  * @send_dscp_up_map_to_fw: send dscp-to-up map values to FW
157*5113495bSYour Name  * @set_mdns_config: set mdns config info
158*5113495bSYour Name  * @get_thermal_stats: send get_thermal_stats cmd to FW
159*5113495bSYour Name  */
160*5113495bSYour Name struct wlan_fwol_tx_ops {
161*5113495bSYour Name #ifdef WLAN_FEATURE_ELNA
162*5113495bSYour Name 	QDF_STATUS (*set_elna_bypass)(struct wlan_objmgr_psoc *psoc,
163*5113495bSYour Name 				      struct set_elna_bypass_request *req);
164*5113495bSYour Name 	QDF_STATUS (*get_elna_bypass)(struct wlan_objmgr_psoc *psoc,
165*5113495bSYour Name 				      struct get_elna_bypass_request *req);
166*5113495bSYour Name #endif
167*5113495bSYour Name 	QDF_STATUS (*reg_evt_handler)(struct wlan_objmgr_psoc *psoc,
168*5113495bSYour Name 				      void *arg);
169*5113495bSYour Name 	QDF_STATUS (*unreg_evt_handler)(struct wlan_objmgr_psoc *psoc,
170*5113495bSYour Name 					void *arg);
171*5113495bSYour Name #ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW
172*5113495bSYour Name 	QDF_STATUS (*send_dscp_up_map_to_fw)(
173*5113495bSYour Name 			struct wlan_objmgr_psoc *psoc,
174*5113495bSYour Name 			uint32_t *dscp_to_up_map);
175*5113495bSYour Name #endif
176*5113495bSYour Name #ifdef WLAN_FEATURE_MDNS_OFFLOAD
177*5113495bSYour Name 	QDF_STATUS (*set_mdns_config)(struct wlan_objmgr_psoc *psoc,
178*5113495bSYour Name 				      struct mdns_config_info *mdns_info);
179*5113495bSYour Name #endif
180*5113495bSYour Name #ifdef THERMAL_STATS_SUPPORT
181*5113495bSYour Name 	QDF_STATUS (*get_thermal_stats)(struct wlan_objmgr_psoc *psoc,
182*5113495bSYour Name 				      enum thermal_stats_request_type req_type,
183*5113495bSYour Name 				      uint8_t therm_stats_offset);
184*5113495bSYour Name #endif
185*5113495bSYour Name };
186*5113495bSYour Name 
187*5113495bSYour Name /**
188*5113495bSYour Name  * struct wlan_fwol_rx_ops - structure of rx func pointers
189*5113495bSYour Name  * @get_elna_bypass_resp: get eLNA bypass response
190*5113495bSYour Name  * @notify_thermal_throttle_handler: thermal stats indication callback to fwol
191*5113495bSYour Name  *  core from target if layer
192*5113495bSYour Name  * @get_thermal_stats_resp: thermal stats cmd response callback to fwol
193*5113495bSYour Name  */
194*5113495bSYour Name struct wlan_fwol_rx_ops {
195*5113495bSYour Name #ifdef WLAN_FEATURE_ELNA
196*5113495bSYour Name 	QDF_STATUS (*get_elna_bypass_resp)(struct wlan_objmgr_psoc *psoc,
197*5113495bSYour Name 					 struct get_elna_bypass_response *resp);
198*5113495bSYour Name #endif
199*5113495bSYour Name #ifdef FW_THERMAL_THROTTLE_SUPPORT
200*5113495bSYour Name 	QDF_STATUS (*notify_thermal_throttle_handler)(
201*5113495bSYour Name 				struct wlan_objmgr_psoc *psoc,
202*5113495bSYour Name 				struct thermal_throttle_info *info);
203*5113495bSYour Name #endif
204*5113495bSYour Name #ifdef THERMAL_STATS_SUPPORT
205*5113495bSYour Name 	QDF_STATUS (*get_thermal_stats_resp)(struct wlan_objmgr_psoc *psoc,
206*5113495bSYour Name 					    struct thermal_throttle_info *resp);
207*5113495bSYour Name #endif
208*5113495bSYour Name };
209*5113495bSYour Name 
210*5113495bSYour Name /**
211*5113495bSYour Name  * struct fwol_thermal_callbacks - structure of rx callback to hdd layer
212*5113495bSYour Name  * @notify_thermal_throttle_handler: thermal throttle event callback
213*5113495bSYour Name  */
214*5113495bSYour Name struct fwol_thermal_callbacks {
215*5113495bSYour Name 	QDF_STATUS (*notify_thermal_throttle_handler)(
216*5113495bSYour Name 					struct wlan_objmgr_psoc *psoc,
217*5113495bSYour Name 					struct thermal_throttle_info *info);
218*5113495bSYour Name };
219*5113495bSYour Name #endif /* _WLAN_FWOL_PUBLIC_STRUCTS_H_ */
220*5113495bSYour Name 
221