Linux Audio

Check our new training course

Loading...
v4.10.11
 
 
 
 
 
 
   1#ifndef __CFG80211_RDEV_OPS
   2#define __CFG80211_RDEV_OPS
   3
   4#include <linux/rtnetlink.h>
   5#include <net/cfg80211.h>
   6#include "core.h"
   7#include "trace.h"
   8
   9static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
  10			       struct cfg80211_wowlan *wowlan)
  11{
  12	int ret;
  13	trace_rdev_suspend(&rdev->wiphy, wowlan);
  14	ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
  15	trace_rdev_return_int(&rdev->wiphy, ret);
  16	return ret;
  17}
  18
  19static inline int rdev_resume(struct cfg80211_registered_device *rdev)
  20{
  21	int ret;
  22	trace_rdev_resume(&rdev->wiphy);
  23	ret = rdev->ops->resume(&rdev->wiphy);
  24	trace_rdev_return_int(&rdev->wiphy, ret);
  25	return ret;
  26}
  27
  28static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
  29				   bool enabled)
  30{
  31	trace_rdev_set_wakeup(&rdev->wiphy, enabled);
  32	rdev->ops->set_wakeup(&rdev->wiphy, enabled);
  33	trace_rdev_return_void(&rdev->wiphy);
  34}
  35
  36static 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, u32 *flags,
  40		       struct vif_params *params)
  41{
  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,
  45					  type, flags, params);
  46	trace_rdev_return_wdev(&rdev->wiphy, ret);
  47	return ret;
  48}
  49
  50static inline int
  51rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
  52		      struct wireless_dev *wdev)
  53{
  54	int ret;
  55	trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
  56	ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
  57	trace_rdev_return_int(&rdev->wiphy, ret);
  58	return ret;
  59}
  60
  61static inline int
  62rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
  63			 struct net_device *dev, enum nl80211_iftype type,
  64			 u32 *flags, struct vif_params *params)
  65{
  66	int ret;
  67	trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
  68	ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags,
  69					     params);
  70	trace_rdev_return_int(&rdev->wiphy, ret);
  71	return ret;
  72}
  73
  74static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
  75			       struct net_device *netdev, u8 key_index,
  76			       bool pairwise, const u8 *mac_addr,
  77			       struct key_params *params)
  78{
  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
  87static inline int
  88rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
  89	     u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie,
 
  90	     void (*callback)(void *cookie, struct key_params*))
  91{
  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
 100static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
 101			       struct net_device *netdev, u8 key_index,
 102			       bool pairwise, const u8 *mac_addr)
 103{
 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
 112static inline int
 113rdev_set_default_key(struct cfg80211_registered_device *rdev,
 114		     struct net_device *netdev, u8 key_index, bool unicast,
 115		     bool multicast)
 116{
 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
 126static inline int
 127rdev_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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 138static 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
 149static 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
 160static 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
 170static 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
 181static 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
 192static 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
 203static 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
 214static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
 215				    struct net_device *dev, int idx, u8 *mac,
 216				    struct station_info *sinfo)
 217{
 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
 225static 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
 235static 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
 245static 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
 256static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
 257				 struct net_device *dev, u8 *dst, u8 *next_hop,
 258				 struct mpath_info *pinfo)
 259{
 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
 268static 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
 280static 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
 293static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev,
 294				struct net_device *dev, int idx, u8 *dst,
 295				u8 *mpp, struct mpath_info *pinfo)
 296
 297{
 298	int ret;
 299
 300	trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp);
 301	ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo);
 302	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
 303	return ret;
 304}
 305
 306static inline int
 307rdev_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
 317static inline int
 318rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
 319			struct net_device *dev, u32 mask,
 320			const struct mesh_config *nconf)
 321{
 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
 329static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
 330				 struct net_device *dev,
 331				 const struct mesh_config *conf,
 332				 const struct mesh_setup *setup)
 333{
 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
 342static 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
 352static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev,
 353				struct net_device *dev,
 354				struct ocb_setup *setup)
 355{
 356	int ret;
 357	trace_rdev_join_ocb(&rdev->wiphy, dev, setup);
 358	ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup);
 359	trace_rdev_return_int(&rdev->wiphy, ret);
 360	return ret;
 361}
 362
 363static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev,
 364				 struct net_device *dev)
 365{
 366	int ret;
 367	trace_rdev_leave_ocb(&rdev->wiphy, dev);
 368	ret = rdev->ops->leave_ocb(&rdev->wiphy, dev);
 369	trace_rdev_return_int(&rdev->wiphy, ret);
 370	return ret;
 371}
 372
 373static 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
 
 
 
 
 
 
 
 
 
 
 
 
 385static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
 386				      struct net_device *dev,
 387				      struct ieee80211_txq_params *params)
 388
 389{
 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
 397static inline int
 398rdev_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
 409static inline int
 410rdev_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
 420static 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
 430static 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
 438static 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
 449static 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
 460static 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
 471static 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
 482static 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
 493static inline int
 494rdev_update_connect_params(struct cfg80211_registered_device *rdev,
 495			   struct net_device *dev,
 496			   struct cfg80211_connect_params *sme, u32 changed)
 497{
 498	int ret;
 499	trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed);
 500	ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed);
 501	trace_rdev_return_int(&rdev->wiphy, ret);
 502	return ret;
 503}
 504
 505static 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
 515static 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
 526static 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
 536static inline int
 537rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
 538{
 539	int ret;
 
 540	trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
 541	ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
 
 542	trace_rdev_return_int(&rdev->wiphy, ret);
 543	return ret;
 544}
 545
 546static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
 547				    struct wireless_dev *wdev,
 548				    enum nl80211_tx_power_setting type, int mbm)
 549{
 550	int ret;
 551	trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
 552	ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
 553	trace_rdev_return_int(&rdev->wiphy, ret);
 554	return ret;
 555}
 556
 557static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
 558				    struct wireless_dev *wdev, int *dbm)
 559{
 560	int ret;
 561	trace_rdev_get_tx_power(&rdev->wiphy, wdev);
 562	ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
 563	trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
 564	return ret;
 565}
 566
 567static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
 568				    struct net_device *dev, const u8 *addr)
 
 
 569{
 570	int ret;
 571	trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
 572	ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
 573	trace_rdev_return_int(&rdev->wiphy, ret);
 574	return ret;
 575}
 576
 577static inline int
 578rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev,
 579			      struct net_device *dev,
 580			      const bool enabled)
 581{
 582	int ret;
 583	trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
 584	ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
 585	trace_rdev_return_int(&rdev->wiphy, ret);
 586	return ret;
 587}
 588
 589static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
 590{
 591	trace_rdev_rfkill_poll(&rdev->wiphy);
 592	rdev->ops->rfkill_poll(&rdev->wiphy);
 593	trace_rdev_return_void(&rdev->wiphy);
 594}
 595
 596
 597#ifdef CONFIG_NL80211_TESTMODE
 598static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
 599				    struct wireless_dev *wdev,
 600				    void *data, int len)
 601{
 602	int ret;
 603	trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
 604	ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
 605	trace_rdev_return_int(&rdev->wiphy, ret);
 606	return ret;
 607}
 608
 609static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
 610				     struct sk_buff *skb,
 611				     struct netlink_callback *cb, void *data,
 612				     int len)
 613{
 614	int ret;
 615	trace_rdev_testmode_dump(&rdev->wiphy);
 616	ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
 617	trace_rdev_return_int(&rdev->wiphy, ret);
 618	return ret;
 619}
 620#endif
 621
 622static inline int
 623rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
 624		      struct net_device *dev, const u8 *peer,
 
 625		      const struct cfg80211_bitrate_mask *mask)
 626{
 627	int ret;
 628	trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
 629	ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
 
 630	trace_rdev_return_int(&rdev->wiphy, ret);
 631	return ret;
 632}
 633
 634static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
 635				   struct net_device *netdev, int idx,
 636				   struct survey_info *info)
 637{
 638	int ret;
 639	trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
 640	ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
 641	if (ret < 0)
 642		trace_rdev_return_int(&rdev->wiphy, ret);
 643	else
 644		trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
 645	return ret;
 646}
 647
 648static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
 649				 struct net_device *netdev,
 650				 struct cfg80211_pmksa *pmksa)
 651{
 652	int ret;
 653	trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
 654	ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
 655	trace_rdev_return_int(&rdev->wiphy, ret);
 656	return ret;
 657}
 658
 659static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
 660				 struct net_device *netdev,
 661				 struct cfg80211_pmksa *pmksa)
 662{
 663	int ret;
 664	trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
 665	ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
 666	trace_rdev_return_int(&rdev->wiphy, ret);
 667	return ret;
 668}
 669
 670static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
 671				   struct net_device *netdev)
 672{
 673	int ret;
 674	trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
 675	ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
 676	trace_rdev_return_int(&rdev->wiphy, ret);
 677	return ret;
 678}
 679
 680static inline int
 681rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
 682		       struct wireless_dev *wdev,
 683		       struct ieee80211_channel *chan,
 684		       unsigned int duration, u64 *cookie)
 685{
 686	int ret;
 687	trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
 688	ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
 689					   duration, cookie);
 690	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 691	return ret;
 692}
 693
 694static inline int
 695rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
 696			      struct wireless_dev *wdev, u64 cookie)
 697{
 698	int ret;
 699	trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
 700	ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
 701	trace_rdev_return_int(&rdev->wiphy, ret);
 702	return ret;
 703}
 704
 705static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
 706			       struct wireless_dev *wdev,
 707			       struct cfg80211_mgmt_tx_params *params,
 708			       u64 *cookie)
 709{
 710	int ret;
 711	trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
 712	ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
 713	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 714	return ret;
 715}
 716
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 717static inline int
 718rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
 719			 struct wireless_dev *wdev, u64 cookie)
 720{
 721	int ret;
 722	trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
 723	ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
 724	trace_rdev_return_int(&rdev->wiphy, ret);
 725	return ret;
 726}
 727
 728static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
 729				      struct net_device *dev, bool enabled,
 730				      int timeout)
 731{
 732	int ret;
 733	trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
 734	ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
 735	trace_rdev_return_int(&rdev->wiphy, ret);
 736	return ret;
 737}
 738
 739static inline int
 740rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
 741			 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
 742{
 743	int ret;
 744	trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
 745				       rssi_hyst);
 746	ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
 747				       rssi_hyst);
 748	trace_rdev_return_int(&rdev->wiphy, ret);
 749	return ret;
 750}
 751
 752static inline int
 
 
 
 
 
 
 
 
 
 
 
 
 753rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
 754			struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
 755{
 756	int ret;
 757	trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
 758	ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
 759					     intvl);
 760	trace_rdev_return_int(&rdev->wiphy, ret);
 761	return ret;
 762}
 763
 764static inline void
 765rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
 766			 struct wireless_dev *wdev, u16 frame_type, bool reg)
 
 767{
 768	might_sleep();
 769
 770	trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
 771	rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
 
 
 772	trace_rdev_return_void(&rdev->wiphy);
 773}
 774
 775static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
 776				   u32 tx_ant, u32 rx_ant)
 777{
 778	int ret;
 779	trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
 780	ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
 781	trace_rdev_return_int(&rdev->wiphy, ret);
 782	return ret;
 783}
 784
 785static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
 786				   u32 *tx_ant, u32 *rx_ant)
 787{
 788	int ret;
 789	trace_rdev_get_antenna(&rdev->wiphy);
 790	ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
 791	if (ret)
 792		trace_rdev_return_int(&rdev->wiphy, ret);
 793	else
 794		trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
 795					    *rx_ant);
 796	return ret;
 797}
 798
 799static inline int
 800rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
 801		      struct net_device *dev,
 802		      struct cfg80211_sched_scan_request *request)
 803{
 804	int ret;
 805	trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
 806	ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
 807	trace_rdev_return_int(&rdev->wiphy, ret);
 808	return ret;
 809}
 810
 811static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
 812				       struct net_device *dev)
 813{
 814	int ret;
 815	trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
 816	ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
 817	trace_rdev_return_int(&rdev->wiphy, ret);
 818	return ret;
 819}
 820
 821static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
 822				      struct net_device *dev,
 823				      struct cfg80211_gtk_rekey_data *data)
 824{
 825	int ret;
 826	trace_rdev_set_rekey_data(&rdev->wiphy, dev);
 827	ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
 828	trace_rdev_return_int(&rdev->wiphy, ret);
 829	return ret;
 830}
 831
 832static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
 833				 struct net_device *dev, u8 *peer,
 834				 u8 action_code, u8 dialog_token,
 835				 u16 status_code, u32 peer_capability,
 836				 bool initiator, const u8 *buf, size_t len)
 
 837{
 838	int ret;
 839	trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
 840			     dialog_token, status_code, peer_capability,
 841			     initiator, buf, len);
 842	ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
 843				   dialog_token, status_code, peer_capability,
 844				   initiator, buf, len);
 845	trace_rdev_return_int(&rdev->wiphy, ret);
 846	return ret;
 847}
 848
 849static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
 850				 struct net_device *dev, u8 *peer,
 851				 enum nl80211_tdls_operation oper)
 852{
 853	int ret;
 854	trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
 855	ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
 856	trace_rdev_return_int(&rdev->wiphy, ret);
 857	return ret;
 858}
 859
 860static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
 861				    struct net_device *dev, const u8 *peer,
 862				    u64 *cookie)
 863{
 864	int ret;
 865	trace_rdev_probe_client(&rdev->wiphy, dev, peer);
 866	ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
 867	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 868	return ret;
 869}
 870
 871static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
 872				     struct net_device *dev, u16 noack_map)
 873{
 874	int ret;
 875	trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
 876	ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
 877	trace_rdev_return_int(&rdev->wiphy, ret);
 878	return ret;
 879}
 880
 881static inline int
 882rdev_get_channel(struct cfg80211_registered_device *rdev,
 883		 struct wireless_dev *wdev,
 
 884		 struct cfg80211_chan_def *chandef)
 885{
 886	int ret;
 887
 888	trace_rdev_get_channel(&rdev->wiphy, wdev);
 889	ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
 890	trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
 891
 892	return ret;
 893}
 894
 895static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
 896					struct wireless_dev *wdev)
 897{
 898	int ret;
 899
 900	trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
 901	ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
 902	trace_rdev_return_int(&rdev->wiphy, ret);
 903	return ret;
 904}
 905
 906static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
 907					struct wireless_dev *wdev)
 908{
 909	trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
 910	rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
 911	trace_rdev_return_void(&rdev->wiphy);
 912}
 913
 914static inline int rdev_start_nan(struct cfg80211_registered_device *rdev,
 915				 struct wireless_dev *wdev,
 916				 struct cfg80211_nan_conf *conf)
 917{
 918	int ret;
 919
 920	trace_rdev_start_nan(&rdev->wiphy, wdev, conf);
 921	ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf);
 922	trace_rdev_return_int(&rdev->wiphy, ret);
 923	return ret;
 924}
 925
 926static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev,
 927				 struct wireless_dev *wdev)
 928{
 929	trace_rdev_stop_nan(&rdev->wiphy, wdev);
 930	rdev->ops->stop_nan(&rdev->wiphy, wdev);
 931	trace_rdev_return_void(&rdev->wiphy);
 932}
 933
 934static inline int
 935rdev_add_nan_func(struct cfg80211_registered_device *rdev,
 936		  struct wireless_dev *wdev,
 937		  struct cfg80211_nan_func *nan_func)
 938{
 939	int ret;
 940
 941	trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func);
 942	ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func);
 943	trace_rdev_return_int(&rdev->wiphy, ret);
 944	return ret;
 945}
 946
 947static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev,
 948				    struct wireless_dev *wdev, u64 cookie)
 949{
 950	trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie);
 951	rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie);
 952	trace_rdev_return_void(&rdev->wiphy);
 953}
 954
 955static inline int
 956rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
 957		     struct wireless_dev *wdev,
 958		     struct cfg80211_nan_conf *conf, u32 changes)
 959{
 960	int ret;
 961
 962	trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes);
 963	if (rdev->ops->nan_change_conf)
 964		ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf,
 965						 changes);
 966	else
 967		ret = -ENOTSUPP;
 968	trace_rdev_return_int(&rdev->wiphy, ret);
 969	return ret;
 970}
 971
 972static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
 973				   struct net_device *dev,
 974				   struct cfg80211_acl_data *params)
 975{
 976	int ret;
 977
 978	trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
 979	ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
 980	trace_rdev_return_int(&rdev->wiphy, ret);
 981	return ret;
 982}
 983
 984static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
 985				     struct net_device *dev,
 986				     struct cfg80211_update_ft_ies_params *ftie)
 987{
 988	int ret;
 989
 990	trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
 991	ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
 992	trace_rdev_return_int(&rdev->wiphy, ret);
 993	return ret;
 994}
 995
 996static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
 997					struct wireless_dev *wdev,
 998					enum nl80211_crit_proto_id protocol,
 999					u16 duration)
