xref: /wlan-driver/qcacld-3.0/core/hdd/inc/wlan_hdd_mpta_helper.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: wlan_hdd_mpta_helper.h
21  *
22  * Add Vendor subcommand QCA_NL80211_VENDOR_SUBCMD_MPTA_HELPER_CONFIG
23  */
24 
25 #ifndef __WLAN_HDD_MPTA_HELPER_H
26 #define __WLAN_HDD_MPTA_HELPER_H
27 
28 #include "wlan_fw_offload_main.h"
29 
30 #ifdef FEATURE_MPTA_HELPER
31 #include <net/cfg80211.h>
32 
33 /**
34  * wlan_hdd_mpta_helper_enable() - enable/disable mpta helper
35  * according to cfg from INI
36  * @coex_cfg_params: pointer of coex config command params
37  * @config: pointer of BTC config items
38  *
39  * Return: 0 on success; error number otherwise.
40  *
41  */
42 int
43 wlan_hdd_mpta_helper_enable(struct coex_config_params *coex_cfg_params,
44 			    struct wlan_fwol_coex_config *config);
45 
46 /**
47  * wlan_hdd_cfg80211_mpta_helper_config() - update
48  * tri-radio coex status by mpta helper
49  * @wiphy: wiphy device pointer
50  * @wdev: wireless device pointer
51  * @data: Vendor command data buffer
52  * @data_len: Buffer length
53  *
54  * Return: 0 on success; error number otherwise.
55  *
56  */
57 int wlan_hdd_cfg80211_mpta_helper_config(struct wiphy *wiphy,
58 					 struct wireless_dev *wdev,
59 					 const void *data,
60 					 int data_len);
61 
62 extern const struct nla_policy
63 qca_wlan_vendor_mpta_helper_attr[QCA_MPTA_HELPER_VENDOR_ATTR_MAX + 1];
64 
65 #define FEATURE_MPTA_HELPER_COMMANDS				\
66 {								\
67 	.info.vendor_id = QCA_NL80211_VENDOR_ID,		\
68 	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_MPTA_HELPER_CONFIG,\
69 	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |			\
70 		WIPHY_VENDOR_CMD_NEED_NETDEV |			\
71 		WIPHY_VENDOR_CMD_NEED_RUNNING,			\
72 	.doit = wlan_hdd_cfg80211_mpta_helper_config,	\
73 	vendor_command_policy(qca_wlan_vendor_mpta_helper_attr, \
74 			      QCA_MPTA_HELPER_VENDOR_ATTR_MAX)  \
75 },
76 
77 #else /* FEATURE_MPTA_HELPER */
78 #define FEATURE_MPTA_HELPER_COMMANDS
79 
80 static inline int
wlan_hdd_mpta_helper_enable(struct coex_config_params * coex_cfg_params,struct wlan_fwol_coex_config * config)81 wlan_hdd_mpta_helper_enable(struct coex_config_params *coex_cfg_params,
82 			    struct wlan_fwol_coex_config *config)
83 {
84 	return 0;
85 }
86 
87 #endif /* FEATURE_MPTA_HELPER */
88 
89 #endif /* __WLAN_HDD_MPTA_HELPER_H */
90 
91