1  /*
2   * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
3   * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4   *
5   * Permission to use, copy, modify, and/or distribute this software for
6   * any purpose with or without fee is hereby granted, provided that the
7   * above copyright notice and this permission notice appear in all
8   * copies.
9   *
10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11   * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12   * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13   * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14   * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15   * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17   * PERFORMANCE OF THIS SOFTWARE.
18   */
19  
20  /**
21   * DOC: os_if_fwol.h
22   *
23   * This Header file provide declaration for OS interface API
24   */
25  
26  #ifndef __OS_IF_FWOL_H__
27  #define __OS_IF_FWOL_H__
28  
29  #include "wlan_objmgr_vdev_obj.h"
30  #include "wlan_fwol_public_structs.h"
31  
32  #ifdef WLAN_FEATURE_ELNA
33  /**
34   * os_if_fwol_set_elna_bypass() - Set eLNA bypass
35   * @vdev: Pointer to vdev
36   * @attr: Pointer to struct nlattr
37   *
38   * Return: 0 on success; error number otherwise
39   */
40  int os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev *vdev,
41  			       const struct nlattr *attr);
42  
43  /**
44   * os_if_fwol_get_elna_bypass() - Get eLNA bypass
45   * @vdev: Pointer to vdev
46   * @skb: sk buffer to hold nl80211 attributes
47   * @attr: Pointer to struct nlattr
48   *
49   * Return: 0 on success; error number otherwise
50   */
51  int os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev *vdev,
52  			       struct sk_buff *skb,
53  			       const struct nlattr *attr);
54  #else
os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev * vdev,const struct nlattr * attr)55  static inline int os_if_fwol_set_elna_bypass(struct wlan_objmgr_vdev *vdev,
56  					     const struct nlattr *attr)
57  {
58  	return 0;
59  }
60  
os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev * vdev,struct sk_buff * skb,const struct nlattr * attr)61  static inline int os_if_fwol_get_elna_bypass(struct wlan_objmgr_vdev *vdev,
62  					     struct sk_buff *skb,
63  					     const struct nlattr *attr)
64  {
65  	return 0;
66  }
67  #endif /* WLAN_FEATURE_ELNA */
68  
69  #ifdef WLAN_SEND_DSCP_UP_MAP_TO_FW
70  /**
71   * os_if_fwol_send_dscp_up_map_to_fw() - Send DSCP to UP map to FW
72   * @vdev: Pointer to vdev
73   * @dscp_to_up_map: Array of DSCP to UP map values
74   *
75   * Return: 0 on success; error number otherwise
76   */
77  int os_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_vdev *vdev,
78  				     uint32_t *dscp_to_up_map);
79  #else
os_if_fwol_send_dscp_up_map_to_fw(struct wlan_objmgr_vdev * vdev,uint32_t * dscp_to_up_map)80  static inline int os_if_fwol_send_dscp_up_map_to_fw(
81  		struct wlan_objmgr_vdev *vdev, uint32_t *dscp_to_up_map)
82  {
83  	return -EOPNOTSUPP;
84  }
85  #endif /* WLAN_SEND_DSCP_UP_MAP_TO_FW */
86  
87  #ifdef WLAN_FEATURE_MDNS_OFFLOAD
88  /**
89   * os_if_fwol_enable_mdns_offload() - Enable mdns offload
90   * @psoc: Pointer to psoc object
91   * @mdns_info: MDNS offload information
92   *
93   * This function will offload mdns response to FW.
94   *
95   * Return: 0 on success; error number otherwise
96   */
97  int os_if_fwol_enable_mdns_offload(struct wlan_objmgr_psoc *psoc,
98  				   struct mdns_config_info *mdns_info);
99  
100  /**
101   * os_if_fwol_disable_mdns_offload() - Disable mdns offload
102   * @psoc: Pointer to psoc
103   *
104   * This function will disable the mdns offload feature.
105   *
106   * Return: 0 on success; error number otherwise
107   */
108  int os_if_fwol_disable_mdns_offload(struct wlan_objmgr_psoc *psoc);
109  #else
os_if_fwol_enable_mdns_offload(struct wlan_objmgr_psoc * psoc)110  static inline int os_if_fwol_enable_mdns_offload(struct wlan_objmgr_psoc *psoc)
111  {
112  	return 0;
113  }
114  
os_if_fwol_disable_mdns_offload(struct wlan_objmgr_psoc * psoc)115  static inline int os_if_fwol_disable_mdns_offload(struct wlan_objmgr_psoc *psoc)
116  {
117  	return 0;
118  }
119  #endif /* WLAN_FEATURE_MDNS_OFFLOAD */
120  
121  #ifdef THERMAL_STATS_SUPPORT
122  int os_if_fwol_get_thermal_stats_req(struct wlan_objmgr_psoc *psoc,
123  				     enum thermal_stats_request_type req,
124  				     void (*callback)(void *context,
125  				     struct thermal_throttle_info *response),
126  				     void *context);
127  #endif /* THERMAL_STATS_SUPPORT */
128  
129  #endif /* __OS_IF_FWOL_H__ */
130