1 /*
2 * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 /**
18 * DOC: wlan_hdd_btc_chain_mode.h
19 *
20 * Add Vendor subcommand QCA_NL80211_VENDOR_SUBCMD_BTC_CHAIN_MODE
21 */
22
23 #ifndef __WLAN_HDD_BTC_CHAIN_MODE_H
24 #define __WLAN_HDD_BTC_CHAIN_MODE_H
25
26 #ifdef FEATURE_BTC_CHAIN_MODE
27 #include <net/cfg80211.h>
28
29 /**
30 * wlan_hdd_register_btc_chain_mode_handler() - register handler for BT coex
31 * chain mode notification.
32 * @psoc: pointer to psoc object
33 *
34 * Return: None
35 */
36 void wlan_hdd_register_btc_chain_mode_handler(struct wlan_objmgr_psoc *psoc);
37
38 /**
39 * wlan_hdd_cfg80211_set_btc_chain_mode() - set btc chain mode
40 * @wiphy: pointer to wireless wiphy structure.
41 * @wdev: pointer to wireless_dev structure.
42 * @data: pointer to btc chain mode command parameters.
43 * @data_len: the length in byte of btc chain mode command parameters.
44 *
45 * Return: An error code or 0 on success.
46 */
47 int wlan_hdd_cfg80211_set_btc_chain_mode(struct wiphy *wiphy,
48 struct wireless_dev *wdev,
49 const void *data, int data_len);
50
51 extern const struct nla_policy
52 btc_chain_mode_policy[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX + 1];
53
54 #define FEATURE_BTC_CHAIN_MODE_COMMANDS \
55 { \
56 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
57 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_BTC_CHAIN_MODE, \
58 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
59 WIPHY_VENDOR_CMD_NEED_NETDEV | \
60 WIPHY_VENDOR_CMD_NEED_RUNNING, \
61 .doit = wlan_hdd_cfg80211_set_btc_chain_mode, \
62 vendor_command_policy(btc_chain_mode_policy, \
63 QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX) \
64 },
65 #else /* FEATURE_BTC_CHAIN_MODE */
66 static inline void
wlan_hdd_register_btc_chain_mode_handler(struct wlan_objmgr_psoc * psoc)67 wlan_hdd_register_btc_chain_mode_handler(struct wlan_objmgr_psoc *psoc) {}
68
69 #define FEATURE_BTC_CHAIN_MODE_COMMANDS
70 #endif /* FEATURE_BTC_CHAIN_MODE */
71
72 #endif /* __WLAN_HDD_BTC_CHAIN_MODE_H */
73