1000{
1001	int ret;
1002
1003	trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
1004	ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
1005					  protocol, duration);
1006	trace_rdev_return_int(&rdev->wiphy, ret);
1007	return ret;
1008}
1009
1010static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
1011				       struct wireless_dev *wdev)
1012{
1013	trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
1014	rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
1015	trace_rdev_return_void(&rdev->wiphy);
1016}
1017
1018static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
1019				      struct net_device *dev,
1020				      struct cfg80211_csa_settings *params)
1021{
1022	int ret;
1023
1024	trace_rdev_channel_switch(&rdev->wiphy, dev, params);
1025	ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
1026	trace_rdev_return_int(&rdev->wiphy, ret);
1027	return ret;
1028}
1029
1030static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
1031				   struct net_device *dev,
1032				   struct cfg80211_qos_map *qos_map)
1033{
1034	int ret = -EOPNOTSUPP;
1035
1036	if (rdev->ops->set_qos_map) {
1037		trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
1038		ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
1039		trace_rdev_return_int(&rdev->wiphy, ret);
1040	}
1041
1042	return ret;
1043}
1044
1045static inline int
1046rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
1047		      struct net_device *dev, struct cfg80211_chan_def *chandef)
 
 
1048{
1049	int ret;
1050
1051	trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1052	ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
1053	trace_rdev_return_int(&rdev->wiphy, ret);
1054
1055	return ret;
1056}
1057
1058static inline int
1059rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
1060	       struct net_device *dev, u8 tsid, const u8 *peer,
1061	       u8 user_prio, u16 admitted_time)
1062{
1063	int ret = -EOPNOTSUPP;
1064
1065	trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1066			     user_prio, admitted_time);
1067	if (rdev->ops->add_tx_ts)
1068		ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1069					   user_prio, admitted_time);
1070	trace_rdev_return_int(&rdev->wiphy, ret);
1071
1072	return ret;
1073}
1074
1075static inline int
1076rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
1077	       struct net_device *dev, u8 tsid, const u8 *peer)
1078{
1079	int ret = -EOPNOTSUPP;
1080
1081	trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1082	if (rdev->ops->del_tx_ts)
1083		ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1084	trace_rdev_return_int(&rdev->wiphy, ret);
1085
1086	return ret;
1087}
1088
1089static inline int
1090rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1091			 struct net_device *dev, const u8 *addr,
1092			 u8 oper_class, struct cfg80211_chan_def *chandef)
1093{
1094	int ret;
1095
1096	trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1097				       chandef);
1098	ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1099					     oper_class, chandef);
1100	trace_rdev_return_int(&rdev->wiphy, ret);
1101	return ret;
1102}
1103
1104static inline void
1105rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1106				struct net_device *dev, const u8 *addr)
1107{
1108	trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1109	rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1110	trace_rdev_return_void(&rdev->wiphy);
1111}
1112
1113static inline int
1114rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
1115			   struct net_device *dev,
1116			   struct cfg80211_chan_def *chandef,
1117			   u32 cac_time_ms)
1118{
1119	int ret = -ENOTSUPP;
1120
1121	trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
1122					 cac_time_ms);
1123	if (rdev->ops->start_radar_detection)
1124		ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
1125						       chandef, cac_time_ms);
 
