netfilter: nf_tables: add __nft_chain_type_get()
[platform/kernel/linux-rpi.git] / net / wireless / rdev-ops.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __CFG80211_RDEV_OPS
3 #define __CFG80211_RDEV_OPS
4
5 #include <linux/rtnetlink.h>
6 #include <net/cfg80211.h>
7 #include "core.h"
8 #include "trace.h"
9
10 static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
11                                struct cfg80211_wowlan *wowlan)
12 {
13         int ret;
14         trace_rdev_suspend(&rdev->wiphy, wowlan);
15         ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
16         trace_rdev_return_int(&rdev->wiphy, ret);
17         return ret;
18 }
19
20 static inline int rdev_resume(struct cfg80211_registered_device *rdev)
21 {
22         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;
27 }
28
29 static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
30                                    bool enabled)
31 {
32         trace_rdev_set_wakeup(&rdev->wiphy, enabled);
33         rdev->ops->set_wakeup(&rdev->wiphy, enabled);
34         trace_rdev_return_void(&rdev->wiphy);
35 }
36
37 static inline struct wireless_dev
38 *rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
39                        unsigned char name_assign_type,
40                        enum nl80211_iftype type,
41                        struct vif_params *params)
42 {
43         struct wireless_dev *ret;
44         trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
45         ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
46                                           type, params);
47         trace_rdev_return_wdev(&rdev->wiphy, ret);
48         return ret;
49 }
50
51 static inline int
52 rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
53                       struct wireless_dev *wdev)
54 {
55         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;
60 }
61
62 static inline int
63 rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
64                          struct net_device *dev, enum nl80211_iftype type,
65                          struct vif_params *params)
66 {
67         int ret;
68         trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
69         ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, params);
70         trace_rdev_return_int(&rdev->wiphy, ret);
71         return ret;
72 }
73
74 static 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 {
79         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,
82                                   mac_addr, params);
83         trace_rdev_return_int(&rdev->wiphy, ret);
84         return ret;
85 }
86
87 static inline int
88 rdev_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 {
92         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,
95                                   mac_addr, cookie, callback);
96         trace_rdev_return_int(&rdev->wiphy, ret);
97         return ret;
98 }
99
100 static 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 {
104         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,
107                                   mac_addr);
108         trace_rdev_return_int(&rdev->wiphy, ret);
109         return ret;
110 }
111
112 static inline int
113 rdev_set_default_key(struct cfg80211_registered_device *rdev,
114                      struct net_device *netdev, u8 key_index, bool unicast,
115                      bool multicast)
116 {
117         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,
121                                           unicast, multicast);
122         trace_rdev_return_int(&rdev->wiphy, ret);
123         return ret;
124 }
125
126 static inline int
127 rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
128                           struct net_device *netdev, u8 key_index)
129 {
130         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,
133                                                key_index);
134         trace_rdev_return_int(&rdev->wiphy, ret);
135         return ret;
136 }
137
138 static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
139                                 struct net_device *dev,
140                                 struct cfg80211_ap_settings *settings)
141 {
142         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;
147 }
148
149 static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
150                                      struct net_device *dev,
151                                      struct cfg80211_beacon_data *info)
152 {
153         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;
158 }
159
160 static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
161                                struct net_device *dev)
162 {
163         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;
168 }
169
170 static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
171                                    struct net_device *dev, u8 *mac,
172                                    struct station_parameters *params)
173 {
174         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;
179 }
180
181 static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
182                                    struct net_device *dev,
183                                    struct station_del_parameters *params)
184 {
185         int ret;
186         trace_rdev_del_station(&rdev->wiphy, dev, params);
187         ret = rdev->ops->del_station(&rdev->wiphy, dev, params);
188         trace_rdev_return_int(&rdev->wiphy, ret);
189         return ret;
190 }
191
192 static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
193                                       struct net_device *dev, u8 *mac,
194                                       struct station_parameters *params)
195 {
196         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;
201 }
202
203 static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
204                                    struct net_device *dev, const u8 *mac,
205                                    struct station_info *sinfo)
206 {
207         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;
212 }
213
214 static 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 {
218         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;
223 }
224
225 static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
226                                  struct net_device *dev, u8 *dst, u8 *next_hop)
227 {
228         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;
233 }
234
235 static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
236                                  struct net_device *dev, u8 *dst)
237 {
238         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;
243 }
244
245 static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
246                                     struct net_device *dev, u8 *dst,
247                                     u8 *next_hop)
248 {
249         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;
254 }
255
256 static 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 {
260         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
266 }
267
268 static 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
280 static 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 {
285         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,
288                                     pinfo);
289         trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
290         return ret;
291 }
292
293 static 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);
302         trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
303         return ret;
304 }
305
306 static inline int
307 rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
308                      struct net_device *dev, struct mesh_config *conf)
309 {
310         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;
315 }
316
317 static inline int
318 rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
319                         struct net_device *dev, u32 mask,
320                         const struct mesh_config *nconf)
321 {
322         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;
327 }
328
329 static 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 {
334         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;
339 }
340
341
342 static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
343                                   struct net_device *dev)
344 {
345         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;
350 }
351
352 static 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
363 static 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
373 static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
374                                   struct net_device *dev,
375                                   struct bss_parameters *params)
376
377 {
378         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;
383 }
384
385 static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
386                                       struct net_device *dev,
387                                       struct ieee80211_txq_params *params)
388
389 {
390         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;
395 }
396
397 static inline int
398 rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
399                                struct net_device *dev,
400                                struct ieee80211_channel *chan)
401 {
402         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;
407 }
408
409 static inline int
410 rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
411                          struct cfg80211_chan_def *chandef)
412 {
413         int ret;
414         trace_rdev_set_monitor_channel(&rdev->wiphy, chandef);
415         ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef);
416         trace_rdev_return_int(&rdev->wiphy, ret);
417         return ret;
418 }
419
420 static inline int rdev_scan(struct cfg80211_registered_device *rdev,
421                             struct cfg80211_scan_request *request)
422 {
423         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;
428 }
429
430 static 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
438 static inline int rdev_auth(struct cfg80211_registered_device *rdev,
439                             struct net_device *dev,
440                             struct cfg80211_auth_request *req)
441 {
442         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;
447 }
448
449 static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
450                              struct net_device *dev,
451                              struct cfg80211_assoc_request *req)
452 {
453         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;
458 }
459
460 static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
461                               struct net_device *dev,
462                               struct cfg80211_deauth_request *req)
463 {
464         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;
469 }
470
471 static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
472                                 struct net_device *dev,
473                                 struct cfg80211_disassoc_request *req)
474 {
475         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;
480 }
481
482 static inline int rdev_connect(struct cfg80211_registered_device *rdev,
483                                struct net_device *dev,
484                                struct cfg80211_connect_params *sme)
485 {
486         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;
491 }
492
493 static inline int
494 rdev_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
505 static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
506                                   struct net_device *dev, u16 reason_code)
507 {
508         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;
513 }
514
515 static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
516                                  struct net_device *dev,
517                                  struct cfg80211_ibss_params *params)
518 {
519         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;
524 }
525
526 static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
527                                   struct net_device *dev)
528 {
529         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;
534 }
535
536 static inline int
537 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
538 {
539         int ret;
540
541         if (!rdev->ops->set_wiphy_params)
542                 return -EOPNOTSUPP;
543
544         trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
545         ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
546         trace_rdev_return_int(&rdev->wiphy, ret);
547         return ret;
548 }
549
550 static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
551                                     struct wireless_dev *wdev,
552                                     enum nl80211_tx_power_setting type, int mbm)
553 {
554         int ret;
555         trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
556         ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
557         trace_rdev_return_int(&rdev->wiphy, ret);
558         return ret;
559 }
560
561 static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
562                                     struct wireless_dev *wdev, int *dbm)
563 {
564         int ret;
565         trace_rdev_get_tx_power(&rdev->wiphy, wdev);
566         ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
567         trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
568         return ret;
569 }
570
571 static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
572                                     struct net_device *dev, const u8 *addr)
573 {
574         int ret;
575         trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
576         ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
577         trace_rdev_return_int(&rdev->wiphy, ret);
578         return ret;
579 }
580
581 static inline int
582 rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev,
583                               struct net_device *dev,
584                               const bool enabled)
585 {
586         int ret;
587         trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
588         ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
589         trace_rdev_return_int(&rdev->wiphy, ret);
590         return ret;
591 }
592
593 static inline int
594 rdev_get_txq_stats(struct cfg80211_registered_device *rdev,
595                    struct wireless_dev *wdev,
596                    struct cfg80211_txq_stats *txqstats)
597 {
598         int ret;
599         trace_rdev_get_txq_stats(&rdev->wiphy, wdev);
600         ret = rdev->ops->get_txq_stats(&rdev->wiphy, wdev, txqstats);
601         trace_rdev_return_int(&rdev->wiphy, ret);
602         return ret;
603 }
604
605 static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
606 {
607         trace_rdev_rfkill_poll(&rdev->wiphy);
608         rdev->ops->rfkill_poll(&rdev->wiphy);
609         trace_rdev_return_void(&rdev->wiphy);
610 }
611
612
613 #ifdef CONFIG_NL80211_TESTMODE
614 static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
615                                     struct wireless_dev *wdev,
616                                     void *data, int len)
617 {
618         int ret;
619         trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
620         ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
621         trace_rdev_return_int(&rdev->wiphy, ret);
622         return ret;
623 }
624
625 static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
626                                      struct sk_buff *skb,
627                                      struct netlink_callback *cb, void *data,
628                                      int len)
629 {
630         int ret;
631         trace_rdev_testmode_dump(&rdev->wiphy);
632         ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
633         trace_rdev_return_int(&rdev->wiphy, ret);
634         return ret;
635 }
636 #endif
637
638 static inline int
639 rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
640                       struct net_device *dev, const u8 *peer,
641                       const struct cfg80211_bitrate_mask *mask)
642 {
643         int ret;
644         trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
645         ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
646         trace_rdev_return_int(&rdev->wiphy, ret);
647         return ret;
648 }
649
650 static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
651                                    struct net_device *netdev, int idx,
652                                    struct survey_info *info)
653 {
654         int ret;
655         trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
656         ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
657         if (ret < 0)
658                 trace_rdev_return_int(&rdev->wiphy, ret);
659         else
660                 trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
661         return ret;
662 }
663
664 static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
665                                  struct net_device *netdev,
666                                  struct cfg80211_pmksa *pmksa)
667 {
668         int ret;
669         trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
670         ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
671         trace_rdev_return_int(&rdev->wiphy, ret);
672         return ret;
673 }
674
675 static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
676                                  struct net_device *netdev,
677                                  struct cfg80211_pmksa *pmksa)
678 {
679         int ret;
680         trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
681         ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
682         trace_rdev_return_int(&rdev->wiphy, ret);
683         return ret;
684 }
685
686 static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
687                                    struct net_device *netdev)
688 {
689         int ret;
690         trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
691         ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
692         trace_rdev_return_int(&rdev->wiphy, ret);
693         return ret;
694 }
695
696 static inline int
697 rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
698                        struct wireless_dev *wdev,
699                        struct ieee80211_channel *chan,
700                        unsigned int duration, u64 *cookie)
701 {
702         int ret;
703         trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
704         ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
705                                            duration, cookie);
706         trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
707         return ret;
708 }
709
710 static inline int
711 rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
712                               struct wireless_dev *wdev, u64 cookie)
713 {
714         int ret;
715         trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
716         ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
717         trace_rdev_return_int(&rdev->wiphy, ret);
718         return ret;
719 }
720
721 static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
722                                struct wireless_dev *wdev,
723                                struct cfg80211_mgmt_tx_params *params,
724                                u64 *cookie)
725 {
726         int ret;
727         trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
728         ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
729         trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
730         return ret;
731 }
732
733 static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
734                                        struct net_device *dev,
735                                        const void *buf, size_t len,
736                                        const u8 *dest, __be16 proto,
737                                        const bool noencrypt)
738 {
739         int ret;
740         trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len,
741                                    dest, proto, noencrypt);
742         ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len,
743                                          dest, proto, noencrypt);
744         trace_rdev_return_int(&rdev->wiphy, ret);
745         return ret;
746 }
747
748 static inline int
749 rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
750                          struct wireless_dev *wdev, u64 cookie)
751 {
752         int ret;
753         trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
754         ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
755         trace_rdev_return_int(&rdev->wiphy, ret);
756         return ret;
757 }
758
759 static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
760                                       struct net_device *dev, bool enabled,
761                                       int timeout)
762 {
763         int ret;
764         trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
765         ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
766         trace_rdev_return_int(&rdev->wiphy, ret);
767         return ret;
768 }
769
770 static inline int
771 rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
772                          struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
773 {
774         int ret;
775         trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
776                                        rssi_hyst);
777         ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
778                                        rssi_hyst);
779         trace_rdev_return_int(&rdev->wiphy, ret);
780         return ret;
781 }
782
783 static inline int
784 rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device *rdev,
785                                struct net_device *dev, s32 low, s32 high)
786 {
787         int ret;
788         trace_rdev_set_cqm_rssi_range_config(&rdev->wiphy, dev, low, high);
789         ret = rdev->ops->set_cqm_rssi_range_config(&rdev->wiphy, dev,
790                                                    low, high);
791         trace_rdev_return_int(&rdev->wiphy, ret);
792         return ret;
793 }
794
795 static inline int
796 rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
797                         struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
798 {
799         int ret;
800         trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
801         ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
802                                              intvl);
803         trace_rdev_return_int(&rdev->wiphy, ret);
804         return ret;
805 }
806
807 static inline void
808 rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
809                          struct wireless_dev *wdev, u16 frame_type, bool reg)
810 {
811         might_sleep();
812
813         trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
814         rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
815         trace_rdev_return_void(&rdev->wiphy);
816 }
817
818 static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
819                                    u32 tx_ant, u32 rx_ant)
820 {
821         int ret;
822         trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
823         ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
824         trace_rdev_return_int(&rdev->wiphy, ret);
825         return ret;
826 }
827
828 static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
829                                    u32 *tx_ant, u32 *rx_ant)
830 {
831         int ret;
832         trace_rdev_get_antenna(&rdev->wiphy);
833         ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
834         if (ret)
835                 trace_rdev_return_int(&rdev->wiphy, ret);
836         else
837                 trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
838                                             *rx_ant);
839         return ret;
840 }
841
842 static inline int
843 rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
844                       struct net_device *dev,
845                       struct cfg80211_sched_scan_request *request)
846 {
847         int ret;
848         trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid);
849         ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
850         trace_rdev_return_int(&rdev->wiphy, ret);
851         return ret;
852 }
853
854 static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
855                                        struct net_device *dev, u64 reqid)
856 {
857         int ret;
858         trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid);
859         ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid);
860         trace_rdev_return_int(&rdev->wiphy, ret);
861         return ret;
862 }
863
864 static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
865                                       struct net_device *dev,
866                                       struct cfg80211_gtk_rekey_data *data)
867 {
868         int ret;
869         trace_rdev_set_rekey_data(&rdev->wiphy, dev);
870         ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
871         trace_rdev_return_int(&rdev->wiphy, ret);
872         return ret;
873 }
874
875 static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
876                                  struct net_device *dev, u8 *peer,
877                                  u8 action_code, u8 dialog_token,
878                                  u16 status_code, u32 peer_capability,
879                                  bool initiator, const u8 *buf, size_t len)
880 {
881         int ret;
882         trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
883                              dialog_token, status_code, peer_capability,
884                              initiator, buf, len);
885         ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
886                                    dialog_token, status_code, peer_capability,
887                                    initiator, buf, len);
888         trace_rdev_return_int(&rdev->wiphy, ret);
889         return ret;
890 }
891
892 static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
893                                  struct net_device *dev, u8 *peer,
894                                  enum nl80211_tdls_operation oper)
895 {
896         int ret;
897         trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
898         ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
899         trace_rdev_return_int(&rdev->wiphy, ret);
900         return ret;
901 }
902
903 static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
904                                     struct net_device *dev, const u8 *peer,
905                                     u64 *cookie)
906 {
907         int ret;
908         trace_rdev_probe_client(&rdev->wiphy, dev, peer);
909         ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
910         trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
911         return ret;
912 }
913
914 static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
915                                      struct net_device *dev, u16 noack_map)
916 {
917         int ret;
918         trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
919         ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
920         trace_rdev_return_int(&rdev->wiphy, ret);
921         return ret;
922 }
923
924 static inline int
925 rdev_get_channel(struct cfg80211_registered_device *rdev,
926                  struct wireless_dev *wdev,
927                  struct cfg80211_chan_def *chandef)
928 {
929         int ret;
930
931         trace_rdev_get_channel(&rdev->wiphy, wdev);
932         ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
933         trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
934
935         return ret;
936 }
937
938 static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
939                                         struct wireless_dev *wdev)
940 {
941         int ret;
942
943         trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
944         ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
945         trace_rdev_return_int(&rdev->wiphy, ret);
946         return ret;
947 }
948
949 static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
950                                         struct wireless_dev *wdev)
951 {
952         trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
953         rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
954         trace_rdev_return_void(&rdev->wiphy);
955 }
956
957 static inline int rdev_start_nan(struct cfg80211_registered_device *rdev,
958                                  struct wireless_dev *wdev,
959                                  struct cfg80211_nan_conf *conf)
960 {
961         int ret;
962
963         trace_rdev_start_nan(&rdev->wiphy, wdev, conf);
964         ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf);
965         trace_rdev_return_int(&rdev->wiphy, ret);
966         return ret;
967 }
968
969 static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev,
970                                  struct wireless_dev *wdev)
971 {
972         trace_rdev_stop_nan(&rdev->wiphy, wdev);
973         rdev->ops->stop_nan(&rdev->wiphy, wdev);
974         trace_rdev_return_void(&rdev->wiphy);
975 }
976
977 static inline int
978 rdev_add_nan_func(struct cfg80211_registered_device *rdev,
979                   struct wireless_dev *wdev,
980                   struct cfg80211_nan_func *nan_func)
981 {
982         int ret;
983
984         trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func);
985         ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func);
986         trace_rdev_return_int(&rdev->wiphy, ret);
987         return ret;
988 }
989
990 static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev,
991                                     struct wireless_dev *wdev, u64 cookie)
992 {
993         trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie);
994         rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie);
995         trace_rdev_return_void(&rdev->wiphy);
996 }
997
998 static inline int
999 rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
1000                      struct wireless_dev *wdev,
1001                      struct cfg80211_nan_conf *conf, u32 changes)
1002 {
1003         int ret;
1004
1005         trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes);
1006         if (rdev->ops->nan_change_conf)
1007                 ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf,
1008                                                  changes);
1009         else
1010                 ret = -ENOTSUPP;
1011         trace_rdev_return_int(&rdev->wiphy, ret);
1012         return ret;
1013 }
1014
1015 static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
1016                                    struct net_device *dev,
1017                                    struct cfg80211_acl_data *params)
1018 {
1019         int ret;
1020
1021         trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
1022         ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
1023         trace_rdev_return_int(&rdev->wiphy, ret);
1024         return ret;
1025 }
1026
1027 static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
1028                                      struct net_device *dev,
1029                                      struct cfg80211_update_ft_ies_params *ftie)
1030 {
1031         int ret;
1032
1033         trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
1034         ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
1035         trace_rdev_return_int(&rdev->wiphy, ret);
1036         return ret;
1037 }
1038
1039 static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
1040                                         struct wireless_dev *wdev,
1041                                         enum nl80211_crit_proto_id protocol,
1042                                         u16 duration)
1043 {
1044         int ret;
1045
1046         trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
1047         ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
1048                                           protocol, duration);
1049         trace_rdev_return_int(&rdev->wiphy, ret);
1050         return ret;
1051 }
1052
1053 static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
1054                                        struct wireless_dev *wdev)
1055 {
1056         trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
1057         rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
1058         trace_rdev_return_void(&rdev->wiphy);
1059 }
1060
1061 static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
1062                                       struct net_device *dev,
1063                                       struct cfg80211_csa_settings *params)
1064 {
1065         int ret;
1066
1067         trace_rdev_channel_switch(&rdev->wiphy, dev, params);
1068         ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
1069         trace_rdev_return_int(&rdev->wiphy, ret);
1070         return ret;
1071 }
1072
1073 static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
1074                                    struct net_device *dev,
1075                                    struct cfg80211_qos_map *qos_map)
1076 {
1077         int ret = -EOPNOTSUPP;
1078
1079         if (rdev->ops->set_qos_map) {
1080                 trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
1081                 ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
1082                 trace_rdev_return_int(&rdev->wiphy, ret);
1083         }
1084
1085         return ret;
1086 }
1087
1088 static inline int
1089 rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
1090                       struct net_device *dev, struct cfg80211_chan_def *chandef)
1091 {
1092         int ret;
1093
1094         trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1095         ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1096         trace_rdev_return_int(&rdev->wiphy, ret);
1097
1098         return ret;
1099 }
1100
1101 static inline int
1102 rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
1103                struct net_device *dev, u8 tsid, const u8 *peer,
1104                u8 user_prio, u16 admitted_time)
1105 {
1106         int ret = -EOPNOTSUPP;
1107
1108         trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1109                              user_prio, admitted_time);
1110         if (rdev->ops->add_tx_ts)
1111                 ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1112                                            user_prio, admitted_time);
1113         trace_rdev_return_int(&rdev->wiphy, ret);
1114
1115         return ret;
1116 }
1117
1118 static inline int
1119 rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
1120                struct net_device *dev, u8 tsid, const u8 *peer)
1121 {
1122         int ret = -EOPNOTSUPP;
1123
1124         trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1125         if (rdev->ops->del_tx_ts)
1126                 ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1127         trace_rdev_return_int(&rdev->wiphy, ret);
1128
1129         return ret;
1130 }
1131
1132 static inline int
1133 rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1134                          struct net_device *dev, const u8 *addr,
1135                          u8 oper_class, struct cfg80211_chan_def *chandef)
1136 {
1137         int ret;
1138
1139         trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1140                                        chandef);
1141         ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1142                                              oper_class, chandef);
1143         trace_rdev_return_int(&rdev->wiphy, ret);
1144         return ret;
1145 }
1146
1147 static inline void
1148 rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1149                                 struct net_device *dev, const u8 *addr)
1150 {
1151         trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1152         rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1153         trace_rdev_return_void(&rdev->wiphy);
1154 }
1155
1156 static inline int
1157 rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
1158                            struct net_device *dev,
1159                            struct cfg80211_chan_def *chandef,
1160                            u32 cac_time_ms)
1161 {
1162         int ret = -ENOTSUPP;
1163
1164         trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
1165                                          cac_time_ms);
1166         if (rdev->ops->start_radar_detection)
1167                 ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
1168                                                        chandef, cac_time_ms);
1169         trace_rdev_return_int(&rdev->wiphy, ret);
1170         return ret;
1171 }
1172
1173 static inline int
1174 rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1175                     struct net_device *dev,
1176                     int mcast_rate[NUM_NL80211_BANDS])
1177 {
1178         int ret = -ENOTSUPP;
1179
1180         trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1181         if (rdev->ops->set_mcast_rate)
1182                 ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1183         trace_rdev_return_int(&rdev->wiphy, ret);
1184         return ret;
1185 }
1186
1187 static inline int
1188 rdev_set_coalesce(struct cfg80211_registered_device *rdev,
1189                   struct cfg80211_coalesce *coalesce)
1190 {
1191         int ret = -ENOTSUPP;
1192
1193         trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
1194         if (rdev->ops->set_coalesce)
1195                 ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
1196         trace_rdev_return_int(&rdev->wiphy, ret);
1197         return ret;
1198 }
1199
1200 static inline int rdev_set_pmk(struct cfg80211_registered_device *rdev,
1201                                struct net_device *dev,
1202                                struct cfg80211_pmk_conf *pmk_conf)
1203 {
1204         int ret = -EOPNOTSUPP;
1205
1206         trace_rdev_set_pmk(&rdev->wiphy, dev, pmk_conf);
1207         if (rdev->ops->set_pmk)
1208                 ret = rdev->ops->set_pmk(&rdev->wiphy, dev, pmk_conf);
1209         trace_rdev_return_int(&rdev->wiphy, ret);
1210         return ret;
1211 }
1212
1213 static inline int rdev_del_pmk(struct cfg80211_registered_device *rdev,
1214                                struct net_device *dev, const u8 *aa)
1215 {
1216         int ret = -EOPNOTSUPP;
1217
1218         trace_rdev_del_pmk(&rdev->wiphy, dev, aa);
1219         if (rdev->ops->del_pmk)
1220                 ret = rdev->ops->del_pmk(&rdev->wiphy, dev, aa);
1221         trace_rdev_return_int(&rdev->wiphy, ret);
1222         return ret;
1223 }
1224
1225 static inline int
1226 rdev_external_auth(struct cfg80211_registered_device *rdev,
1227                    struct net_device *dev,
1228                    struct cfg80211_external_auth_params *params)
1229 {
1230         int ret = -EOPNOTSUPP;
1231
1232         trace_rdev_external_auth(&rdev->wiphy, dev, params);
1233         if (rdev->ops->external_auth)
1234                 ret = rdev->ops->external_auth(&rdev->wiphy, dev, params);
1235         trace_rdev_return_int(&rdev->wiphy, ret);
1236         return ret;
1237 }
1238
1239 #endif /* __CFG80211_RDEV_OPS */