1 /* 2 * Copyright (c) 2012-2018,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 #ifndef __WLAN_HDD_SAP_COND_CHAN_SWITCH_H 20 #define __WLAN_HDD_SAP_COND_CHAN_SWITCH_H 21 22 /** 23 * DOC: wlan_hdd_sap_cond_chan_switch_h 24 * 25 * WLAN Host Device Driver SAP conditional channel switch API specification 26 */ 27 28 #ifdef FEATURE_SAP_COND_CHAN_SWITCH 29 30 extern const struct nla_policy conditional_chan_switch_policy[ 31 QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_MAX + 1]; 32 33 /** 34 * wlan_hdd_cfg80211_conditional_chan_switch() - SAP conditional channel switch 35 * @wiphy: Pointer to wireless phy 36 * @wdev: Pointer to wireless device 37 * @data: Pointer to data 38 * @data_len: Data length 39 * 40 * Invokes internal API __wlan_hdd_cfg80211_conditional_chan_switch() 41 * to process the conditional channel switch request. 42 * 43 * Return: 0 on success, negative errno on failure 44 */ 45 int wlan_hdd_cfg80211_conditional_chan_switch(struct wiphy *wiphy, 46 struct wireless_dev *wdev, 47 const void *data, 48 int data_len); 49 50 #define FEATURE_SAP_COND_CHAN_SWITCH_VENDOR_COMMANDS \ 51 { \ 52 .info.vendor_id = QCA_NL80211_VENDOR_ID, \ 53 .info.subcmd = \ 54 QCA_NL80211_VENDOR_SUBCMD_SAP_CONDITIONAL_CHAN_SWITCH, \ 55 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ 56 WIPHY_VENDOR_CMD_NEED_NETDEV | \ 57 WIPHY_VENDOR_CMD_NEED_RUNNING, \ 58 .doit = wlan_hdd_cfg80211_conditional_chan_switch, \ 59 vendor_command_policy( \ 60 conditional_chan_switch_policy, \ 61 QCA_WLAN_VENDOR_ATTR_SAP_CONDITIONAL_CHAN_SWITCH_MAX) \ 62 }, 63 #else /* FEATURE_SAP_COND_CHAN_SWITCH */ 64 #define FEATURE_SAP_COND_CHAN_SWITCH_VENDOR_COMMANDS 65 #endif /* FEATURE_SAP_COND_CHAN_SWITCH */ 66 67 #endif /* __WLAN_HDD_SAP_COND_CHAN_SWITCH_H */ 68 69