1126	trace_rdev_return_int(&rdev->wiphy, ret);
1127	return ret;
1128}
1129
 
 
 
 
 
 
 
 
 
 
1130static inline int
1131rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1132		    struct net_device *dev,
1133		    int mcast_rate[NUM_NL80211_BANDS])
1134{
1135	int ret = -ENOTSUPP;
1136
1137	trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1138	if (rdev->ops->set_mcast_rate)
1139		ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1140	trace_rdev_return_int(&rdev->wiphy, ret);
1141	return ret;
1142}
1143
1144static inline int
1145rdev_set_coalesce(struct cfg80211_registered_device *rdev,
1146		  struct cfg80211_coalesce *coalesce)
1147{
1148	int ret = -ENOTSUPP;
1149
1150	trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
1151	if (rdev->ops->set_coalesce)
1152		ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
1153	trace_rdev_return_int(&rdev->wiphy, ret);
1154	return ret;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1155}
1156#endif /* __CFG80211_RDEV_OPS */
v6.13.7
   1/* SPDX-License-Identifier: GPL-2.0 */
   2/*
   3 * Portions of this file
   4 * Copyright(c) 2016-2017 Intel Deutschland GmbH
   5 * Copyright (C) 2018, 2021-2024 Intel Corporation
   6 */
   7#ifndef __CFG80211_RDEV_OPS
   8#define __CFG80211_RDEV_OPS
   9
  10#include <linux/rtnetlink.h>
  11#include <net/cfg80211.h>
  12#include "core.h"
  13#include "trace.h"
  14
  15static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
  16			       struct cfg80211_wowlan *wowlan)
  17{
  18	int ret;
  19	trace_rdev_suspend(&rdev->wiphy, wowlan);
  20	ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
  21	trace_rdev_return_int(&rdev->wiphy, ret);
  22	return ret;
  23}
  24
  25static inline int rdev_resume(struct cfg80211_registered_device *rdev)
  26{
  27	int ret;
  28	trace_rdev_resume(&rdev->wiphy);
  29	ret = rdev->ops->resume(&rdev->wiphy);
  30	trace_rdev_return_int(&rdev->wiphy, ret);
  31	return ret;
  32}
  33
  34static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
  35				   bool enabled)
  36{
  37	trace_rdev_set_wakeup(&rdev->wiphy, enabled);
  38	rdev->ops->set_wakeup(&rdev->wiphy, enabled);
  39	trace_rdev_return_void(&rdev->wiphy);
  40}
  41
  42static inline struct wireless_dev
  43*rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
  44		       unsigned char name_assign_type,
  45		       enum nl80211_iftype type,
  46		       struct vif_params *params)
  47{
  48	struct wireless_dev *ret;
  49	trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
  50	ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
  51					  type, params);
  52	trace_rdev_return_wdev(&rdev->wiphy, ret);
  53	return ret;
  54}
  55
  56static inline int
  57rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
  58		      struct wireless_dev *wdev)
  59{
  60	int ret;
  61	trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
  62	ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
  63	trace_rdev_return_int(&rdev->wiphy, ret);
  64	return ret;
  65}
  66
  67static inline int
  68rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
  69			 struct net_device *dev, enum nl80211_iftype type,
  70			 struct vif_params *params)
  71{
  72	int ret;
  73	trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
  74	ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, params);
 
  75	trace_rdev_return_int(&rdev->wiphy, ret);
  76	return ret;
  77}
  78
  79static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
  80			       struct net_device *netdev, int link_id,
  81			       u8 key_index, bool pairwise, const u8 *mac_addr,
  82			       struct key_params *params)
  83{
  84	int ret;
  85	trace_rdev_add_key(&rdev->wiphy, netdev, link_id, key_index, pairwise,
  86			   mac_addr, params->mode);
  87	ret = rdev->ops->add_key(&rdev->wiphy, netdev, link_id, key_index,
  88				  pairwise, mac_addr, params);
  89	trace_rdev_return_int(&rdev->wiphy, ret);
  90	return ret;
  91}
  92
  93static inline int
  94rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
  95	     int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
  96	     void *cookie,
  97	     void (*callback)(void *cookie, struct key_params*))
  98{
  99	int ret;
 100	trace_rdev_get_key(&rdev->wiphy, netdev, link_id, key_index, pairwise,
 101			   mac_addr);
 102	ret = rdev->ops->get_key(&rdev->wiphy, netdev, link_id, key_index,
 103				  pairwise, mac_addr, cookie, callback);
 104	trace_rdev_return_int(&rdev->wiphy, ret);
 105	return ret;
 106}
 107
 108static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
 109			       struct net_device *netdev, int link_id,
 110			       u8 key_index, bool pairwise, const u8 *mac_addr)
 111{
 112	int ret;
 113	trace_rdev_del_key(&rdev->wiphy, netdev, link_id, key_index, pairwise,
 114			   mac_addr);
 115	ret = rdev->ops->del_key(&rdev->wiphy, netdev, link_id, key_index,
 116				  pairwise, mac_addr);
 117	trace_rdev_return_int(&rdev->wiphy, ret);
 118	return ret;
 119}
 120
 121static inline int
 122rdev_set_default_key(struct cfg80211_registered_device *rdev,
 123		     struct net_device *netdev, int link_id, u8 key_index,
 124		     bool unicast, bool multicast)
 125{
 126	int ret;
 127	trace_rdev_set_default_key(&rdev->wiphy, netdev, link_id, key_index,
 128				   unicast, multicast);
 129	ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, link_id,
 130					  key_index, unicast, multicast);
 131	trace_rdev_return_int(&rdev->wiphy, ret);
 132	return ret;
 133}
 134
 135static inline int
 136rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
 137			  struct net_device *netdev, int link_id, u8 key_index)
 138{
 139	int ret;
 140	trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, link_id,
 141					key_index);
 142	ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev, link_id,
 143					       key_index);
 144	trace_rdev_return_int(&rdev->wiphy, ret);
 145	return ret;
 146}
 147
 148static inline int
 149rdev_set_default_beacon_key(struct cfg80211_registered_device *rdev,
 150			    struct net_device *netdev, int link_id,
 151			    u8 key_index)
 152{
 153	int ret;
 154
 155	trace_rdev_set_default_beacon_key(&rdev->wiphy, netdev, link_id,
 156					  key_index);
 157	ret = rdev->ops->set_default_beacon_key(&rdev->wiphy, netdev, link_id,
 158						 key_index);
 159	trace_rdev_return_int(&rdev->wiphy, ret);
 160	return ret;
 161}
 162
 163static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
 164				struct net_device *dev,
 165				struct cfg80211_ap_settings *settings)
 166{
 167	int ret;
 168	trace_rdev_start_ap(&rdev->wiphy, dev, settings);
 169	ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings);
 170	trace_rdev_return_int(&rdev->wiphy, ret);
 171	return ret;
 172}
 173
 174static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
 175				     struct net_device *dev,
 176				     struct cfg80211_ap_update *info)
 177{
 178	int ret;
 179	trace_rdev_change_beacon(&rdev->wiphy, dev, info);
 180	ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info);
 181	trace_rdev_return_int(&rdev->wiphy, ret);
 182	return ret;
 183}
 184
 185static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
 186			       struct net_device *dev, unsigned int link_id)
 187{
 188	int ret;
 189	trace_rdev_stop_ap(&rdev->wiphy, dev, link_id);
 190	ret = rdev->ops->stop_ap(&rdev->wiphy, dev, link_id);
 191	trace_rdev_return_int(&rdev->wiphy, ret);
 192	return ret;
 193}
 194
 195static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
 196				   struct net_device *dev, u8 *mac,
 197				   struct station_parameters *params)
 198{
 199	int ret;
 200	trace_rdev_add_station(&rdev->wiphy, dev, mac, params);
 201	ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
 202	trace_rdev_return_int(&rdev->wiphy, ret);
 203	return ret;
 204}
 205
 206static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
 207				   struct net_device *dev,
 208				   struct station_del_parameters *params)
 209{
 210	int ret;
 211	trace_rdev_del_station(&rdev->wiphy, dev, params);
 212	ret = rdev->ops->del_station(&rdev->wiphy, dev, params);
 213	trace_rdev_return_int(&rdev->wiphy, ret);
 214	return ret;
 215}
 216
 217static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
 218				      struct net_device *dev, u8 *mac,
 219				      struct station_parameters *params)
 220{
 221	int ret;
 222	trace_rdev_change_station(&rdev->wiphy, dev, mac, params);
 223	ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
 224	trace_rdev_return_int(&rdev->wiphy, ret);
 225	return ret;
 226}
 227
 228static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
 229				   struct net_device *dev, const u8 *mac,
 230				   struct station_info *sinfo)
 231{
 232	int ret;
 233	trace_rdev_get_station(&rdev->wiphy, dev, mac);
 234	ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
 235	trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
 236	return ret;
 237}
 238
 239static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
 240				    struct net_device *dev, int idx, u8 *mac,
 241				    struct station_info *sinfo)
 242{
 243	int ret;
 244	trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac);
 245	ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
 246	trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
 247	return ret;
 248}
 249
 250static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
 251				 struct net_device *dev, u8 *dst, u8 *next_hop)
 252{
 253	int ret;
 254	trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop);
 255	ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
 256	trace_rdev_return_int(&rdev->wiphy, ret);
 257	return ret;
 258}
 259
 260static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
 261				 struct net_device *dev, u8 *dst)
 262{
 263	int ret;
 264	trace_rdev_del_mpath(&rdev->wiphy, dev, dst);
 265	ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
 266	trace_rdev_return_int(&rdev->wiphy, ret);
 267	return ret;
 268}
 269
 270static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
 271				    struct net_device *dev, u8 *dst,
 272				    u8 *next_hop)
 273{
 274	int ret;
 275	trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop);
 276	ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
 277	trace_rdev_return_int(&rdev->wiphy, ret);
 278	return ret;
 279}
 280
 281static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
 282				 struct net_device *dev, u8 *dst, u8 *next_hop,
 283				 struct mpath_info *pinfo)
 284{
 285	int ret;
 286	trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop);
 287	ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
 288	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
 289	return ret;
 290
 291}
 292
 293static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev,
 294			       struct net_device *dev, u8 *dst, u8 *mpp,
 295			       struct mpath_info *pinfo)
 296{
 297	int ret;
 298
 299	trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp);
 300	ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo);
 301	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
 302	return ret;
 303}
 304
 305static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev,
 306				  struct net_device *dev, int idx, u8 *dst,
 307				  u8 *next_hop, struct mpath_info *pinfo)
 308
 309{
 310	int ret;
 311	trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop);
 312	ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
 313				    pinfo);
 314	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
 315	return ret;
 316}
 317
 318static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev,
 319				struct net_device *dev, int idx, u8 *dst,
 320				u8 *mpp, struct mpath_info *pinfo)
 321
 322{
 323	int ret;
 324
 325	trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp);
 326	ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo);
 327	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
 328	return ret;
 329}
 330
 331static inline int
 332rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
 333		     struct net_device *dev, struct mesh_config *conf)
 334{
 335	int ret;
 336	trace_rdev_get_mesh_config(&rdev->wiphy, dev);
 337	ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
 338	trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf);
 339	return ret;
 340}
 341
 342static inline int
 343rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
 344			struct net_device *dev, u32 mask,
 345			const struct mesh_config *nconf)
 346{
 347	int ret;
 348	trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf);
 349	ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
 350	trace_rdev_return_int(&rdev->wiphy, ret);
 351	return ret;
 352}
 353
 354static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
 355				 struct net_device *dev,
 356				 const struct mesh_config *conf,
 357				 const struct mesh_setup *setup)
 358{
 359	int ret;
 360	trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup);
 361	ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
 362	trace_rdev_return_int(&rdev->wiphy, ret);
 363	return ret;
 364}
 365
 366
 367static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
 368				  struct net_device *dev)
 369{
 370	int ret;
 371	trace_rdev_leave_mesh(&rdev->wiphy, dev);
 372	ret = rdev->ops->leave_mesh(&rdev->wiphy, dev);
 373	trace_rdev_return_int(&rdev->wiphy, ret);
 374	return ret;
 375}
 376
 377static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev,
 378				struct net_device *dev,
 379				struct ocb_setup *setup)
 380{
 381	int ret;
 382	trace_rdev_join_ocb(&rdev->wiphy, dev, setup);
 383	ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup);
 384	trace_rdev_return_int(&rdev->wiphy, ret);
 385	return ret;
 386}
 387
 388static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev,
 389				 struct net_device *dev)
 390{
 391	int ret;
 392	trace_rdev_leave_ocb(&rdev->wiphy, dev);
 393	ret = rdev->ops->leave_ocb(&rdev->wiphy, dev);
 394	trace_rdev_return_int(&rdev->wiphy, ret);
 395	return ret;
 396}
 397
 398static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
 399				  struct net_device *dev,
 400				  struct bss_parameters *params)
 401
 402{
 403	int ret;
 404	trace_rdev_change_bss(&rdev->wiphy, dev, params);
 405	ret = rdev->ops->change_bss(&rdev->wiphy, dev, params);
 406	trace_rdev_return_int(&rdev->wiphy, ret);
 407	return ret;
 408}
 409
 410static inline void rdev_inform_bss(struct cfg80211_registered_device *rdev,
 411				   struct cfg80211_bss *bss,
 412				   const struct cfg80211_bss_ies *ies,
 413				   void *drv_data)
 414
 415{
 416	trace_rdev_inform_bss(&rdev->wiphy, bss);
 417	if (rdev->ops->inform_bss)
 418		rdev->ops->inform_bss(&rdev->wiphy, bss, ies, drv_data);
 419	trace_rdev_return_void(&rdev->wiphy);
 420}
 421
 422static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
 423				      struct net_device *dev,
 424				      struct ieee80211_txq_params *params)
 425
 426{
 427	int ret;
 428	trace_rdev_set_txq_params(&rdev->wiphy, dev, params);
 429	ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
 430	trace_rdev_return_int(&rdev->wiphy, ret);
 431	return ret;
 432}
 433
 434static inline int
 435rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
 436			       struct net_device *dev,
 437			       struct ieee80211_channel *chan)
 438{
 439	int ret;
 440	trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
 441	ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
 442	trace_rdev_return_int(&rdev->wiphy, ret);
 443	return ret;
 444}
 445
 446static inline int
 447rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
 448			 struct net_device *dev,
 449			 struct cfg80211_chan_def *chandef)
 450{
 451	int ret;
 452	trace_rdev_set_monitor_channel(&rdev->wiphy, dev, chandef);
 453	ret = rdev->ops->set_monitor_channel(&rdev->wiphy, dev, chandef);
 454	trace_rdev_return_int(&rdev->wiphy, ret);
 455	return ret;
 456}
 457
 458static inline int rdev_scan(struct cfg80211_registered_device *rdev,
 459			    struct cfg80211_scan_request *request)
 460{
 461	int ret;
 462
 463	if (WARN_ON_ONCE(!request->n_ssids && request->ssids))
 464		return -EINVAL;
 465
 466	trace_rdev_scan(&rdev->wiphy, request);
 467	ret = rdev->ops->scan(&rdev->wiphy, request);
 468	trace_rdev_return_int(&rdev->wiphy, ret);
 469	return ret;
 470}
 471
 472static inline void rdev_abort_scan(struct cfg80211_registered_device *rdev,
 473				   struct wireless_dev *wdev)
 474{
 475	trace_rdev_abort_scan(&rdev->wiphy, wdev);
 476	rdev->ops->abort_scan(&rdev->wiphy, wdev);
 477	trace_rdev_return_void(&rdev->wiphy);
 478}
 479
 480static inline int rdev_auth(struct cfg80211_registered_device *rdev,
 481			    struct net_device *dev,
 482			    struct cfg80211_auth_request *req)
 483{
 484	int ret;
 485	trace_rdev_auth(&rdev->wiphy, dev, req);
 486	ret = rdev->ops->auth(&rdev->wiphy, dev, req);
 487	trace_rdev_return_int(&rdev->wiphy, ret);
 488	return ret;
 489}
 490
 491static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
 492			     struct net_device *dev,
 493			     struct cfg80211_assoc_request *req)
 494{
 495	int ret;
 496
 497	trace_rdev_assoc(&rdev->wiphy, dev, req);
 498	ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
 499	trace_rdev_return_int(&rdev->wiphy, ret);
 500	return ret;
 501}
 502
 503static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
 504			      struct net_device *dev,
 505			      struct cfg80211_deauth_request *req)
 506{
 507	int ret;
 508	trace_rdev_deauth(&rdev->wiphy, dev, req);
 509	ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
 510	trace_rdev_return_int(&rdev->wiphy, ret);
 511	return ret;
 512}
 513
 514static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
 515				struct net_device *dev,
 516				struct cfg80211_disassoc_request *req)
 517{
 518	int ret;
 519	trace_rdev_disassoc(&rdev->wiphy, dev, req);
 520	ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
 521	trace_rdev_return_int(&rdev->wiphy, ret);
 522	return ret;
 523}
 524
 525static inline int rdev_connect(struct cfg80211_registered_device *rdev,
 526			       struct net_device *dev,
 527			       struct cfg80211_connect_params *sme)
 528{
 529	int ret;
 530	trace_rdev_connect(&rdev->wiphy, dev, sme);
 531	ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
 532	trace_rdev_return_int(&rdev->wiphy, ret);
 533	return ret;
 534}
 535
 536static inline int
 537rdev_update_connect_params(struct cfg80211_registered_device *rdev,
 538			   struct net_device *dev,
 539			   struct cfg80211_connect_params *sme, u32 changed)
 540{
 541	int ret;
 542	trace_rdev_update_connect_params(&rdev->wiphy, dev, sme, changed);
 543	ret = rdev->ops->update_connect_params(&rdev->wiphy, dev, sme, changed);
 544	trace_rdev_return_int(&rdev->wiphy, ret);
 545	return ret;
 546}
 547
 548static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
 549				  struct net_device *dev, u16 reason_code)
 550{
 551	int ret;
 552	trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
 553	ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
 554	trace_rdev_return_int(&rdev->wiphy, ret);
 555	return ret;
 556}
 557
 558static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
 559				 struct net_device *dev,
 560				 struct cfg80211_ibss_params *params)
 561{
 562	int ret;
 563	trace_rdev_join_ibss(&rdev->wiphy, dev, params);
 564	ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
 565	trace_rdev_return_int(&rdev->wiphy, ret);
 566	return ret;
 567}
 568
 569static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
 570				  struct net_device *dev)
 571{
 572	int ret;
 573	trace_rdev_leave_ibss(&rdev->wiphy, dev);
 574	ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
 575	trace_rdev_return_int(&rdev->wiphy, ret);
 576	return ret;
 577}
 578
 579static inline int
 580rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
 581{
 582	int ret = -EOPNOTSUPP;
 583
 584	trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
 585	if (rdev->ops->set_wiphy_params)
 586		ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
 587	trace_rdev_return_int(&rdev->wiphy, ret);
 588	return ret;
 589}
 590
 591static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
 592				    struct wireless_dev *wdev,
 593				    enum nl80211_tx_power_setting type, int mbm)
 594{
 595	int ret;
 596	trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
 597	ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
 598	trace_rdev_return_int(&rdev->wiphy, ret);
 599	return ret;
 600}
 601
 602static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
 603				    struct wireless_dev *wdev, int *dbm)
 604{
 605	int ret;
 606	trace_rdev_get_tx_power(&rdev->wiphy, wdev);
 607	ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
 608	trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
 609	return ret;
 610}
 611
 612static inline int
 613rdev_set_multicast_to_unicast(struct cfg80211_registered_device *rdev,
 614			      struct net_device *dev,
 615			      const bool enabled)
 616{
 617	int ret;
 618	trace_rdev_set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
 619	ret = rdev->ops->set_multicast_to_unicast(&rdev->wiphy, dev, enabled);
 620	trace_rdev_return_int(&rdev->wiphy, ret);
 621	return ret;
 622}
 623
 624static inline int
 625rdev_get_txq_stats(struct cfg80211_registered_device *rdev,
 626		   struct wireless_dev *wdev,
 627		   struct cfg80211_txq_stats *txqstats)
 628{
 629	int ret;
 630	trace_rdev_get_txq_stats(&rdev->wiphy, wdev);
 631	ret = rdev->ops->get_txq_stats(&rdev->wiphy, wdev, txqstats);
 632	trace_rdev_return_int(&rdev->wiphy, ret);
 633	return ret;
 634}
 635
 636static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
 637{
 638	trace_rdev_rfkill_poll(&rdev->wiphy);
 639	rdev->ops->rfkill_poll(&rdev->wiphy);
 640	trace_rdev_return_void(&rdev->wiphy);
 641}
 642
 643
 644#ifdef CONFIG_NL80211_TESTMODE
 645static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
 646				    struct wireless_dev *wdev,
 647				    void *data, int len)
 648{
 649	int ret;
 650	trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
 651	ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
 652	trace_rdev_return_int(&rdev->wiphy, ret);
 653	return ret;
 654}
 655
 656static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
 657				     struct sk_buff *skb,
 658				     struct netlink_callback *cb, void *data,
 659				     int len)
 660{
 661	int ret;
 662	trace_rdev_testmode_dump(&rdev->wiphy);
 663	ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
 664	trace_rdev_return_int(&rdev->wiphy, ret);
 665	return ret;
 666}
 667#endif
 668
 669static inline int
 670rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
 671		      struct net_device *dev, unsigned int link_id,
 672		      const u8 *peer,
 673		      const struct cfg80211_bitrate_mask *mask)
 674{
 675	int ret;
 676	trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, link_id, peer, mask);
 677	ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, link_id,
 678					  peer, mask);
 679	trace_rdev_return_int(&rdev->wiphy, ret);
 680	return ret;
 681}
 682
 683static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
 684				   struct net_device *netdev, int idx,
 685				   struct survey_info *info)
 686{
 687	int ret;
 688	trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
 689	ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
 690	if (ret < 0)
 691		trace_rdev_return_int(&rdev->wiphy, ret);
 692	else
 693		trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
 694	return ret;
 695}
 696
 697static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
 698				 struct net_device *netdev,
 699				 struct cfg80211_pmksa *pmksa)
 700{
 701	int ret;
 702	trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
 703	ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
 704	trace_rdev_return_int(&rdev->wiphy, ret);
 705	return ret;
 706}
 707
 708static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
 709				 struct net_device *netdev,
 710				 struct cfg80211_pmksa *pmksa)
 711{
 712	int ret;
 713	trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
 714	ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
 715	trace_rdev_return_int(&rdev->wiphy, ret);
 716	return ret;
 717}
 718
 719static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
 720				   struct net_device *netdev)
 721{
 722	int ret;
 723	trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
 724	ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
 725	trace_rdev_return_int(&rdev->wiphy, ret);
 726	return ret;
 727}
 728
 729static inline int
 730rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
 731		       struct wireless_dev *wdev,
 732		       struct ieee80211_channel *chan,
 733		       unsigned int duration, u64 *cookie)
 734{
 735	int ret;
 736	trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
 737	ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
 738					   duration, cookie);
 739	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 740	return ret;
 741}
 742
 743static inline int
 744rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
 745			      struct wireless_dev *wdev, u64 cookie)
 746{
 747	int ret;
 748	trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
 749	ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
 750	trace_rdev_return_int(&rdev->wiphy, ret);
 751	return ret;
 752}
 753
 754static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
 755			       struct wireless_dev *wdev,
 756			       struct cfg80211_mgmt_tx_params *params,
 757			       u64 *cookie)
 758{
 759	int ret;
 760	trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
 761	ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
 762	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 763	return ret;
 764}
 765
 766static inline int rdev_tx_control_port(struct cfg80211_registered_device *rdev,
 767				       struct net_device *dev,
 768				       const void *buf, size_t len,
 769				       const u8 *dest, __be16 proto,
 770				       const bool noencrypt, int link,
 771				       u64 *cookie)
 772{
 773	int ret;
 774	trace_rdev_tx_control_port(&rdev->wiphy, dev, buf, len,
 775				   dest, proto, noencrypt, link);
 776	ret = rdev->ops->tx_control_port(&rdev->wiphy, dev, buf, len,
 777					 dest, proto, noencrypt, link, cookie);
 778	if (cookie)
 779		trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 780	else
 781		trace_rdev_return_int(&rdev->wiphy, ret);
 782	return ret;
 783}
 784
 785static inline int
 786rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
 787			 struct wireless_dev *wdev, u64 cookie)
 788{
 789	int ret;
 790	trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
 791	ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
 792	trace_rdev_return_int(&rdev->wiphy, ret);
 793	return ret;
 794}
 795
 796static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
 797				      struct net_device *dev, bool enabled,
 798				      int timeout)
 799{
 800	int ret;
 801	trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
 802	ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
 803	trace_rdev_return_int(&rdev->wiphy, ret);
 804	return ret;
 805}
 806
 807static inline int
 808rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
 809			 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
 810{
 811	int ret;
 812	trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
 813				       rssi_hyst);
 814	ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
 815				       rssi_hyst);
 816	trace_rdev_return_int(&rdev->wiphy, ret);
 817	return ret;
 818}
 819
 820static inline int
 821rdev_set_cqm_rssi_range_config(struct cfg80211_registered_device *rdev,
 822			       struct net_device *dev, s32 low, s32 high)
 823{
 824	int ret;
 825	trace_rdev_set_cqm_rssi_range_config(&rdev->wiphy, dev, low, high);
 826	ret = rdev->ops->set_cqm_rssi_range_config(&rdev->wiphy, dev,
 827						   low, high);
 828	trace_rdev_return_int(&rdev->wiphy, ret);
 829	return ret;
 830}
 831
 832static inline int
 833rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
 834			struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
 835{
 836	int ret;
 837	trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
 838	ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
 839					     intvl);
 840	trace_rdev_return_int(&rdev->wiphy, ret);
 841	return ret;
 842}
 843
 844static inline void
 845rdev_update_mgmt_frame_registrations(struct cfg80211_registered_device *rdev,
 846				     struct wireless_dev *wdev,
 847				     struct mgmt_frame_regs *upd)
 848{
 849	might_sleep();
 850
 851	trace_rdev_update_mgmt_frame_registrations(&rdev->wiphy, wdev, upd);
 852	if (rdev->ops->update_mgmt_frame_registrations)
 853		rdev->ops->update_mgmt_frame_registrations(&rdev->wiphy, wdev,
 854							   upd);
 855	trace_rdev_return_void(&rdev->wiphy);
 856}
 857
 858static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
 859				   u32 tx_ant, u32 rx_ant)
 860{
 861	int ret;
 862	trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
 863	ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
 864	trace_rdev_return_int(&rdev->wiphy, ret);
 865	return ret;
 866}
 867
 868static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
 869				   u32 *tx_ant, u32 *rx_ant)
 870{
 871	int ret;
 872	trace_rdev_get_antenna(&rdev->wiphy);
 873	ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
 874	if (ret)
 875		trace_rdev_return_int(&rdev->wiphy, ret);
 876	else
 877		trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
 878					    *rx_ant);
 879	return ret;
 880}
 881
 882static inline int
 883rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
 884		      struct net_device *dev,
 885		      struct cfg80211_sched_scan_request *request)
 886{
 887	int ret;
 888	trace_rdev_sched_scan_start(&rdev->wiphy, dev, request->reqid);
 889	ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
 890	trace_rdev_return_int(&rdev->wiphy, ret);
 891	return ret;
 892}
 893
 894static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
 895				       struct net_device *dev, u64 reqid)
 896{
 897	int ret;
 898	trace_rdev_sched_scan_stop(&rdev->wiphy, dev, reqid);
 899	ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev, reqid);
 900	trace_rdev_return_int(&rdev->wiphy, ret);
 901	return ret;
 902}
 903
 904static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
 905				      struct net_device *dev,
 906				      struct cfg80211_gtk_rekey_data *data)
 907{
 908	int ret;
 909	trace_rdev_set_rekey_data(&rdev->wiphy, dev);
 910	ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
 911	trace_rdev_return_int(&rdev->wiphy, ret);
 912	return ret;
 913}
 914
 915static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
 916				 struct net_device *dev, u8 *peer,
 917				 int link_id, u8 action_code,
 918				 u8 dialog_token, u16 status_code,
 919				 u32 peer_capability, bool initiator,
 920				 const u8 *buf, size_t len)
 921{
 922	int ret;
 923	trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, link_id, action_code,
 924			     dialog_token, status_code, peer_capability,
 925			     initiator, buf, len);
 926	ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, link_id,
 927				   action_code, dialog_token, status_code,
 928				   peer_capability, initiator, buf, len);
 929	trace_rdev_return_int(&rdev->wiphy, ret);
 930	return ret;
 931}
 932
 933static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
 934				 struct net_device *dev, u8 *peer,
 935				 enum nl80211_tdls_operation oper)
 936{
 937	int ret;
 938	trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
 939	ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
 940	trace_rdev_return_int(&rdev->wiphy, ret);
 941	return ret;
 942}
 943
 944static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
 945				    struct net_device *dev, const u8 *peer,
 946				    u64 *cookie)
 947{
 948	int ret;
 949	trace_rdev_probe_client(&rdev->wiphy, dev, peer);
 950	ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
 951	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
 952	return ret;
 953}
 954
 955static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
 956				     struct net_device *dev, u16 noack_map)
 957{
 958	int ret;
 959	trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
 960	ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
 961	trace_rdev_return_int(&rdev->wiphy, ret);
 962	return ret;
 963}
 964
 965static inline int
 966rdev_get_channel(struct cfg80211_registered_device *rdev,
 967		 struct wireless_dev *wdev,
 968		 unsigned int link_id,
 969		 struct cfg80211_chan_def *chandef)
 970{
 971	int ret;
 972
 973	trace_rdev_get_channel(&rdev->wiphy, wdev, link_id);
 974	ret = rdev->ops->get_channel(&rdev->wiphy, wdev, link_id, chandef);
 975	trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
 976
 977	return ret;
 978}
 979
 980static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
 981					struct wireless_dev *wdev)
 982{
 983	int ret;
 984
 985	trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
 986	ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
 987	trace_rdev_return_int(&rdev->wiphy, ret);
 988	return ret;
 989}
 990
 991static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
 992					struct wireless_dev *wdev)
 993{
 994	trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
 995	rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
 996	trace_rdev_return_void(&rdev->wiphy);
 997}
 998
 999static inline int rdev_start_nan(struct cfg80211_registered_device *rdev,
1000				 struct wireless_dev *wdev,
1001				 struct cfg80211_nan_conf *conf)
1002{
1003	int ret;
1004
1005	trace_rdev_start_nan(&rdev->wiphy, wdev, conf);
1006	ret = rdev->ops->start_nan(&rdev->wiphy, wdev, conf);
1007	trace_rdev_return_int(&rdev->wiphy, ret);
1008	return ret;
1009}
1010
1011static inline void rdev_stop_nan(struct cfg80211_registered_device *rdev,
1012				 struct wireless_dev *wdev)
1013{
1014	trace_rdev_stop_nan(&rdev->wiphy, wdev);
1015	rdev->ops->stop_nan(&rdev->wiphy, wdev);
1016	trace_rdev_return_void(&rdev->wiphy);
1017}
1018
1019static inline int
1020rdev_add_nan_func(struct cfg80211_registered_device *rdev,
1021		  struct wireless_dev *wdev,
1022		  struct cfg80211_nan_func *nan_func)
1023{
1024	int ret;
1025
1026	trace_rdev_add_nan_func(&rdev->wiphy, wdev, nan_func);
1027	ret = rdev->ops->add_nan_func(&rdev->wiphy, wdev, nan_func);
1028	trace_rdev_return_int(&rdev->wiphy, ret);
1029	return ret;
1030}
1031
1032static inline void rdev_del_nan_func(struct cfg80211_registered_device *rdev,
1033				    struct wireless_dev *wdev, u64 cookie)
1034{
1035	trace_rdev_del_nan_func(&rdev->wiphy, wdev, cookie);
1036	rdev->ops->del_nan_func(&rdev->wiphy, wdev, cookie);
1037	trace_rdev_return_void(&rdev->wiphy);
1038}
1039
1040static inline int
1041rdev_nan_change_conf(struct cfg80211_registered_device *rdev,
1042		     struct wireless_dev *wdev,
1043		     struct cfg80211_nan_conf *conf, u32 changes)
1044{
1045	int ret;
1046
1047	trace_rdev_nan_change_conf(&rdev->wiphy, wdev, conf, changes);
1048	if (rdev->ops->nan_change_conf)
1049		ret = rdev->ops->nan_change_conf(&rdev->wiphy, wdev, conf,
1050						 changes);
1051	else
1052		ret = -EOPNOTSUPP;
1053	trace_rdev_return_int(&rdev->wiphy, ret);
1054	return ret;
1055}
1056
1057static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
1058				   struct net_device *dev,
1059				   struct cfg80211_acl_data *params)
1060{
1061	int ret;
1062
1063	trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
1064	ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
1065	trace_rdev_return_int(&rdev->wiphy, ret);
1066	return ret;
1067}
1068
1069static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
1070				     struct net_device *dev,
1071				     struct cfg80211_update_ft_ies_params *ftie)
1072{
1073	int ret;
1074
1075	trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
1076	ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
1077	trace_rdev_return_int(&rdev->wiphy, ret);
1078	return ret;
1079}
1080
1081static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
1082					struct wireless_dev *wdev,
1083					enum nl80211_crit_proto_id protocol,
1084					u16 duration)
1085{
1086	int ret;
1087
1088	trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
1089	ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
1090					  protocol, duration);
1091	trace_rdev_return_int(&rdev->wiphy, ret);
1092	return ret;
1093}
1094
1095static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
1096				       struct wireless_dev *wdev)
1097{
1098	trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
1099	rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
1100	trace_rdev_return_void(&rdev->wiphy);
1101}
1102
1103static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
1104				      struct net_device *dev,
1105				      struct cfg80211_csa_settings *params)
1106{
1107	int ret;
1108
1109	trace_rdev_channel_switch(&rdev->wiphy, dev, params);
1110	ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
1111	trace_rdev_return_int(&rdev->wiphy, ret);
1112	return ret;
1113}
1114
1115static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
1116				   struct net_device *dev,
1117				   struct cfg80211_qos_map *qos_map)
1118{
1119	int ret = -EOPNOTSUPP;
1120
1121	if (rdev->ops->set_qos_map) {
1122		trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
1123		ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
1124		trace_rdev_return_int(&rdev->wiphy, ret);
1125	}
1126
1127	return ret;
1128}
1129
1130static inline int
1131rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
1132		      struct net_device *dev,
1133		      unsigned int link_id,
1134		      struct cfg80211_chan_def *chandef)
1135{
1136	int ret;
1137
1138	trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, link_id, chandef);
1139	ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, link_id, chandef);
1140	trace_rdev_return_int(&rdev->wiphy, ret);
1141
1142	return ret;
1143}
1144
1145static inline int
1146rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
1147	       struct net_device *dev, u8 tsid, const u8 *peer,
1148	       u8 user_prio, u16 admitted_time)
1149{
1150	int ret = -EOPNOTSUPP;
1151
1152	trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1153			     user_prio, admitted_time);
1154	if (rdev->ops->add_tx_ts)
1155		ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
1156					   user_prio, admitted_time);
1157	trace_rdev_return_int(&rdev->wiphy, ret);
1158
1159	return ret;
1160}
1161
1162static inline int
1163rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
1164	       struct net_device *dev, u8 tsid, const u8 *peer)
1165{
1166	int ret = -EOPNOTSUPP;
1167
1168	trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1169	if (rdev->ops->del_tx_ts)
1170		ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
1171	trace_rdev_return_int(&rdev->wiphy, ret);
1172
1173	return ret;
1174}
1175
1176static inline int
1177rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1178			 struct net_device *dev, const u8 *addr,
1179			 u8 oper_class, struct cfg80211_chan_def *chandef)
1180{
1181	int ret;
1182
1183	trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1184				       chandef);
1185	ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1186					     oper_class, chandef);
1187	trace_rdev_return_int(&rdev->wiphy, ret);
1188	return ret;
1189}
1190
1191static inline void
1192rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1193				struct net_device *dev, const u8 *addr)
1194{
1195	trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1196	rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1197	trace_rdev_return_void(&rdev->wiphy);
1198}
1199
1200static inline int
1201rdev_start_radar_detection(struct cfg80211_registered_device *rdev,
1202			   struct net_device *dev,
1203			   struct cfg80211_chan_def *chandef,
1204			   u32 cac_time_ms, int link_id)
1205{
1206	int ret = -EOPNOTSUPP;
1207
1208	trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef,
1209					 cac_time_ms, link_id);
1210	if (rdev->ops->start_radar_detection)
1211		ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev,
1212						       chandef, cac_time_ms,
1213						       link_id);
1214	trace_rdev_return_int(&rdev->wiphy, ret);
1215	return ret;
1216}
1217
1218static inline void
1219rdev_end_cac(struct cfg80211_registered_device *rdev,
1220	     struct net_device *dev, unsigned int link_id)
1221{
1222	trace_rdev_end_cac(&rdev->wiphy, dev, link_id);
1223	if (rdev->ops->end_cac)
1224		rdev->ops->end_cac(&rdev->wiphy, dev, link_id);
1225	trace_rdev_return_void(&rdev->wiphy);
1226}
1227
1228static inline int
1229rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
1230		    struct net_device *dev,
1231		    int mcast_rate[NUM_NL80211_BANDS])
1232{
1233	int ret = -EOPNOTSUPP;
1234
1235	trace_rdev_set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1236	if (rdev->ops->set_mcast_rate)
1237		ret = rdev->ops->set_mcast_rate(&rdev->wiphy, dev, mcast_rate);
1238	trace_rdev_return_int(&rdev->wiphy, ret);
1239	return ret;
1240}
1241
1242static inline int
1243rdev_set_coalesce(struct cfg80211_registered_device *rdev,
1244		  struct cfg80211_coalesce *coalesce)
1245{
1246	int ret = -EOPNOTSUPP;
1247
1248	trace_rdev_set_coalesce(&rdev->wiphy, coalesce);
1249	if (rdev->ops->set_coalesce)
1250		ret = rdev->ops->set_coalesce(&rdev->wiphy, coalesce);
1251	trace_rdev_return_int(&rdev->wiphy, ret);
1252	return ret;
1253}
1254
1255static inline int rdev_set_pmk(struct cfg80211_registered_device *rdev,
1256			       struct net_device *dev,
1257			       struct cfg80211_pmk_conf *pmk_conf)
1258{
1259	int ret = -EOPNOTSUPP;
1260
1261	trace_rdev_set_pmk(&rdev->wiphy, dev, pmk_conf);
1262	if (rdev->ops->set_pmk)
1263		ret = rdev->ops->set_pmk(&rdev->wiphy, dev, pmk_conf);
1264	trace_rdev_return_int(&rdev->wiphy, ret);
1265	return ret;
1266}
1267
1268static inline int rdev_del_pmk(struct cfg80211_registered_device *rdev,
1269			       struct net_device *dev, const u8 *aa)
1270{
1271	int ret = -EOPNOTSUPP;
1272
1273	trace_rdev_del_pmk(&rdev->wiphy, dev, aa);
1274	if (rdev->ops->del_pmk)
1275		ret = rdev->ops->del_pmk(&rdev->wiphy, dev, aa);
1276	trace_rdev_return_int(&rdev->wiphy, ret);
1277	return ret;
1278}
1279
1280static inline int
1281rdev_external_auth(struct cfg80211_registered_device *rdev,
1282		   struct net_device *dev,
1283		   struct cfg80211_external_auth_params *params)
1284{
1285	int ret = -EOPNOTSUPP;
1286
1287	trace_rdev_external_auth(&rdev->wiphy, dev, params);
1288	if (rdev->ops->external_auth)
1289		ret = rdev->ops->external_auth(&rdev->wiphy, dev, params);
1290	trace_rdev_return_int(&rdev->wiphy, ret);
1291	return ret;
1292}
1293
1294static inline int
1295rdev_get_ftm_responder_stats(struct cfg80211_registered_device *rdev,
1296			     struct net_device *dev,
1297			     struct cfg80211_ftm_responder_stats *ftm_stats)
1298{
1299	int ret = -EOPNOTSUPP;
1300
1301	trace_rdev_get_ftm_responder_stats(&rdev->wiphy, dev, ftm_stats);
1302	if (rdev->ops->get_ftm_responder_stats)
1303		ret = rdev->ops->get_ftm_responder_stats(&rdev->wiphy, dev,
1304							ftm_stats);
1305	trace_rdev_return_int(&rdev->wiphy, ret);
1306	return ret;
1307}
1308
1309static inline int
1310rdev_start_pmsr(struct cfg80211_registered_device *rdev,
1311		struct wireless_dev *wdev,
1312		struct cfg80211_pmsr_request *request)
1313{
1314	int ret = -EOPNOTSUPP;
1315
1316	trace_rdev_start_pmsr(&rdev->wiphy, wdev, request->cookie);
1317	if (rdev->ops->start_pmsr)
1318		ret = rdev->ops->start_pmsr(&rdev->wiphy, wdev, request);
1319	trace_rdev_return_int(&rdev->wiphy, ret);
1320	return ret;
1321}
1322
1323static inline void
1324rdev_abort_pmsr(struct cfg80211_registered_device *rdev,
1325		struct wireless_dev *wdev,
1326		struct cfg80211_pmsr_request *request)
1327{
1328	trace_rdev_abort_pmsr(&rdev->wiphy, wdev, request->cookie);
1329	if (rdev->ops->abort_pmsr)
1330		rdev->ops->abort_pmsr(&rdev->wiphy, wdev, request);
1331	trace_rdev_return_void(&rdev->wiphy);
1332}
1333
1334static inline int rdev_update_owe_info(struct cfg80211_registered_device *rdev,
1335				       struct net_device *dev,
1336				       struct cfg80211_update_owe_info *oweinfo)
1337{
1338	int ret = -EOPNOTSUPP;
1339
1340	trace_rdev_update_owe_info(&rdev->wiphy, dev, oweinfo);
1341	if (rdev->ops->update_owe_info)
1342		ret = rdev->ops->update_owe_info(&rdev->wiphy, dev, oweinfo);
1343	trace_rdev_return_int(&rdev->wiphy, ret);
1344	return ret;
1345}
1346
1347static inline int
1348rdev_probe_mesh_link(struct cfg80211_registered_device *rdev,
1349		     struct net_device *dev, const u8 *dest,
1350		     const void *buf, size_t len)
1351{
1352	int ret;
1353
1354	trace_rdev_probe_mesh_link(&rdev->wiphy, dev, dest, buf, len);
1355	ret = rdev->ops->probe_mesh_link(&rdev->wiphy, dev, buf, len);
1356	trace_rdev_return_int(&rdev->wiphy, ret);
1357	return ret;
1358}
1359
1360static inline int rdev_set_tid_config(struct cfg80211_registered_device *rdev,
1361				      struct net_device *dev,
1362				      struct cfg80211_tid_config *tid_conf)
1363{
1364	int ret;
1365
1366	trace_rdev_set_tid_config(&rdev->wiphy, dev, tid_conf);
1367	ret = rdev->ops->set_tid_config(&rdev->wiphy, dev, tid_conf);
1368	trace_rdev_return_int(&rdev->wiphy, ret);
1369	return ret;
1370}
1371
1372static inline int rdev_reset_tid_config(struct cfg80211_registered_device *rdev,
1373					struct net_device *dev, const u8 *peer,
1374					u8 tids)
1375{
1376	int ret;
1377
1378	trace_rdev_reset_tid_config(&rdev->wiphy, dev, peer, tids);
1379	ret = rdev->ops->reset_tid_config(&rdev->wiphy, dev, peer, tids);
1380	trace_rdev_return_int(&rdev->wiphy, ret);
1381	return ret;
1382}
1383
1384static inline int rdev_set_sar_specs(struct cfg80211_registered_device *rdev,
1385				     struct cfg80211_sar_specs *sar)
1386{
1387	int ret;
1388
1389	trace_rdev_set_sar_specs(&rdev->wiphy, sar);
1390	ret = rdev->ops->set_sar_specs(&rdev->wiphy, sar);
1391	trace_rdev_return_int(&rdev->wiphy, ret);
1392
1393	return ret;
1394}
1395
1396static inline int rdev_color_change(struct cfg80211_registered_device *rdev,
1397				    struct net_device *dev,
1398				    struct cfg80211_color_change_settings *params)
1399{
1400	int ret;
1401
1402	trace_rdev_color_change(&rdev->wiphy, dev, params);
1403	ret = rdev->ops->color_change(&rdev->wiphy, dev, params);
1404	trace_rdev_return_int(&rdev->wiphy, ret);
1405
1406	return ret;
1407}
1408
1409static inline int
1410rdev_set_fils_aad(struct cfg80211_registered_device *rdev,
1411		  struct net_device *dev, struct cfg80211_fils_aad *fils_aad)
1412{
1413	int ret = -EOPNOTSUPP;
1414
1415	trace_rdev_set_fils_aad(&rdev->wiphy, dev, fils_aad);
1416	if (rdev->ops->set_fils_aad)
1417		ret = rdev->ops->set_fils_aad(&rdev->wiphy, dev, fils_aad);
1418	trace_rdev_return_int(&rdev->wiphy, ret);
1419
1420	return ret;
1421}
1422
1423static inline int
1424rdev_set_radar_background(struct cfg80211_registered_device *rdev,
1425			  struct cfg80211_chan_def *chandef)
1426{
1427	struct wiphy *wiphy = &rdev->wiphy;
1428	int ret = -EOPNOTSUPP;
1429
1430	trace_rdev_set_radar_background(wiphy, chandef);
1431	if (rdev->ops->set_radar_background)
1432		ret = rdev->ops->set_radar_background(wiphy, chandef);
1433	trace_rdev_return_int(wiphy, ret);
1434
1435	return ret;
1436}
1437
1438static inline int
1439rdev_add_intf_link(struct cfg80211_registered_device *rdev,
1440		   struct wireless_dev *wdev,
1441		   unsigned int link_id)
1442{
1443	int ret = 0;
1444
1445	trace_rdev_add_intf_link(&rdev->wiphy, wdev, link_id);
1446	if (rdev->ops->add_intf_link)
1447		ret = rdev->ops->add_intf_link(&rdev->wiphy, wdev, link_id);
1448	trace_rdev_return_int(&rdev->wiphy, ret);
1449
1450	return ret;
1451}
1452
1453static inline void
1454rdev_del_intf_link(struct cfg80211_registered_device *rdev,
1455		   struct wireless_dev *wdev,
1456		   unsigned int link_id)
1457{
1458	trace_rdev_del_intf_link(&rdev->wiphy, wdev, link_id);
1459	if (rdev->ops->del_intf_link)
1460		rdev->ops->del_intf_link(&rdev->wiphy, wdev, link_id);
1461	trace_rdev_return_void(&rdev->wiphy);
1462}
1463
1464static inline int
1465rdev_add_link_station(struct cfg80211_registered_device *rdev,
1466		      struct net_device *dev,
1467		      struct link_station_parameters *params)
1468{
1469	int ret = -EOPNOTSUPP;
1470
1471	trace_rdev_add_link_station(&rdev->wiphy, dev, params);
1472	if (rdev->ops->add_link_station)
1473		ret = rdev->ops->add_link_station(&rdev->wiphy, dev, params);
1474	trace_rdev_return_int(&rdev->wiphy, ret);
1475	return ret;
1476}
1477
1478static inline int
1479rdev_mod_link_station(struct cfg80211_registered_device *rdev,
1480		      struct net_device *dev,
1481		      struct link_station_parameters *params)
1482{
1483	int ret = -EOPNOTSUPP;
1484
1485	trace_rdev_mod_link_station(&rdev->wiphy, dev, params);
1486	if (rdev->ops->mod_link_station)
1487		ret = rdev->ops->mod_link_station(&rdev->wiphy, dev, params);
1488	trace_rdev_return_int(&rdev->wiphy, ret);
1489	return ret;
1490}
1491
1492static inline int
1493rdev_del_link_station(struct cfg80211_registered_device *rdev,
1494		      struct net_device *dev,
1495		      struct link_station_del_parameters *params)
1496{
1497	int ret = -EOPNOTSUPP;
1498
1499	trace_rdev_del_link_station(&rdev->wiphy, dev, params);
1500	if (rdev->ops->del_link_station)
1501		ret = rdev->ops->del_link_station(&rdev->wiphy, dev, params);
1502	trace_rdev_return_int(&rdev->wiphy, ret);
1503	return ret;
1504}
1505
1506static inline int
1507rdev_set_hw_timestamp(struct cfg80211_registered_device *rdev,
1508		      struct net_device *dev,
1509		      struct cfg80211_set_hw_timestamp *hwts)
1510{
1511	struct wiphy *wiphy = &rdev->wiphy;
1512	int ret = -EOPNOTSUPP;
1513
1514	trace_rdev_set_hw_timestamp(wiphy, dev, hwts);
1515	if (rdev->ops->set_hw_timestamp)
1516		ret = rdev->ops->set_hw_timestamp(wiphy, dev, hwts);
1517	trace_rdev_return_int(wiphy, ret);
1518
1519	return ret;
1520}
1521
1522static inline int
1523rdev_set_ttlm(struct cfg80211_registered_device *rdev,
1524	      struct net_device *dev,
1525	      struct cfg80211_ttlm_params *params)
1526{
1527	struct wiphy *wiphy = &rdev->wiphy;
1528	int ret = -EOPNOTSUPP;
1529
1530	trace_rdev_set_ttlm(wiphy, dev, params);
1531	if (rdev->ops->set_ttlm)
1532		ret = rdev->ops->set_ttlm(wiphy, dev, params);
1533	trace_rdev_return_int(wiphy, ret);
1534
1535	return ret;
1536}
1537
1538static inline u32
1539rdev_get_radio_mask(struct cfg80211_registered_device *rdev,
1540		    struct net_device *dev)
1541{
1542	struct wiphy *wiphy = &rdev->wiphy;
1543
1544	if (!rdev->ops->get_radio_mask)
1545		return 0;
1546
1547	return rdev->ops->get_radio_mask(wiphy, dev);
1548}
1549#endif /* __CFG80211_RDEV_OPS */