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_gpio.h 19 * 20 * This Header file provide declaration for cfg80211 command handler API 21 */ 22 23 #ifndef __WLAN_HDD_GPIO_H__ 24 #define __WLAN_HDD_GPIO_H__ 25 26 #include <qdf_types.h> 27 #include <net/cfg80211.h> 28 #include <qca_vendor.h> 29 30 #ifdef WLAN_FEATURE_GPIO_CFG 31 #include <wlan_cfg80211_gpio.h> 32 33 #define FEATURE_GPIO_CFG_VENDOR_COMMANDS \ 34 { \ 35 .info.vendor_id = QCA_NL80211_VENDOR_ID, \ 36 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GPIO_CONFIG_COMMAND, \ 37 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ 38 WIPHY_VENDOR_CMD_NEED_NETDEV | \ 39 WIPHY_VENDOR_CMD_NEED_RUNNING, \ 40 .doit = wlan_hdd_cfg80211_set_gpio_config, \ 41 vendor_command_policy(wlan_cfg80211_gpio_config_policy, \ 42 QCA_WLAN_VENDOR_ATTR_GPIO_PARAM_MAX) \ 43 }, 44 45 /** 46 * wlan_hdd_cfg80211_set_gpio_config() - set GPIO config 47 * @wiphy: wiphy structure pointer 48 * @wdev: Wireless device structure pointer 49 * @data: Pointer to the data to be passed via vendor interface 50 * @data_len: Length of the data to be passed 51 * 52 * Return: Return the Success or Failure code 53 */ 54 int wlan_hdd_cfg80211_set_gpio_config(struct wiphy *wiphy, 55 struct wireless_dev *wdev, 56 const void *data, int data_len); 57 #else 58 #define FEATURE_GPIO_CFG_VENDOR_COMMANDS 59 #endif /* WLAN_FEATURE_GPIO_CFG */ 60 #endif /* __WLAN_CFG80211_GPIO_CFG_H__ */ 61