blob: be1b55f423aa249d16674778b4a4f5bb8ed5e39c [file] [log] [blame]
Sandeep Puligilla00d2a1f2017-12-21 00:21:44 -08001/*
Sandeep Puligilla019a1bd2018-02-04 22:57:44 -08002 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
Sandeep Puligilla00d2a1f2017-12-21 00:21:44 -08003 *
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/**
20 * DOC : wlan_hdd_spectralscan.h
21 *
22 * WLAN Host Device Driver spectral scan implementation
23 *
24 */
25
26#if !defined(WLAN_HDD_SPECTRALSCAN_H)
27#define WLAN_HDD_SPECTRALSCAN_H
28
Sandeep Puligilla8e89d572018-04-02 18:07:45 -070029#ifdef WLAN_CONV_SPECTRAL_ENABLE
Sandeep Puligilla019a1bd2018-02-04 22:57:44 -080030/*
31 * enum spectral_scan_msg_type - spectral scan registration
32 * @SPECTRAL_SCAN_REGISTER_REQ: spectral scan app register request
33 * @SPECTRAL_SCAN_REGISTER_RSP: spectral scan app register response
34 */
35enum spectral_scan_msg_type {
36 SPECTRAL_SCAN_REGISTER_REQ,
37 SPECTRAL_SCAN_REGISTER_RSP,
38};
39
40/*
41 * struct spectral_scan_msg - spectral scan request message
42 * @msg_type: message type
43 * @pid: process id
44 */
45struct spectral_scan_msg {
46 uint32_t msg_type;
47 uint32_t pid;
48};
49
Sandeep Puligilla00d2a1f2017-12-21 00:21:44 -080050#define FEATURE_SPECTRAL_SCAN_VENDOR_COMMANDS \
51{ \
52 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
53 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_START, \
54 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
55 WIPHY_VENDOR_CMD_NEED_NETDEV, \
56 .doit = wlan_hdd_cfg80211_spectral_scan_start \
57}, \
58{ \
59 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
60 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_STOP, \
61 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
62 WIPHY_VENDOR_CMD_NEED_NETDEV, \
63 .doit = wlan_hdd_cfg80211_spectral_scan_stop \
64}, \
65{ \
66 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
67 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CONFIG, \
68 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
69 WIPHY_VENDOR_CMD_NEED_NETDEV, \
70 .doit = wlan_hdd_cfg80211_spectral_scam_get_config \
71}, \
72{ \
73 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
74 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_DIAG_STATS, \
75 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
76 WIPHY_VENDOR_CMD_NEED_NETDEV, \
77 .doit = wlan_hdd_cfg80211_spectral_scan_get_diag_stats \
78}, \
79{ \
80 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
81 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_CAP_INFO, \
82 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
83 WIPHY_VENDOR_CMD_NEED_NETDEV, \
84 .doit = wlan_hdd_cfg80211_spectral_scan_get_cap_info \
85}, \
86{ \
87 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
88 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SPECTRAL_SCAN_GET_STATUS, \
89 .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
90 WIPHY_VENDOR_CMD_NEED_NETDEV, \
91 .doit = wlan_hdd_cfg80211_spectral_scan_get_status \
92},
93
94/**
95 * wlan_hdd_cfg80211_spectral_scan_start() - start spectral scan
96 * @wiphy: WIPHY structure pointer
97 * @wdev: Wireless device structure pointer
98 * @data: Pointer to the data received
99 * @data_len: Length of the data received
100 *
101 * This function starts spectral scan
102 *
103 * Return: 0 on success and errno on failure
104 */
105int wlan_hdd_cfg80211_spectral_scan_start(struct wiphy *wiphy,
106 struct wireless_dev *wdev,
107 const void *data,
108 int data_len);
109
110/**
111 * wlan_hdd_cfg80211_spectral_scan_stop() - stop spectral scan
112 * @wiphy: WIPHY structure pointer
113 * @wdev: Wireless device structure pointer
114 * @data: Pointer to the data received
115 * @data_len: Length of the data received
116 *
117 * This function stops spectral scan
118 *
119 * Return: 0 on success and errno on failure
120 */
121int wlan_hdd_cfg80211_spectral_scan_stop(struct wiphy *wiphy,
122 struct wireless_dev *wdev,
123 const void *data,
124 int data_len);
125
126/**
127 * wlan_hdd_cfg80211_spectral_scan_start() - start spectral scan
128 * @wiphy: WIPHY structure pointer
129 * @wdev: Wireless device structure pointer
130 * @data: Pointer to the data received
131 * @data_len: Length of the data received
132 *
133 * This function starts spectral scan
134 *
135 * Return: 0 on success and errno on failure
136 */
137int wlan_hdd_cfg80211_spectral_scam_get_config(struct wiphy *wiphy,
138 struct wireless_dev *wdev,
139 const void *data,
140 int data_len);
141
142/**
143 * wlan_hdd_cfg80211_spectral_scan_start() - start spectral scan
144 * @wiphy: WIPHY structure pointer
145 * @wdev: Wireless device structure pointer
146 * @data: Pointer to the data received
147 * @data_len: Length of the data received
148 *
149 * This function starts spectral scan
150 *
151 * Return: 0 on success and errno on failure
152 */
153int wlan_hdd_cfg80211_spectral_scan_get_diag_stats(struct wiphy *wiphy,
154 struct wireless_dev *wdev,
155 const void *data,
156 int data_len);
157
158/**
159 * wlan_hdd_cfg80211_spectral_scan_start() - start spectral scan
160 * @wiphy: WIPHY structure pointer
161 * @wdev: Wireless device structure pointer
162 * @data: Pointer to the data received
163 * @data_len: Length of the data received
164 *
165 * This function starts spectral scan
166 *
167 * Return: 0 on success and errno on failure
168 */
169int wlan_hdd_cfg80211_spectral_scan_get_cap_info(struct wiphy *wiphy,
170 struct wireless_dev *wdev,
171 const void *data,
172 int data_len);
173
174/**
175 * wlan_hdd_cfg80211_spectral_scan_start() - start spectral scan
176 * @wiphy: WIPHY structure pointer
177 * @wdev: Wireless device structure pointer
178 * @data: Pointer to the data received
179 * @data_len: Length of the data received
180 *
181 * This function starts spectral scan
182 *
183 * Return: 0 on success and errno on failure
184 */
185int wlan_hdd_cfg80211_spectral_scan_get_status(struct wiphy *wiphy,
186 struct wireless_dev *wdev,
187 const void *data,
188 int data_len);
Sandeep Puligilla8e89d572018-04-02 18:07:45 -0700189#else
190#define FEATURE_SPECTRAL_SCAN_VENDOR_COMMANDS
191#endif
Sandeep Puligilla00d2a1f2017-12-21 00:21:44 -0800192
Sandeep Puligilla8e89d572018-04-02 18:07:45 -0700193#if defined(CNSS_GENL) && defined(WLAN_CONV_SPECTRAL_ENABLE)
Sandeep Puligilla019a1bd2018-02-04 22:57:44 -0800194/**
195 * spectral_scan_activate_service() - Activate spectral scan message handler
196 *
Vignesh Viswanathana1cb4b42018-05-17 21:19:27 +0530197 * This function registers a handler to receive netlink message from
198 * the spectral scan application process.
Sandeep Puligilla019a1bd2018-02-04 22:57:44 -0800199 *
Vignesh Viswanathana1cb4b42018-05-17 21:19:27 +0530200 * Return: None
Sandeep Puligilla019a1bd2018-02-04 22:57:44 -0800201 */
Vignesh Viswanathana1cb4b42018-05-17 21:19:27 +0530202void spectral_scan_activate_service(void);
203
204/**
205 * spectral_scan_deactivate_service() - Deactivate spectral scan message handler
206 *
207 * This function deregisters a handler to receive netlink message from
208 * the spectral scan application process.
209 *
210 * Return: None
211 */
212void spectral_scan_deactivate_service(void);
Sandeep Puligilla8e89d572018-04-02 18:07:45 -0700213#else
Vignesh Viswanathana1cb4b42018-05-17 21:19:27 +0530214static inline void spectral_scan_activate_service(void)
Sandeep Puligilla8e89d572018-04-02 18:07:45 -0700215{
Vignesh Viswanathana1cb4b42018-05-17 21:19:27 +0530216}
217
218static inline void spectral_scan_deactivate_service(void)
219{
Sandeep Puligilla8e89d572018-04-02 18:07:45 -0700220}
221#endif
Sandeep Puligilla00d2a1f2017-12-21 00:21:44 -0800222#endif