xref: /wlan-driver/qcacld-3.0/core/hdd/inc/wlan_hdd_fw_state.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: wlan_hdd_fw_state.h
22  *
23  * Get firmware state related API's and definitions
24  */
25 
26 #ifndef __WLAN_HDD_FW_STATE_H
27 #define __WLAN_HDD_FW_STATE_H
28 
29 #ifdef FEATURE_FW_STATE
30 #include <net/cfg80211.h>
31 /**
32  * wlan_hdd_cfg80211_get_fw_state() - get fw state
33  * @wiphy: wiphy pointer
34  * @wdev: pointer to struct wireless_dev
35  * @data: pointer to incoming NL vendor data
36  * @data_len: length of @data
37  *
38  * Return: 0 on success; error number otherwise.
39  */
40 int wlan_hdd_cfg80211_get_fw_state(struct wiphy *wiphy,
41 				   struct wireless_dev *wdev,
42 				   const void *data,
43 				   int data_len);
44 
45 #define FEATURE_FW_STATE_COMMANDS                                       \
46 {                                                                       \
47 	.info.vendor_id = QCA_NL80211_VENDOR_ID,                        \
48 	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_FW_STATE,          \
49 	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |                           \
50 		WIPHY_VENDOR_CMD_NEED_NETDEV,                           \
51 	.doit = wlan_hdd_cfg80211_get_fw_state,                         \
52 	vendor_command_policy(VENDOR_CMD_RAW_DATA, 0)                   \
53 },
54 #else /* FEATURE_FW_STATE */
55 #define FEATURE_FW_STATE_COMMANDS
56 #endif /* FEATURE_FW_STATE */
57 #endif /* __WLAN_HDD_FW_STATE_H */
58