xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_station_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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_STATION_INFO_H
20 #define __WLAN_HDD_STATION_INFO_H
21 
22 /**
23  * DOC: wlan_hdd_station_info_h
24  *
25  * WLAN Host Device Driver STATION info API specification
26  */
27 
28 #ifdef FEATURE_STATION_INFO
29 extern const struct nla_policy hdd_get_station_policy[
30 			QCA_WLAN_VENDOR_ATTR_GET_STATION_MAX + 1];
31 
32 /**
33  * hdd_cfg80211_get_station_cmd() - Handle get station vendor cmd
34  * @wiphy: corestack handler
35  * @wdev: wireless device
36  * @data: data
37  * @data_len: data length
38  *
39  * Handles QCA_NL80211_VENDOR_SUBCMD_GET_STATION.
40  * Validate cmd attributes and send the station info to upper layers.
41  *
42  * Return: Success(0) or reason code for failure
43  */
44 int32_t hdd_cfg80211_get_station_cmd(struct wiphy *wiphy,
45 				     struct wireless_dev *wdev,
46 				     const void *data,
47 				     int data_len);
48 
49 extern const struct nla_policy hdd_get_sta_policy[
50 			QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_MAX + 1];
51 
52 /**
53  * hdd_cfg80211_get_sta_info_cmd() - Handle get sta info vendor cmd
54  * @wiphy: corestack handler
55  * @wdev: wireless device
56  * @data: data
57  * @data_len: data length
58  *
59  * Handles QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO.
60  * Validate cmd attributes and send the sta info to upper layers.
61  *
62  * Return: Success(0) or reason code for failure
63  */
64 int32_t hdd_cfg80211_get_sta_info_cmd(struct wiphy *wiphy,
65 				      struct wireless_dev *wdev,
66 				      const void *data,
67 				      int data_len);
68 
69 #define FEATURE_STATION_INFO_VENDOR_COMMANDS				\
70 {									\
71 	.info.vendor_id = QCA_NL80211_VENDOR_ID,			\
72 	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_STATION,		\
73 	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |				\
74 		WIPHY_VENDOR_CMD_NEED_NETDEV |				\
75 		WIPHY_VENDOR_CMD_NEED_RUNNING,				\
76 	.doit = hdd_cfg80211_get_station_cmd,				\
77 	vendor_command_policy(hdd_get_station_policy,			\
78 			      QCA_WLAN_VENDOR_ATTR_GET_STATION_MAX)	\
79 },									\
80 {									\
81 	.info.vendor_id = QCA_NL80211_VENDOR_ID,			\
82 	.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_STA_INFO,		\
83 	.flags = WIPHY_VENDOR_CMD_NEED_WDEV |				\
84 		WIPHY_VENDOR_CMD_NEED_NETDEV |				\
85 		WIPHY_VENDOR_CMD_NEED_RUNNING,				\
86 	.doit = hdd_cfg80211_get_sta_info_cmd,				\
87 	vendor_command_policy(hdd_get_sta_policy,			\
88 			      QCA_WLAN_VENDOR_ATTR_GET_STA_INFO_MAX)	\
89 },
90 #else /* FEATURE_STATION_INFO */
91 #define FEATURE_STATION_INFO_VENDOR_COMMANDS
92 #endif /* FEATURE_STATION_INFO */
93 
94 #endif /* __WLAN_HDD_STATION_INFO_H */
95 
96