1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __CFG80211_RDEV_OPS
3 #define __CFG80211_RDEV_OPS
5 #include <linux/rtnetlink.h>
6 #include <net/cfg80211.h>
10 static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
11 struct cfg80211_wowlan *wowlan)
14 trace_rdev_suspend(&rdev->wiphy, wowlan);
15 ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
16 trace_rdev_return_int(&rdev->wiphy, ret);
20 static inline int rdev_resume(struct cfg80211_registered_device *rdev)
23 trace_rdev_resume(&rdev->wiphy);
24 ret = rdev->ops->resume(&rdev->wiphy);
25 trace_rdev_return_int(&rdev->wiphy, ret);
29 static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
32 trace_rdev_set_wakeup(&rdev->wiphy, enabled);
33 rdev->ops->set_wakeup(&rdev->wiphy, enabled);
34 trace_rdev_return_void(&rdev->wiphy);
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)
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,
47 trace_rdev_return_wdev(&rdev->wiphy, ret);
52 rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
53 struct wireless_dev *wdev)
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);
63 rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
64 struct net_device *dev, enum nl80211_iftype type,
65 struct vif_params *params)
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);
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)
80 trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise,
81 mac_addr, params->mode);
82 ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise,
84 trace_rdev_return_int(&rdev->wiphy, ret);
89 rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
90 u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie,
91 void (*callback)(void *cookie, struct key_params*))
94 trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
95 ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise,
96 mac_addr, cookie, callback);
97 trace_rdev_return_int(&rdev->wiphy, ret);
101 static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
102 struct net_device *netdev, u8 key_index,
103 bool pairwise, const u8 *mac_addr)
106 trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
107 ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise,
109 trace_rdev_return_int(&rdev->wiphy, ret);
114 rdev_set_default_key(struct cfg80211_registered_device *rdev,
115 struct net_device *netdev, u8 key_index, bool unicast,
119 trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index,
121 ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index,
123 trace_rdev_return_int(&rdev->wiphy, ret);
128 rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
129 struct net_device *netdev, u8 key_index)
132 trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index);
133 ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev,
135 trace_rdev_return_int(&rdev->wiphy, ret);
139 static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
140 struct net_device *dev,
141 struct cfg80211_ap_settings *settings)
144 trace_rdev_start_ap(&rdev->wiphy, dev, settings);
145 ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings);
146 trace_rdev_return_int(&rdev->wiphy, ret);
150 static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
151 struct net_device *dev,
152 struct cfg80211_beacon_data *info)
155 trace_rdev_change_beacon(&rdev->wiphy, dev, info);
156 ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info);
157 trace_rdev_return_int(&rdev->wiphy, ret);
161 static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
162 struct net_device *dev)
165 trace_rdev_stop_ap(&rdev->wiphy, dev);
166 ret = rdev->ops->stop_ap(&rdev->wiphy, dev);
167 trace_rdev_return_int(&rdev->wiphy, ret);
171 static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
172 struct net_device *dev, u8 *mac,
173 struct station_parameters *params)
176 trace_rdev_add_station(&rdev->wiphy, dev, mac, params);
177 ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
178 trace_rdev_return_int(&rdev->wiphy, ret);
182 static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
183 struct net_device *dev,
184 struct station_del_parameters *params)
187 trace_rdev_del_station(&rdev->wiphy, dev, params);
188 ret = rdev->ops->del_station(&rdev->wiphy, dev, params);
189 trace_rdev_return_int(&rdev->wiphy, ret);
193 static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
194 struct net_device *dev, u8 *mac,
195 struct station_parameters *params)
198 trace_rdev_change_station(&rdev->wiphy, dev, mac, params);
199 ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
200 trace_rdev_return_int(&rdev->wiphy, ret);
204 static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
205 struct net_device *dev, const u8 *mac,
206 struct station_info *sinfo)
209 trace_rdev_get_station(&rdev->wiphy, dev, mac);
210 ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
211 trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
215 static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
216 struct net_device *dev, int idx, u8 *mac,
217 struct station_info *sinfo)
220 trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac);
221 ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
222 trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
226 static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
227 struct net_device *dev, u8 *dst, u8 *next_hop)
230 trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop);
231 ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
232 trace_rdev_return_int(&rdev->wiphy, ret);
236 static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
237 struct net_device *dev, u8 *dst)
240 trace_rdev_del_mpath(&rdev->wiphy, dev, dst);
241 ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
242 trace_rdev_return_int(&rdev->wiphy, ret);
246 static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
247 struct net_device *dev, u8 *dst,
251 trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop);
252 ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
253 trace_rdev_return_int(&rdev->wiphy, ret);
257 static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
258 struct net_device *dev, u8 *dst, u8 *next_hop,
259 struct mpath_info *pinfo)
262 trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop);
263 ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
264 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
269 static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev,
270 struct net_device *dev, u8 *dst, u8 *mpp,
271 struct mpath_info *pinfo)
275 trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp);
276 ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo);
277 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
281 static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev,
282 struct net_device *dev, int idx, u8 *dst,
283 u8 *next_hop, struct mpath_info *pinfo)
287 trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop);
288 ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
290 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
294 static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev,
295 struct net_device *dev, int idx, u8 *dst,
296 u8 *mpp, struct mpath_info *pinfo)
301 trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp);
302 ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo);
303 trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
308 rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
309 struct net_device *dev, struct mesh_config *conf)
312 trace_rdev_get_mesh_config(&rdev->wiphy, dev);
313 ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
314 trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf);
319 rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
320 struct net_device *dev, u32 mask,
321 const struct mesh_config *nconf)
324 trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf);
325 ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
326 trace_rdev_return_int(&rdev->wiphy, ret);
330 static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
331 struct net_device *dev,
332 const struct mesh_config *conf,
333 const struct mesh_setup *setup)
336 trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup);
337 ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
338 trace_rdev_return_int(&rdev->wiphy, ret);
343 static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
344 struct net_device *dev)
347 trace_rdev_leave_mesh(&rdev->wiphy, dev);
348 ret = rdev->ops->leave_mesh(&rdev->wiphy, dev);
349 trace_rdev_return_int(&rdev->wiphy, ret);
353 static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev,
354 struct net_device *dev,
355 struct ocb_setup *setup)
358 trace_rdev_join_ocb(&rdev->wiphy, dev, setup);
359 ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup);
360 trace_rdev_return_int(&rdev->wiphy, ret);
364 static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev,
365 struct net_device *dev)
368 trace_rdev_leave_ocb(&rdev->wiphy, dev);
369 ret = rdev->ops->leave_ocb(&rdev->wiphy, dev);
370 trace_rdev_return_int(&rdev->wiphy, ret);
374 static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
375 struct net_device *dev,
376 struct bss_parameters *params)
380 trace_rdev_change_bss(&rdev->wiphy, dev, params);
381 ret = rdev->ops->change_bss(&rdev->wiphy, dev, params);
382 trace_rdev_return_int(&rdev->wiphy, ret);
386 static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
387 struct net_device *dev,
388 struct ieee80211_txq_params *params)
392 trace_rdev_set_txq_params(&rdev->wiphy, dev, params);
393 ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
394 trace_rdev_return_int(&rdev->wiphy, ret);
399 rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
400 struct net_device *dev,
401 struct ieee80211_channel *chan)
404 trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
405 ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
406 trace_rdev_return_int(&rdev->wiphy, ret);
411 rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
412 struct cfg80211_chan_def *chandef)
415 trace_rdev_set_monitor_channel(&rdev->wiphy, chandef);
416 ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef);
417 trace_rdev_return_int(&rdev->wiphy, ret);
421 static inline int rdev_scan(struct cfg80211_registered_device *rdev,
422 struct cfg80211_scan_request *request)
425 trace_rdev_scan(&rdev->wiphy, request);
426 ret = rdev->ops->scan(&rdev->wiphy, request);
427 trace_rdev_return_int(&rdev->wiphy, ret);
431 static inline void rdev_abort_scan(struct cfg80211_registered_device *rdev,
432 struct wireless_dev *wdev)
434 trace_rdev_abort_scan(&rdev->wiphy, wdev);
435 rdev->ops->abort_scan(&rdev->wiphy, wdev);
436 trace_rdev_return_void(&rdev->wiphy);
439 static inline int rdev_auth(struct cfg80211_registered_device *rdev,
440 struct net_device *dev,
441 struct cfg80211_auth_request *req)
444 trace_rdev_auth(&rdev->wiphy, dev, req);
445 ret = rdev->ops->auth(&rdev->wiphy, dev, req);
446 trace_rdev_return_int(&rdev->wiphy, ret);
450 static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
451 struct net_device *dev,
452 struct cfg80211_assoc_request *req)
455 trace_rdev_assoc(&rdev->wiphy, dev, req);
456 ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
457 trace_rdev_return_int(&rdev->wiphy, ret);
461 static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
462 struct net_device *dev,
463 struct cfg80211_deauth_request *req)
466 trace_rdev_deauth(&rdev->wiphy, dev, req);
467 ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
468 trace_rdev_return_int(&rdev->wiphy, ret);
472 static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
473 struct net_device *dev,
474 struct cfg80211_disassoc_request *req)
477 trace_rdev_disassoc(&rdev->wiphy, dev, req);
478 ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
479 trace_rdev_return_int(&rdev->wiphy, ret);
483 static inline int rdev_connect(struct cfg80211_registered_device *rdev,
484 struct net_device *dev,
485 struct cfg80211_connect_params *sme)
488 trace_rdev_connect(&rdev->wiphy, dev, sme);
489 ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
490 trace_rdev_return_int(&rdev->wiphy, ret);
495 rdev_update_connect_params(struct cfg80211_registered_device *rdev,
496 struct net_device *dev,
497 struct cfg80211_connect_params *sme, u32 changed)
500 trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed);
501 ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed);
502 trace_rdev_return_int(&rdev->wiphy, ret);
506 static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
507 struct net_device *dev, u16 reason_code)
510 trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
511 ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
512 trace_rdev_return_int(&rdev->wiphy, ret);
516 static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
517 struct net_device *dev,
518 struct cfg80211_ibss_params *params)
521 trace_rdev_join_ibss(&rdev->wiphy, dev, params);
522 ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
523 trace_rdev_return_int(&rdev->wiphy, ret);
527 static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
528 struct net_device *dev)
531 trace_rdev_leave_ibss(&rdev->wiphy, dev);
532 ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
533 trace_rdev_return_int(&rdev->wiphy, ret);
538 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
541 trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
542 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
543 trace_rdev_return_int(&rdev->wiphy, ret);
547 static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
548 struct wireless_dev *wdev,
549 enum nl80211_tx_power_setting type, int mbm)
552 trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
553 ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
554 trace_rdev_return_int(&rdev->wiphy, ret);
558 static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
559 struct wireless_dev *wdev, int *dbm)
562 trace_rdev_get_tx_power(&rdev->wiphy, wdev);
563 ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
564 trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
568 static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
569 struct net_device *dev, const u8 *addr)
572 trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
573 ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
574 trace_rdev_return_int(&rdev->wiphy, ret);
579 rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev,
580 struct net_device *dev,
584 trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
585 ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
586 trace_rdev_return_int(&rdev->wiphy, ret);
591 rdev_get_txq_stats(struct cfg80211_registered_device *rdev,
592 struct wireless_dev *wdev,
593 struct cfg80211_txq_stats *txqstats)
596 trace_rdev_get_txq_stats(&rdev->wiphy, wdev);
597 ret = rdev->ops->get_txq_stats(&rdev->wiphy, wdev, txqstats);
598 trace_rdev_return_int(&rdev->wiphy, ret);
602 static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
604 trace_rdev_rfkill_poll(&rdev->wiphy);
605 rdev->ops->rfkill_poll(&rdev->wiphy);
606 trace_rdev_return_void(&rdev->wiphy);
610 #ifdef CONFIG_NL80211_TESTMODE
611 static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
612 struct wireless_dev *wdev,
616 trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
617 ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
618 trace_rdev_return_int(&rdev->wiphy, ret);
622 static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
624 struct netlink_callback *cb, void *data,
628 trace_rdev_testmode_dump(&rdev->wiphy);
629 ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
630 trace_rdev_return_int(&rdev->wiphy, ret);
636 rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
637 struct net_device *dev, const u8 *peer,
638 const struct cfg80211_bitrate_mask *mask)
641 trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
642 ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
643 trace_rdev_return_int(&rdev->wiphy, ret);
647 static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
648 struct net_device *netdev, int idx,
649 struct survey_info *info)
652 trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
653 ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
655 trace_rdev_return_int(&rdev->wiphy, ret);
657 trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
661 static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
662 struct net_device *netdev,
663 struct cfg80211_pmksa *pmksa)
666 trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
667 ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
668 trace_rdev_return_int(&rdev->wiphy, ret);
672 static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
673 struct net_device *netdev,
674 struct cfg80211_pmksa *pmksa)
677 trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
678 ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
679 trace_rdev_return_int(&rdev->wiphy, ret);
683 static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
684 struct net_device *netdev)
687 trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
688 ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
689 trace_rdev_return_int(&rdev->wiphy, ret);
694 rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
695 struct wireless_dev *wdev,
696 struct ieee80211_channel *chan,
697 unsigned int duration, u64 *cookie)
700 trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
701 ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
703 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
708 rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
709 struct wireless_dev *wdev, u64 cookie)
712 trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
713 ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
714 trace_rdev_return_int(&rdev->wiphy, ret);
718 static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
719 struct wireless_dev *wdev,
720 struct cfg80211_mgmt_tx_params *params,
724 trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
725 ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
726 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
730 static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
731 struct net_device *dev,
732 const void *buf, size_t len,
733 const u8 *dest, __be16 proto,
734 const bool noencrypt)
737 trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len,
738 dest, proto, noencrypt);
739 ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len,
740 dest, proto, noencrypt);
741 trace_rdev_return_int(&rdev->wiphy, ret);
746 rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
747 struct wireless_dev *wdev, u64 cookie)
750 trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
751 ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
752 trace_rdev_return_int(&rdev->wiphy, ret);
756 static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
757 struct net_device *dev, bool enabled,
761 trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
762 ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
763 trace_rdev_return_int(&rdev->wiphy, ret);
768 rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
769 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
772 trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
774 ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
776 trace_rdev_return_int(&rdev->wiphy, ret);
781 rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device *rdev,
782 struct net_device *dev, s32 low, s32 high)
785 trace_rdev_set_cqm_rssi_range_config(&rdev->wiphy, dev, low, high);
786 ret = rdev->ops->set_cqm_rssi_range_config(&rdev->wiphy, dev,
788 trace_rdev_return_int(&rdev->wiphy, ret);
793 rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
794 struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
797 trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
798 ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
800 trace_rdev_return_int(&rdev->wiphy, ret);
805 rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
806 struct wireless_dev *wdev, u16 frame_type, bool reg)
810 trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
811 rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
812 trace_rdev_return_void(&rdev->wiphy);
815 static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
816 u32 tx_ant, u32 rx_ant)
819 trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
820 ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
821 trace_rdev_return_int(&rdev->wiphy, ret);
825 static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
826 u32 *tx_ant, u32 *rx_ant)
829 trace_rdev_get_antenna(&rdev->wiphy);
830 ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
832 trace_rdev_return_int(&rdev->wiphy, ret);
834 trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
840 rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
841 struct net_device *dev,
842 struct cfg80211_sched_scan_request *request)
845 trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid);
846 ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
847 trace_rdev_return_int(&rdev->wiphy, ret);
851 static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
852 struct net_device *dev, u64 reqid)
855 trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid);
856 ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid);
857 trace_rdev_return_int(&rdev->wiphy, ret);
861 static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
862 struct net_device *dev,
863 struct cfg80211_gtk_rekey_data *data)
866 trace_rdev_set_rekey_data(&rdev->wiphy, dev);
867 ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
868 trace_rdev_return_int(&rdev->wiphy, ret);
872 static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
873 struct net_device *dev, u8 *peer,
874 u8 action_code, u8 dialog_token,
875 u16 status_code, u32 peer_capability,
876 bool initiator, const u8 *buf, size_t len)
879 trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
880 dialog_token, status_code, peer_capability,
881 initiator, buf, len);
882 ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
883 dialog_token, status_code, peer_capability,
884 initiator, buf, len);
885 trace_rdev_return_int(&rdev->wiphy, ret);
889 static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
890 struct net_device *dev, u8 *peer,
891 enum nl80211_tdls_operation oper)
894 trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
895 ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
896 trace_rdev_return_int(&rdev->wiphy, ret);
900 static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
901 struct net_device *dev, const u8 *peer,
905 trace_rdev_probe_client(&rdev->wiphy, dev, peer);
906 ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
907 trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
911 static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
912 struct net_device *dev, u16 noack_map)
915 trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
916 ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
917 trace_rdev_return_int(&rdev->wiphy, ret);
922 rdev_get_channel(struct cfg80211_registered_device *rdev,
923 struct wireless_dev *wdev,
924 struct cfg80211_chan_def *chandef)
928 trace_rdev_get_channel(&rdev->wiphy, wdev);
929 ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
930 trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
935 static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
936 struct wireless_dev *wdev)
940 trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
941 ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
942 trace_rdev_return_int(&rdev->wiphy, ret);
946 static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
947 struct wireless_dev *wdev)
949 trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
950 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
951 trace_rdev_return_void(&rdev->wiphy);
954 static inline int rdev_start_nan(struct cfg80211_registered_device *rdev,
955 struct wireless_dev *wdev,
956 struct cfg80211_nan_conf *conf)
960 trace_rdev_start_nan(&rdev->wiphy, wdev, conf);
961 ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf);
962 trace_rdev_return_int(&rdev->wiphy, ret);
966 static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev,
967 struct wireless_dev *wdev)
969 trace_rdev_stop_nan(&rdev->wiphy, wdev);
970 rdev->ops->stop_nan(&rdev->wiphy, wdev);
971 trace_rdev_return_void(&rdev->wiphy);
975 rdev_add_nan_func(struct cfg80211_registered_device *rdev,
976 struct wireless_dev *wdev,
977 struct cfg80211_nan_func *nan_func)
981 trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func);
982 ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func);
983 trace_rdev_return_int(&rdev->wiphy, ret);
987 static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev,
988 struct wireless_dev *wdev, u64 cookie)
990 trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie);
991 rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie);
992 trace_rdev_return_void(&rdev->wiphy);
996 rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
997 struct wireless_dev *wdev,
998 struct cfg80211_nan_conf *conf, u32 changes)
1002 trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes);
1003 if (rdev->ops->nan_change_conf)
1004 ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf,
1008 trace_rdev_return_int(&rdev->wiphy, ret);
1012 static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
1013 struct net_device *dev,
1014 struct cfg80211_acl_data *params)
1018 trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
1019 ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
1020 trace_rdev_return_int(&rdev->wiphy, ret);
1024 static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
1025 struct net_device *dev,
1026 struct cfg80211_update_ft_ies_params *ftie)
1030 trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
1031 ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
1032 trace_rdev_return_int(&rdev->wiphy, ret);
1036 static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
1037 struct wireless_dev *wdev,
1038 enum nl80211_crit_proto_id protocol,
1043 trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
1044 ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
1045 protocol, duration);
1046 trace_rdev_return_int(&rdev->wiphy, ret);
1050 static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
1051 struct wireless_dev *wdev)
1053 trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
1054 rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
1055 trace_rdev_return_void(&rdev->wiphy);
1058 static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
1059 struct net_device *dev,
1060 struct cfg80211_csa_settings *params)
1064 trace_rdev_channel_switch(&rdev->wiphy, dev, params);
1065 ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
1066 trace_rdev_return_int(&rdev->wiphy, ret);
1070 static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
1071 struct net_device *dev,
1072 struct cfg80211_qos_map *qos_map)
1074 int ret = -EOPNOTSUPP;
1076 if (rdev->ops->set_qos_map) {
1077 trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
1078 ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
1079 trace_rdev_return_int(&rdev->wiphy, ret);
1086 rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
1087 struct net_device *dev, struct cfg80211_chan_def *chandef)
1091 trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1092 ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1093 trace_rdev_return_int(&rdev->wiphy, ret);
1099 rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
1100 struct net_device *dev, u8 tsid, const u8 *peer,
1101 u8 user_prio, u16 admitted_time)
1103 int ret = -EOPNOTSUPP;
1105 trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1106 user_prio, admitted_time);
1107 if (rdev->ops->add_tx_ts)
1108 ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1109 user_prio, admitted_time);
1110 trace_rdev_return_int(&rdev->wiphy, ret);
1116 rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
1117 struct net_device *dev, u8 tsid, const u8 *peer)
1119 int ret = -EOPNOTSUPP;
1121 trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1122 if (rdev->ops->del_tx_ts)
1123 ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1124 trace_rdev_return_int(&rdev->wiphy, ret);
1130 rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1131 struct net_device *dev, const u8 *addr,
1132 u8 oper_class, struct cfg80211_chan_def *chandef)
1136 trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1138 ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1139 oper_class, chandef);
1140 trace_rdev_return_int(&rdev->wiphy, ret);
1145 rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1146 struct net_device *dev, const u8 *addr)
1148 trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1149 rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1150 trace_rdev_return_void(&rdev->wiphy);
1154 rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
1155 struct net_device *dev,
1156 struct cfg80211_chan_def *chandef,
1159 int ret = -ENOTSUPP;
1161 trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
1163 if (rdev->ops->start_radar_detection)
1164 ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
1165 chandef, cac_time_ms);
1166 trace_rdev_return_int(&rdev->wiphy, ret);
1171 rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1172 struct net_device *dev,
1173 int mcast_rate[NUM_NL80211_BANDS])
1175 int ret = -ENOTSUPP;
1177 trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1178 if (rdev->ops->set_mcast_rate)
1179 ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1180 trace_rdev_return_int(&rdev->wiphy, ret);
1185 rdev_set_coalesce(struct cfg80211_registered_device *rdev,
1186 struct cfg80211_coalesce *coalesce)
1188 int ret = -ENOTSUPP;
1190 trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
1191 if (rdev->ops->set_coalesce)
1192 ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
1193 trace_rdev_return_int(&rdev->wiphy, ret);
1197 static inline int rdev_set_pmk(struct cfg80211_registered_device *rdev,
1198 struct net_device *dev,
1199 struct cfg80211_pmk_conf *pmk_conf)
1201 int ret = -EOPNOTSUPP;
1203 trace_rdev_set_pmk(&rdev->wiphy, dev, pmk_conf);
1204 if (rdev->ops->set_pmk)
1205 ret = rdev->ops->set_pmk(&rdev->wiphy, dev, pmk_conf);
1206 trace_rdev_return_int(&rdev->wiphy, ret);
1210 static inline int rdev_del_pmk(struct cfg80211_registered_device *rdev,
1211 struct net_device *dev, const u8 *aa)
1213 int ret = -EOPNOTSUPP;
1215 trace_rdev_del_pmk(&rdev->wiphy, dev, aa);
1216 if (rdev->ops->del_pmk)
1217 ret = rdev->ops->del_pmk(&rdev->wiphy, dev, aa);
1218 trace_rdev_return_int(&rdev->wiphy, ret);
1223 rdev_external_auth(struct cfg80211_registered_device *rdev,
1224 struct net_device *dev,
1225 struct cfg80211_external_auth_params *params)
1227 int ret = -EOPNOTSUPP;
1229 trace_rdev_external_auth(&rdev->wiphy, dev, params);
1230 if (rdev->ops->external_auth)
1231 ret = rdev->ops->external_auth(&rdev->wiphy, dev, params);
1232 trace_rdev_return_int(&rdev->wiphy, ret);
1237 rdev_get_ftm_responder_stats(struct cfg80211_registered_device *rdev,
1238 struct net_device *dev,
1239 struct cfg80211_ftm_responder_stats *ftm_stats)
1241 int ret = -EOPNOTSUPP;
1243 trace_rdev_get_ftm_responder_stats(&rdev->wiphy, dev, ftm_stats);
1244 if (rdev->ops->get_ftm_responder_stats)
1245 ret = rdev->ops->get_ftm_responder_stats(&rdev->wiphy, dev,
1247 trace_rdev_return_int(&rdev->wiphy, ret);
1252 rdev_start_pmsr(struct cfg80211_registered_device *rdev,
1253 struct wireless_dev *wdev,
1254 struct cfg80211_pmsr_request *request)
1256 int ret = -EOPNOTSUPP;
1258 trace_rdev_start_pmsr(&rdev->wiphy, wdev, request->cookie);
1259 if (rdev->ops->start_pmsr)
1260 ret = rdev->ops->start_pmsr(&rdev->wiphy, wdev, request);
1261 trace_rdev_return_int(&rdev->wiphy, ret);
1266 rdev_abort_pmsr(struct cfg80211_registered_device *rdev,
1267 struct wireless_dev *wdev,
1268 struct cfg80211_pmsr_request *request)
1270 trace_rdev_abort_pmsr(&rdev->wiphy, wdev, request->cookie);
1271 if (rdev->ops->abort_pmsr)
1272 rdev->ops->abort_pmsr(&rdev->wiphy, wdev, request);
1273 trace_rdev_return_void(&rdev->wiphy);
1276 static inline int rdev_update_owe_info(struct cfg80211_registered_device *rdev,
1277 struct net_device *dev,
1278 struct cfg80211_update_owe_info *oweinfo)
1280 int ret = -EOPNOTSUPP;
1282 trace_rdev_update_owe_info(&rdev->wiphy, dev, oweinfo);
1283 if (rdev->ops->update_owe_info)
1284 ret = rdev->ops->update_owe_info(&rdev->wiphy, dev, oweinfo);
1285 trace_rdev_return_int(&rdev->wiphy, ret);
1290 rdev_probe_mesh_link(struct cfg80211_registered_device *rdev,
1291 struct net_device *dev, const u8 *dest,
1292 const void *buf, size_t len)
1296 trace_rdev_probe_mesh_link(&rdev->wiphy, dev, dest, buf, len);
1297 ret = rdev->ops->probe_mesh_link(&rdev->wiphy, dev, buf, len);
1298 trace_rdev_return_int(&rdev->wiphy, ret);
1302 #endif /* __CFG80211_RDEV_OPS */