blob: 87479a53411bd860a461c2ad90d585c52147a534 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Hila Gonene35e4d22012-06-27 17:19:42 +03002#ifndef __CFG80211_RDEV_OPS
3#define __CFG80211_RDEV_OPS
4
5#include <linux/rtnetlink.h>
6#include <net/cfg80211.h>
7#include "core.h"
Beni Lev14e8a3c2012-07-31 18:48:27 +03008#include "trace.h"
Hila Gonene35e4d22012-06-27 17:19:42 +03009
Stanislaw Gruszka81256962013-02-28 10:55:25 +010010static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
11 struct cfg80211_wowlan *wowlan)
Hila Gonene35e4d22012-06-27 17:19:42 +030012{
Beni Lev14e8a3c2012-07-31 18:48:27 +030013 int ret;
Stanislaw Gruszka81256962013-02-28 10:55:25 +010014 trace_rdev_suspend(&rdev->wiphy, wowlan);
15 ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
Beni Lev14e8a3c2012-07-31 18:48:27 +030016 trace_rdev_return_int(&rdev->wiphy, ret);
17 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030018}
19
20static inline int rdev_resume(struct cfg80211_registered_device *rdev)
21{
Beni Lev14e8a3c2012-07-31 18:48:27 +030022 int ret;
23 trace_rdev_resume(&rdev->wiphy);
24 ret = rdev->ops->resume(&rdev->wiphy);
25 trace_rdev_return_int(&rdev->wiphy, ret);
26 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030027}
28
29static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
30 bool enabled)
31{
Beni Lev14e8a3c2012-07-31 18:48:27 +030032 trace_rdev_set_wakeup(&rdev->wiphy, enabled);
Hila Gonene35e4d22012-06-27 17:19:42 +030033 rdev->ops->set_wakeup(&rdev->wiphy, enabled);
Beni Lev14e8a3c2012-07-31 18:48:27 +030034 trace_rdev_return_void(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +030035}
36
37static inline struct wireless_dev
38*rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
Tom Gundersen6bab2e192015-03-18 11:13:39 +010039 unsigned char name_assign_type,
Johannes Berg818a9862017-04-12 11:23:28 +020040 enum nl80211_iftype type,
Hila Gonene35e4d22012-06-27 17:19:42 +030041 struct vif_params *params)
42{
Beni Lev14e8a3c2012-07-31 18:48:27 +030043 struct wireless_dev *ret;
44 trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
Tom Gundersen6bab2e192015-03-18 11:13:39 +010045 ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
Johannes Berg818a9862017-04-12 11:23:28 +020046 type, params);
Beni Lev14e8a3c2012-07-31 18:48:27 +030047 trace_rdev_return_wdev(&rdev->wiphy, ret);
48 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030049}
50
51static inline int
52rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
53 struct wireless_dev *wdev)
54{
Beni Lev14e8a3c2012-07-31 18:48:27 +030055 int ret;
56 trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
57 ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
58 trace_rdev_return_int(&rdev->wiphy, ret);
59 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030060}
61
62static inline int
63rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
64 struct net_device *dev, enum nl80211_iftype type,
Johannes Berg818a9862017-04-12 11:23:28 +020065 struct vif_params *params)
Hila Gonene35e4d22012-06-27 17:19:42 +030066{
Beni Lev14e8a3c2012-07-31 18:48:27 +030067 int ret;
68 trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
Johannes Berg818a9862017-04-12 11:23:28 +020069 ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, params);
Beni Lev14e8a3c2012-07-31 18:48:27 +030070 trace_rdev_return_int(&rdev->wiphy, ret);
71 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030072}
73
74static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
75 struct net_device *netdev, u8 key_index,
76 bool pairwise, const u8 *mac_addr,
77 struct key_params *params)
78{
Beni Lev14e8a3c2012-07-31 18:48:27 +030079 int ret;
80 trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
81 ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise,
Hila Gonene35e4d22012-06-27 17:19:42 +030082 mac_addr, params);
Beni Lev14e8a3c2012-07-31 18:48:27 +030083 trace_rdev_return_int(&rdev->wiphy, ret);
84 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030085}
86
87static inline int
88rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
89 u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie,
90 void (*callback)(void *cookie, struct key_params*))
91{
Beni Lev14e8a3c2012-07-31 18:48:27 +030092 int ret;
93 trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
94 ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise,
Hila Gonene35e4d22012-06-27 17:19:42 +030095 mac_addr, cookie, callback);
Beni Lev14e8a3c2012-07-31 18:48:27 +030096 trace_rdev_return_int(&rdev->wiphy, ret);
97 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030098}
99
100static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
101 struct net_device *netdev, u8 key_index,
102 bool pairwise, const u8 *mac_addr)
103{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300104 int ret;
105 trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
106 ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise,
Hila Gonene35e4d22012-06-27 17:19:42 +0300107 mac_addr);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300108 trace_rdev_return_int(&rdev->wiphy, ret);
109 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300110}
111
112static inline int
113rdev_set_default_key(struct cfg80211_registered_device *rdev,
114 struct net_device *netdev, u8 key_index, bool unicast,
115 bool multicast)
116{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300117 int ret;
118 trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index,
119 unicast, multicast);
120 ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index,
Hila Gonene35e4d22012-06-27 17:19:42 +0300121 unicast, multicast);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300122 trace_rdev_return_int(&rdev->wiphy, ret);
123 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300124}
125
126static inline int
127rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
128 struct net_device *netdev, u8 key_index)
129{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300130 int ret;
131 trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index);
132 ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev,
Hila Gonene35e4d22012-06-27 17:19:42 +0300133 key_index);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300134 trace_rdev_return_int(&rdev->wiphy, ret);
135 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300136}
137
138static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
139 struct net_device *dev,
140 struct cfg80211_ap_settings *settings)
141{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300142 int ret;
143 trace_rdev_start_ap(&rdev->wiphy, dev, settings);
144 ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings);
145 trace_rdev_return_int(&rdev->wiphy, ret);
146 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300147}
148
149static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
150 struct net_device *dev,
151 struct cfg80211_beacon_data *info)
152{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300153 int ret;
154 trace_rdev_change_beacon(&rdev->wiphy, dev, info);
155 ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info);
156 trace_rdev_return_int(&rdev->wiphy, ret);
157 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300158}
159
160static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
161 struct net_device *dev)
162{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300163 int ret;
164 trace_rdev_stop_ap(&rdev->wiphy, dev);
165 ret = rdev->ops->stop_ap(&rdev->wiphy, dev);
166 trace_rdev_return_int(&rdev->wiphy, ret);
167 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300168}
169
170static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
171 struct net_device *dev, u8 *mac,
172 struct station_parameters *params)
173{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300174 int ret;
175 trace_rdev_add_station(&rdev->wiphy, dev, mac, params);
176 ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
177 trace_rdev_return_int(&rdev->wiphy, ret);
178 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300179}
180
181static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
Jouni Malinen89c771e2014-10-10 20:52:40 +0300182 struct net_device *dev,
183 struct station_del_parameters *params)
Hila Gonene35e4d22012-06-27 17:19:42 +0300184{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300185 int ret;
Jouni Malinen89c771e2014-10-10 20:52:40 +0300186 trace_rdev_del_station(&rdev->wiphy, dev, params);
187 ret = rdev->ops->del_station(&rdev->wiphy, dev, params);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300188 trace_rdev_return_int(&rdev->wiphy, ret);
189 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300190}
191
192static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
193 struct net_device *dev, u8 *mac,
194 struct station_parameters *params)
195{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300196 int ret;
197 trace_rdev_change_station(&rdev->wiphy, dev, mac, params);
198 ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
199 trace_rdev_return_int(&rdev->wiphy, ret);
200 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300201}
202
203static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
Antonio Quartulli74063532014-05-19 21:53:21 +0200204 struct net_device *dev, const u8 *mac,
Hila Gonene35e4d22012-06-27 17:19:42 +0300205 struct station_info *sinfo)
206{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300207 int ret;
208 trace_rdev_get_station(&rdev->wiphy, dev, mac);
209 ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
210 trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
211 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300212}
213
214static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
215 struct net_device *dev, int idx, u8 *mac,
216 struct station_info *sinfo)
217{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300218 int ret;
219 trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac);
220 ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
221 trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
222 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300223}
224
225static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
226 struct net_device *dev, u8 *dst, u8 *next_hop)
227{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300228 int ret;
229 trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop);
230 ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
231 trace_rdev_return_int(&rdev->wiphy, ret);
232 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300233}
234
235static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
236 struct net_device *dev, u8 *dst)
237{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300238 int ret;
239 trace_rdev_del_mpath(&rdev->wiphy, dev, dst);
240 ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
241 trace_rdev_return_int(&rdev->wiphy, ret);
242 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300243}
244
245static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
246 struct net_device *dev, u8 *dst,
247 u8 *next_hop)
248{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300249 int ret;
250 trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop);
251 ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
252 trace_rdev_return_int(&rdev->wiphy, ret);
253 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300254}
255
256static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
257 struct net_device *dev, u8 *dst, u8 *next_hop,
258 struct mpath_info *pinfo)
259{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300260 int ret;
261 trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop);
262 ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
263 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
264 return ret;
265
Hila Gonene35e4d22012-06-27 17:19:42 +0300266}
267
Henning Rogge66be7d22014-09-12 08:58:49 +0200268static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev,
269 struct net_device *dev, u8 *dst, u8 *mpp,
270 struct mpath_info *pinfo)
271{
272 int ret;
273
274 trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp);
275 ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo);
276 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
277 return ret;
278}
279
Hila Gonene35e4d22012-06-27 17:19:42 +0300280static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev,
281 struct net_device *dev, int idx, u8 *dst,
282 u8 *next_hop, struct mpath_info *pinfo)
283
284{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300285 int ret;
286 trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop);
287 ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
Henning Rogge66be7d22014-09-12 08:58:49 +0200288 pinfo);
289 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
290 return ret;
291}
292
293static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev,
294 struct net_device *dev, int idx, u8 *dst,
295 u8 *mpp, struct mpath_info *pinfo)
296
297{
298 int ret;
299
300 trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp);
301 ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300302 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
303 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300304}
305
306static inline int
307rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
308 struct net_device *dev, struct mesh_config *conf)
309{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300310 int ret;
311 trace_rdev_get_mesh_config(&rdev->wiphy, dev);
312 ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
313 trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf);
314 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300315}
316
317static inline int
318rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
319 struct net_device *dev, u32 mask,
320 const struct mesh_config *nconf)
321{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300322 int ret;
323 trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf);
324 ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
325 trace_rdev_return_int(&rdev->wiphy, ret);
326 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300327}
328
329static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
330 struct net_device *dev,
331 const struct mesh_config *conf,
332 const struct mesh_setup *setup)
333{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300334 int ret;
335 trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup);
336 ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
337 trace_rdev_return_int(&rdev->wiphy, ret);
338 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300339}
340
341
342static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
343 struct net_device *dev)
344{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300345 int ret;
346 trace_rdev_leave_mesh(&rdev->wiphy, dev);
347 ret = rdev->ops->leave_mesh(&rdev->wiphy, dev);
348 trace_rdev_return_int(&rdev->wiphy, ret);
349 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300350}
351
Rostislav Lisovy6e0bd6c2014-11-03 10:33:18 +0100352static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev,
353 struct net_device *dev,
354 struct ocb_setup *setup)
355{
356 int ret;
357 trace_rdev_join_ocb(&rdev->wiphy, dev, setup);
358 ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup);
359 trace_rdev_return_int(&rdev->wiphy, ret);
360 return ret;
361}
362
363static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev,
364 struct net_device *dev)
365{
366 int ret;
367 trace_rdev_leave_ocb(&rdev->wiphy, dev);
368 ret = rdev->ops->leave_ocb(&rdev->wiphy, dev);
369 trace_rdev_return_int(&rdev->wiphy, ret);
370 return ret;
371}
372
Hila Gonene35e4d22012-06-27 17:19:42 +0300373static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
374 struct net_device *dev,
375 struct bss_parameters *params)
376
377{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300378 int ret;
379 trace_rdev_change_bss(&rdev->wiphy, dev, params);
380 ret = rdev->ops->change_bss(&rdev->wiphy, dev, params);
381 trace_rdev_return_int(&rdev->wiphy, ret);
382 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300383}
384
385static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
386 struct net_device *dev,
387 struct ieee80211_txq_params *params)
388
389{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300390 int ret;
391 trace_rdev_set_txq_params(&rdev->wiphy, dev, params);
392 ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
393 trace_rdev_return_int(&rdev->wiphy, ret);
394 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300395}
396
397static inline int
398rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
399 struct net_device *dev,
400 struct ieee80211_channel *chan)
401{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300402 int ret;
403 trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
404 ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
405 trace_rdev_return_int(&rdev->wiphy, ret);
406 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300407}
408
409static inline int
410rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
Johannes Berg683b6d32012-11-08 21:25:48 +0100411 struct cfg80211_chan_def *chandef)
Hila Gonene35e4d22012-06-27 17:19:42 +0300412{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300413 int ret;
Johannes Berg683b6d32012-11-08 21:25:48 +0100414 trace_rdev_set_monitor_channel(&rdev->wiphy, chandef);
415 ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300416 trace_rdev_return_int(&rdev->wiphy, ret);
417 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300418}
419
420static inline int rdev_scan(struct cfg80211_registered_device *rdev,
421 struct cfg80211_scan_request *request)
422{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300423 int ret;
424 trace_rdev_scan(&rdev->wiphy, request);
425 ret = rdev->ops->scan(&rdev->wiphy, request);
426 trace_rdev_return_int(&rdev->wiphy, ret);
427 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300428}
429
Vidyullatha Kanchanapally91d3ab42015-10-30 19:14:49 +0530430static inline void rdev_abort_scan(struct cfg80211_registered_device *rdev,
431 struct wireless_dev *wdev)
432{
433 trace_rdev_abort_scan(&rdev->wiphy, wdev);
434 rdev->ops->abort_scan(&rdev->wiphy, wdev);
435 trace_rdev_return_void(&rdev->wiphy);
436}
437
Hila Gonene35e4d22012-06-27 17:19:42 +0300438static inline int rdev_auth(struct cfg80211_registered_device *rdev,
439 struct net_device *dev,
440 struct cfg80211_auth_request *req)
441{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300442 int ret;
443 trace_rdev_auth(&rdev->wiphy, dev, req);
444 ret = rdev->ops->auth(&rdev->wiphy, dev, req);
445 trace_rdev_return_int(&rdev->wiphy, ret);
446 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300447}
448
449static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
450 struct net_device *dev,
451 struct cfg80211_assoc_request *req)
452{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300453 int ret;
454 trace_rdev_assoc(&rdev->wiphy, dev, req);
455 ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
456 trace_rdev_return_int(&rdev->wiphy, ret);
457 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300458}
459
460static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
461 struct net_device *dev,
462 struct cfg80211_deauth_request *req)
463{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300464 int ret;
465 trace_rdev_deauth(&rdev->wiphy, dev, req);
466 ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
467 trace_rdev_return_int(&rdev->wiphy, ret);
468 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300469}
470
471static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
472 struct net_device *dev,
473 struct cfg80211_disassoc_request *req)
474{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300475 int ret;
476 trace_rdev_disassoc(&rdev->wiphy, dev, req);
477 ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
478 trace_rdev_return_int(&rdev->wiphy, ret);
479 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300480}
481
482static inline int rdev_connect(struct cfg80211_registered_device *rdev,
483 struct net_device *dev,
484 struct cfg80211_connect_params *sme)
485{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300486 int ret;
487 trace_rdev_connect(&rdev->wiphy, dev, sme);
488 ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
489 trace_rdev_return_int(&rdev->wiphy, ret);
490 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300491}
492
vamsi krishna088e8df2016-10-27 16:51:11 +0300493static inline int
494rdev_update_connect_params(struct cfg80211_registered_device *rdev,
495 struct net_device *dev,
496 struct cfg80211_connect_params *sme, u32 changed)
497{
498 int ret;
499 trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed);
500 ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed);
501 trace_rdev_return_int(&rdev->wiphy, ret);
502 return ret;
503}
504
Hila Gonene35e4d22012-06-27 17:19:42 +0300505static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
506 struct net_device *dev, u16 reason_code)
507{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300508 int ret;
509 trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
510 ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
511 trace_rdev_return_int(&rdev->wiphy, ret);
512 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300513}
514
515static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
516 struct net_device *dev,
517 struct cfg80211_ibss_params *params)
518{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300519 int ret;
520 trace_rdev_join_ibss(&rdev->wiphy, dev, params);
521 ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
522 trace_rdev_return_int(&rdev->wiphy, ret);
523 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300524}
525
526static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
527 struct net_device *dev)
528{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300529 int ret;
530 trace_rdev_leave_ibss(&rdev->wiphy, dev);
531 ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
532 trace_rdev_return_int(&rdev->wiphy, ret);
533 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300534}
535
536static inline int
537rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
538{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300539 int ret;
540 trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
541 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
542 trace_rdev_return_int(&rdev->wiphy, ret);
543 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300544}
545
546static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
Johannes Bergc8442112012-10-24 10:17:18 +0200547 struct wireless_dev *wdev,
Hila Gonene35e4d22012-06-27 17:19:42 +0300548 enum nl80211_tx_power_setting type, int mbm)
549{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300550 int ret;
Johannes Bergc8442112012-10-24 10:17:18 +0200551 trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
552 ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300553 trace_rdev_return_int(&rdev->wiphy, ret);
554 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300555}
556
557static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
Johannes Bergc8442112012-10-24 10:17:18 +0200558 struct wireless_dev *wdev, int *dbm)
Hila Gonene35e4d22012-06-27 17:19:42 +0300559{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300560 int ret;
Johannes Bergc8442112012-10-24 10:17:18 +0200561 trace_rdev_get_tx_power(&rdev->wiphy, wdev);
562 ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300563 trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
564 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300565}
566
567static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
568 struct net_device *dev, const u8 *addr)
569{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300570 int ret;
571 trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
572 ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
573 trace_rdev_return_int(&rdev->wiphy, ret);
574 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300575}
576
Michael Braunce0ce132016-10-10 19:12:22 +0200577static inline int
578rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev,
579 struct net_device *dev,
580 const bool enabled)
581{
582 int ret;
583 trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
584 ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
585 trace_rdev_return_int(&rdev->wiphy, ret);
586 return ret;
587}
588
Hila Gonene35e4d22012-06-27 17:19:42 +0300589static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
590{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300591 trace_rdev_rfkill_poll(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +0300592 rdev->ops->rfkill_poll(&rdev->wiphy);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300593 trace_rdev_return_void(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +0300594}
595
596
597#ifdef CONFIG_NL80211_TESTMODE
598static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
David Spinadelfc73f112013-07-31 18:04:15 +0300599 struct wireless_dev *wdev,
Hila Gonene35e4d22012-06-27 17:19:42 +0300600 void *data, int len)
601{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300602 int ret;
David Spinadelfc73f112013-07-31 18:04:15 +0300603 trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
604 ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300605 trace_rdev_return_int(&rdev->wiphy, ret);
606 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300607}
608
609static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
610 struct sk_buff *skb,
611 struct netlink_callback *cb, void *data,
612 int len)
613{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300614 int ret;
615 trace_rdev_testmode_dump(&rdev->wiphy);
616 ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
617 trace_rdev_return_int(&rdev->wiphy, ret);
618 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300619}
620#endif
621
622static inline int
623rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
624 struct net_device *dev, const u8 *peer,
625 const struct cfg80211_bitrate_mask *mask)
626{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300627 int ret;
628 trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
629 ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
630 trace_rdev_return_int(&rdev->wiphy, ret);
631 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300632}
633
634static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
635 struct net_device *netdev, int idx,
636 struct survey_info *info)
637{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300638 int ret;
639 trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
640 ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
641 if (ret < 0)
642 trace_rdev_return_int(&rdev->wiphy, ret);
643 else
644 trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
645 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300646}
647
648static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
649 struct net_device *netdev,
650 struct cfg80211_pmksa *pmksa)
651{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300652 int ret;
653 trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
654 ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
655 trace_rdev_return_int(&rdev->wiphy, ret);
656 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300657}
658
659static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
660 struct net_device *netdev,
661 struct cfg80211_pmksa *pmksa)
662{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300663 int ret;
664 trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
665 ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
666 trace_rdev_return_int(&rdev->wiphy, ret);
667 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300668}
669
670static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
671 struct net_device *netdev)
672{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300673 int ret;
674 trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
675 ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
676 trace_rdev_return_int(&rdev->wiphy, ret);
677 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300678}
679
680static inline int
681rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
682 struct wireless_dev *wdev,
683 struct ieee80211_channel *chan,
Hila Gonene35e4d22012-06-27 17:19:42 +0300684 unsigned int duration, u64 *cookie)
685{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300686 int ret;
Johannes Berg42d97a52012-11-08 18:31:02 +0100687 trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300688 ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
Johannes Berg42d97a52012-11-08 18:31:02 +0100689 duration, cookie);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300690 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
691 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300692}
693
694static inline int
695rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
696 struct wireless_dev *wdev, u64 cookie)
697{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300698 int ret;
699 trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
700 ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
701 trace_rdev_return_int(&rdev->wiphy, ret);
702 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300703}
704
705static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
706 struct wireless_dev *wdev,
Andrei Otcheretianskib176e622013-11-18 19:06:49 +0200707 struct cfg80211_mgmt_tx_params *params,
708 u64 *cookie)
Hila Gonene35e4d22012-06-27 17:19:42 +0300709{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300710 int ret;
Andrei Otcheretianskib176e622013-11-18 19:06:49 +0200711 trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
712 ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300713 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
714 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300715}
716
Denis Kenzior2576a9a2018-03-26 12:52:42 -0500717static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
718 struct net_device *dev,
719 const void *buf, size_t len,
720 const u8 *dest, __be16 proto,
721 const bool noencrypt)
722{
723 int ret;
724 trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len,
725 dest, proto, noencrypt);
726 ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len,
727 dest, proto, noencrypt);
728 trace_rdev_return_int(&rdev->wiphy, ret);
729 return ret;
730}
731
Hila Gonene35e4d22012-06-27 17:19:42 +0300732static inline int
733rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
734 struct wireless_dev *wdev, u64 cookie)
735{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300736 int ret;
737 trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
738 ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
739 trace_rdev_return_int(&rdev->wiphy, ret);
740 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300741}
742
743static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
744 struct net_device *dev, bool enabled,
745 int timeout)
746{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300747 int ret;
748 trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
749 ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
750 trace_rdev_return_int(&rdev->wiphy, ret);
751 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300752}
753
754static inline int
755rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
756 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
757{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300758 int ret;
759 trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
760 rssi_hyst);
761 ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
762 rssi_hyst);
763 trace_rdev_return_int(&rdev->wiphy, ret);
764 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300765}
766
767static inline int
Andrew Zaborowski4a4b8162017-02-10 10:02:31 +0100768rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device *rdev,
769 struct net_device *dev, s32 low, s32 high)
770{
771 int ret;
772 trace_rdev_set_cqm_rssi_range_config(&rdev->wiphy, dev, low, high);
773 ret = rdev->ops->set_cqm_rssi_range_config(&rdev->wiphy, dev,
774 low, high);
775 trace_rdev_return_int(&rdev->wiphy, ret);
776 return ret;
777}
778
779static inline int
Hila Gonene35e4d22012-06-27 17:19:42 +0300780rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
781 struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
782{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300783 int ret;
784 trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
785 ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
Hila Gonene35e4d22012-06-27 17:19:42 +0300786 intvl);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300787 trace_rdev_return_int(&rdev->wiphy, ret);
788 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300789}
790
791static inline void
792rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
793 struct wireless_dev *wdev, u16 frame_type, bool reg)
794{
Johannes Berg33d87832015-06-23 17:47:05 +0200795 might_sleep();
796
Beni Lev14e8a3c2012-07-31 18:48:27 +0300797 trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
798 rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
799 trace_rdev_return_void(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +0300800}
801
802static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
803 u32 tx_ant, u32 rx_ant)
804{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300805 int ret;
806 trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
807 ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
808 trace_rdev_return_int(&rdev->wiphy, ret);
809 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300810}
811
812static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
813 u32 *tx_ant, u32 *rx_ant)
814{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300815 int ret;
816 trace_rdev_get_antenna(&rdev->wiphy);
817 ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
818 if (ret)
819 trace_rdev_return_int(&rdev->wiphy, ret);
820 else
821 trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
822 *rx_ant);
823 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300824}
825
Hila Gonene35e4d22012-06-27 17:19:42 +0300826static inline int
827rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
828 struct net_device *dev,
829 struct cfg80211_sched_scan_request *request)
830{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300831 int ret;
Arend Van Sprielca986ad2017-04-21 13:05:00 +0100832 trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300833 ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
834 trace_rdev_return_int(&rdev->wiphy, ret);
835 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300836}
837
838static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
Arend Van Spriel3a3ecf12017-04-21 13:05:02 +0100839 struct net_device *dev, u64 reqid)
Hila Gonene35e4d22012-06-27 17:19:42 +0300840{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300841 int ret;
Arend Van Spriel3a3ecf12017-04-21 13:05:02 +0100842 trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid);
843 ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300844 trace_rdev_return_int(&rdev->wiphy, ret);
845 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300846}
847
848static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
849 struct net_device *dev,
850 struct cfg80211_gtk_rekey_data *data)
851{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300852 int ret;
853 trace_rdev_set_rekey_data(&rdev->wiphy, dev);
854 ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
855 trace_rdev_return_int(&rdev->wiphy, ret);
856 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300857}
858
859static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
860 struct net_device *dev, u8 *peer,
861 u8 action_code, u8 dialog_token,
Sunil Dutt Undekaridf942e72014-02-20 16:22:09 +0530862 u16 status_code, u32 peer_capability,
Arik Nemtsov31fa97c2014-06-11 17:18:21 +0300863 bool initiator, const u8 *buf, size_t len)
Hila Gonene35e4d22012-06-27 17:19:42 +0300864{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300865 int ret;
866 trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
Sunil Dutt Undekaridf942e72014-02-20 16:22:09 +0530867 dialog_token, status_code, peer_capability,
Arik Nemtsov31fa97c2014-06-11 17:18:21 +0300868 initiator, buf, len);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300869 ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
Sunil Dutt Undekaridf942e72014-02-20 16:22:09 +0530870 dialog_token, status_code, peer_capability,
Arik Nemtsov31fa97c2014-06-11 17:18:21 +0300871 initiator, buf, len);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300872 trace_rdev_return_int(&rdev->wiphy, ret);
873 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300874}
875
876static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
877 struct net_device *dev, u8 *peer,
878 enum nl80211_tdls_operation oper)
879{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300880 int ret;
881 trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
882 ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
883 trace_rdev_return_int(&rdev->wiphy, ret);
884 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300885}
886
887static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
888 struct net_device *dev, const u8 *peer,
889 u64 *cookie)
890{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300891 int ret;
892 trace_rdev_probe_client(&rdev->wiphy, dev, peer);
893 ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
894 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
895 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300896}
897
898static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
899 struct net_device *dev, u16 noack_map)
900{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300901 int ret;
902 trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
903 ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
904 trace_rdev_return_int(&rdev->wiphy, ret);
905 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300906}
907
908static inline int
Johannes Berg683b6d32012-11-08 21:25:48 +0100909rdev_get_channel(struct cfg80211_registered_device *rdev,
910 struct wireless_dev *wdev,
911 struct cfg80211_chan_def *chandef)
Hila Gonene35e4d22012-06-27 17:19:42 +0300912{
Johannes Berg683b6d32012-11-08 21:25:48 +0100913 int ret;
914
Beni Lev14e8a3c2012-07-31 18:48:27 +0300915 trace_rdev_get_channel(&rdev->wiphy, wdev);
Johannes Berg683b6d32012-11-08 21:25:48 +0100916 ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
917 trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
918
Beni Lev14e8a3c2012-07-31 18:48:27 +0300919 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300920}
921
Johannes Bergeeb126e2012-10-23 15:16:50 +0200922static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
923 struct wireless_dev *wdev)
924{
925 int ret;
926
927 trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
928 ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
929 trace_rdev_return_int(&rdev->wiphy, ret);
930 return ret;
931}
932
933static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
934 struct wireless_dev *wdev)
935{
936 trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
937 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
938 trace_rdev_return_void(&rdev->wiphy);
Arend van Spriel5de17982013-04-18 15:49:00 +0200939}
Vasanthakumar Thiagarajan77765ea2013-01-18 11:18:45 +0530940
Ayala Bekercb3b7d82016-09-20 17:31:13 +0300941static inline int rdev_start_nan(struct cfg80211_registered_device *rdev,
942 struct wireless_dev *wdev,
943 struct cfg80211_nan_conf *conf)
944{
945 int ret;
946
947 trace_rdev_start_nan(&rdev->wiphy, wdev, conf);
948 ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf);
949 trace_rdev_return_int(&rdev->wiphy, ret);
950 return ret;
951}
952
953static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev,
954 struct wireless_dev *wdev)
955{
956 trace_rdev_stop_nan(&rdev->wiphy, wdev);
957 rdev->ops->stop_nan(&rdev->wiphy, wdev);
958 trace_rdev_return_void(&rdev->wiphy);
959}
960
Ayala Bekera442b762016-09-20 17:31:15 +0300961static inline int
962rdev_add_nan_func(struct cfg80211_registered_device *rdev,
963 struct wireless_dev *wdev,
964 struct cfg80211_nan_func *nan_func)
965{
966 int ret;
967
968 trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func);
969 ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func);
970 trace_rdev_return_int(&rdev->wiphy, ret);
971 return ret;
972}
973
974static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev,
975 struct wireless_dev *wdev, u64 cookie)
976{
977 trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie);
978 rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie);
979 trace_rdev_return_void(&rdev->wiphy);
980}
981
Ayala Bekera5a9dcf2016-09-20 17:31:16 +0300982static inline int
983rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
984 struct wireless_dev *wdev,
985 struct cfg80211_nan_conf *conf, u32 changes)
986{
987 int ret;
988
989 trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes);
990 if (rdev->ops->nan_change_conf)
991 ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf,
992 changes);
993 else
994 ret = -ENOTSUPP;
995 trace_rdev_return_int(&rdev->wiphy, ret);
996 return ret;
997}
998
Vasanthakumar Thiagarajan77765ea2013-01-18 11:18:45 +0530999static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
1000 struct net_device *dev,
1001 struct cfg80211_acl_data *params)
1002{
1003 int ret;
1004
1005 trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
1006 ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
1007 trace_rdev_return_int(&rdev->wiphy, ret);
1008 return ret;
1009}
Jouni Malinen355199e2013-02-27 17:14:27 +02001010
1011static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
1012 struct net_device *dev,
1013 struct cfg80211_update_ft_ies_params *ftie)
1014{
1015 int ret;
1016
1017 trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
1018 ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
1019 trace_rdev_return_int(&rdev->wiphy, ret);
1020 return ret;
1021}
1022
Arend van Spriel5de17982013-04-18 15:49:00 +02001023static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
1024 struct wireless_dev *wdev,
1025 enum nl80211_crit_proto_id protocol,
1026 u16 duration)
1027{
1028 int ret;
1029
1030 trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
1031 ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
1032 protocol, duration);
1033 trace_rdev_return_int(&rdev->wiphy, ret);
1034 return ret;
1035}
1036
1037static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
1038 struct wireless_dev *wdev)
1039{
1040 trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
1041 rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
1042 trace_rdev_return_void(&rdev->wiphy);
1043}
1044
Simon Wunderlich16ef1fe2013-07-11 16:09:05 +02001045static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
1046 struct net_device *dev,
1047 struct cfg80211_csa_settings *params)
1048{
1049 int ret;
1050
1051 trace_rdev_channel_switch(&rdev->wiphy, dev, params);
1052 ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
1053 trace_rdev_return_int(&rdev->wiphy, ret);
1054 return ret;
1055}
1056
Kyeyoon Parkfa9ffc72013-12-16 23:01:30 -08001057static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
1058 struct net_device *dev,
1059 struct cfg80211_qos_map *qos_map)
1060{
1061 int ret = -EOPNOTSUPP;
1062
1063 if (rdev->ops->set_qos_map) {
1064 trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
1065 ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
1066 trace_rdev_return_int(&rdev->wiphy, ret);
1067 }
1068
1069 return ret;
1070}
1071
Jouni Malinene16821b2014-04-28 11:22:08 +03001072static inline int
1073rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
1074 struct net_device *dev, struct cfg80211_chan_def *chandef)
1075{
1076 int ret;
1077
1078 trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1079 ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1080 trace_rdev_return_int(&rdev->wiphy, ret);
1081
1082 return ret;
1083}
1084
Johannes Berg960d01a2014-09-09 22:55:35 +03001085static inline int
1086rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
1087 struct net_device *dev, u8 tsid, const u8 *peer,
1088 u8 user_prio, u16 admitted_time)
1089{
1090 int ret = -EOPNOTSUPP;
1091
1092 trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1093 user_prio, admitted_time);
1094 if (rdev->ops->add_tx_ts)
1095 ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1096 user_prio, admitted_time);
1097 trace_rdev_return_int(&rdev->wiphy, ret);
1098
1099 return ret;
1100}
1101
1102static inline int
1103rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
1104 struct net_device *dev, u8 tsid, const u8 *peer)
1105{
1106 int ret = -EOPNOTSUPP;
1107
1108 trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1109 if (rdev->ops->del_tx_ts)
1110 ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1111 trace_rdev_return_int(&rdev->wiphy, ret);
1112
1113 return ret;
1114}
1115
Arik Nemtsov1057d352014-11-19 12:54:26 +02001116static inline int
1117rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1118 struct net_device *dev, const u8 *addr,
1119 u8 oper_class, struct cfg80211_chan_def *chandef)
1120{
1121 int ret;
1122
1123 trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1124 chandef);
1125 ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1126 oper_class, chandef);
1127 trace_rdev_return_int(&rdev->wiphy, ret);
1128 return ret;
1129}
1130
1131static inline void
1132rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1133 struct net_device *dev, const u8 *addr)
1134{
1135 trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1136 rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1137 trace_rdev_return_void(&rdev->wiphy);
1138}
1139
Ilan Peera1056b1b2015-10-22 22:27:46 +03001140static inline int
1141rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
1142 struct net_device *dev,
1143 struct cfg80211_chan_def *chandef,
1144 u32 cac_time_ms)
1145{
1146 int ret = -ENOTSUPP;
1147
1148 trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
1149 cac_time_ms);
1150 if (rdev->ops->start_radar_detection)
1151 ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
1152 chandef, cac_time_ms);
1153 trace_rdev_return_int(&rdev->wiphy, ret);
1154 return ret;
1155}
1156
1157static inline int
1158rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1159 struct net_device *dev,
Johannes Berg57fbcce2016-04-12 15:56:15 +02001160 int mcast_rate[NUM_NL80211_BANDS])
Ilan Peera1056b1b2015-10-22 22:27:46 +03001161{
1162 int ret = -ENOTSUPP;
1163
1164 trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1165 if (rdev->ops->set_mcast_rate)
1166 ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1167 trace_rdev_return_int(&rdev->wiphy, ret);
1168 return ret;
1169}
1170
1171static inline int
1172rdev_set_coalesce(struct cfg80211_registered_device *rdev,
1173 struct cfg80211_coalesce *coalesce)
1174{
1175 int ret = -ENOTSUPP;
1176
1177 trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
1178 if (rdev->ops->set_coalesce)
1179 ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
1180 trace_rdev_return_int(&rdev->wiphy, ret);
1181 return ret;
1182}
Avraham Stern3a00df52017-06-09 13:08:43 +01001183
1184static inline int rdev_set_pmk(struct cfg80211_registered_device *rdev,
1185 struct net_device *dev,
1186 struct cfg80211_pmk_conf *pmk_conf)
1187{
1188 int ret = -EOPNOTSUPP;
1189
1190 trace_rdev_set_pmk(&rdev->wiphy, dev, pmk_conf);
1191 if (rdev->ops->set_pmk)
1192 ret = rdev->ops->set_pmk(&rdev->wiphy, dev, pmk_conf);
1193 trace_rdev_return_int(&rdev->wiphy, ret);
1194 return ret;
1195}
1196
1197static inline int rdev_del_pmk(struct cfg80211_registered_device *rdev,
1198 struct net_device *dev, const u8 *aa)
1199{
1200 int ret = -EOPNOTSUPP;
1201
1202 trace_rdev_del_pmk(&rdev->wiphy, dev, aa);
1203 if (rdev->ops->del_pmk)
1204 ret = rdev->ops->del_pmk(&rdev->wiphy, dev, aa);
1205 trace_rdev_return_int(&rdev->wiphy, ret);
1206 return ret;
1207}
Srinivas Dasari40cbfa92018-01-25 17:13:38 +02001208
1209static inline int
1210rdev_external_auth(struct cfg80211_registered_device *rdev,
1211 struct net_device *dev,
1212 struct cfg80211_external_auth_params *params)
1213{
1214 int ret = -EOPNOTSUPP;
1215
1216 trace_rdev_external_auth(&rdev->wiphy, dev, params);
1217 if (rdev->ops->external_auth)
1218 ret = rdev->ops->external_auth(&rdev->wiphy, dev, params);
1219 trace_rdev_return_int(&rdev->wiphy, ret);
1220 return ret;
1221}
1222
Hila Gonene35e4d22012-06-27 17:19:42 +03001223#endif /* __CFG80211_RDEV_OPS */