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_coex_config.h
21   *
22   * Add Vendor subcommand QCA_NL80211_VENDOR_SUBCMD_COEX_CONFIG
23   */
24  
25  #ifndef __WLAN_HDD_COEX_CONFIG_H
26  #define __WLAN_HDD_COEX_CONFIG_H
27  
28  #ifdef FEATURE_COEX_CONFIG
29  #include <net/cfg80211.h>
30  
31  /**
32   * wlan_hdd_cfg80211_set_coex_config() - set coex configuration
33   * @wiphy: pointer to wireless wiphy structure.
34   * @wdev: pointer to wireless_dev structure.
35   * @data: pointer to limit off-channel command parameters.
36   * @data_len: the length in byte of  limit off-channel command parameters.
37   *
38   * Return: An error code or 0 on success.
39   */
40  int wlan_hdd_cfg80211_set_coex_config(struct wiphy *wiphy,
41  				      struct wireless_dev *wdev,
42  				      const void *data, int data_len);
43  
44  extern const struct nla_policy
45  coex_config_three_way_policy[QCA_VENDOR_ATTR_COEX_CONFIG_THREE_WAY_MAX + 1];
46  
47  #define FEATURE_COEX_CONFIG_COMMANDS                                     \
48  {                                                                        \
49  	.info.vendor_id = QCA_NL80211_VENDOR_ID,                         \
50  	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_COEX_CONFIG,            \
51  	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |                            \
52  		WIPHY_VENDOR_CMD_NEED_NETDEV |                           \
53  		WIPHY_VENDOR_CMD_NEED_RUNNING,                           \
54  	.doit = wlan_hdd_cfg80211_set_coex_config,                       \
55  	vendor_command_policy(coex_config_three_way_policy,              \
56  			      QCA_VENDOR_ATTR_COEX_CONFIG_THREE_WAY_MAX) \
57  },
58  #else /* FEATURE_COEX_CONFIG */
59  #define FEATURE_COEX_CONFIG_COMMANDS
60  #endif /* FEATURE_COEX_CONFIG */
61  
62  #endif /* __WLAN_HDD_COEX_CONFIG_H */
63