xref: /wlan-driver/qcacld-3.0/core/hdd/inc/wlan_hdd_avoid_freq_ext.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2021, 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_avoid_freq_ext.h
19  *
20  * WLAN Host Device Driver extended avoid frequency interface implementation.
21  */
22 
23 #if !defined(__WLAN_HDD_AVOID_FREQ_EXT_H)
24 #define __WLAN_HDD_AVOID_FREQ_EXT_H
25 
26 #include <linux/netdevice.h>
27 #include <net/netlink.h>
28 #include <net/cfg80211.h>
29 #include <qca_vendor.h>
30 #include "wlan_hdd_main.h"
31 
32 #ifdef FEATURE_WLAN_CH_AVOID_EXT
33 extern const struct nla_policy
34 avoid_freq_ext_policy[QCA_WLAN_VENDOR_ATTR_AVOID_FREQUENCY_MAX + 1];
35 
36 #define FEATURE_AVOID_FREQ_EXT_VENDOR_COMMANDS                          \
37 {                                                                       \
38 	.info.vendor_id = QCA_NL80211_VENDOR_ID,                        \
39 	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY_EXT,   \
40 	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |                           \
41 		WIPHY_VENDOR_CMD_NEED_NETDEV |                          \
42 		WIPHY_VENDOR_CMD_NEED_RUNNING,                          \
43 	.doit = wlan_hdd_cfg80211_avoid_freq_ext,                       \
44 	vendor_command_policy(avoid_freq_ext_policy,                    \
45 			      QCA_WLAN_VENDOR_ATTR_AVOID_FREQUENCY_MAX) \
46 },
47 
48 int wlan_hdd_cfg80211_avoid_freq_ext(struct wiphy *wiphy,
49 				     struct wireless_dev *wdev,
50 				     const void *data, int data_len);
51 
52 #else
53 #define FEATURE_AVOID_FREQ_EXT_VENDOR_COMMANDS
wlan_hdd_cfg80211_avoid_freq_ext(void)54 static inline void wlan_hdd_cfg80211_avoid_freq_ext(void) {}
55 #endif
56 #endif
57 
58