xref: /wlan-driver/qcacld-3.0/os_if/fw_offload/inc/os_if_fwol.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: os_if_fwol.h
22*5113495bSYour Name  *
23*5113495bSYour Name  * This Header file provide declaration for OS interface API
24*5113495bSYour Name  */
25*5113495bSYour Name 
26*5113495bSYour Name #ifndef __OS_IF_FWOL_H__
27*5113495bSYour Name #define __OS_IF_FWOL_H__
28*5113495bSYour Name 
29*5113495bSYour Name #include "wlan_objmgr_vdev_obj.h"
30*5113495bSYour Name #include "wlan_fwol_public_structs.h"
31*5113495bSYour Name 
32*5113495bSYour Name #ifdef WLAN_FEATURE_ELNA
33*5113495bSYour Name /**
34*5113495bSYour Name  * os_if_fwol_set_elna_bypass() - Set eLNA bypass
35*5113495bSYour Name  * @vdev: Pointer to vdev
36*5113495bSYour Name  * @attr: Pointer to struct nlattr
37*5113495bSYour Name  *
38*5113495bSYour Name  * Return: 0 on success; error number otherwise
39*5113495bSYour Name  */
40*5113495bSYour Name int os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev *vdev,
41*5113495bSYour Name 			       const struct nlattr *attr);
42*5113495bSYour Name 
43*5113495bSYour Name /**
44*5113495bSYour Name  * os_if_fwol_get_elna_bypass() - Get eLNA bypass
45*5113495bSYour Name  * @vdev: Pointer to vdev
46*5113495bSYour Name  * @skb: sk buffer to hold nl80211 attributes
47*5113495bSYour Name  * @attr: Pointer to struct nlattr
48*5113495bSYour Name  *
49*5113495bSYour Name  * Return: 0 on success; error number otherwise
50*5113495bSYour Name  */
51*5113495bSYour Name int os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev *vdev,
52*5113495bSYour Name 			       struct sk_buff *skb,
53*5113495bSYour Name 			       const struct nlattr *attr);
54*5113495bSYour Name #else
os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev * vdev,const struct nlattr * attr)55*5113495bSYour Name static inline int os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev *vdev,
56*5113495bSYour Name 					     const struct nlattr *attr)
57*5113495bSYour Name {
58*5113495bSYour Name 	return 0;
59*5113495bSYour Name }
60*5113495bSYour Name 
os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev * vdev,struct sk_buff * skb,const struct nlattr * attr)61*5113495bSYour Name static inline int os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev *vdev,
62*5113495bSYour Name 					     struct sk_buff *skb,
63*5113495bSYour Name 					     const struct nlattr *attr)
64*5113495bSYour Name {
65*5113495bSYour Name 	return 0;
66*5113495bSYour Name }
67*5113495bSYour Name #endif /* WLAN_FEATURE_ELNA */
68*5113495bSYour Name 
69*5113495bSYour Name #ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW
70*5113495bSYour Name /**
71*5113495bSYour Name  * os_if_fwol_send_dscp_up_map_to_fw() - Send DSCP to UP map to FW
72*5113495bSYour Name  * @vdev: Pointer to vdev
73*5113495bSYour Name  * @dscp_to_up_map: Array of DSCP to UP map values
74*5113495bSYour Name  *
75*5113495bSYour Name  * Return: 0 on success; error number otherwise
76*5113495bSYour Name  */
77*5113495bSYour Name int os_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_vdev *vdev,
78*5113495bSYour Name 				     uint32_t *dscp_to_up_map);
79*5113495bSYour Name #else
os_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_vdev * vdev,uint32_t * dscp_to_up_map)80*5113495bSYour Name static inline int os_if_fwol_send_dscp_up_map_to_fw(
81*5113495bSYour Name 		struct wlan_objmgr_vdev *vdev, uint32_t *dscp_to_up_map)
82*5113495bSYour Name {
83*5113495bSYour Name 	return -EOPNOTSUPP;
84*5113495bSYour Name }
85*5113495bSYour Name #endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */
86*5113495bSYour Name 
87*5113495bSYour Name #ifdef WLAN_FEATURE_MDNS_OFFLOAD
88*5113495bSYour Name /**
89*5113495bSYour Name  * os_if_fwol_enable_mdns_offload() - Enable mdns offload
90*5113495bSYour Name  * @psoc: Pointer to psoc object
91*5113495bSYour Name  * @mdns_info: MDNS offload information
92*5113495bSYour Name  *
93*5113495bSYour Name  * This function will offload mdns response to FW.
94*5113495bSYour Name  *
95*5113495bSYour Name  * Return: 0 on success; error number otherwise
96*5113495bSYour Name  */
97*5113495bSYour Name int os_if_fwol_enable_mdns_offload(struct wlan_objmgr_psoc *psoc,
98*5113495bSYour Name 				   struct mdns_config_info *mdns_info);
99*5113495bSYour Name 
100*5113495bSYour Name /**
101*5113495bSYour Name  * os_if_fwol_disable_mdns_offload() - Disable mdns offload
102*5113495bSYour Name  * @psoc: Pointer to psoc
103*5113495bSYour Name  *
104*5113495bSYour Name  * This function will disable the mdns offload feature.
105*5113495bSYour Name  *
106*5113495bSYour Name  * Return: 0 on success; error number otherwise
107*5113495bSYour Name  */
108*5113495bSYour Name int os_if_fwol_disable_mdns_offload(struct wlan_objmgr_psoc *psoc);
109*5113495bSYour Name #else
os_if_fwol_enable_mdns_offload(struct wlan_objmgr_psoc * psoc)110*5113495bSYour Name static inline int os_if_fwol_enable_mdns_offload(struct wlan_objmgr_psoc *psoc)
111*5113495bSYour Name {
112*5113495bSYour Name 	return 0;
113*5113495bSYour Name }
114*5113495bSYour Name 
os_if_fwol_disable_mdns_offload(struct wlan_objmgr_psoc * psoc)115*5113495bSYour Name static inline int os_if_fwol_disable_mdns_offload(struct wlan_objmgr_psoc *psoc)
116*5113495bSYour Name {
117*5113495bSYour Name 	return 0;
118*5113495bSYour Name }
119*5113495bSYour Name #endif /* WLAN_FEATURE_MDNS_OFFLOAD */
120*5113495bSYour Name 
121*5113495bSYour Name #ifdef THERMAL_STATS_SUPPORT
122*5113495bSYour Name int os_if_fwol_get_thermal_stats_req(struct wlan_objmgr_psoc *psoc,
123*5113495bSYour Name 				     enum thermal_stats_request_type req,
124*5113495bSYour Name 				     void (*callback)(void *context,
125*5113495bSYour Name 				     struct thermal_throttle_info *response),
126*5113495bSYour Name 				     void *context);
127*5113495bSYour Name #endif /* THERMAL_STATS_SUPPORT */
128*5113495bSYour Name 
129*5113495bSYour Name #endif /* __OS_IF_FWOL_H__ */
130