Linux Audio

Check our new training course

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