blob: 8ae0c04f9fc7d476919be7dc3b4e6c8e9a528496 [file] [log] [blame]
Hila Gonene35e4d22012-06-27 17:19:42 +03001#ifndef __CFG80211_RDEV_OPS
2#define __CFG80211_RDEV_OPS
3
4#include <linux/rtnetlink.h>
5#include <net/cfg80211.h>
6#include "core.h"
Beni Lev14e8a3c2012-07-31 18:48:27 +03007#include "trace.h"
Hila Gonene35e4d22012-06-27 17:19:42 +03008
Stanislaw Gruszka81256962013-02-28 10:55:25 +01009static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
10 struct cfg80211_wowlan *wowlan)
Hila Gonene35e4d22012-06-27 17:19:42 +030011{
Beni Lev14e8a3c2012-07-31 18:48:27 +030012 int ret;
Stanislaw Gruszka81256962013-02-28 10:55:25 +010013 trace_rdev_suspend(&rdev->wiphy, wowlan);
14 ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
Beni Lev14e8a3c2012-07-31 18:48:27 +030015 trace_rdev_return_int(&rdev->wiphy, ret);
16 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030017}
18
19static inline int rdev_resume(struct cfg80211_registered_device *rdev)
20{
Beni Lev14e8a3c2012-07-31 18:48:27 +030021 int ret;
22 trace_rdev_resume(&rdev->wiphy);
23 ret = rdev->ops->resume(&rdev->wiphy);
24 trace_rdev_return_int(&rdev->wiphy, ret);
25 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030026}
27
28static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
29 bool enabled)
30{
Beni Lev14e8a3c2012-07-31 18:48:27 +030031 trace_rdev_set_wakeup(&rdev->wiphy, enabled);
Hila Gonene35e4d22012-06-27 17:19:42 +030032 rdev->ops->set_wakeup(&rdev->wiphy, enabled);
Beni Lev14e8a3c2012-07-31 18:48:27 +030033 trace_rdev_return_void(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +030034}
35
36static inline struct wireless_dev
37*rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
Tom Gundersen6bab2e192015-03-18 11:13:39 +010038 unsigned char name_assign_type,
Hila Gonene35e4d22012-06-27 17:19:42 +030039 enum nl80211_iftype type, u32 *flags,
40 struct vif_params *params)
41{
Beni Lev14e8a3c2012-07-31 18:48:27 +030042 struct wireless_dev *ret;
43 trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
Tom Gundersen6bab2e192015-03-18 11:13:39 +010044 ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
45 type, flags, params);
Beni Lev14e8a3c2012-07-31 18:48:27 +030046 trace_rdev_return_wdev(&rdev->wiphy, ret);
47 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030048}
49
50static inline int
51rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
52 struct wireless_dev *wdev)
53{
Beni Lev14e8a3c2012-07-31 18:48:27 +030054 int ret;
55 trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
56 ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
57 trace_rdev_return_int(&rdev->wiphy, ret);
58 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +030059}
60
61static inline int
62rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
63 struct net_device *dev, enum nl80211_iftype type,
64 u32 *flags, struct vif_params *params)
65{
Beni Lev14e8a3c2012-07-31 18:48:27 +030066 int ret;
67 trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
68 ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags,
69 params);
70 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
493static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
494 struct net_device *dev, u16 reason_code)
495{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300496 int ret;
497 trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
498 ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
499 trace_rdev_return_int(&rdev->wiphy, ret);
500 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300501}
502
503static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
504 struct net_device *dev,
505 struct cfg80211_ibss_params *params)
506{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300507 int ret;
508 trace_rdev_join_ibss(&rdev->wiphy, dev, params);
509 ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
510 trace_rdev_return_int(&rdev->wiphy, ret);
511 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300512}
513
514static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
515 struct net_device *dev)
516{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300517 int ret;
518 trace_rdev_leave_ibss(&rdev->wiphy, dev);
519 ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
520 trace_rdev_return_int(&rdev->wiphy, ret);
521 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300522}
523
524static inline int
525rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
526{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300527 int ret;
528 trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
529 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
530 trace_rdev_return_int(&rdev->wiphy, ret);
531 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300532}
533
534static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
Johannes Bergc8442112012-10-24 10:17:18 +0200535 struct wireless_dev *wdev,
Hila Gonene35e4d22012-06-27 17:19:42 +0300536 enum nl80211_tx_power_setting type, int mbm)
537{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300538 int ret;
Johannes Bergc8442112012-10-24 10:17:18 +0200539 trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
540 ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300541 trace_rdev_return_int(&rdev->wiphy, ret);
542 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300543}
544
545static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
Johannes Bergc8442112012-10-24 10:17:18 +0200546 struct wireless_dev *wdev, int *dbm)
Hila Gonene35e4d22012-06-27 17:19:42 +0300547{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300548 int ret;
Johannes Bergc8442112012-10-24 10:17:18 +0200549 trace_rdev_get_tx_power(&rdev->wiphy, wdev);
550 ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300551 trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
552 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300553}
554
555static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
556 struct net_device *dev, const u8 *addr)
557{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300558 int ret;
559 trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
560 ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
561 trace_rdev_return_int(&rdev->wiphy, ret);
562 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300563}
564
565static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
566{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300567 trace_rdev_rfkill_poll(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +0300568 rdev->ops->rfkill_poll(&rdev->wiphy);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300569 trace_rdev_return_void(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +0300570}
571
572
573#ifdef CONFIG_NL80211_TESTMODE
574static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
David Spinadelfc73f112013-07-31 18:04:15 +0300575 struct wireless_dev *wdev,
Hila Gonene35e4d22012-06-27 17:19:42 +0300576 void *data, int len)
577{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300578 int ret;
David Spinadelfc73f112013-07-31 18:04:15 +0300579 trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
580 ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300581 trace_rdev_return_int(&rdev->wiphy, ret);
582 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300583}
584
585static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
586 struct sk_buff *skb,
587 struct netlink_callback *cb, void *data,
588 int len)
589{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300590 int ret;
591 trace_rdev_testmode_dump(&rdev->wiphy);
592 ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
593 trace_rdev_return_int(&rdev->wiphy, ret);
594 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300595}
596#endif
597
598static inline int
599rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
600 struct net_device *dev, const u8 *peer,
601 const struct cfg80211_bitrate_mask *mask)
602{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300603 int ret;
604 trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
605 ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
606 trace_rdev_return_int(&rdev->wiphy, ret);
607 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300608}
609
610static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
611 struct net_device *netdev, int idx,
612 struct survey_info *info)
613{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300614 int ret;
615 trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
616 ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
617 if (ret < 0)
618 trace_rdev_return_int(&rdev->wiphy, ret);
619 else
620 trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
621 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300622}
623
624static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
625 struct net_device *netdev,
626 struct cfg80211_pmksa *pmksa)
627{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300628 int ret;
629 trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
630 ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
631 trace_rdev_return_int(&rdev->wiphy, ret);
632 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300633}
634
635static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
636 struct net_device *netdev,
637 struct cfg80211_pmksa *pmksa)
638{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300639 int ret;
640 trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
641 ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
642 trace_rdev_return_int(&rdev->wiphy, ret);
643 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300644}
645
646static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
647 struct net_device *netdev)
648{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300649 int ret;
650 trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
651 ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
652 trace_rdev_return_int(&rdev->wiphy, ret);
653 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300654}
655
656static inline int
657rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
658 struct wireless_dev *wdev,
659 struct ieee80211_channel *chan,
Hila Gonene35e4d22012-06-27 17:19:42 +0300660 unsigned int duration, u64 *cookie)
661{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300662 int ret;
Johannes Berg42d97a52012-11-08 18:31:02 +0100663 trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300664 ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
Johannes Berg42d97a52012-11-08 18:31:02 +0100665 duration, cookie);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300666 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
667 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300668}
669
670static inline int
671rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
672 struct wireless_dev *wdev, u64 cookie)
673{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300674 int ret;
675 trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
676 ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
677 trace_rdev_return_int(&rdev->wiphy, ret);
678 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300679}
680
681static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
682 struct wireless_dev *wdev,
Andrei Otcheretianskib176e622013-11-18 19:06:49 +0200683 struct cfg80211_mgmt_tx_params *params,
684 u64 *cookie)
Hila Gonene35e4d22012-06-27 17:19:42 +0300685{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300686 int ret;
Andrei Otcheretianskib176e622013-11-18 19:06:49 +0200687 trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
688 ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300689 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
690 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300691}
692
693static inline int
694rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
695 struct wireless_dev *wdev, u64 cookie)
696{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300697 int ret;
698 trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
699 ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
700 trace_rdev_return_int(&rdev->wiphy, ret);
701 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300702}
703
704static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
705 struct net_device *dev, bool enabled,
706 int timeout)
707{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300708 int ret;
709 trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
710 ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
711 trace_rdev_return_int(&rdev->wiphy, ret);
712 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300713}
714
715static inline int
716rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
717 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
718{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300719 int ret;
720 trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
721 rssi_hyst);
722 ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
723 rssi_hyst);
724 trace_rdev_return_int(&rdev->wiphy, ret);
725 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300726}
727
728static inline int
729rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
730 struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
731{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300732 int ret;
733 trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
734 ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
Hila Gonene35e4d22012-06-27 17:19:42 +0300735 intvl);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300736 trace_rdev_return_int(&rdev->wiphy, ret);
737 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300738}
739
740static inline void
741rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
742 struct wireless_dev *wdev, u16 frame_type, bool reg)
743{
Johannes Berg33d87832015-06-23 17:47:05 +0200744 might_sleep();
745
Beni Lev14e8a3c2012-07-31 18:48:27 +0300746 trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
747 rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
748 trace_rdev_return_void(&rdev->wiphy);
Hila Gonene35e4d22012-06-27 17:19:42 +0300749}
750
751static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
752 u32 tx_ant, u32 rx_ant)
753{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300754 int ret;
755 trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
756 ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
757 trace_rdev_return_int(&rdev->wiphy, ret);
758 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300759}
760
761static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
762 u32 *tx_ant, u32 *rx_ant)
763{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300764 int ret;
765 trace_rdev_get_antenna(&rdev->wiphy);
766 ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
767 if (ret)
768 trace_rdev_return_int(&rdev->wiphy, ret);
769 else
770 trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
771 *rx_ant);
772 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300773}
774
Hila Gonene35e4d22012-06-27 17:19:42 +0300775static inline int
776rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
777 struct net_device *dev,
778 struct cfg80211_sched_scan_request *request)
779{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300780 int ret;
781 trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
782 ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
783 trace_rdev_return_int(&rdev->wiphy, ret);
784 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300785}
786
787static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
788 struct net_device *dev)
789{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300790 int ret;
791 trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
792 ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
793 trace_rdev_return_int(&rdev->wiphy, ret);
794 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300795}
796
797static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
798 struct net_device *dev,
799 struct cfg80211_gtk_rekey_data *data)
800{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300801 int ret;
802 trace_rdev_set_rekey_data(&rdev->wiphy, dev);
803 ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
804 trace_rdev_return_int(&rdev->wiphy, ret);
805 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300806}
807
808static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
809 struct net_device *dev, u8 *peer,
810 u8 action_code, u8 dialog_token,
Sunil Dutt Undekaridf942e72014-02-20 16:22:09 +0530811 u16 status_code, u32 peer_capability,
Arik Nemtsov31fa97c2014-06-11 17:18:21 +0300812 bool initiator, const u8 *buf, size_t len)
Hila Gonene35e4d22012-06-27 17:19:42 +0300813{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300814 int ret;
815 trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
Sunil Dutt Undekaridf942e72014-02-20 16:22:09 +0530816 dialog_token, status_code, peer_capability,
Arik Nemtsov31fa97c2014-06-11 17:18:21 +0300817 initiator, buf, len);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300818 ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
Sunil Dutt Undekaridf942e72014-02-20 16:22:09 +0530819 dialog_token, status_code, peer_capability,
Arik Nemtsov31fa97c2014-06-11 17:18:21 +0300820 initiator, buf, len);
Beni Lev14e8a3c2012-07-31 18:48:27 +0300821 trace_rdev_return_int(&rdev->wiphy, ret);
822 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300823}
824
825static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
826 struct net_device *dev, u8 *peer,
827 enum nl80211_tdls_operation oper)
828{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300829 int ret;
830 trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
831 ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
832 trace_rdev_return_int(&rdev->wiphy, ret);
833 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300834}
835
836static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
837 struct net_device *dev, const u8 *peer,
838 u64 *cookie)
839{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300840 int ret;
841 trace_rdev_probe_client(&rdev->wiphy, dev, peer);
842 ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
843 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
844 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300845}
846
847static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
848 struct net_device *dev, u16 noack_map)
849{
Beni Lev14e8a3c2012-07-31 18:48:27 +0300850 int ret;
851 trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
852 ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
853 trace_rdev_return_int(&rdev->wiphy, ret);
854 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300855}
856
857static inline int
Johannes Berg683b6d32012-11-08 21:25:48 +0100858rdev_get_channel(struct cfg80211_registered_device *rdev,
859 struct wireless_dev *wdev,
860 struct cfg80211_chan_def *chandef)
Hila Gonene35e4d22012-06-27 17:19:42 +0300861{
Johannes Berg683b6d32012-11-08 21:25:48 +0100862 int ret;
863
Beni Lev14e8a3c2012-07-31 18:48:27 +0300864 trace_rdev_get_channel(&rdev->wiphy, wdev);
Johannes Berg683b6d32012-11-08 21:25:48 +0100865 ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
866 trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
867
Beni Lev14e8a3c2012-07-31 18:48:27 +0300868 return ret;
Hila Gonene35e4d22012-06-27 17:19:42 +0300869}
870
Johannes Bergeeb126e2012-10-23 15:16:50 +0200871static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
872 struct wireless_dev *wdev)
873{
874 int ret;
875
876 trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
877 ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
878 trace_rdev_return_int(&rdev->wiphy, ret);
879 return ret;
880}
881
882static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
883 struct wireless_dev *wdev)
884{
885 trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
886 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
887 trace_rdev_return_void(&rdev->wiphy);
Arend van Spriel5de17982013-04-18 15:49:00 +0200888}
Vasanthakumar Thiagarajan77765ea2013-01-18 11:18:45 +0530889
890static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
891 struct net_device *dev,
892 struct cfg80211_acl_data *params)
893{
894 int ret;
895
896 trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
897 ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
898 trace_rdev_return_int(&rdev->wiphy, ret);
899 return ret;
900}
Jouni Malinen355199e2013-02-27 17:14:27 +0200901
902static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
903 struct net_device *dev,
904 struct cfg80211_update_ft_ies_params *ftie)
905{
906 int ret;
907
908 trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
909 ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
910 trace_rdev_return_int(&rdev->wiphy, ret);
911 return ret;
912}
913
Arend van Spriel5de17982013-04-18 15:49:00 +0200914static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
915 struct wireless_dev *wdev,
916 enum nl80211_crit_proto_id protocol,
917 u16 duration)
918{
919 int ret;
920
921 trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
922 ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
923 protocol, duration);
924 trace_rdev_return_int(&rdev->wiphy, ret);
925 return ret;
926}
927
928static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
929 struct wireless_dev *wdev)
930{
931 trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
932 rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
933 trace_rdev_return_void(&rdev->wiphy);
934}
935
Simon Wunderlich16ef1fe2013-07-11 16:09:05 +0200936static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
937 struct net_device *dev,
938 struct cfg80211_csa_settings *params)
939{
940 int ret;
941
942 trace_rdev_channel_switch(&rdev->wiphy, dev, params);
943 ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
944 trace_rdev_return_int(&rdev->wiphy, ret);
945 return ret;
946}
947
Kyeyoon Parkfa9ffc72013-12-16 23:01:30 -0800948static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
949 struct net_device *dev,
950 struct cfg80211_qos_map *qos_map)
951{
952 int ret = -EOPNOTSUPP;
953
954 if (rdev->ops->set_qos_map) {
955 trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
956 ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
957 trace_rdev_return_int(&rdev->wiphy, ret);
958 }
959
960 return ret;
961}
962
Jouni Malinene16821b2014-04-28 11:22:08 +0300963static inline int
964rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
965 struct net_device *dev, struct cfg80211_chan_def *chandef)
966{
967 int ret;
968
969 trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
970 ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
971 trace_rdev_return_int(&rdev->wiphy, ret);
972
973 return ret;
974}
975
Johannes Berg960d01a2014-09-09 22:55:35 +0300976static inline int
977rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
978 struct net_device *dev, u8 tsid, const u8 *peer,
979 u8 user_prio, u16 admitted_time)
980{
981 int ret = -EOPNOTSUPP;
982
983 trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
984 user_prio, admitted_time);
985 if (rdev->ops->add_tx_ts)
986 ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
987 user_prio, admitted_time);
988 trace_rdev_return_int(&rdev->wiphy, ret);
989
990 return ret;
991}
992
993static inline int
994rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
995 struct net_device *dev, u8 tsid, const u8 *peer)
996{
997 int ret = -EOPNOTSUPP;
998
999 trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1000 if (rdev->ops->del_tx_ts)
1001 ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1002 trace_rdev_return_int(&rdev->wiphy, ret);
1003
1004 return ret;
1005}
1006
Arik Nemtsov1057d352014-11-19 12:54:26 +02001007static inline int
1008rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1009 struct net_device *dev, const u8 *addr,
1010 u8 oper_class, struct cfg80211_chan_def *chandef)
1011{
1012 int ret;
1013
1014 trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1015 chandef);
1016 ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1017 oper_class, chandef);
1018 trace_rdev_return_int(&rdev->wiphy, ret);
1019 return ret;
1020}
1021
1022static inline void
1023rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1024 struct net_device *dev, const u8 *addr)
1025{
1026 trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1027 rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1028 trace_rdev_return_void(&rdev->wiphy);
1029}
1030
Ilan Peera1056b12015-10-22 22:27:46 +03001031static inline int
1032rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
1033 struct net_device *dev,
1034 struct cfg80211_chan_def *chandef,
1035 u32 cac_time_ms)
1036{
1037 int ret = -ENOTSUPP;
1038
1039 trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
1040 cac_time_ms);
1041 if (rdev->ops->start_radar_detection)
1042 ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
1043 chandef, cac_time_ms);
1044 trace_rdev_return_int(&rdev->wiphy, ret);
1045 return ret;
1046}
1047
1048static inline int
1049rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1050 struct net_device *dev,
1051 int mcast_rate[IEEE80211_NUM_BANDS])
1052{
1053 int ret = -ENOTSUPP;
1054
1055 trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1056 if (rdev->ops->set_mcast_rate)
1057 ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1058 trace_rdev_return_int(&rdev->wiphy, ret);
1059 return ret;
1060}
1061
1062static inline int
1063rdev_set_coalesce(struct cfg80211_registered_device *rdev,
1064 struct cfg80211_coalesce *coalesce)
1065{
1066 int ret = -ENOTSUPP;
1067
1068 trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
1069 if (rdev->ops->set_coalesce)
1070 ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
1071 trace_rdev_return_int(&rdev->wiphy, ret);
1072 return ret;
1073}
Hila Gonene35e4d22012-06-27 17:19:42 +03001074#endif /* __CFG80211_RDEV_OPS */