1 #ifndef __CFG80211_RDEV_OPS
2 #define __CFG80211_RDEV_OPS
4 #include <linux/rtnetlink.h>
5 #include <net/cfg80211.h>
9 static inline int rdev_suspend(struct cfg80211_registered_device
*rdev
,
10 struct cfg80211_wowlan
*wowlan
)
13 trace_rdev_suspend(&rdev
->wiphy
, wowlan
);
14 ret
= rdev
->ops
->suspend(&rdev
->wiphy
, wowlan
);
15 trace_rdev_return_int(&rdev
->wiphy
, ret
);
19 static inline int rdev_resume(struct cfg80211_registered_device
*rdev
)
22 trace_rdev_resume(&rdev
->wiphy
);
23 ret
= rdev
->ops
->resume(&rdev
->wiphy
);
24 trace_rdev_return_int(&rdev
->wiphy
, ret
);
28 static inline void rdev_set_wakeup(struct cfg80211_registered_device
*rdev
,
31 trace_rdev_set_wakeup(&rdev
->wiphy
, enabled
);
32 rdev
->ops
->set_wakeup(&rdev
->wiphy
, enabled
);
33 trace_rdev_return_void(&rdev
->wiphy
);
36 static inline struct wireless_dev
37 *rdev_add_virtual_intf(struct cfg80211_registered_device
*rdev
, char *name
,
38 unsigned char name_assign_type
,
39 enum nl80211_iftype type
,
40 struct vif_params
*params
)
42 struct wireless_dev
*ret
;
43 trace_rdev_add_virtual_intf(&rdev
->wiphy
, name
, type
);
44 ret
= rdev
->ops
->add_virtual_intf(&rdev
->wiphy
, name
, name_assign_type
,
46 trace_rdev_return_wdev(&rdev
->wiphy
, ret
);
51 rdev_del_virtual_intf(struct cfg80211_registered_device
*rdev
,
52 struct wireless_dev
*wdev
)
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
);
62 rdev_change_virtual_intf(struct cfg80211_registered_device
*rdev
,
63 struct net_device
*dev
, enum nl80211_iftype type
,
64 struct vif_params
*params
)
67 trace_rdev_change_virtual_intf(&rdev
->wiphy
, dev
, type
);
68 ret
= rdev
->ops
->change_virtual_intf(&rdev
->wiphy
, dev
, type
, params
);
69 trace_rdev_return_int(&rdev
->wiphy
, ret
);
73 static inline int rdev_add_key(struct cfg80211_registered_device
*rdev
,
74 struct net_device
*netdev
, u8 key_index
,
75 bool pairwise
, const u8
*mac_addr
,
76 struct key_params
*params
)
79 trace_rdev_add_key(&rdev
->wiphy
, netdev
, key_index
, pairwise
, mac_addr
);
80 ret
= rdev
->ops
->add_key(&rdev
->wiphy
, netdev
, key_index
, pairwise
,
82 trace_rdev_return_int(&rdev
->wiphy
, ret
);
87 rdev_get_key(struct cfg80211_registered_device
*rdev
, struct net_device
*netdev
,
88 u8 key_index
, bool pairwise
, const u8
*mac_addr
, void *cookie
,
89 void (*callback
)(void *cookie
, struct key_params
*))
92 trace_rdev_get_key(&rdev
->wiphy
, netdev
, key_index
, pairwise
, mac_addr
);
93 ret
= rdev
->ops
->get_key(&rdev
->wiphy
, netdev
, key_index
, pairwise
,
94 mac_addr
, cookie
, callback
);
95 trace_rdev_return_int(&rdev
->wiphy
, ret
);
99 static inline int rdev_del_key(struct cfg80211_registered_device
*rdev
,
100 struct net_device
*netdev
, u8 key_index
,
101 bool pairwise
, const u8
*mac_addr
)
104 trace_rdev_del_key(&rdev
->wiphy
, netdev
, key_index
, pairwise
, mac_addr
);
105 ret
= rdev
->ops
->del_key(&rdev
->wiphy
, netdev
, key_index
, pairwise
,
107 trace_rdev_return_int(&rdev
->wiphy
, ret
);
112 rdev_set_default_key(struct cfg80211_registered_device
*rdev
,
113 struct net_device
*netdev
, u8 key_index
, bool unicast
,
117 trace_rdev_set_default_key(&rdev
->wiphy
, netdev
, key_index
,
119 ret
= rdev
->ops
->set_default_key(&rdev
->wiphy
, netdev
, key_index
,
121 trace_rdev_return_int(&rdev
->wiphy
, ret
);
126 rdev_set_default_mgmt_key(struct cfg80211_registered_device
*rdev
,
127 struct net_device
*netdev
, u8 key_index
)
130 trace_rdev_set_default_mgmt_key(&rdev
->wiphy
, netdev
, key_index
);
131 ret
= rdev
->ops
->set_default_mgmt_key(&rdev
->wiphy
, netdev
,
133 trace_rdev_return_int(&rdev
->wiphy
, ret
);
137 static inline int rdev_start_ap(struct cfg80211_registered_device
*rdev
,
138 struct net_device
*dev
,
139 struct cfg80211_ap_settings
*settings
)
142 trace_rdev_start_ap(&rdev
->wiphy
, dev
, settings
);
143 ret
= rdev
->ops
->start_ap(&rdev
->wiphy
, dev
, settings
);
144 trace_rdev_return_int(&rdev
->wiphy
, ret
);
148 static inline int rdev_change_beacon(struct cfg80211_registered_device
*rdev
,
149 struct net_device
*dev
,
150 struct cfg80211_beacon_data
*info
)
153 trace_rdev_change_beacon(&rdev
->wiphy
, dev
, info
);
154 ret
= rdev
->ops
->change_beacon(&rdev
->wiphy
, dev
, info
);
155 trace_rdev_return_int(&rdev
->wiphy
, ret
);
159 static inline int rdev_stop_ap(struct cfg80211_registered_device
*rdev
,
160 struct net_device
*dev
)
163 trace_rdev_stop_ap(&rdev
->wiphy
, dev
);
164 ret
= rdev
->ops
->stop_ap(&rdev
->wiphy
, dev
);
165 trace_rdev_return_int(&rdev
->wiphy
, ret
);
169 static inline int rdev_add_station(struct cfg80211_registered_device
*rdev
,
170 struct net_device
*dev
, u8
*mac
,
171 struct station_parameters
*params
)
174 trace_rdev_add_station(&rdev
->wiphy
, dev
, mac
, params
);
175 ret
= rdev
->ops
->add_station(&rdev
->wiphy
, dev
, mac
, params
);
176 trace_rdev_return_int(&rdev
->wiphy
, ret
);
180 static inline int rdev_del_station(struct cfg80211_registered_device
*rdev
,
181 struct net_device
*dev
,
182 struct station_del_parameters
*params
)
185 trace_rdev_del_station(&rdev
->wiphy
, dev
, params
);
186 ret
= rdev
->ops
->del_station(&rdev
->wiphy
, dev
, params
);
187 trace_rdev_return_int(&rdev
->wiphy
, ret
);
191 static inline int rdev_change_station(struct cfg80211_registered_device
*rdev
,
192 struct net_device
*dev
, u8
*mac
,
193 struct station_parameters
*params
)
196 trace_rdev_change_station(&rdev
->wiphy
, dev
, mac
, params
);
197 ret
= rdev
->ops
->change_station(&rdev
->wiphy
, dev
, mac
, params
);
198 trace_rdev_return_int(&rdev
->wiphy
, ret
);
202 static inline int rdev_get_station(struct cfg80211_registered_device
*rdev
,
203 struct net_device
*dev
, const u8
*mac
,
204 struct station_info
*sinfo
)
207 trace_rdev_get_station(&rdev
->wiphy
, dev
, mac
);
208 ret
= rdev
->ops
->get_station(&rdev
->wiphy
, dev
, mac
, sinfo
);
209 trace_rdev_return_int_station_info(&rdev
->wiphy
, ret
, sinfo
);
213 static inline int rdev_dump_station(struct cfg80211_registered_device
*rdev
,
214 struct net_device
*dev
, int idx
, u8
*mac
,
215 struct station_info
*sinfo
)
218 trace_rdev_dump_station(&rdev
->wiphy
, dev
, idx
, mac
);
219 ret
= rdev
->ops
->dump_station(&rdev
->wiphy
, dev
, idx
, mac
, sinfo
);
220 trace_rdev_return_int_station_info(&rdev
->wiphy
, ret
, sinfo
);
224 static inline int rdev_add_mpath(struct cfg80211_registered_device
*rdev
,
225 struct net_device
*dev
, u8
*dst
, u8
*next_hop
)
228 trace_rdev_add_mpath(&rdev
->wiphy
, dev
, dst
, next_hop
);
229 ret
= rdev
->ops
->add_mpath(&rdev
->wiphy
, dev
, dst
, next_hop
);
230 trace_rdev_return_int(&rdev
->wiphy
, ret
);
234 static inline int rdev_del_mpath(struct cfg80211_registered_device
*rdev
,
235 struct net_device
*dev
, u8
*dst
)
238 trace_rdev_del_mpath(&rdev
->wiphy
, dev
, dst
);
239 ret
= rdev
->ops
->del_mpath(&rdev
->wiphy
, dev
, dst
);
240 trace_rdev_return_int(&rdev
->wiphy
, ret
);
244 static inline int rdev_change_mpath(struct cfg80211_registered_device
*rdev
,
245 struct net_device
*dev
, u8
*dst
,
249 trace_rdev_change_mpath(&rdev
->wiphy
, dev
, dst
, next_hop
);
250 ret
= rdev
->ops
->change_mpath(&rdev
->wiphy
, dev
, dst
, next_hop
);
251 trace_rdev_return_int(&rdev
->wiphy
, ret
);
255 static inline int rdev_get_mpath(struct cfg80211_registered_device
*rdev
,
256 struct net_device
*dev
, u8
*dst
, u8
*next_hop
,
257 struct mpath_info
*pinfo
)
260 trace_rdev_get_mpath(&rdev
->wiphy
, dev
, dst
, next_hop
);
261 ret
= rdev
->ops
->get_mpath(&rdev
->wiphy
, dev
, dst
, next_hop
, pinfo
);
262 trace_rdev_return_int_mpath_info(&rdev
->wiphy
, ret
, pinfo
);
267 static inline int rdev_get_mpp(struct cfg80211_registered_device
*rdev
,
268 struct net_device
*dev
, u8
*dst
, u8
*mpp
,
269 struct mpath_info
*pinfo
)
273 trace_rdev_get_mpp(&rdev
->wiphy
, dev
, dst
, mpp
);
274 ret
= rdev
->ops
->get_mpp(&rdev
->wiphy
, dev
, dst
, mpp
, pinfo
);
275 trace_rdev_return_int_mpath_info(&rdev
->wiphy
, ret
, pinfo
);
279 static inline int rdev_dump_mpath(struct cfg80211_registered_device
*rdev
,
280 struct net_device
*dev
, int idx
, u8
*dst
,
281 u8
*next_hop
, struct mpath_info
*pinfo
)
285 trace_rdev_dump_mpath(&rdev
->wiphy
, dev
, idx
, dst
, next_hop
);
286 ret
= rdev
->ops
->dump_mpath(&rdev
->wiphy
, dev
, idx
, dst
, next_hop
,
288 trace_rdev_return_int_mpath_info(&rdev
->wiphy
, ret
, pinfo
);
292 static inline int rdev_dump_mpp(struct cfg80211_registered_device
*rdev
,
293 struct net_device
*dev
, int idx
, u8
*dst
,
294 u8
*mpp
, struct mpath_info
*pinfo
)
299 trace_rdev_dump_mpp(&rdev
->wiphy
, dev
, idx
, dst
, mpp
);
300 ret
= rdev
->ops
->dump_mpp(&rdev
->wiphy
, dev
, idx
, dst
, mpp
, pinfo
);
301 trace_rdev_return_int_mpath_info(&rdev
->wiphy
, ret
, pinfo
);
306 rdev_get_mesh_config(struct cfg80211_registered_device
*rdev
,
307 struct net_device
*dev
, struct mesh_config
*conf
)
310 trace_rdev_get_mesh_config(&rdev
->wiphy
, dev
);
311 ret
= rdev
->ops
->get_mesh_config(&rdev
->wiphy
, dev
, conf
);
312 trace_rdev_return_int_mesh_config(&rdev
->wiphy
, ret
, conf
);
317 rdev_update_mesh_config(struct cfg80211_registered_device
*rdev
,
318 struct net_device
*dev
, u32 mask
,
319 const struct mesh_config
*nconf
)
322 trace_rdev_update_mesh_config(&rdev
->wiphy
, dev
, mask
, nconf
);
323 ret
= rdev
->ops
->update_mesh_config(&rdev
->wiphy
, dev
, mask
, nconf
);
324 trace_rdev_return_int(&rdev
->wiphy
, ret
);
328 static inline int rdev_join_mesh(struct cfg80211_registered_device
*rdev
,
329 struct net_device
*dev
,
330 const struct mesh_config
*conf
,
331 const struct mesh_setup
*setup
)
334 trace_rdev_join_mesh(&rdev
->wiphy
, dev
, conf
, setup
);
335 ret
= rdev
->ops
->join_mesh(&rdev
->wiphy
, dev
, conf
, setup
);
336 trace_rdev_return_int(&rdev
->wiphy
, ret
);
341 static inline int rdev_leave_mesh(struct cfg80211_registered_device
*rdev
,
342 struct net_device
*dev
)
345 trace_rdev_leave_mesh(&rdev
->wiphy
, dev
);
346 ret
= rdev
->ops
->leave_mesh(&rdev
->wiphy
, dev
);
347 trace_rdev_return_int(&rdev
->wiphy
, ret
);
351 static inline int rdev_join_ocb(struct cfg80211_registered_device
*rdev
,
352 struct net_device
*dev
,
353 struct ocb_setup
*setup
)
356 trace_rdev_join_ocb(&rdev
->wiphy
, dev
, setup
);
357 ret
= rdev
->ops
->join_ocb(&rdev
->wiphy
, dev
, setup
);
358 trace_rdev_return_int(&rdev
->wiphy
, ret
);
362 static inline int rdev_leave_ocb(struct cfg80211_registered_device
*rdev
,
363 struct net_device
*dev
)
366 trace_rdev_leave_ocb(&rdev
->wiphy
, dev
);
367 ret
= rdev
->ops
->leave_ocb(&rdev
->wiphy
, dev
);
368 trace_rdev_return_int(&rdev
->wiphy
, ret
);
372 static inline int rdev_change_bss(struct cfg80211_registered_device
*rdev
,
373 struct net_device
*dev
,
374 struct bss_parameters
*params
)
378 trace_rdev_change_bss(&rdev
->wiphy
, dev
, params
);
379 ret
= rdev
->ops
->change_bss(&rdev
->wiphy
, dev
, params
);
380 trace_rdev_return_int(&rdev
->wiphy
, ret
);
384 static inline int rdev_set_txq_params(struct cfg80211_registered_device
*rdev
,
385 struct net_device
*dev
,
386 struct ieee80211_txq_params
*params
)
390 trace_rdev_set_txq_params(&rdev
->wiphy
, dev
, params
);
391 ret
= rdev
->ops
->set_txq_params(&rdev
->wiphy
, dev
, params
);
392 trace_rdev_return_int(&rdev
->wiphy
, ret
);
397 rdev_libertas_set_mesh_channel(struct cfg80211_registered_device
*rdev
,
398 struct net_device
*dev
,
399 struct ieee80211_channel
*chan
)
402 trace_rdev_libertas_set_mesh_channel(&rdev
->wiphy
, dev
, chan
);
403 ret
= rdev
->ops
->libertas_set_mesh_channel(&rdev
->wiphy
, dev
, chan
);
404 trace_rdev_return_int(&rdev
->wiphy
, ret
);
409 rdev_set_monitor_channel(struct cfg80211_registered_device
*rdev
,
410 struct cfg80211_chan_def
*chandef
)
413 trace_rdev_set_monitor_channel(&rdev
->wiphy
, chandef
);
414 ret
= rdev
->ops
->set_monitor_channel(&rdev
->wiphy
, chandef
);
415 trace_rdev_return_int(&rdev
->wiphy
, ret
);
419 static inline int rdev_scan(struct cfg80211_registered_device
*rdev
,
420 struct cfg80211_scan_request
*request
)
423 trace_rdev_scan(&rdev
->wiphy
, request
);
424 ret
= rdev
->ops
->scan(&rdev
->wiphy
, request
);
425 trace_rdev_return_int(&rdev
->wiphy
, ret
);
429 static inline void rdev_abort_scan(struct cfg80211_registered_device
*rdev
,
430 struct wireless_dev
*wdev
)
432 trace_rdev_abort_scan(&rdev
->wiphy
, wdev
);
433 rdev
->ops
->abort_scan(&rdev
->wiphy
, wdev
);
434 trace_rdev_return_void(&rdev
->wiphy
);
437 static inline int rdev_auth(struct cfg80211_registered_device
*rdev
,
438 struct net_device
*dev
,
439 struct cfg80211_auth_request
*req
)
442 trace_rdev_auth(&rdev
->wiphy
, dev
, req
);
443 ret
= rdev
->ops
->auth(&rdev
->wiphy
, dev
, req
);
444 trace_rdev_return_int(&rdev
->wiphy
, ret
);
448 static inline int rdev_assoc(struct cfg80211_registered_device
*rdev
,
449 struct net_device
*dev
,
450 struct cfg80211_assoc_request
*req
)
453 trace_rdev_assoc(&rdev
->wiphy
, dev
, req
);
454 ret
= rdev
->ops
->assoc(&rdev
->wiphy
, dev
, req
);
455 trace_rdev_return_int(&rdev
->wiphy
, ret
);
459 static inline int rdev_deauth(struct cfg80211_registered_device
*rdev
,
460 struct net_device
*dev
,
461 struct cfg80211_deauth_request
*req
)
464 trace_rdev_deauth(&rdev
->wiphy
, dev
, req
);
465 ret
= rdev
->ops
->deauth(&rdev
->wiphy
, dev
, req
);
466 trace_rdev_return_int(&rdev
->wiphy
, ret
);
470 static inline int rdev_disassoc(struct cfg80211_registered_device
*rdev
,
471 struct net_device
*dev
,
472 struct cfg80211_disassoc_request
*req
)
475 trace_rdev_disassoc(&rdev
->wiphy
, dev
, req
);
476 ret
= rdev
->ops
->disassoc(&rdev
->wiphy
, dev
, req
);
477 trace_rdev_return_int(&rdev
->wiphy
, ret
);
481 static inline int rdev_connect(struct cfg80211_registered_device
*rdev
,
482 struct net_device
*dev
,
483 struct cfg80211_connect_params
*sme
)
486 trace_rdev_connect(&rdev
->wiphy
, dev
, sme
);
487 ret
= rdev
->ops
->connect(&rdev
->wiphy
, dev
, sme
);
488 trace_rdev_return_int(&rdev
->wiphy
, ret
);
493 rdev_update_connect_params(struct cfg80211_registered_device
*rdev
,
494 struct net_device
*dev
,
495 struct cfg80211_connect_params
*sme
, u32 changed
)
498 trace_rdev_update_connect_params(&rdev
->wiphy
, dev
, sme
, changed
);
499 ret
= rdev
->ops
->update_connect_params(&rdev
->wiphy
, dev
, sme
, changed
);
500 trace_rdev_return_int(&rdev
->wiphy
, ret
);
504 static inline int rdev_disconnect(struct cfg80211_registered_device
*rdev
,
505 struct net_device
*dev
, u16 reason_code
)
508 trace_rdev_disconnect(&rdev
->wiphy
, dev
, reason_code
);
509 ret
= rdev
->ops
->disconnect(&rdev
->wiphy
, dev
, reason_code
);
510 trace_rdev_return_int(&rdev
->wiphy
, ret
);
514 static inline int rdev_join_ibss(struct cfg80211_registered_device
*rdev
,
515 struct net_device
*dev
,
516 struct cfg80211_ibss_params
*params
)
519 trace_rdev_join_ibss(&rdev
->wiphy
, dev
, params
);
520 ret
= rdev
->ops
->join_ibss(&rdev
->wiphy
, dev
, params
);
521 trace_rdev_return_int(&rdev
->wiphy
, ret
);
525 static inline int rdev_leave_ibss(struct cfg80211_registered_device
*rdev
,
526 struct net_device
*dev
)
529 trace_rdev_leave_ibss(&rdev
->wiphy
, dev
);
530 ret
= rdev
->ops
->leave_ibss(&rdev
->wiphy
, dev
);
531 trace_rdev_return_int(&rdev
->wiphy
, ret
);
536 rdev_set_wiphy_params(struct cfg80211_registered_device
*rdev
, u32 changed
)
539 trace_rdev_set_wiphy_params(&rdev
->wiphy
, changed
);
540 ret
= rdev
->ops
->set_wiphy_params(&rdev
->wiphy
, changed
);
541 trace_rdev_return_int(&rdev
->wiphy
, ret
);
545 static inline int rdev_set_tx_power(struct cfg80211_registered_device
*rdev
,
546 struct wireless_dev
*wdev
,
547 enum nl80211_tx_power_setting type
, int mbm
)
550 trace_rdev_set_tx_power(&rdev
->wiphy
, wdev
, type
, mbm
);
551 ret
= rdev
->ops
->set_tx_power(&rdev
->wiphy
, wdev
, type
, mbm
);
552 trace_rdev_return_int(&rdev
->wiphy
, ret
);
556 static inline int rdev_get_tx_power(struct cfg80211_registered_device
*rdev
,
557 struct wireless_dev
*wdev
, int *dbm
)
560 trace_rdev_get_tx_power(&rdev
->wiphy
, wdev
);
561 ret
= rdev
->ops
->get_tx_power(&rdev
->wiphy
, wdev
, dbm
);
562 trace_rdev_return_int_int(&rdev
->wiphy
, ret
, *dbm
);
566 static inline int rdev_set_wds_peer(struct cfg80211_registered_device
*rdev
,
567 struct net_device
*dev
, const u8
*addr
)
570 trace_rdev_set_wds_peer(&rdev
->wiphy
, dev
, addr
);
571 ret
= rdev
->ops
->set_wds_peer(&rdev
->wiphy
, dev
, addr
);
572 trace_rdev_return_int(&rdev
->wiphy
, ret
);
577 rdev_set_multicast_to_unicast(struct cfg80211_registered_device
*rdev
,
578 struct net_device
*dev
,
582 trace_rdev_set_multicast_to_unicast(&rdev
->wiphy
, dev
, enabled
);
583 ret
= rdev
->ops
->set_multicast_to_unicast(&rdev
->wiphy
, dev
, enabled
);
584 trace_rdev_return_int(&rdev
->wiphy
, ret
);
588 static inline void rdev_rfkill_poll(struct cfg80211_registered_device
*rdev
)
590 trace_rdev_rfkill_poll(&rdev
->wiphy
);
591 rdev
->ops
->rfkill_poll(&rdev
->wiphy
);
592 trace_rdev_return_void(&rdev
->wiphy
);
596 #ifdef CONFIG_NL80211_TESTMODE
597 static inline int rdev_testmode_cmd(struct cfg80211_registered_device
*rdev
,
598 struct wireless_dev
*wdev
,
602 trace_rdev_testmode_cmd(&rdev
->wiphy
, wdev
);
603 ret
= rdev
->ops
->testmode_cmd(&rdev
->wiphy
, wdev
, data
, len
);
604 trace_rdev_return_int(&rdev
->wiphy
, ret
);
608 static inline int rdev_testmode_dump(struct cfg80211_registered_device
*rdev
,
610 struct netlink_callback
*cb
, void *data
,
614 trace_rdev_testmode_dump(&rdev
->wiphy
);
615 ret
= rdev
->ops
->testmode_dump(&rdev
->wiphy
, skb
, cb
, data
, len
);
616 trace_rdev_return_int(&rdev
->wiphy
, ret
);
622 rdev_set_bitrate_mask(struct cfg80211_registered_device
*rdev
,
623 struct net_device
*dev
, const u8
*peer
,
624 const struct cfg80211_bitrate_mask
*mask
)
627 trace_rdev_set_bitrate_mask(&rdev
->wiphy
, dev
, peer
, mask
);
628 ret
= rdev
->ops
->set_bitrate_mask(&rdev
->wiphy
, dev
, peer
, mask
);
629 trace_rdev_return_int(&rdev
->wiphy
, ret
);
633 static inline int rdev_dump_survey(struct cfg80211_registered_device
*rdev
,
634 struct net_device
*netdev
, int idx
,
635 struct survey_info
*info
)
638 trace_rdev_dump_survey(&rdev
->wiphy
, netdev
, idx
);
639 ret
= rdev
->ops
->dump_survey(&rdev
->wiphy
, netdev
, idx
, info
);
641 trace_rdev_return_int(&rdev
->wiphy
, ret
);
643 trace_rdev_return_int_survey_info(&rdev
->wiphy
, ret
, info
);
647 static inline int rdev_set_pmksa(struct cfg80211_registered_device
*rdev
,
648 struct net_device
*netdev
,
649 struct cfg80211_pmksa
*pmksa
)
652 trace_rdev_set_pmksa(&rdev
->wiphy
, netdev
, pmksa
);
653 ret
= rdev
->ops
->set_pmksa(&rdev
->wiphy
, netdev
, pmksa
);
654 trace_rdev_return_int(&rdev
->wiphy
, ret
);
658 static inline int rdev_del_pmksa(struct cfg80211_registered_device
*rdev
,
659 struct net_device
*netdev
,
660 struct cfg80211_pmksa
*pmksa
)
663 trace_rdev_del_pmksa(&rdev
->wiphy
, netdev
, pmksa
);
664 ret
= rdev
->ops
->del_pmksa(&rdev
->wiphy
, netdev
, pmksa
);
665 trace_rdev_return_int(&rdev
->wiphy
, ret
);
669 static inline int rdev_flush_pmksa(struct cfg80211_registered_device
*rdev
,
670 struct net_device
*netdev
)
673 trace_rdev_flush_pmksa(&rdev
->wiphy
, netdev
);
674 ret
= rdev
->ops
->flush_pmksa(&rdev
->wiphy
, netdev
);
675 trace_rdev_return_int(&rdev
->wiphy
, ret
);
680 rdev_remain_on_channel(struct cfg80211_registered_device
*rdev
,
681 struct wireless_dev
*wdev
,
682 struct ieee80211_channel
*chan
,
683 unsigned int duration
, u64
*cookie
)
686 trace_rdev_remain_on_channel(&rdev
->wiphy
, wdev
, chan
, duration
);
687 ret
= rdev
->ops
->remain_on_channel(&rdev
->wiphy
, wdev
, chan
,
689 trace_rdev_return_int_cookie(&rdev
->wiphy
, ret
, *cookie
);
694 rdev_cancel_remain_on_channel(struct cfg80211_registered_device
*rdev
,
695 struct wireless_dev
*wdev
, u64 cookie
)
698 trace_rdev_cancel_remain_on_channel(&rdev
->wiphy
, wdev
, cookie
);
699 ret
= rdev
->ops
->cancel_remain_on_channel(&rdev
->wiphy
, wdev
, cookie
);
700 trace_rdev_return_int(&rdev
->wiphy
, ret
);
704 static inline int rdev_mgmt_tx(struct cfg80211_registered_device
*rdev
,
705 struct wireless_dev
*wdev
,
706 struct cfg80211_mgmt_tx_params
*params
,
710 trace_rdev_mgmt_tx(&rdev
->wiphy
, wdev
, params
);
711 ret
= rdev
->ops
->mgmt_tx(&rdev
->wiphy
, wdev
, params
, cookie
);
712 trace_rdev_return_int_cookie(&rdev
->wiphy
, ret
, *cookie
);
717 rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device
*rdev
,
718 struct wireless_dev
*wdev
, u64 cookie
)
721 trace_rdev_mgmt_tx_cancel_wait(&rdev
->wiphy
, wdev
, cookie
);
722 ret
= rdev
->ops
->mgmt_tx_cancel_wait(&rdev
->wiphy
, wdev
, cookie
);
723 trace_rdev_return_int(&rdev
->wiphy
, ret
);
727 static inline int rdev_set_power_mgmt(struct cfg80211_registered_device
*rdev
,
728 struct net_device
*dev
, bool enabled
,
732 trace_rdev_set_power_mgmt(&rdev
->wiphy
, dev
, enabled
, timeout
);
733 ret
= rdev
->ops
->set_power_mgmt(&rdev
->wiphy
, dev
, enabled
, timeout
);
734 trace_rdev_return_int(&rdev
->wiphy
, ret
);
739 rdev_set_cqm_rssi_config(struct cfg80211_registered_device
*rdev
,
740 struct net_device
*dev
, s32 rssi_thold
, u32 rssi_hyst
)
743 trace_rdev_set_cqm_rssi_config(&rdev
->wiphy
, dev
, rssi_thold
,
745 ret
= rdev
->ops
->set_cqm_rssi_config(&rdev
->wiphy
, dev
, rssi_thold
,
747 trace_rdev_return_int(&rdev
->wiphy
, ret
);
752 rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device
*rdev
,
753 struct net_device
*dev
, s32 low
, s32 high
)
756 trace_rdev_set_cqm_rssi_range_config(&rdev
->wiphy
, dev
, low
, high
);
757 ret
= rdev
->ops
->set_cqm_rssi_range_config(&rdev
->wiphy
, dev
,
759 trace_rdev_return_int(&rdev
->wiphy
, ret
);
764 rdev_set_cqm_txe_config(struct cfg80211_registered_device
*rdev
,
765 struct net_device
*dev
, u32 rate
, u32 pkts
, u32 intvl
)
768 trace_rdev_set_cqm_txe_config(&rdev
->wiphy
, dev
, rate
, pkts
, intvl
);
769 ret
= rdev
->ops
->set_cqm_txe_config(&rdev
->wiphy
, dev
, rate
, pkts
,
771 trace_rdev_return_int(&rdev
->wiphy
, ret
);
776 rdev_mgmt_frame_register(struct cfg80211_registered_device
*rdev
,
777 struct wireless_dev
*wdev
, u16 frame_type
, bool reg
)
781 trace_rdev_mgmt_frame_register(&rdev
->wiphy
, wdev
, frame_type
, reg
);
782 rdev
->ops
->mgmt_frame_register(&rdev
->wiphy
, wdev
, frame_type
, reg
);
783 trace_rdev_return_void(&rdev
->wiphy
);
786 static inline int rdev_set_antenna(struct cfg80211_registered_device
*rdev
,
787 u32 tx_ant
, u32 rx_ant
)
790 trace_rdev_set_antenna(&rdev
->wiphy
, tx_ant
, rx_ant
);
791 ret
= rdev
->ops
->set_antenna(&rdev
->wiphy
, tx_ant
, rx_ant
);
792 trace_rdev_return_int(&rdev
->wiphy
, ret
);
796 static inline int rdev_get_antenna(struct cfg80211_registered_device
*rdev
,
797 u32
*tx_ant
, u32
*rx_ant
)
800 trace_rdev_get_antenna(&rdev
->wiphy
);
801 ret
= rdev
->ops
->get_antenna(&rdev
->wiphy
, tx_ant
, rx_ant
);
803 trace_rdev_return_int(&rdev
->wiphy
, ret
);
805 trace_rdev_return_int_tx_rx(&rdev
->wiphy
, ret
, *tx_ant
,
811 rdev_sched_scan_start(struct cfg80211_registered_device
*rdev
,
812 struct net_device
*dev
,
813 struct cfg80211_sched_scan_request
*request
)
816 trace_rdev_sched_scan_start(&rdev
->wiphy
, dev
, request
->reqid
);
817 ret
= rdev
->ops
->sched_scan_start(&rdev
->wiphy
, dev
, request
);
818 trace_rdev_return_int(&rdev
->wiphy
, ret
);
822 static inline int rdev_sched_scan_stop(struct cfg80211_registered_device
*rdev
,
823 struct net_device
*dev
, u64 reqid
)
826 trace_rdev_sched_scan_stop(&rdev
->wiphy
, dev
, reqid
);
827 ret
= rdev
->ops
->sched_scan_stop(&rdev
->wiphy
, dev
, reqid
);
828 trace_rdev_return_int(&rdev
->wiphy
, ret
);
832 static inline int rdev_set_rekey_data(struct cfg80211_registered_device
*rdev
,
833 struct net_device
*dev
,
834 struct cfg80211_gtk_rekey_data
*data
)
837 trace_rdev_set_rekey_data(&rdev
->wiphy
, dev
);
838 ret
= rdev
->ops
->set_rekey_data(&rdev
->wiphy
, dev
, data
);
839 trace_rdev_return_int(&rdev
->wiphy
, ret
);
843 static inline int rdev_tdls_mgmt(struct cfg80211_registered_device
*rdev
,
844 struct net_device
*dev
, u8
*peer
,
845 u8 action_code
, u8 dialog_token
,
846 u16 status_code
, u32 peer_capability
,
847 bool initiator
, const u8
*buf
, size_t len
)
850 trace_rdev_tdls_mgmt(&rdev
->wiphy
, dev
, peer
, action_code
,
851 dialog_token
, status_code
, peer_capability
,
852 initiator
, buf
, len
);
853 ret
= rdev
->ops
->tdls_mgmt(&rdev
->wiphy
, dev
, peer
, action_code
,
854 dialog_token
, status_code
, peer_capability
,
855 initiator
, buf
, len
);
856 trace_rdev_return_int(&rdev
->wiphy
, ret
);
860 static inline int rdev_tdls_oper(struct cfg80211_registered_device
*rdev
,
861 struct net_device
*dev
, u8
*peer
,
862 enum nl80211_tdls_operation oper
)
865 trace_rdev_tdls_oper(&rdev
->wiphy
, dev
, peer
, oper
);
866 ret
= rdev
->ops
->tdls_oper(&rdev
->wiphy
, dev
, peer
, oper
);
867 trace_rdev_return_int(&rdev
->wiphy
, ret
);
871 static inline int rdev_probe_client(struct cfg80211_registered_device
*rdev
,
872 struct net_device
*dev
, const u8
*peer
,
876 trace_rdev_probe_client(&rdev
->wiphy
, dev
, peer
);
877 ret
= rdev
->ops
->probe_client(&rdev
->wiphy
, dev
, peer
, cookie
);
878 trace_rdev_return_int_cookie(&rdev
->wiphy
, ret
, *cookie
);
882 static inline int rdev_set_noack_map(struct cfg80211_registered_device
*rdev
,
883 struct net_device
*dev
, u16 noack_map
)
886 trace_rdev_set_noack_map(&rdev
->wiphy
, dev
, noack_map
);
887 ret
= rdev
->ops
->set_noack_map(&rdev
->wiphy
, dev
, noack_map
);
888 trace_rdev_return_int(&rdev
->wiphy
, ret
);
893 rdev_get_channel(struct cfg80211_registered_device
*rdev
,
894 struct wireless_dev
*wdev
,
895 struct cfg80211_chan_def
*chandef
)
899 trace_rdev_get_channel(&rdev
->wiphy
, wdev
);
900 ret
= rdev
->ops
->get_channel(&rdev
->wiphy
, wdev
, chandef
);
901 trace_rdev_return_chandef(&rdev
->wiphy
, ret
, chandef
);
906 static inline int rdev_start_p2p_device(struct cfg80211_registered_device
*rdev
,
907 struct wireless_dev
*wdev
)
911 trace_rdev_start_p2p_device(&rdev
->wiphy
, wdev
);
912 ret
= rdev
->ops
->start_p2p_device(&rdev
->wiphy
, wdev
);
913 trace_rdev_return_int(&rdev
->wiphy
, ret
);
917 static inline void rdev_stop_p2p_device(struct cfg80211_registered_device
*rdev
,
918 struct wireless_dev
*wdev
)
920 trace_rdev_stop_p2p_device(&rdev
->wiphy
, wdev
);
921 rdev
->ops
->stop_p2p_device(&rdev
->wiphy
, wdev
);
922 trace_rdev_return_void(&rdev
->wiphy
);
925 static inline int rdev_start_nan(struct cfg80211_registered_device
*rdev
,
926 struct wireless_dev
*wdev
,
927 struct cfg80211_nan_conf
*conf
)
931 trace_rdev_start_nan(&rdev
->wiphy
, wdev
, conf
);
932 ret
= rdev
->ops
->start_nan(&rdev
->wiphy
, wdev
, conf
);
933 trace_rdev_return_int(&rdev
->wiphy
, ret
);
937 static inline void rdev_stop_nan(struct cfg80211_registered_device
*rdev
,
938 struct wireless_dev
*wdev
)
940 trace_rdev_stop_nan(&rdev
->wiphy
, wdev
);
941 rdev
->ops
->stop_nan(&rdev
->wiphy
, wdev
);
942 trace_rdev_return_void(&rdev
->wiphy
);
946 rdev_add_nan_func(struct cfg80211_registered_device
*rdev
,
947 struct wireless_dev
*wdev
,
948 struct cfg80211_nan_func
*nan_func
)
952 trace_rdev_add_nan_func(&rdev
->wiphy
, wdev
, nan_func
);
953 ret
= rdev
->ops
->add_nan_func(&rdev
->wiphy
, wdev
, nan_func
);
954 trace_rdev_return_int(&rdev
->wiphy
, ret
);
958 static inline void rdev_del_nan_func(struct cfg80211_registered_device
*rdev
,
959 struct wireless_dev
*wdev
, u64 cookie
)
961 trace_rdev_del_nan_func(&rdev
->wiphy
, wdev
, cookie
);
962 rdev
->ops
->del_nan_func(&rdev
->wiphy
, wdev
, cookie
);
963 trace_rdev_return_void(&rdev
->wiphy
);
967 rdev_nan_change_conf(struct cfg80211_registered_device
*rdev
,
968 struct wireless_dev
*wdev
,
969 struct cfg80211_nan_conf
*conf
, u32 changes
)
973 trace_rdev_nan_change_conf(&rdev
->wiphy
, wdev
, conf
, changes
);
974 if (rdev
->ops
->nan_change_conf
)
975 ret
= rdev
->ops
->nan_change_conf(&rdev
->wiphy
, wdev
, conf
,
979 trace_rdev_return_int(&rdev
->wiphy
, ret
);
983 static inline int rdev_set_mac_acl(struct cfg80211_registered_device
*rdev
,
984 struct net_device
*dev
,
985 struct cfg80211_acl_data
*params
)
989 trace_rdev_set_mac_acl(&rdev
->wiphy
, dev
, params
);
990 ret
= rdev
->ops
->set_mac_acl(&rdev
->wiphy
, dev
, params
);
991 trace_rdev_return_int(&rdev
->wiphy
, ret
);
995 static inline int rdev_update_ft_ies(struct cfg80211_registered_device
*rdev
,
996 struct net_device
*dev
,
997 struct cfg80211_update_ft_ies_params
*ftie
)
1001 trace_rdev_update_ft_ies(&rdev
->wiphy
, dev
, ftie
);
1002 ret
= rdev
->ops
->update_ft_ies(&rdev
->wiphy
, dev
, ftie
);
1003 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1007 static inline int rdev_crit_proto_start(struct cfg80211_registered_device
*rdev
,
1008 struct wireless_dev
*wdev
,
1009 enum nl80211_crit_proto_id protocol
,
1014 trace_rdev_crit_proto_start(&rdev
->wiphy
, wdev
, protocol
, duration
);
1015 ret
= rdev
->ops
->crit_proto_start(&rdev
->wiphy
, wdev
,
1016 protocol
, duration
);
1017 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1021 static inline void rdev_crit_proto_stop(struct cfg80211_registered_device
*rdev
,
1022 struct wireless_dev
*wdev
)
1024 trace_rdev_crit_proto_stop(&rdev
->wiphy
, wdev
);
1025 rdev
->ops
->crit_proto_stop(&rdev
->wiphy
, wdev
);
1026 trace_rdev_return_void(&rdev
->wiphy
);
1029 static inline int rdev_channel_switch(struct cfg80211_registered_device
*rdev
,
1030 struct net_device
*dev
,
1031 struct cfg80211_csa_settings
*params
)
1035 trace_rdev_channel_switch(&rdev
->wiphy
, dev
, params
);
1036 ret
= rdev
->ops
->channel_switch(&rdev
->wiphy
, dev
, params
);
1037 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1041 static inline int rdev_set_qos_map(struct cfg80211_registered_device
*rdev
,
1042 struct net_device
*dev
,
1043 struct cfg80211_qos_map
*qos_map
)
1045 int ret
= -EOPNOTSUPP
;
1047 if (rdev
->ops
->set_qos_map
) {
1048 trace_rdev_set_qos_map(&rdev
->wiphy
, dev
, qos_map
);
1049 ret
= rdev
->ops
->set_qos_map(&rdev
->wiphy
, dev
, qos_map
);
1050 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1057 rdev_set_ap_chanwidth(struct cfg80211_registered_device
*rdev
,
1058 struct net_device
*dev
, struct cfg80211_chan_def
*chandef
)
1062 trace_rdev_set_ap_chanwidth(&rdev
->wiphy
, dev
, chandef
);
1063 ret
= rdev
->ops
->set_ap_chanwidth(&rdev
->wiphy
, dev
, chandef
);
1064 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1070 rdev_add_tx_ts(struct cfg80211_registered_device
*rdev
,
1071 struct net_device
*dev
, u8 tsid
, const u8
*peer
,
1072 u8 user_prio
, u16 admitted_time
)
1074 int ret
= -EOPNOTSUPP
;
1076 trace_rdev_add_tx_ts(&rdev
->wiphy
, dev
, tsid
, peer
,
1077 user_prio
, admitted_time
);
1078 if (rdev
->ops
->add_tx_ts
)
1079 ret
= rdev
->ops
->add_tx_ts(&rdev
->wiphy
, dev
, tsid
, peer
,
1080 user_prio
, admitted_time
);
1081 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1087 rdev_del_tx_ts(struct cfg80211_registered_device
*rdev
,
1088 struct net_device
*dev
, u8 tsid
, const u8
*peer
)
1090 int ret
= -EOPNOTSUPP
;
1092 trace_rdev_del_tx_ts(&rdev
->wiphy
, dev
, tsid
, peer
);
1093 if (rdev
->ops
->del_tx_ts
)
1094 ret
= rdev
->ops
->del_tx_ts(&rdev
->wiphy
, dev
, tsid
, peer
);
1095 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1101 rdev_tdls_channel_switch(struct cfg80211_registered_device
*rdev
,
1102 struct net_device
*dev
, const u8
*addr
,
1103 u8 oper_class
, struct cfg80211_chan_def
*chandef
)
1107 trace_rdev_tdls_channel_switch(&rdev
->wiphy
, dev
, addr
, oper_class
,
1109 ret
= rdev
->ops
->tdls_channel_switch(&rdev
->wiphy
, dev
, addr
,
1110 oper_class
, chandef
);
1111 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1116 rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device
*rdev
,
1117 struct net_device
*dev
, const u8
*addr
)
1119 trace_rdev_tdls_cancel_channel_switch(&rdev
->wiphy
, dev
, addr
);
1120 rdev
->ops
->tdls_cancel_channel_switch(&rdev
->wiphy
, dev
, addr
);
1121 trace_rdev_return_void(&rdev
->wiphy
);
1125 rdev_start_radar_detection(struct cfg80211_registered_device
*rdev
,
1126 struct net_device
*dev
,
1127 struct cfg80211_chan_def
*chandef
,
1130 int ret
= -ENOTSUPP
;
1132 trace_rdev_start_radar_detection(&rdev
->wiphy
, dev
, chandef
,
1134 if (rdev
->ops
->start_radar_detection
)
1135 ret
= rdev
->ops
->start_radar_detection(&rdev
->wiphy
, dev
,
1136 chandef
, cac_time_ms
);
1137 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1142 rdev_set_mcast_rate(struct cfg80211_registered_device
*rdev
,
1143 struct net_device
*dev
,
1144 int mcast_rate
[NUM_NL80211_BANDS
])
1146 int ret
= -ENOTSUPP
;
1148 trace_rdev_set_mcast_rate(&rdev
->wiphy
, dev
, mcast_rate
);
1149 if (rdev
->ops
->set_mcast_rate
)
1150 ret
= rdev
->ops
->set_mcast_rate(&rdev
->wiphy
, dev
, mcast_rate
);
1151 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1156 rdev_set_coalesce(struct cfg80211_registered_device
*rdev
,
1157 struct cfg80211_coalesce
*coalesce
)
1159 int ret
= -ENOTSUPP
;
1161 trace_rdev_set_coalesce(&rdev
->wiphy
, coalesce
);
1162 if (rdev
->ops
->set_coalesce
)
1163 ret
= rdev
->ops
->set_coalesce(&rdev
->wiphy
, coalesce
);
1164 trace_rdev_return_int(&rdev
->wiphy
, ret
);
1167 #endif /* __CFG80211_RDEV_OPS */