• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef __CFG80211_RDEV_OPS
2 #define __CFG80211_RDEV_OPS
3 
4 #include <linux/rtnetlink.h>
5 #include <net/cfg80211.h>
6 #include "core.h"
7 #include "trace.h"
8 
rdev_suspend(struct cfg80211_registered_device * rdev,struct cfg80211_wowlan * wowlan)9 static inline int rdev_suspend(struct cfg80211_registered_device *rdev,
10 			       struct cfg80211_wowlan *wowlan)
11 {
12 	int ret;
13 	trace_rdev_suspend(&rdev->wiphy, wowlan);
14 	ret = rdev->ops->suspend(&rdev->wiphy, wowlan);
15 	trace_rdev_return_int(&rdev->wiphy, ret);
16 	return ret;
17 }
18 
rdev_resume(struct cfg80211_registered_device * rdev)19 static inline int rdev_resume(struct cfg80211_registered_device *rdev)
20 {
21 	int ret;
22 	trace_rdev_resume(&rdev->wiphy);
23 	ret = rdev->ops->resume(&rdev->wiphy);
24 	trace_rdev_return_int(&rdev->wiphy, ret);
25 	return ret;
26 }
27 
rdev_set_wakeup(struct cfg80211_registered_device * rdev,bool enabled)28 static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
29 				   bool enabled)
30 {
31 	trace_rdev_set_wakeup(&rdev->wiphy, enabled);
32 	rdev->ops->set_wakeup(&rdev->wiphy, enabled);
33 	trace_rdev_return_void(&rdev->wiphy);
34 }
35 
36 static inline struct wireless_dev
rdev_add_virtual_intf(struct cfg80211_registered_device * rdev,char * name,unsigned char name_assign_type,enum nl80211_iftype type,u32 * flags,struct vif_params * params)37 *rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
38 		       unsigned char name_assign_type,
39 		       enum nl80211_iftype type, u32 *flags,
40 		       struct vif_params *params)
41 {
42 	struct wireless_dev *ret;
43 	trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
44 	ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
45 					  type, flags, params);
46 	trace_rdev_return_wdev(&rdev->wiphy, ret);
47 	return ret;
48 }
49 
50 static inline int
rdev_del_virtual_intf(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev)51 rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
52 		      struct wireless_dev *wdev)
53 {
54 	int ret;
55 	trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
56 	ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
57 	trace_rdev_return_int(&rdev->wiphy, ret);
58 	return ret;
59 }
60 
61 static inline int
rdev_change_virtual_intf(struct cfg80211_registered_device * rdev,struct net_device * dev,enum nl80211_iftype type,u32 * flags,struct vif_params * params)62 rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
63 			 struct net_device *dev, enum nl80211_iftype type,
64 			 u32 *flags, struct vif_params *params)
65 {
66 	int ret;
67 	trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
68 	ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags,
69 					     params);
70 	trace_rdev_return_int(&rdev->wiphy, ret);
71 	return ret;
72 }
73 
rdev_add_key(struct cfg80211_registered_device * rdev,struct net_device * netdev,u8 key_index,bool pairwise,const u8 * mac_addr,struct key_params * params)74 static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
75 			       struct net_device *netdev, u8 key_index,
76 			       bool pairwise, const u8 *mac_addr,
77 			       struct key_params *params)
78 {
79 	int ret;
80 	trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
81 	ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise,
82 				  mac_addr, params);
83 	trace_rdev_return_int(&rdev->wiphy, ret);
84 	return ret;
85 }
86 
87 static inline int
rdev_get_key(struct cfg80211_registered_device * rdev,struct net_device * netdev,u8 key_index,bool pairwise,const u8 * mac_addr,void * cookie,void (* callback)(void * cookie,struct key_params *))88 rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
89 	     u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie,
90 	     void (*callback)(void *cookie, struct key_params*))
91 {
92 	int ret;
93 	trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
94 	ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise,
95 				  mac_addr, cookie, callback);
96 	trace_rdev_return_int(&rdev->wiphy, ret);
97 	return ret;
98 }
99 
rdev_del_key(struct cfg80211_registered_device * rdev,struct net_device * netdev,u8 key_index,bool pairwise,const u8 * mac_addr)100 static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
101 			       struct net_device *netdev, u8 key_index,
102 			       bool pairwise, const u8 *mac_addr)
103 {
104 	int ret;
105 	trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
106 	ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise,
107 				  mac_addr);
108 	trace_rdev_return_int(&rdev->wiphy, ret);
109 	return ret;
110 }
111 
112 static inline int
rdev_set_default_key(struct cfg80211_registered_device * rdev,struct net_device * netdev,u8 key_index,bool unicast,bool multicast)113 rdev_set_default_key(struct cfg80211_registered_device *rdev,
114 		     struct net_device *netdev, u8 key_index, bool unicast,
115 		     bool multicast)
116 {
117 	int ret;
118 	trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index,
119 				   unicast, multicast);
120 	ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index,
121 					  unicast, multicast);
122 	trace_rdev_return_int(&rdev->wiphy, ret);
123 	return ret;
124 }
125 
126 static inline int
rdev_set_default_mgmt_key(struct cfg80211_registered_device * rdev,struct net_device * netdev,u8 key_index)127 rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
128 			  struct net_device *netdev, u8 key_index)
129 {
130 	int ret;
131 	trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index);
132 	ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev,
133 					       key_index);
134 	trace_rdev_return_int(&rdev->wiphy, ret);
135 	return ret;
136 }
137 
rdev_start_ap(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_ap_settings * settings)138 static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
139 				struct net_device *dev,
140 				struct cfg80211_ap_settings *settings)
141 {
142 	int ret;
143 	trace_rdev_start_ap(&rdev->wiphy, dev, settings);
144 	ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings);
145 	trace_rdev_return_int(&rdev->wiphy, ret);
146 	return ret;
147 }
148 
rdev_change_beacon(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_beacon_data * info)149 static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
150 				     struct net_device *dev,
151 				     struct cfg80211_beacon_data *info)
152 {
153 	int ret;
154 	trace_rdev_change_beacon(&rdev->wiphy, dev, info);
155 	ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info);
156 	trace_rdev_return_int(&rdev->wiphy, ret);
157 	return ret;
158 }
159 
rdev_stop_ap(struct cfg80211_registered_device * rdev,struct net_device * dev)160 static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
161 			       struct net_device *dev)
162 {
163 	int ret;
164 	trace_rdev_stop_ap(&rdev->wiphy, dev);
165 	ret = rdev->ops->stop_ap(&rdev->wiphy, dev);
166 	trace_rdev_return_int(&rdev->wiphy, ret);
167 	return ret;
168 }
169 
rdev_add_station(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * mac,struct station_parameters * params)170 static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
171 				   struct net_device *dev, u8 *mac,
172 				   struct station_parameters *params)
173 {
174 	int ret;
175 	trace_rdev_add_station(&rdev->wiphy, dev, mac, params);
176 	ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
177 	trace_rdev_return_int(&rdev->wiphy, ret);
178 	return ret;
179 }
180 
rdev_del_station(struct cfg80211_registered_device * rdev,struct net_device * dev,struct station_del_parameters * params)181 static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
182 				   struct net_device *dev,
183 				   struct station_del_parameters *params)
184 {
185 	int ret;
186 	trace_rdev_del_station(&rdev->wiphy, dev, params);
187 	ret = rdev->ops->del_station(&rdev->wiphy, dev, params);
188 	trace_rdev_return_int(&rdev->wiphy, ret);
189 	return ret;
190 }
191 
rdev_change_station(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * mac,struct station_parameters * params)192 static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
193 				      struct net_device *dev, u8 *mac,
194 				      struct station_parameters *params)
195 {
196 	int ret;
197 	trace_rdev_change_station(&rdev->wiphy, dev, mac, params);
198 	ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
199 	trace_rdev_return_int(&rdev->wiphy, ret);
200 	return ret;
201 }
202 
rdev_get_station(struct cfg80211_registered_device * rdev,struct net_device * dev,const u8 * mac,struct station_info * sinfo)203 static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
204 				   struct net_device *dev, const u8 *mac,
205 				   struct station_info *sinfo)
206 {
207 	int ret;
208 	trace_rdev_get_station(&rdev->wiphy, dev, mac);
209 	ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
210 	trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
211 	return ret;
212 }
213 
rdev_dump_station(struct cfg80211_registered_device * rdev,struct net_device * dev,int idx,u8 * mac,struct station_info * sinfo)214 static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
215 				    struct net_device *dev, int idx, u8 *mac,
216 				    struct station_info *sinfo)
217 {
218 	int ret;
219 	trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac);
220 	ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
221 	trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
222 	return ret;
223 }
224 
rdev_add_mpath(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * dst,u8 * next_hop)225 static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
226 				 struct net_device *dev, u8 *dst, u8 *next_hop)
227 {
228 	int ret;
229 	trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop);
230 	ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
231 	trace_rdev_return_int(&rdev->wiphy, ret);
232 	return ret;
233 }
234 
rdev_del_mpath(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * dst)235 static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
236 				 struct net_device *dev, u8 *dst)
237 {
238 	int ret;
239 	trace_rdev_del_mpath(&rdev->wiphy, dev, dst);
240 	ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
241 	trace_rdev_return_int(&rdev->wiphy, ret);
242 	return ret;
243 }
244 
rdev_change_mpath(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * dst,u8 * next_hop)245 static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
246 				    struct net_device *dev, u8 *dst,
247 				    u8 *next_hop)
248 {
249 	int ret;
250 	trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop);
251 	ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
252 	trace_rdev_return_int(&rdev->wiphy, ret);
253 	return ret;
254 }
255 
rdev_get_mpath(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * dst,u8 * next_hop,struct mpath_info * pinfo)256 static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
257 				 struct net_device *dev, u8 *dst, u8 *next_hop,
258 				 struct mpath_info *pinfo)
259 {
260 	int ret;
261 	trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop);
262 	ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
263 	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
264 	return ret;
265 
266 }
267 
rdev_get_mpp(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * dst,u8 * mpp,struct mpath_info * pinfo)268 static inline int rdev_get_mpp(struct cfg80211_registered_device *rdev,
269 			       struct net_device *dev, u8 *dst, u8 *mpp,
270 			       struct mpath_info *pinfo)
271 {
272 	int ret;
273 
274 	trace_rdev_get_mpp(&rdev->wiphy, dev, dst, mpp);
275 	ret = rdev->ops->get_mpp(&rdev->wiphy, dev, dst, mpp, pinfo);
276 	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
277 	return ret;
278 }
279 
rdev_dump_mpath(struct cfg80211_registered_device * rdev,struct net_device * dev,int idx,u8 * dst,u8 * next_hop,struct mpath_info * pinfo)280 static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev,
281 				  struct net_device *dev, int idx, u8 *dst,
282 				  u8 *next_hop, struct mpath_info *pinfo)
283 
284 {
285 	int ret;
286 	trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop);
287 	ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
288 				    pinfo);
289 	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
290 	return ret;
291 }
292 
rdev_dump_mpp(struct cfg80211_registered_device * rdev,struct net_device * dev,int idx,u8 * dst,u8 * mpp,struct mpath_info * pinfo)293 static inline int rdev_dump_mpp(struct cfg80211_registered_device *rdev,
294 				struct net_device *dev, int idx, u8 *dst,
295 				u8 *mpp, struct mpath_info *pinfo)
296 
297 {
298 	int ret;
299 
300 	trace_rdev_dump_mpp(&rdev->wiphy, dev, idx, dst, mpp);
301 	ret = rdev->ops->dump_mpp(&rdev->wiphy, dev, idx, dst, mpp, pinfo);
302 	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
303 	return ret;
304 }
305 
306 static inline int
rdev_get_mesh_config(struct cfg80211_registered_device * rdev,struct net_device * dev,struct mesh_config * conf)307 rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
308 		     struct net_device *dev, struct mesh_config *conf)
309 {
310 	int ret;
311 	trace_rdev_get_mesh_config(&rdev->wiphy, dev);
312 	ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
313 	trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf);
314 	return ret;
315 }
316 
317 static inline int
rdev_update_mesh_config(struct cfg80211_registered_device * rdev,struct net_device * dev,u32 mask,const struct mesh_config * nconf)318 rdev_update_mesh_config(struct cfg80211_registered_device *rdev,
319 			struct net_device *dev, u32 mask,
320 			const struct mesh_config *nconf)
321 {
322 	int ret;
323 	trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf);
324 	ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
325 	trace_rdev_return_int(&rdev->wiphy, ret);
326 	return ret;
327 }
328 
rdev_join_mesh(struct cfg80211_registered_device * rdev,struct net_device * dev,const struct mesh_config * conf,const struct mesh_setup * setup)329 static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
330 				 struct net_device *dev,
331 				 const struct mesh_config *conf,
332 				 const struct mesh_setup *setup)
333 {
334 	int ret;
335 	trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup);
336 	ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
337 	trace_rdev_return_int(&rdev->wiphy, ret);
338 	return ret;
339 }
340 
341 
rdev_leave_mesh(struct cfg80211_registered_device * rdev,struct net_device * dev)342 static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
343 				  struct net_device *dev)
344 {
345 	int ret;
346 	trace_rdev_leave_mesh(&rdev->wiphy, dev);
347 	ret = rdev->ops->leave_mesh(&rdev->wiphy, dev);
348 	trace_rdev_return_int(&rdev->wiphy, ret);
349 	return ret;
350 }
351 
rdev_join_ocb(struct cfg80211_registered_device * rdev,struct net_device * dev,struct ocb_setup * setup)352 static inline int rdev_join_ocb(struct cfg80211_registered_device *rdev,
353 				struct net_device *dev,
354 				struct ocb_setup *setup)
355 {
356 	int ret;
357 	trace_rdev_join_ocb(&rdev->wiphy, dev, setup);
358 	ret = rdev->ops->join_ocb(&rdev->wiphy, dev, setup);
359 	trace_rdev_return_int(&rdev->wiphy, ret);
360 	return ret;
361 }
362 
rdev_leave_ocb(struct cfg80211_registered_device * rdev,struct net_device * dev)363 static inline int rdev_leave_ocb(struct cfg80211_registered_device *rdev,
364 				 struct net_device *dev)
365 {
366 	int ret;
367 	trace_rdev_leave_ocb(&rdev->wiphy, dev);
368 	ret = rdev->ops->leave_ocb(&rdev->wiphy, dev);
369 	trace_rdev_return_int(&rdev->wiphy, ret);
370 	return ret;
371 }
372 
rdev_change_bss(struct cfg80211_registered_device * rdev,struct net_device * dev,struct bss_parameters * params)373 static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
374 				  struct net_device *dev,
375 				  struct bss_parameters *params)
376 
377 {
378 	int ret;
379 	trace_rdev_change_bss(&rdev->wiphy, dev, params);
380 	ret = rdev->ops->change_bss(&rdev->wiphy, dev, params);
381 	trace_rdev_return_int(&rdev->wiphy, ret);
382 	return ret;
383 }
384 
rdev_set_txq_params(struct cfg80211_registered_device * rdev,struct net_device * dev,struct ieee80211_txq_params * params)385 static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
386 				      struct net_device *dev,
387 				      struct ieee80211_txq_params *params)
388 
389 {
390 	int ret;
391 	trace_rdev_set_txq_params(&rdev->wiphy, dev, params);
392 	ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
393 	trace_rdev_return_int(&rdev->wiphy, ret);
394 	return ret;
395 }
396 
397 static inline int
rdev_libertas_set_mesh_channel(struct cfg80211_registered_device * rdev,struct net_device * dev,struct ieee80211_channel * chan)398 rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
399 			       struct net_device *dev,
400 			       struct ieee80211_channel *chan)
401 {
402 	int ret;
403 	trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
404 	ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
405 	trace_rdev_return_int(&rdev->wiphy, ret);
406 	return ret;
407 }
408 
409 static inline int
rdev_set_monitor_channel(struct cfg80211_registered_device * rdev,struct cfg80211_chan_def * chandef)410 rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
411 			 struct cfg80211_chan_def *chandef)
412 {
413 	int ret;
414 	trace_rdev_set_monitor_channel(&rdev->wiphy, chandef);
415 	ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef);
416 	trace_rdev_return_int(&rdev->wiphy, ret);
417 	return ret;
418 }
419 
rdev_scan(struct cfg80211_registered_device * rdev,struct cfg80211_scan_request * request)420 static inline int rdev_scan(struct cfg80211_registered_device *rdev,
421 			    struct cfg80211_scan_request *request)
422 {
423 	int ret;
424 	trace_rdev_scan(&rdev->wiphy, request);
425 	ret = rdev->ops->scan(&rdev->wiphy, request);
426 	trace_rdev_return_int(&rdev->wiphy, ret);
427 	return ret;
428 }
429 
rdev_auth(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_auth_request * req)430 static inline int rdev_auth(struct cfg80211_registered_device *rdev,
431 			    struct net_device *dev,
432 			    struct cfg80211_auth_request *req)
433 {
434 	int ret;
435 	trace_rdev_auth(&rdev->wiphy, dev, req);
436 	ret = rdev->ops->auth(&rdev->wiphy, dev, req);
437 	trace_rdev_return_int(&rdev->wiphy, ret);
438 	return ret;
439 }
440 
rdev_assoc(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_assoc_request * req)441 static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
442 			     struct net_device *dev,
443 			     struct cfg80211_assoc_request *req)
444 {
445 	int ret;
446 	trace_rdev_assoc(&rdev->wiphy, dev, req);
447 	ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
448 	trace_rdev_return_int(&rdev->wiphy, ret);
449 	return ret;
450 }
451 
rdev_deauth(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_deauth_request * req)452 static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
453 			      struct net_device *dev,
454 			      struct cfg80211_deauth_request *req)
455 {
456 	int ret;
457 	trace_rdev_deauth(&rdev->wiphy, dev, req);
458 	ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
459 	trace_rdev_return_int(&rdev->wiphy, ret);
460 	return ret;
461 }
462 
rdev_disassoc(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_disassoc_request * req)463 static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
464 				struct net_device *dev,
465 				struct cfg80211_disassoc_request *req)
466 {
467 	int ret;
468 	trace_rdev_disassoc(&rdev->wiphy, dev, req);
469 	ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
470 	trace_rdev_return_int(&rdev->wiphy, ret);
471 	return ret;
472 }
473 
rdev_connect(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_connect_params * sme)474 static inline int rdev_connect(struct cfg80211_registered_device *rdev,
475 			       struct net_device *dev,
476 			       struct cfg80211_connect_params *sme)
477 {
478 	int ret;
479 	trace_rdev_connect(&rdev->wiphy, dev, sme);
480 	ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
481 	trace_rdev_return_int(&rdev->wiphy, ret);
482 	return ret;
483 }
484 
rdev_disconnect(struct cfg80211_registered_device * rdev,struct net_device * dev,u16 reason_code)485 static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
486 				  struct net_device *dev, u16 reason_code)
487 {
488 	int ret;
489 	trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
490 	ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
491 	trace_rdev_return_int(&rdev->wiphy, ret);
492 	return ret;
493 }
494 
rdev_join_ibss(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_ibss_params * params)495 static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
496 				 struct net_device *dev,
497 				 struct cfg80211_ibss_params *params)
498 {
499 	int ret;
500 	trace_rdev_join_ibss(&rdev->wiphy, dev, params);
501 	ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
502 	trace_rdev_return_int(&rdev->wiphy, ret);
503 	return ret;
504 }
505 
rdev_leave_ibss(struct cfg80211_registered_device * rdev,struct net_device * dev)506 static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
507 				  struct net_device *dev)
508 {
509 	int ret;
510 	trace_rdev_leave_ibss(&rdev->wiphy, dev);
511 	ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
512 	trace_rdev_return_int(&rdev->wiphy, ret);
513 	return ret;
514 }
515 
516 static inline int
rdev_set_wiphy_params(struct cfg80211_registered_device * rdev,u32 changed)517 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
518 {
519 	int ret;
520 
521 	if (!rdev->ops->set_wiphy_params)
522 		return -EOPNOTSUPP;
523 
524 	trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
525 	ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
526 	trace_rdev_return_int(&rdev->wiphy, ret);
527 	return ret;
528 }
529 
rdev_set_tx_power(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,enum nl80211_tx_power_setting type,int mbm)530 static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
531 				    struct wireless_dev *wdev,
532 				    enum nl80211_tx_power_setting type, int mbm)
533 {
534 	int ret;
535 	trace_rdev_set_tx_power(&rdev->wiphy, wdev, type, mbm);
536 	ret = rdev->ops->set_tx_power(&rdev->wiphy, wdev, type, mbm);
537 	trace_rdev_return_int(&rdev->wiphy, ret);
538 	return ret;
539 }
540 
rdev_get_tx_power(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,int * dbm)541 static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
542 				    struct wireless_dev *wdev, int *dbm)
543 {
544 	int ret;
545 	trace_rdev_get_tx_power(&rdev->wiphy, wdev);
546 	ret = rdev->ops->get_tx_power(&rdev->wiphy, wdev, dbm);
547 	trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
548 	return ret;
549 }
550 
rdev_set_wds_peer(struct cfg80211_registered_device * rdev,struct net_device * dev,const u8 * addr)551 static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
552 				    struct net_device *dev, const u8 *addr)
553 {
554 	int ret;
555 	trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
556 	ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
557 	trace_rdev_return_int(&rdev->wiphy, ret);
558 	return ret;
559 }
560 
rdev_rfkill_poll(struct cfg80211_registered_device * rdev)561 static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
562 {
563 	trace_rdev_rfkill_poll(&rdev->wiphy);
564 	rdev->ops->rfkill_poll(&rdev->wiphy);
565 	trace_rdev_return_void(&rdev->wiphy);
566 }
567 
568 
569 #ifdef CONFIG_NL80211_TESTMODE
rdev_testmode_cmd(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,void * data,int len)570 static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
571 				    struct wireless_dev *wdev,
572 				    void *data, int len)
573 {
574 	int ret;
575 	trace_rdev_testmode_cmd(&rdev->wiphy, wdev);
576 	ret = rdev->ops->testmode_cmd(&rdev->wiphy, wdev, data, len);
577 	trace_rdev_return_int(&rdev->wiphy, ret);
578 	return ret;
579 }
580 
rdev_testmode_dump(struct cfg80211_registered_device * rdev,struct sk_buff * skb,struct netlink_callback * cb,void * data,int len)581 static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
582 				     struct sk_buff *skb,
583 				     struct netlink_callback *cb, void *data,
584 				     int len)
585 {
586 	int ret;
587 	trace_rdev_testmode_dump(&rdev->wiphy);
588 	ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
589 	trace_rdev_return_int(&rdev->wiphy, ret);
590 	return ret;
591 }
592 #endif
593 
594 static inline int
rdev_set_bitrate_mask(struct cfg80211_registered_device * rdev,struct net_device * dev,const u8 * peer,const struct cfg80211_bitrate_mask * mask)595 rdev_set_bitrate_mask(struct cfg80211_registered_device *rdev,
596 		      struct net_device *dev, const u8 *peer,
597 		      const struct cfg80211_bitrate_mask *mask)
598 {
599 	int ret;
600 	trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
601 	ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
602 	trace_rdev_return_int(&rdev->wiphy, ret);
603 	return ret;
604 }
605 
rdev_dump_survey(struct cfg80211_registered_device * rdev,struct net_device * netdev,int idx,struct survey_info * info)606 static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
607 				   struct net_device *netdev, int idx,
608 				   struct survey_info *info)
609 {
610 	int ret;
611 	trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
612 	ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
613 	if (ret < 0)
614 		trace_rdev_return_int(&rdev->wiphy, ret);
615 	else
616 		trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
617 	return ret;
618 }
619 
rdev_set_pmksa(struct cfg80211_registered_device * rdev,struct net_device * netdev,struct cfg80211_pmksa * pmksa)620 static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
621 				 struct net_device *netdev,
622 				 struct cfg80211_pmksa *pmksa)
623 {
624 	int ret;
625 	trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
626 	ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
627 	trace_rdev_return_int(&rdev->wiphy, ret);
628 	return ret;
629 }
630 
rdev_del_pmksa(struct cfg80211_registered_device * rdev,struct net_device * netdev,struct cfg80211_pmksa * pmksa)631 static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
632 				 struct net_device *netdev,
633 				 struct cfg80211_pmksa *pmksa)
634 {
635 	int ret;
636 	trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
637 	ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
638 	trace_rdev_return_int(&rdev->wiphy, ret);
639 	return ret;
640 }
641 
rdev_flush_pmksa(struct cfg80211_registered_device * rdev,struct net_device * netdev)642 static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
643 				   struct net_device *netdev)
644 {
645 	int ret;
646 	trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
647 	ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
648 	trace_rdev_return_int(&rdev->wiphy, ret);
649 	return ret;
650 }
651 
652 static inline int
rdev_remain_on_channel(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,struct ieee80211_channel * chan,unsigned int duration,u64 * cookie)653 rdev_remain_on_channel(struct cfg80211_registered_device *rdev,
654 		       struct wireless_dev *wdev,
655 		       struct ieee80211_channel *chan,
656 		       unsigned int duration, u64 *cookie)
657 {
658 	int ret;
659 	trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, duration);
660 	ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
661 					   duration, cookie);
662 	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
663 	return ret;
664 }
665 
666 static inline int
rdev_cancel_remain_on_channel(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,u64 cookie)667 rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
668 			      struct wireless_dev *wdev, u64 cookie)
669 {
670 	int ret;
671 	trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
672 	ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
673 	trace_rdev_return_int(&rdev->wiphy, ret);
674 	return ret;
675 }
676 
rdev_mgmt_tx(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,struct cfg80211_mgmt_tx_params * params,u64 * cookie)677 static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
678 			       struct wireless_dev *wdev,
679 			       struct cfg80211_mgmt_tx_params *params,
680 			       u64 *cookie)
681 {
682 	int ret;
683 	trace_rdev_mgmt_tx(&rdev->wiphy, wdev, params);
684 	ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, params, cookie);
685 	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
686 	return ret;
687 }
688 
689 static inline int
rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,u64 cookie)690 rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
691 			 struct wireless_dev *wdev, u64 cookie)
692 {
693 	int ret;
694 	trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
695 	ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
696 	trace_rdev_return_int(&rdev->wiphy, ret);
697 	return ret;
698 }
699 
rdev_set_power_mgmt(struct cfg80211_registered_device * rdev,struct net_device * dev,bool enabled,int timeout)700 static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
701 				      struct net_device *dev, bool enabled,
702 				      int timeout)
703 {
704 	int ret;
705 	trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
706 	ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
707 	trace_rdev_return_int(&rdev->wiphy, ret);
708 	return ret;
709 }
710 
711 static inline int
rdev_set_cqm_rssi_config(struct cfg80211_registered_device * rdev,struct net_device * dev,s32 rssi_thold,u32 rssi_hyst)712 rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
713 			 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
714 {
715 	int ret;
716 	trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
717 				       rssi_hyst);
718 	ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
719 				       rssi_hyst);
720 	trace_rdev_return_int(&rdev->wiphy, ret);
721 	return ret;
722 }
723 
724 static inline int
rdev_set_cqm_txe_config(struct cfg80211_registered_device * rdev,struct net_device * dev,u32 rate,u32 pkts,u32 intvl)725 rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
726 			struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
727 {
728 	int ret;
729 	trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
730 	ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
731 					     intvl);
732 	trace_rdev_return_int(&rdev->wiphy, ret);
733 	return ret;
734 }
735 
736 static inline void
rdev_mgmt_frame_register(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,u16 frame_type,bool reg)737 rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
738 			 struct wireless_dev *wdev, u16 frame_type, bool reg)
739 {
740 	might_sleep();
741 
742 	trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
743 	rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
744 	trace_rdev_return_void(&rdev->wiphy);
745 }
746 
rdev_set_antenna(struct cfg80211_registered_device * rdev,u32 tx_ant,u32 rx_ant)747 static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
748 				   u32 tx_ant, u32 rx_ant)
749 {
750 	int ret;
751 	trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
752 	ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
753 	trace_rdev_return_int(&rdev->wiphy, ret);
754 	return ret;
755 }
756 
rdev_get_antenna(struct cfg80211_registered_device * rdev,u32 * tx_ant,u32 * rx_ant)757 static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
758 				   u32 *tx_ant, u32 *rx_ant)
759 {
760 	int ret;
761 	trace_rdev_get_antenna(&rdev->wiphy);
762 	ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
763 	if (ret)
764 		trace_rdev_return_int(&rdev->wiphy, ret);
765 	else
766 		trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
767 					    *rx_ant);
768 	return ret;
769 }
770 
771 static inline int
rdev_sched_scan_start(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_sched_scan_request * request)772 rdev_sched_scan_start(struct cfg80211_registered_device *rdev,
773 		      struct net_device *dev,
774 		      struct cfg80211_sched_scan_request *request)
775 {
776 	int ret;
777 	trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
778 	ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
779 	trace_rdev_return_int(&rdev->wiphy, ret);
780 	return ret;
781 }
782 
rdev_sched_scan_stop(struct cfg80211_registered_device * rdev,struct net_device * dev)783 static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
784 				       struct net_device *dev)
785 {
786 	int ret;
787 	trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
788 	ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
789 	trace_rdev_return_int(&rdev->wiphy, ret);
790 	return ret;
791 }
792 
rdev_set_rekey_data(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_gtk_rekey_data * data)793 static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
794 				      struct net_device *dev,
795 				      struct cfg80211_gtk_rekey_data *data)
796 {
797 	int ret;
798 	trace_rdev_set_rekey_data(&rdev->wiphy, dev);
799 	ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
800 	trace_rdev_return_int(&rdev->wiphy, ret);
801 	return ret;
802 }
803 
rdev_tdls_mgmt(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * peer,u8 action_code,u8 dialog_token,u16 status_code,u32 peer_capability,bool initiator,const u8 * buf,size_t len)804 static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
805 				 struct net_device *dev, u8 *peer,
806 				 u8 action_code, u8 dialog_token,
807 				 u16 status_code, u32 peer_capability,
808 				 bool initiator, const u8 *buf, size_t len)
809 {
810 	int ret;
811 	trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
812 			     dialog_token, status_code, peer_capability,
813 			     initiator, buf, len);
814 	ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
815 				   dialog_token, status_code, peer_capability,
816 				   initiator, buf, len);
817 	trace_rdev_return_int(&rdev->wiphy, ret);
818 	return ret;
819 }
820 
rdev_tdls_oper(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 * peer,enum nl80211_tdls_operation oper)821 static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
822 				 struct net_device *dev, u8 *peer,
823 				 enum nl80211_tdls_operation oper)
824 {
825 	int ret;
826 	trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
827 	ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
828 	trace_rdev_return_int(&rdev->wiphy, ret);
829 	return ret;
830 }
831 
rdev_probe_client(struct cfg80211_registered_device * rdev,struct net_device * dev,const u8 * peer,u64 * cookie)832 static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
833 				    struct net_device *dev, const u8 *peer,
834 				    u64 *cookie)
835 {
836 	int ret;
837 	trace_rdev_probe_client(&rdev->wiphy, dev, peer);
838 	ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
839 	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
840 	return ret;
841 }
842 
rdev_set_noack_map(struct cfg80211_registered_device * rdev,struct net_device * dev,u16 noack_map)843 static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
844 				     struct net_device *dev, u16 noack_map)
845 {
846 	int ret;
847 	trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
848 	ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
849 	trace_rdev_return_int(&rdev->wiphy, ret);
850 	return ret;
851 }
852 
853 static inline int
rdev_get_channel(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,struct cfg80211_chan_def * chandef)854 rdev_get_channel(struct cfg80211_registered_device *rdev,
855 		 struct wireless_dev *wdev,
856 		 struct cfg80211_chan_def *chandef)
857 {
858 	int ret;
859 
860 	trace_rdev_get_channel(&rdev->wiphy, wdev);
861 	ret = rdev->ops->get_channel(&rdev->wiphy, wdev, chandef);
862 	trace_rdev_return_chandef(&rdev->wiphy, ret, chandef);
863 
864 	return ret;
865 }
866 
rdev_start_p2p_device(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev)867 static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
868 					struct wireless_dev *wdev)
869 {
870 	int ret;
871 
872 	trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
873 	ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
874 	trace_rdev_return_int(&rdev->wiphy, ret);
875 	return ret;
876 }
877 
rdev_stop_p2p_device(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev)878 static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
879 					struct wireless_dev *wdev)
880 {
881 	trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
882 	rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
883 	trace_rdev_return_void(&rdev->wiphy);
884 }
885 
rdev_set_mac_acl(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_acl_data * params)886 static inline int rdev_set_mac_acl(struct cfg80211_registered_device *rdev,
887 				   struct net_device *dev,
888 				   struct cfg80211_acl_data *params)
889 {
890 	int ret;
891 
892 	trace_rdev_set_mac_acl(&rdev->wiphy, dev, params);
893 	ret = rdev->ops->set_mac_acl(&rdev->wiphy, dev, params);
894 	trace_rdev_return_int(&rdev->wiphy, ret);
895 	return ret;
896 }
897 
rdev_update_ft_ies(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_update_ft_ies_params * ftie)898 static inline int rdev_update_ft_ies(struct cfg80211_registered_device *rdev,
899 				     struct net_device *dev,
900 				     struct cfg80211_update_ft_ies_params *ftie)
901 {
902 	int ret;
903 
904 	trace_rdev_update_ft_ies(&rdev->wiphy, dev, ftie);
905 	ret = rdev->ops->update_ft_ies(&rdev->wiphy, dev, ftie);
906 	trace_rdev_return_int(&rdev->wiphy, ret);
907 	return ret;
908 }
909 
rdev_crit_proto_start(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev,enum nl80211_crit_proto_id protocol,u16 duration)910 static inline int rdev_crit_proto_start(struct cfg80211_registered_device *rdev,
911 					struct wireless_dev *wdev,
912 					enum nl80211_crit_proto_id protocol,
913 					u16 duration)
914 {
915 	int ret;
916 
917 	trace_rdev_crit_proto_start(&rdev->wiphy, wdev, protocol, duration);
918 	ret = rdev->ops->crit_proto_start(&rdev->wiphy, wdev,
919 					  protocol, duration);
920 	trace_rdev_return_int(&rdev->wiphy, ret);
921 	return ret;
922 }
923 
rdev_crit_proto_stop(struct cfg80211_registered_device * rdev,struct wireless_dev * wdev)924 static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
925 				       struct wireless_dev *wdev)
926 {
927 	trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
928 	rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
929 	trace_rdev_return_void(&rdev->wiphy);
930 }
931 
rdev_channel_switch(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_csa_settings * params)932 static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev,
933 				      struct net_device *dev,
934 				      struct cfg80211_csa_settings *params)
935 {
936 	int ret;
937 
938 	trace_rdev_channel_switch(&rdev->wiphy, dev, params);
939 	ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params);
940 	trace_rdev_return_int(&rdev->wiphy, ret);
941 	return ret;
942 }
943 
rdev_set_qos_map(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_qos_map * qos_map)944 static inline int rdev_set_qos_map(struct cfg80211_registered_device *rdev,
945 				   struct net_device *dev,
946 				   struct cfg80211_qos_map *qos_map)
947 {
948 	int ret = -EOPNOTSUPP;
949 
950 	if (rdev->ops->set_qos_map) {
951 		trace_rdev_set_qos_map(&rdev->wiphy, dev, qos_map);
952 		ret = rdev->ops->set_qos_map(&rdev->wiphy, dev, qos_map);
953 		trace_rdev_return_int(&rdev->wiphy, ret);
954 	}
955 
956 	return ret;
957 }
958 
959 static inline int
rdev_set_ap_chanwidth(struct cfg80211_registered_device * rdev,struct net_device * dev,struct cfg80211_chan_def * chandef)960 rdev_set_ap_chanwidth(struct cfg80211_registered_device *rdev,
961 		      struct net_device *dev, struct cfg80211_chan_def *chandef)
962 {
963 	int ret;
964 
965 	trace_rdev_set_ap_chanwidth(&rdev->wiphy, dev, chandef);
966 	ret = rdev->ops->set_ap_chanwidth(&rdev->wiphy, dev, chandef);
967 	trace_rdev_return_int(&rdev->wiphy, ret);
968 
969 	return ret;
970 }
971 
972 static inline int
rdev_add_tx_ts(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 tsid,const u8 * peer,u8 user_prio,u16 admitted_time)973 rdev_add_tx_ts(struct cfg80211_registered_device *rdev,
974 	       struct net_device *dev, u8 tsid, const u8 *peer,
975 	       u8 user_prio, u16 admitted_time)
976 {
977 	int ret = -EOPNOTSUPP;
978 
979 	trace_rdev_add_tx_ts(&rdev->wiphy, dev, tsid, peer,
980 			     user_prio, admitted_time);
981 	if (rdev->ops->add_tx_ts)
982 		ret = rdev->ops->add_tx_ts(&rdev->wiphy, dev, tsid, peer,
983 					   user_prio, admitted_time);
984 	trace_rdev_return_int(&rdev->wiphy, ret);
985 
986 	return ret;
987 }
988 
989 static inline int
rdev_del_tx_ts(struct cfg80211_registered_device * rdev,struct net_device * dev,u8 tsid,const u8 * peer)990 rdev_del_tx_ts(struct cfg80211_registered_device *rdev,
991 	       struct net_device *dev, u8 tsid, const u8 *peer)
992 {
993 	int ret = -EOPNOTSUPP;
994 
995 	trace_rdev_del_tx_ts(&rdev->wiphy, dev, tsid, peer);
996 	if (rdev->ops->del_tx_ts)
997 		ret = rdev->ops->del_tx_ts(&rdev->wiphy, dev, tsid, peer);
998 	trace_rdev_return_int(&rdev->wiphy, ret);
999 
1000 	return ret;
1001 }
1002 
1003 static inline int
rdev_tdls_channel_switch(struct cfg80211_registered_device * rdev,struct net_device * dev,const u8 * addr,u8 oper_class,struct cfg80211_chan_def * chandef)1004 rdev_tdls_channel_switch(struct cfg80211_registered_device *rdev,
1005 			 struct net_device *dev, const u8 *addr,
1006 			 u8 oper_class, struct cfg80211_chan_def *chandef)
1007 {
1008 	int ret;
1009 
1010 	trace_rdev_tdls_channel_switch(&rdev->wiphy, dev, addr, oper_class,
1011 				       chandef);
1012 	ret = rdev->ops->tdls_channel_switch(&rdev->wiphy, dev, addr,
1013 					     oper_class, chandef);
1014 	trace_rdev_return_int(&rdev->wiphy, ret);
1015 	return ret;
1016 }
1017 
1018 static inline void
rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device * rdev,struct net_device * dev,const u8 * addr)1019 rdev_tdls_cancel_channel_switch(struct cfg80211_registered_device *rdev,
1020 				struct net_device *dev, const u8 *addr)
1021 {
1022 	trace_rdev_tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1023 	rdev->ops->tdls_cancel_channel_switch(&rdev->wiphy, dev, addr);
1024 	trace_rdev_return_void(&rdev->wiphy);
1025 }
1026 
1027 #endif /* __CFG80211_RDEV_OPS */
1028